diff options
author | Willem Jan Palenstijn | 2015-07-22 22:37:40 +0200 |
---|---|---|
committer | Willem Jan Palenstijn | 2015-07-22 22:43:42 +0200 |
commit | 6ec9c81b575f13b2c4b30aeac592ebf2557b5890 (patch) | |
tree | 503d50902bad2d800165593039d08d5ccf0c98ab /engines/sky/music/adlibchannel.cpp | |
parent | 5ec05f6b647c5ea41418be7ed19ad381f97cabd8 (diff) | |
parent | 4e5c8d35f7e133e2e72a846fdbd54900c91eeb73 (diff) | |
download | scummvm-rg350-6ec9c81b575f13b2c4b30aeac592ebf2557b5890.tar.gz scummvm-rg350-6ec9c81b575f13b2c4b30aeac592ebf2557b5890.tar.bz2 scummvm-rg350-6ec9c81b575f13b2c4b30aeac592ebf2557b5890.zip |
Merge branch 'master' into mm
Conflicts:
engines/access/access.cpp
engines/access/asurface.h
engines/access/bubble_box.cpp
engines/access/bubble_box.h
engines/access/martian/martian_game.cpp
engines/access/player.cpp
engines/access/player.h
engines/access/resources.cpp
engines/access/screen.cpp
engines/access/screen.h
engines/access/sound.cpp
engines/access/sound.h
Diffstat (limited to 'engines/sky/music/adlibchannel.cpp')
-rw-r--r-- | engines/sky/music/adlibchannel.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/engines/sky/music/adlibchannel.cpp b/engines/sky/music/adlibchannel.cpp index 8400fef6eb..c7acb9b6c1 100644 --- a/engines/sky/music/adlibchannel.cpp +++ b/engines/sky/music/adlibchannel.cpp @@ -29,7 +29,7 @@ namespace Sky { -AdLibChannel::AdLibChannel(FM_OPL *opl, uint8 *pMusicData, uint16 startOfData) { +AdLibChannel::AdLibChannel(OPL::OPL *opl, uint8 *pMusicData, uint16 startOfData) { _opl = opl; _musicData = pMusicData; _channelData.loopPoint = startOfData; @@ -45,6 +45,8 @@ AdLibChannel::AdLibChannel(FM_OPL *opl, uint8 *pMusicData, uint16 startOfData) { _channelData.frequency = 0; _channelData.instrumentData = NULL; + _musicVolume = 128; + uint16 instrumentDataLoc; if (SkyEngine::_systemVars.gameVersion == 109) { @@ -86,7 +88,7 @@ bool AdLibChannel::isActive() { } void AdLibChannel::updateVolume(uint16 pVolume) { - // Do nothing. The mixer handles the music volume for us. + _musicVolume = pVolume; } /* This class uses the same area for the register mirror as the original @@ -95,7 +97,7 @@ void AdLibChannel::updateVolume(uint16 pVolume) { */ void AdLibChannel::setRegister(uint8 regNum, uint8 value) { if (_adlibRegMirror[regNum] != value) { - OPLWriteReg (_opl, regNum, value); + _opl->writeReg(regNum, value); _adlibRegMirror[regNum] = value; } } @@ -208,6 +210,8 @@ void AdLibChannel::setupChannelVolume(uint8 volume) { uint32 resVol = ((volume + 1) * (_channelData.instrumentData->totOutLev_Op2 + 1)) << 1; resVol &= 0xFFFF; resVol *= (_channelData.channelVolume + 1) << 1; + resVol >>= 8; + resVol *= _musicVolume << 1; resVol >>= 16; assert(resVol < 0x81); resultOp = ((_channelData.instrumentData->scalingLevel << 6) & 0xC0) | _opOutputTable[resVol]; @@ -216,6 +220,8 @@ void AdLibChannel::setupChannelVolume(uint8 volume) { resVol = ((volume + 1) * (_channelData.instrumentData->totOutLev_Op1 + 1)) << 1; resVol &= 0xFFFF; resVol *= (_channelData.channelVolume + 1) << 1; + resVol >>= 8; + resVol *= _musicVolume << 1; resVol >>= 16; } else resVol = _channelData.instrumentData->totOutLev_Op1; |