Skip to content

Commit

Permalink
ACCESS: Properly indent some code in playSound
Browse files Browse the repository at this point in the history
  • Loading branch information
Strangerke authored and dreammaster committed Dec 13, 2014
1 parent 712a18d commit de63e2a
Showing 1 changed file with 18 additions and 6 deletions.
24 changes: 18 additions & 6 deletions engines/access/sound.cpp
Expand Up @@ -96,8 +96,8 @@ void SoundManager::playSound(Resource *res, int priority) {
// header content:
// "STEVE" - fixed header
// byte - sample rate
// 01h mapped internally to 3Ch ??
// 02h mapped internally to 78h seems to be 11025Hz
// 01h mapped internally to 3Ch
// 02h mapped internally to 78h
// 03h mapped internally to B5h
// 04h mapped internally to F1h
// byte - unknown
Expand All @@ -109,10 +109,22 @@ void SoundManager::playSound(Resource *res, int priority) {

int sampleRate = 0;
switch (internalSampleRate) {
case 1: sampleRate = 16666; break; // 3Ch -> C4h time constant
case 2: sampleRate = 8334; break; // 78h -> 88h time constant
case 3: sampleRate = 5525; break; // B5h -> 4Bh time constant
case 4: sampleRate = 4150; break; // F1h -> 0Fh time constant
case 1: // NEG(3Ch) -> C4h time constant
sampleRate = 16666;
break;

case 2: // NEG(78h) -> 88h time constant
sampleRate = 8334;
break;

case 3: // NEG(B5h) -> 4Bh time constant
sampleRate = 5525;
break;

case 4: // NEG(F1h) -> 0Fh time constant
sampleRate = 4150;
break;

default:
error("Unexpected internal Sample Rate %d", internalSampleRate);
return;
Expand Down

0 comments on commit de63e2a

Please sign in to comment.