diff options
author | Travis Howell | 2004-08-28 09:19:53 +0000 |
---|---|---|
committer | Travis Howell | 2004-08-28 09:19:53 +0000 |
commit | 0f71f50d3743f1a8680a87b6ac88b8a742708885 (patch) | |
tree | aed9b291725e6f009c50e82f99d680eb430053ba /scumm | |
parent | 51c1ca442eada2281df1c8001848f6fb08066d6f (diff) | |
download | scummvm-rg350-0f71f50d3743f1a8680a87b6ac88b8a742708885.tar.gz scummvm-rg350-0f71f50d3743f1a8680a87b6ac88b8a742708885.tar.bz2 scummvm-rg350-0f71f50d3743f1a8680a87b6ac88b8a742708885.zip |
Sound change for later HE 7.x games
Revert cursor change, later games have no .he3 file.
Add some stubs/opcodes
Later HE games use hard code value for _numRoomVariables
svn-id: r14808
Diffstat (limited to 'scumm')
-rw-r--r-- | scumm/intern.h | 5 | ||||
-rw-r--r-- | scumm/resource.cpp | 3 | ||||
-rw-r--r-- | scumm/script_v72he.cpp | 44 | ||||
-rw-r--r-- | scumm/script_v7he.cpp | 39 | ||||
-rw-r--r-- | scumm/scumm.cpp | 4 | ||||
-rw-r--r-- | scumm/sound.cpp | 13 |
6 files changed, 85 insertions, 23 deletions
diff --git a/scumm/intern.h b/scumm/intern.h index d6856e572b..a455dd48ee 100644 --- a/scumm/intern.h +++ b/scumm/intern.h @@ -623,9 +623,12 @@ protected: void o7_getActorRoom(); void o7_resourceRoutines(); void o7_quitPauseRestart(); + void o7_unknownED(); void o7_stringLen(); + void o7_unknownEF(); void o7_readINI(); void o7_unknownF4(); + void o7_unknownF6(); void o7_unknownF9(); void o7_unknownFA(); void o7_unknownFB(); @@ -686,6 +689,7 @@ protected: void o72_wordArrayWrite(); void o72_wordArrayIndexedWrite(); void o72_compareStackList(); + void o72_unknown1C(); void o72_unknown50(); void o72_wordArrayInc(); void o72_objectX(); @@ -698,6 +702,7 @@ protected: void o72_drawObject(); void o72_unknown62(); void o72_getArrayDimSize(); + void o72_getNumFreeArrays(); void o72_arrayOps(); void o72_dimArray(); void o72_dim2dimArray(); diff --git a/scumm/resource.cpp b/scumm/resource.cpp index cfc491e63e..61b8fe62a7 100644 --- a/scumm/resource.cpp +++ b/scumm/resource.cpp @@ -992,7 +992,7 @@ int ScummEngine::readSoundResource(int type, int idx) { total_size = _fileHandle.readUint32BE(); _fileHandle.read(createResource(type, idx, total_size), total_size - 8); return 1; - } else if (basetag == MKID('HDHS')) { + } else if (basetag == MKID('HSHD')) { _fileHandle.seek(-12, SEEK_CUR); total_size = _fileHandle.readUint32BE(); _fileHandle.read(createResource(type, idx, total_size), total_size - 8); @@ -2321,6 +2321,7 @@ void ScummEngine::readMAXS(int blockSize) { _objectRoomTable = (byte *)calloc(_numGlobalObjects, 1); _numNewNames = 10; + _numRoomVariables = 64; _objectRoomTable = (byte *)calloc(_numGlobalObjects * 4, 1); diff --git a/scumm/script_v72he.cpp b/scumm/script_v72he.cpp index 78275dd12a..5650a1d2d2 100644 --- a/scumm/script_v72he.cpp +++ b/scumm/script_v72he.cpp @@ -81,7 +81,7 @@ void ScummEngine_v72he::setupOpcodes() { OPCODE(o6_pop), OPCODE(o72_compareStackList), /* 1C */ - OPCODE(o6_invalid), + OPCODE(o72_unknown1C), OPCODE(o6_invalid), OPCODE(o6_invalid), OPCODE(o6_invalid), @@ -171,7 +171,7 @@ void ScummEngine_v72he::setupOpcodes() { OPCODE(o72_unknown62), OPCODE(o72_getArrayDimSize), /* 64 */ - OPCODE(o6_invalid), + OPCODE(o72_getNumFreeArrays), OPCODE(o6_stopObjectCode), OPCODE(o6_stopObjectCode), OPCODE(o6_endCutscene), @@ -334,7 +334,7 @@ void ScummEngine_v72he::setupOpcodes() { OPCODE(o6_setBoxSet), OPCODE(o6_invalid), OPCODE(o6_invalid), - OPCODE(o6_invalid), + OPCODE(o7_unknownEF), /* E8 */ OPCODE(o6_invalid), OPCODE(o6_seekFilePos), @@ -383,7 +383,7 @@ static int arrayDataSizes[] = {0, 1, 4, 8, 8, 16, 32}; ScummEngine_v72he::ArrayHeader *ScummEngine_v72he::defineArray(int array, int type, int dim2start, int dim2end, int dim1start, int dim1end) { - debug(1,"defineArray (array %d, dim2start %d, dim2end %d dim1start %d dim1end %d", array, dim2start, dim2end, dim1start, dim1end); + debug(5,"defineArray (array %d, dim2start %d, dim2end %d dim1start %d dim1end %d", array, dim2start, dim2end, dim1start, dim1end); int id; int size; @@ -425,7 +425,7 @@ ScummEngine_v72he::ArrayHeader *ScummEngine_v72he::defineArray(int array, int ty } int ScummEngine_v72he::readArray(int array, int idx2, int idx1) { - debug(1, "readArray (array %d, idx2 %d, idx1 %d)", array, idx2, idx1); + debug(5, "readArray (array %d, idx2 %d, idx1 %d)", array, idx2, idx1); if (readVar(array) == 0) error("readArray: Reference to zeroed array pointer"); @@ -461,7 +461,7 @@ int ScummEngine_v72he::readArray(int array, int idx2, int idx1) { } void ScummEngine_v72he::writeArray(int array, int idx2, int idx1, int value) { - debug(1, "writeArray (array %d, idx2 %d, idx1 %d, value %d)", array, idx2, idx1, value); + debug(5, "writeArray (array %d, idx2 %d, idx1 %d, value %d)", array, idx2, idx1, value); if (readVar(array) == 0) error("writeArray: Reference to zeroed array pointer"); @@ -529,7 +529,7 @@ void ScummEngine_v72he::o72_addMessageToStack() { _stringLength = resStrLen(_scriptPointer) + 1; addMessageToStack(_scriptPointer, _stringBuffer, _stringLength); - debug(1,"o72_addMessageToStack(\"%s\")", _scriptPointer); + debug(0,"o72_addMessageToStack(\"%s\")", _scriptPointer); _scriptPointer += _stringLength; } @@ -562,6 +562,24 @@ void ScummEngine_v72he::o72_compareStackList() { } } +void ScummEngine_v72he::o72_unknown1C() { + // For Pajame Sam 2 + // Maybe HE 7.3? + // Incomplete + int value = fetchScriptByte(); + value -= 46; + + if (value == 10) { + pop(); + pop(); + pop(); + pop(); + pop(); + } + + warning("o72_unknown1C stub (%d)", value); +} + void ScummEngine_v72he::o72_wordArrayWrite() { int a = pop(); writeArray(fetchScriptWord(), 0, pop(), a); @@ -736,6 +754,18 @@ void ScummEngine_v72he::o72_getArrayDimSize() { } } +void ScummEngine_v72he::o72_getNumFreeArrays() { + byte **addr = _baseArrays; + int i, num = 0; + + for (i = 1; i < _numArray; i++) { + if (!addr[i]) + num++; + } + + push (num); +} + void ScummEngine_v72he::o72_arrayOps() { byte subOp = fetchScriptByte(); int array = 0; diff --git a/scumm/script_v7he.cpp b/scumm/script_v7he.cpp index 9b50528888..039a7ac07b 100644 --- a/scumm/script_v7he.cpp +++ b/scumm/script_v7he.cpp @@ -342,9 +342,9 @@ void ScummEngine_v7he::setupOpcodes() { OPCODE(o6_readFilePos), /* EC */ OPCODE(o6_invalid), - OPCODE(o6_invalid), + OPCODE(o7_unknownED), OPCODE(o7_stringLen), - OPCODE(o6_invalid), + OPCODE(o7_unknownEF), /* F0 */ OPCODE(o6_invalid), OPCODE(o6_invalid), @@ -353,7 +353,7 @@ void ScummEngine_v7he::setupOpcodes() { /* F4 */ OPCODE(o7_unknownF4), OPCODE(o6_invalid), - OPCODE(o6_invalid), + OPCODE(o7_unknownF6), OPCODE(o6_invalid), /* F8 */ OPCODE(o6_invalid), @@ -416,12 +416,7 @@ void ScummEngine_v7he::o7_cursorCommand() { case 0x13: // HE 7.2 (Not all games) case 0x14: // Loads cursors from another resource - // Use old cursors for now a = pop(); - if (a == 2) - _Win32ResExtractor->setCursor(102); - else if (a == 5) - _Win32ResExtractor->setCursor(103); debug(1, "o7_cursorCommand: case %x (%d)", subOp, a); break; case 0x90: // SO_CURSOR_ON Turn cursor on @@ -716,6 +711,15 @@ void ScummEngine_v7he::o7_quitPauseRestart() { } } +void ScummEngine_v7he::o7_unknownED() { + int a, b, c; + a = pop(); + b = pop(); + c = pop(); + push(-1); + warning("stub o7_unknownED (%d, %d, %d)", c, b, a); +} + void ScummEngine_v7he::o7_stringLen() { int id, len; byte *addr; @@ -730,6 +734,15 @@ void ScummEngine_v7he::o7_stringLen() { push(len); } +void ScummEngine_v7he::o7_unknownEF() { + int a, b, c; + a = pop(); + b = pop(); + c = pop(); + push(1); + warning("stub o7_unknownEF (%d, %d, %d)", c, b, a); +} + void ScummEngine_v7he::o7_readINI() { int len; int type; @@ -787,6 +800,16 @@ void ScummEngine_v7he::o7_unknownF4() { warning("o7_unknownF4 stub"); } +void ScummEngine_v7he::o7_unknownF6() { + int a, b, c, d; + a = pop(); + b = pop(); + c = pop(); + d = pop(); + push(0); + warning("stub o7_unknownF6 (%d, %d, %d, %d)", d, c, b, a); +} + void ScummEngine_v7he::o7_unknownF9() { // File related int len, r; diff --git a/scumm/scumm.cpp b/scumm/scumm.cpp index 64c48e07a7..ed256dd02e 100644 --- a/scumm/scumm.cpp +++ b/scumm/scumm.cpp @@ -296,9 +296,9 @@ static const ScummGameSettings scumm_settings[] = { GF_NEW_OPCODES | GF_USE_KEY | GF_HUMONGOUS | GF_NEW_COSTUMES, 0, 0}, // Humongous Entertainment Scumm Version 9.5 ? Scummsys.95 - {"pj2demo", "Pajama Sam 2: Thunder and Lightning Aren't so Frightening (Demo)", GID_HEGAME, 6, 90, MDT_NONE, + {"pj2demo", "Pajama Sam 2: Thunder and Lightning Aren't so Frightening (Demo)", GID_PAJAMA, 6, 90, MDT_NONE, GF_NEW_OPCODES | GF_USE_KEY | GF_HUMONGOUS | GF_NEW_COSTUMES, 0, 0}, - {"pajama2", "Pajama Sam 2: Thunder and Lightning Aren't so Frightening", GID_HEGAME, 6, 90, MDT_NONE, + {"pajama2", "Pajama Sam 2: Thunder and Lightning Aren't so Frightening", GID_PAJAMA, 6, 90, MDT_NONE, GF_NEW_OPCODES | GF_USE_KEY | GF_HUMONGOUS | GF_NEW_COSTUMES, 0, 0}, {"chase", "Spy Fox in Cheese Chase Game", GID_HEGAME, 6, 90, MDT_NONE, GF_NEW_OPCODES | GF_USE_KEY | GF_HUMONGOUS | GF_NEW_COSTUMES, 0, 0}, diff --git a/scumm/sound.cpp b/scumm/sound.cpp index fa273ed834..127e5be5d2 100644 --- a/scumm/sound.cpp +++ b/scumm/sound.cpp @@ -180,8 +180,8 @@ void Sound::playSound(int soundID, int offset) { musicFile.seek(+40, SEEK_CUR); if (musicFile.readUint32LE() == MKID('SGEN')) { - // Skip to correct music header - skip = (soundID - 8001) * 21; + // TODO Work out skpi calcution + //skip = (soundID - 8001) * 21; musicFile.seek(+skip, SEEK_CUR); // Skip to offsets @@ -260,12 +260,15 @@ void Sound::playSound(int soundID, int offset) { _vm->_mixer->playRaw(NULL, sound, size, rate, flags, soundID); } // Support for Putt-Putt sounds - very hackish, too 8-) - else if (READ_UINT32(ptr) == MKID('DIGI') || READ_UINT32(ptr) == MKID('TALK')) { + else if (READ_UINT32(ptr) == MKID('DIGI') || READ_UINT32(ptr) == MKID('TALK') || READ_UINT32(ptr) == MKID('HSHD')) { + // Later game start have 8 less + int diff = (READ_UINT32(ptr) == MKID('HSHD')) ? 8 : 0; + // TODO - discover what data the first chunk, HSHD, contains // it might be useful here. - rate = READ_LE_UINT16(ptr + 22); + rate = READ_LE_UINT16(ptr + 22 - diff); - ptr += 8 + READ_BE_UINT32(ptr+12); + ptr += 8 + READ_BE_UINT32(ptr + 12 - diff); if (READ_UINT32(ptr) != MKID('SDAT')) return; // abort |