[Scummvm-cvs-logs] CVS: scummvm/sky/music gmchannel.cpp,1.5,1.6 gmchannel.h,1.3,1.4 gmmusic.cpp,1.10,1.11
Robert G?ffringmann
lavosspawn at users.sourceforge.net
Wed Aug 20 05:33:12 CEST 2003
- Previous message: [Scummvm-cvs-logs] CVS: residual TODO,1.9,1.10
- Next message: [Scummvm-cvs-logs] CVS: scummvm/sky autoroute.cpp,1.17,1.18 logic.cpp,1.131,1.132 sky.cpp,1.106,1.107 sound.cpp,1.32,1.33 sound.h,1.15,1.16
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /cvsroot/scummvm/scummvm/sky/music
In directory sc8-pr-cvs1:/tmp/cvs-serv24176/sky/music
Modified Files:
gmchannel.cpp gmchannel.h gmmusic.cpp
Log Message:
copied some fixes which only were in 0.5.1 branch.
Index: gmchannel.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sky/music/gmchannel.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- gmchannel.cpp 12 Jul 2003 06:20:40 -0000 1.5
+++ gmchannel.cpp 20 Aug 2003 12:12:11 -0000 1.6
@@ -21,11 +21,6 @@
#include "gmchannel.h"
-// the MT32 is a lot more sensitive to velocities than most general midi devices,
-// so we need to boost them a little
-
-
-
SkyGmChannel::SkyGmChannel(uint8 *pMusicData, uint16 startOfData, MidiDriver *pMidiDrv, byte *pInstMap, uint8 *veloTab)
{
_musicData = pMusicData;
@@ -38,7 +33,8 @@
_mt32_to_gm = pInstMap;
_veloTab = veloTab;
- _musicVolume = 0x100;
+ _musicVolume = 0x7F;
+ _lastVolume = 0xFF;
}
bool SkyGmChannel::isActive(void) {
@@ -49,6 +45,12 @@
void SkyGmChannel::updateVolume(uint16 pVolume) {
_musicVolume = pVolume;
+ if (_musicVolume > 0)
+ _musicVolume = (_musicVolume * 2) / 3 + 43;
+ if (_lastVolume < 0xFF) {
+ uint8 newVol = (_lastVolume * _musicVolume) >> 7;
+ _midiDrv->send((0xB0 | _channelData.midiChannelNumber) | 0x700 | (newVol << 16));
+ }
}
void SkyGmChannel::stopNote(void) {
@@ -166,8 +168,9 @@
void SkyGmChannel::com90_getChannelVolume(void) {
- _midiDrv->send((0xB0 | _channelData.midiChannelNumber) | 0x700 | (_musicData[_channelData.eventDataPtr] << 16));
- _channelData.eventDataPtr++;
+ _lastVolume = _musicData[_channelData.eventDataPtr];
+ uint8 newVol = (uint8)((_musicData[_channelData.eventDataPtr++] * _musicVolume) >> 7);
+ _midiDrv->send((0xB0 | _channelData.midiChannelNumber) | 0x700 | (newVol << 16));
}
void SkyGmChannel::com90_rewindMusic(void) {
Index: gmchannel.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sky/music/gmchannel.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- gmchannel.h 12 Jul 2003 06:20:40 -0000 1.3
+++ gmchannel.h 20 Aug 2003 12:12:11 -0000 1.4
@@ -50,6 +50,7 @@
uint8 *_musicData;
uint16 _musicVolume;
MidiChannelType _channelData;
+ uint8 _lastVolume;
//- normal subs
void setRegister(uint8 regNum, uint8 value);
int32 getNextEventTime(void);
Index: gmmusic.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sky/music/gmmusic.cpp,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- gmmusic.cpp 13 Jul 2003 16:22:17 -0000 1.10
+++ gmmusic.cpp 20 Aug 2003 12:12:11 -0000 1.11
@@ -86,6 +86,7 @@
for (uint8 cnt = 0; cnt < _numberOfChannels; cnt++) {
uint16 chDataStart = ((channelData[(cnt << 1) | 1] << 8) | channelData[cnt << 1]) + _musicDataLoc;
_channels[cnt] = new SkyGmChannel(_musicData, chDataStart, _midiDrv, _mt32_to_gm, _veloTab);
+ _channels[cnt]->updateVolume(_musicVolume);
}
}
- Previous message: [Scummvm-cvs-logs] CVS: residual TODO,1.9,1.10
- Next message: [Scummvm-cvs-logs] CVS: scummvm/sky autoroute.cpp,1.17,1.18 logic.cpp,1.131,1.132 sky.cpp,1.106,1.107 sound.cpp,1.32,1.33 sound.h,1.15,1.16
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the Scummvm-git-logs
mailing list