aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaweł Kołodziejski2002-07-19 18:52:50 +0000
committerPaweł Kołodziejski2002-07-19 18:52:50 +0000
commitd5e5f054b308f3937ed272db66a8d4eb6d113216 (patch)
treed437fe68f6ba6de31436a31b60e9c15c67dd4eb2
parentd65204a24cd0a397acf4a2ea1a1fd72576245935 (diff)
downloadscummvm-rg350-d5e5f054b308f3937ed272db66a8d4eb6d113216.tar.gz
scummvm-rg350-d5e5f054b308f3937ed272db66a8d4eb6d113216.tar.bz2
scummvm-rg350-d5e5f054b308f3937ed272db66a8d4eb6d113216.zip
DIG: implemented music codec 11,
12 coming soon. not really tested yet svn-id: r4603
-rw-r--r--sound.cpp32
1 files changed, 30 insertions, 2 deletions
diff --git a/sound.cpp b/sound.cpp
index be5c0a64ba..d2cdb5eab2 100644
--- a/sound.cpp
+++ b/sound.cpp
@@ -789,7 +789,7 @@ void Scumm::decompressBundleSound(int index) {
COMP_table table[50];
unsigned char *CompInput, *CompOutput, *CompFinal, *Final;
int outputSize, finalSize;
- uint32 offset1, offset2, offset3, length, k, c, s, j, r;
+ uint32 offset1, offset2, offset3, length, k, c, s, j, r, t;
byte * src, * t_table;
byte t_tmp1, t_tmp2;
@@ -933,7 +933,35 @@ void Scumm::decompressBundleSound(int index) {
*(t_table + offset2 + 1) = *(src + offset3);
} while(1);
- // completed soon
+ src = CompOutput;
+ length = (outputSize * 8) / 12;
+ k = 1;
+ c = 0;
+ s = 12;
+ t_tmp1 = (*(t_table + length)) >> 4;
+ *(src) = t_tmp1;
+ t = length + k;
+ if (t > k) {
+ do {
+ j = length + (k / 2);
+ if (k & 1) {
+ r = c / 8;
+ t_tmp1 = *(t_table + k - 1);
+ t_tmp2 = *(t_table + j);
+ *(src + r + 0) = (*(src + r)) | (t_tmp1 & 0xf0);
+ *(src + r + 1) = ((t_tmp1 & 0x0f) << 4) | (t_tmp2 & 0x0f);
+ } else {
+ r = s / 8;
+ t_tmp1 = *(t_table + k - 1);
+ t_tmp2 = *(t_table + j);
+ *(src + r + 0) = (t_tmp1 & 0xf0) >> 4;
+ *(src + r - 1) = ((t_tmp1 & 0x0f) << 4) | ((t_tmp2 & 0xf0) >> 4);
+ }
+ s += 12;
+ k++;
+ c += 12;
+ } while (k < t);
+ }
break;