diff options
author | Travis Howell | 2004-08-26 06:08:41 +0000 |
---|---|---|
committer | Travis Howell | 2004-08-26 06:08:41 +0000 |
commit | 8e2e48e40c4e52ae190a380f6e372119c565743c (patch) | |
tree | a7eaab6a4600cf361fa9f2a6da19eb74e8c1ef10 /scumm | |
parent | 68d35856c03900f2777933072a38f4665451ccc0 (diff) | |
download | scummvm-rg350-8e2e48e40c4e52ae190a380f6e372119c565743c.tar.gz scummvm-rg350-8e2e48e40c4e52ae190a380f6e372119c565743c.tar.bz2 scummvm-rg350-8e2e48e40c4e52ae190a380f6e372119c565743c.zip |
Add some stubs for HE 7.2
Fix warning
Add music support for later HE 7.2 games
svn-id: r14761
Diffstat (limited to 'scumm')
-rw-r--r-- | scumm/gfx.cpp | 3 | ||||
-rw-r--r-- | scumm/intern.h | 3 | ||||
-rw-r--r-- | scumm/resource.cpp | 1 | ||||
-rw-r--r-- | scumm/script.cpp | 4 | ||||
-rw-r--r-- | scumm/script_v6he.cpp | 4 | ||||
-rw-r--r-- | scumm/script_v72he.cpp | 33 | ||||
-rw-r--r-- | scumm/script_v7he.cpp | 2 | ||||
-rw-r--r-- | scumm/sound.cpp | 31 |
8 files changed, 66 insertions, 15 deletions
diff --git a/scumm/gfx.cpp b/scumm/gfx.cpp index 8873875a61..67df4cc569 100644 --- a/scumm/gfx.cpp +++ b/scumm/gfx.cpp @@ -1337,7 +1337,8 @@ void Gdi::drawBMAPBg(const byte *ptr, VirtScreen *vs, int startstrip, int width) } void Gdi::decompressBMAPbg(byte *dst, int screenwidth, int w, int height, const byte *src, int shr, int mask) { - uint32 color, dataBit, data, shift, iteration; + uint32 color, dataBit, data, shift; + int32 iteration; color = *src; src++; diff --git a/scumm/intern.h b/scumm/intern.h index e70b82f0c7..deeeea470f 100644 --- a/scumm/intern.h +++ b/scumm/intern.h @@ -691,6 +691,8 @@ protected: void o72_wordArrayInc(); void o72_objectX(); void o72_objectY(); + void o72_getTimer(); + void o72_setTimer(); void o72_wordArrayDec(); void o72_startScript(); void o72_startObject(); @@ -700,6 +702,7 @@ protected: void o72_arrayOps(); void o72_dimArray(); void o72_dim2dimArray(); + void o72_unknownCE(); void o72_shuffle(); void o72_jumpToScript(); void o72_openFile(); diff --git a/scumm/resource.cpp b/scumm/resource.cpp index e4ccec5053..c0492b4e29 100644 --- a/scumm/resource.cpp +++ b/scumm/resource.cpp @@ -2411,7 +2411,6 @@ void ScummEngine::allocateArrays() { _inventory = (uint16 *)calloc(_numInventory, sizeof(uint16)); _verbs = (VerbSlot *)calloc(_numVerbs, sizeof(VerbSlot)); _objs = (ObjectData *)calloc(_numLocalObjects, sizeof(ObjectData)); - debug(2, "Allocated %d space in numObjects", _numLocalObjects); _scummVars = (int32 *)calloc(_numVariables, sizeof(int32)); _bitVars = (byte *)calloc(_numBitVariables >> 3, 1); _images = (uint16 *)calloc(_numImages, sizeof(uint16)); diff --git a/scumm/script.cpp b/scumm/script.cpp index 861c51fabe..3ae5b862f3 100644 --- a/scumm/script.cpp +++ b/scumm/script.cpp @@ -477,6 +477,10 @@ int ScummEngine::fetchScriptWordSigned() { } int ScummEngine::readVar(uint var) { + // HACK Seems to variable difference + if (_gameId == GID_PAJAMA && var == 32770) + return 5; + int a; static byte copyprotbypassed; if (!_copyProtection) diff --git a/scumm/script_v6he.cpp b/scumm/script_v6he.cpp index 5e1995b138..0f0421d954 100644 --- a/scumm/script_v6he.cpp +++ b/scumm/script_v6he.cpp @@ -772,7 +772,7 @@ void ScummEngine_v6he::o6_kernelSetFunctions() { _skipDrawObject = 0; break; default: - error("o6_kernelSetFunctions: default case %d (param count %d)", args[0], num); + warning("o6_kernelSetFunctions: default case %d (param count %d)", args[0], num); break; } } @@ -851,7 +851,7 @@ void ScummEngine_v6he::o6_kernelGetFunctions() { push(retval); break; default: - error("o6_kernelGetFunctions: default case %d", args[0]); + warning("o6_kernelGetFunctions: default case %d", args[0]); } } diff --git a/scumm/script_v72he.cpp b/scumm/script_v72he.cpp index ab9d5d3a8f..39112daf7f 100644 --- a/scumm/script_v72he.cpp +++ b/scumm/script_v72he.cpp @@ -156,8 +156,8 @@ void ScummEngine_v72he::setupOpcodes() { OPCODE(o6_invalid), OPCODE(o6_wordVarDec), /* 58 */ - OPCODE(o6_invalid), - OPCODE(o6_invalid), + OPCODE(o72_getTimer), + OPCODE(o72_setTimer), OPCODE(o6_invalid), OPCODE(o72_wordArrayDec), /* 5C */ @@ -303,7 +303,7 @@ void ScummEngine_v72he::setupOpcodes() { /* CC */ OPCODE(o6_pickOneOfDefault), OPCODE(o6_stampObject), - OPCODE(o6_invalid), + OPCODE(o72_unknownCE), OPCODE(o6_invalid), /* D0 */ OPCODE(o6_getDateTime), @@ -619,6 +619,24 @@ void ScummEngine_v72he::o72_objectY() { push(_objs[objnum].y_pos); } +void ScummEngine_v72he::o72_getTimer() { + int b = pop(); + int a = fetchScriptByte(); + warning("o72_getTimer stub (%d, %d)", b, a); + if (a == 10) + push(1); + else + push(0); +} + +void ScummEngine_v72he::o72_setTimer() { + int b = pop(); + int a = fetchScriptByte(); + if (a != 158) + error("TIMER command %d?", a); + warning("o72_setTimer stub (%d, %d)", b, a); +} + void ScummEngine_v72he::o72_wordArrayDec() { int var = fetchScriptWord(); int base = pop(); @@ -821,6 +839,15 @@ void ScummEngine_v72he::o72_dim2dimArray() { defineArray(fetchScriptWord(), data, 0, a, 0, b); } +void ScummEngine_v72he::o72_unknownCE() { + int a = pop(); + int b = pop(); + int c = pop(); + int d = pop(); + warning("o72_unknownCE stub (%d, %d, %d, %d)", d, c, b, a); + push(4000); +} + void ScummEngine_v72he::shuffleArray(int num, int minIdx, int maxIdx) { int range = maxIdx - minIdx; int count = range * 2; diff --git a/scumm/script_v7he.cpp b/scumm/script_v7he.cpp index b3b4caf48a..d024c9d0fa 100644 --- a/scumm/script_v7he.cpp +++ b/scumm/script_v7he.cpp @@ -707,7 +707,7 @@ void ScummEngine_v7he::o7_quitPauseRestart() { warning("stub: o7_quitPauseRestart subOpcode %d", subOp); break; default: - error("o7_quitPauseRestart invalid case %d", subOp); + warning("o7_quitPauseRestart invalid case %d", subOp); } } diff --git a/scumm/sound.cpp b/scumm/sound.cpp index 14a13e8e18..09aef4d84e 100644 --- a/scumm/sound.cpp +++ b/scumm/sound.cpp @@ -166,8 +166,10 @@ void Sound::playSound(int soundID, int offset) { debugC(DEBUG_SOUND, "playSound #%d", soundID); int music_offs, total_size; + uint skip; char buf[32]; File musicFile; + sprintf(buf, "%s.he4", _vm->getGameName()); if (musicFile.open(buf) == false) { warning("playSound: Music file is not open"); @@ -176,15 +178,30 @@ void Sound::playSound(int soundID, int offset) { musicFile.seek(4, SEEK_SET); total_size = musicFile.readUint32BE(); - // Skip header junk - musicFile.seek(+20, SEEK_CUR); + musicFile.seek(+40, SEEK_CUR); + if (musicFile.readUint32LE() == MKID('SGEN')) { + // Skip to correct music header + skip = (soundID - 4001) * 21; + musicFile.seek(+skip, SEEK_CUR); + + // Skip to offsets + musicFile.seek(+8, SEEK_CUR); + + } else { + // Rewind + musicFile.seek(-44, SEEK_CUR); - // Skip to correct music header - uint skip = (soundID - 4001) * 25; - musicFile.seek(+skip, SEEK_CUR); + // Skip header junk + musicFile.seek(+20, SEEK_CUR); + + // Skip to correct music header + skip = (soundID - 4001) * 25; + musicFile.seek(+skip, SEEK_CUR); + + // Skip to offsets + musicFile.seek(+21, SEEK_CUR); + } - // Skip to offsets - musicFile.seek(+21, SEEK_CUR); music_offs = musicFile.readUint32LE(); size = musicFile.readUint32LE(); |