aboutsummaryrefslogtreecommitdiff
path: root/sound/softsynth/fmtowns_pc98/towns_audio.cpp
diff options
context:
space:
mode:
authorFlorian Kagerer2010-08-11 22:50:13 +0000
committerFlorian Kagerer2010-08-11 22:50:13 +0000
commit75117d787514192c20788efb5c62997c1b1b514c (patch)
treed0c8eae0dfb8857ef1a4ba26142854f84316ee6b /sound/softsynth/fmtowns_pc98/towns_audio.cpp
parent53f11373d491d34ee735dcb99106926c9e6af342 (diff)
downloadscummvm-rg350-75117d787514192c20788efb5c62997c1b1b514c.tar.gz
scummvm-rg350-75117d787514192c20788efb5c62997c1b1b514c.tar.bz2
scummvm-rg350-75117d787514192c20788efb5c62997c1b1b514c.zip
FMTOWNS AUDIO: fix cda volume and balance control
svn-id: r52013
Diffstat (limited to 'sound/softsynth/fmtowns_pc98/towns_audio.cpp')
-rw-r--r--sound/softsynth/fmtowns_pc98/towns_audio.cpp10
1 files changed, 3 insertions, 7 deletions
diff --git a/sound/softsynth/fmtowns_pc98/towns_audio.cpp b/sound/softsynth/fmtowns_pc98/towns_audio.cpp
index c9ba03ea27..46569dd842 100644
--- a/sound/softsynth/fmtowns_pc98/towns_audio.cpp
+++ b/sound/softsynth/fmtowns_pc98/towns_audio.cpp
@@ -360,7 +360,6 @@ void TownsAudioInterface::timerCallbackB() {
}
int TownsAudioInterface::intf_reset(va_list &args) {
- Common::StackLock lock(_mutex);
fmReset();
pcmReset();
callback(68);
@@ -1393,12 +1392,9 @@ void TownsAudioInterface::updateOutputVolume() {
// balance values for our -128 to 127 volume range
// CD-AUDIO
- int vl = (int)(((float)_outputLevel[12] * 127.0f) / 63.0f);
- int vr = (int)(((float)_outputLevel[13] * 127.0f) / 63.0f);
- int8 balance = vr - vl;
- vl = (int)(((float)_outputLevel[12] * 255.0f) / 63.0f);
- vr = (int)(((float)_outputLevel[13] * 255.0f) / 63.0f);
- AudioCD.setVolume((vl + vr) >> 1);
+ int volume = (int)(((float)MAX(_outputLevel[12], _outputLevel[13]) * 255.0f) / 63.0f);
+ int balance = (int)((float)((_outputLevel[13] - _outputLevel[12]) * 127.0f) / (float)MAX(_outputLevel[12], _outputLevel[13]));
+ AudioCD.setVolume(volume);
AudioCD.setBalance(balance);
}