[Scummvm-cvs-logs] CVS: scummvm/scumm intern.h,2.203,2.204 resource.cpp,1.256,1.257 script_v72he.cpp,2.28,2.29 script_v7he.cpp,2.50,2.51 scumm.cpp,1.156,1.157 sound.cpp,1.372,1.373
Travis Howell
kirben at users.sourceforge.net
Sat Aug 28 02:21:04 CEST 2004
Update of /cvsroot/scummvm/scummvm/scumm
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1175/scumm
Modified Files:
intern.h resource.cpp script_v72he.cpp script_v7he.cpp
scumm.cpp sound.cpp
Log Message:
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
Index: intern.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/intern.h,v
retrieving revision 2.203
retrieving revision 2.204
diff -u -d -r2.203 -r2.204
--- intern.h 28 Aug 2004 03:18:51 -0000 2.203
+++ intern.h 28 Aug 2004 09:19:52 -0000 2.204
@@ -623,9 +623,12 @@
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 @@
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 @@
void o72_drawObject();
void o72_unknown62();
void o72_getArrayDimSize();
+ void o72_getNumFreeArrays();
void o72_arrayOps();
void o72_dimArray();
void o72_dim2dimArray();
Index: resource.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/resource.cpp,v
retrieving revision 1.256
retrieving revision 1.257
diff -u -d -r1.256 -r1.257
--- resource.cpp 28 Aug 2004 03:18:52 -0000 1.256
+++ resource.cpp 28 Aug 2004 09:19:52 -0000 1.257
@@ -992,7 +992,7 @@
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 @@
_objectRoomTable = (byte *)calloc(_numGlobalObjects, 1);
_numNewNames = 10;
+ _numRoomVariables = 64;
_objectRoomTable = (byte *)calloc(_numGlobalObjects * 4, 1);
Index: script_v72he.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v72he.cpp,v
retrieving revision 2.28
retrieving revision 2.29
diff -u -d -r2.28 -r2.29
--- script_v72he.cpp 28 Aug 2004 03:18:52 -0000 2.28
+++ script_v72he.cpp 28 Aug 2004 09:19:52 -0000 2.29
@@ -81,7 +81,7 @@
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 @@
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 @@
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 @@
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 @@
}
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 @@
}
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 @@
_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_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_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;
Index: script_v7he.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v7he.cpp,v
retrieving revision 2.50
retrieving revision 2.51
diff -u -d -r2.50 -r2.51
--- script_v7he.cpp 28 Aug 2004 03:18:52 -0000 2.50
+++ script_v7he.cpp 28 Aug 2004 09:19:52 -0000 2.51
@@ -342,9 +342,9 @@
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 @@
/* F4 */
OPCODE(o7_unknownF4),
OPCODE(o6_invalid),
- OPCODE(o6_invalid),
+ OPCODE(o7_unknownF6),
OPCODE(o6_invalid),
/* F8 */
OPCODE(o6_invalid),
@@ -416,12 +416,7 @@
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_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 @@
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 @@
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;
Index: scumm.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/scumm.cpp,v
retrieving revision 1.156
retrieving revision 1.157
diff -u -d -r1.156 -r1.157
--- scumm.cpp 28 Aug 2004 04:14:32 -0000 1.156
+++ scumm.cpp 28 Aug 2004 09:19:52 -0000 1.157
@@ -296,9 +296,9 @@
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},
Index: sound.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/sound.cpp,v
retrieving revision 1.372
retrieving revision 1.373
diff -u -d -r1.372 -r1.373
--- sound.cpp 28 Aug 2004 04:34:34 -0000 1.372
+++ sound.cpp 28 Aug 2004 09:19:53 -0000 1.373
@@ -180,8 +180,8 @@
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 @@
_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
More information about the Scummvm-git-logs
mailing list