[Scummvm-cvs-logs] CVS: scummvm/scumm actor.cpp,1.279,1.280 actor.h,1.60,1.61 intern.h,2.215,2.216 saveload.h,1.39,1.40 script.cpp,1.192,1.193 script_v6.cpp,1.395,1.396 script_v6he.cpp,2.109,2.110 script_v72he.cpp,2.45,2.46 scumm.cpp,1.167,1.168 scumm.h,1.468,1.469 vars.cpp,1.97,1.98

Travis Howell kirben at users.sourceforge.net
Sun Sep 5 02:38:01 CEST 2004


Update of /cvsroot/scummvm/scummvm/scumm
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9433/scumm

Modified Files:
	actor.cpp actor.h intern.h saveload.h script.cpp script_v6.cpp 
	script_v6he.cpp script_v72he.cpp scumm.cpp scumm.h vars.cpp 
Log Message:

Increase actor.sound to 32 for HE 80+ games.
Add some more HE vars.
More adjustments for copying script strings in HE games.


Index: actor.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/actor.cpp,v
retrieving revision 1.279
retrieving revision 1.280
diff -u -d -r1.279 -r1.280
--- actor.cpp	4 Sep 2004 10:29:06 -0000	1.279
+++ actor.cpp	5 Sep 2004 09:36:50 -0000	1.280
@@ -1838,7 +1838,11 @@
 		MKLINE(Actor, scalex, sleByte, VER(8)),
 		MKLINE(Actor, scaley, sleByte, VER(8)),
 		MKLINE(Actor, charset, sleByte, VER(8)),
-		MKARRAY(Actor, sound[0], sleByte, 8, VER(8)),
+
+		// Actor sound grew from 8 to 32 bytes
+		MKARRAY_OLD(Actor, sound[0], sleByte, 8, VER(35), VER(36)),
+		MKARRAY(Actor, sound[0], sleByte, 32, VER(37)),
+
 		MKARRAY(Actor, animVariable[0], sleUint16, 8, VER(8)),
 		MKLINE(Actor, targetFacing, sleUint16, VER(8)),
 		MKLINE(Actor, moving, sleByte, VER(8)),

Index: actor.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/actor.h,v
retrieving revision 1.60
retrieving revision 1.61
diff -u -d -r1.60 -r1.61
--- actor.h	4 Sep 2004 10:29:06 -0000	1.60
+++ actor.h	5 Sep 2004 09:36:50 -0000	1.61
@@ -117,7 +117,7 @@
 	bool drawToBackBuf;
 	bool talking;
 	int8 layer;
-	uint16 sound[8];
+	uint16 sound[32];
 	CostumeData cost;
 protected:
 	byte palette[256];

Index: intern.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/intern.h,v
retrieving revision 2.215
retrieving revision 2.216
diff -u -d -r2.215 -r2.216
--- intern.h	4 Sep 2004 23:58:14 -0000	2.215
+++ intern.h	5 Sep 2004 09:36:50 -0000	2.216
@@ -574,8 +574,6 @@
 	void seekFilePos(int slot, int offset, int mode);
 	virtual void decodeParseString(int a, int b);
 
-	void decodeScriptString(byte *dst, bool scriptString = false);
-
 	/* Version 6 script opcodes */
 	void o6_setState();
 	void o6_roomOps();
@@ -702,6 +700,10 @@
 	void flushWizBuffer();
 	void copyWizImage(uint8 *dst, const uint8 *src, int dstw, int dsth, int srcx, int srcy, int srcw, int srch, Common::Rect *pr);
 
+	virtual void decodeParseString(int a, int b);
+	void decodeScriptString(byte *dst, bool scriptString = false);
+	int copyScriptString(byte *dst);
+
 	/* Version 7 script opcodes */
 	void o72_pushDWord();
 	void o72_addMessageToStack();
@@ -727,6 +729,8 @@
 	void o72_getArrayDimSize();
 	void o72_getNumFreeArrays();
 	void o72_pickupObject();
+	void o72_actorOps();
+	void o72_verbOps();
 	void o72_arrayOps();
 	void o72_dimArray();
 	void o72_dim2dimArray();
@@ -744,6 +748,7 @@
 	void o72_unknownED();
 	void o72_unknownEF();
 	void o72_unknownF1();
+	void o72_unknownF2();
 	void o72_readINI();
 	void o72_writeINI();
 	void o72_unknownF4();

Index: saveload.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/saveload.h,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -d -r1.39 -r1.40
--- saveload.h	9 Aug 2004 01:07:48 -0000	1.39
+++ saveload.h	5 Sep 2004 09:36:50 -0000	1.40
@@ -32,7 +32,7 @@
 // Can be useful for other ports too :)
 
 #define VER(x) x
-#define CURRENT_VER 35
+#define CURRENT_VER 37
 
 // To work around a warning in GCC 3.2 (and 3.1 ?) regarding non-POD types,
 // we use a small trick: instead of 0 we use 42. Why? Well, it seems newer GCC

Index: script.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script.cpp,v
retrieving revision 1.192
retrieving revision 1.193
diff -u -d -r1.192 -r1.193
--- script.cpp	3 Sep 2004 06:57:37 -0000	1.192
+++ script.cpp	5 Sep 2004 09:36:50 -0000	1.193
@@ -1056,20 +1056,11 @@
 	return false;
 }
 
-int ScummEngine::copyScriptString(byte *dst, bool override) {
-	int len, i = 0;
-	if (_heversion >= 72 && (pop() == -1 || override)) {
-		len = resStrLen(_stringBuffer) + 1;
-		while (len--)
-			*dst++ = _stringBuffer[i++];
-	} else {
-		len = resStrLen(_scriptPointer) + 1;
-		while (len--)
-			*dst++ = fetchScriptByte();
-	}
+void ScummEngine::copyScriptString(byte *dst) {
+	int len = resStrLen(_scriptPointer) + 1;
+	while (len--)
+		*dst++ = fetchScriptByte();
 	*dst = 0;
-
-	return len;
 }
 
 //

Index: script_v6.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v6.cpp,v
retrieving revision 1.395
retrieving revision 1.396
diff -u -d -r1.395 -r1.396
--- script_v6.cpp	4 Sep 2004 08:13:47 -0000	1.395
+++ script_v6.cpp	5 Sep 2004 09:36:50 -0000	1.396
@@ -398,6 +398,9 @@
 }
 
 ArrayHeader *ScummEngine_v6::defineArray(int array, int type, int dim2, int dim1) {
+	if (_heversion >= 72)
+		error("Call to old defineArray");
+
 	int id;
 	int size;
 	ArrayHeader *ah;
@@ -503,6 +506,9 @@
 }
 
 int ScummEngine_v6::readArray(int array, int idx, int base) {
+	if (_heversion >= 72)
+		error("Call to old readArray");
+
 	ArrayHeader *ah = getArray(array);
 
 	if (ah == NULL || ah->data == NULL)
@@ -536,6 +542,9 @@
 }
 
 void ScummEngine_v6::writeArray(int array, int idx, int base, int value) {
+	if (_heversion >= 72)
+		error("Call to old writeArray");
+
 	ArrayHeader *ah = getArray(array);
 	if (!ah)
 		return;
@@ -1910,7 +1919,6 @@
 	int slot, a, b;
 	VerbSlot *vs;
 	byte op;
-	byte name[200];
 
 	op = fetchScriptByte();
 	if (op == 196) {
@@ -1932,8 +1940,7 @@
 		}
 		break;
 	case 125:		// SO_VERB_NAME
-		copyScriptString(name);
-		loadPtrToResource(rtVerb, slot, name);
+		loadPtrToResource(rtVerb, slot, NULL);
 		vs->type = kTextVerbType;
 		vs->imgindex = 0;
 		break;

Index: script_v6he.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v6he.cpp,v
retrieving revision 2.109
retrieving revision 2.110
diff -u -d -r2.109 -r2.110
--- script_v6he.cpp	4 Sep 2004 10:29:06 -0000	2.109
+++ script_v6he.cpp	5 Sep 2004 09:36:50 -0000	2.110
@@ -552,7 +552,6 @@
 	int i, j, k;
 	int args[8];
 	byte b;
-	byte name[256];
 
 	b = fetchScriptByte();
 	if (b == 197) {
@@ -565,25 +564,12 @@
 		return;
 
 	switch (b) {
-	case 21:
-		// HE 7.3 (Pajama Sam onwards)
-		k = getStackList(args, ARRAYSIZE(args));
-		break;
 	case 30:
 		// _heversion >= 70
 		_actorClipOverride.bottom = pop();
 		_actorClipOverride.right = pop();
 		_actorClipOverride.top = pop();
 		_actorClipOverride.left = pop();
-		warning("o6_actorOps: stub case %d", b);
-		break;
-	case 64:
-		// _heversion >= 72
-		_actorClipOverride.bottom = pop();
-		_actorClipOverride.right = pop();
-		_actorClipOverride.top = pop();
-		_actorClipOverride.left = pop();
-		warning("o6_actorOps: stub case %d", b);
 		break;
 	case 76:		// SO_COSTUME
 		a->setActorCostume(pop());
@@ -637,8 +623,7 @@
 		a->talkColor = pop();
 		break;
 	case 88:		// SO_ACTOR_NAME
-		copyScriptString(name);
-		loadPtrToResource(rtActorName, a->number, name);
+		loadPtrToResource(rtActorName, a->number, NULL);
 		break;
 	case 89:		// SO_INIT_ANIMATION
 		a->initFrame = pop();
@@ -1252,7 +1237,6 @@
 	byte b;
 	int i, color;
 	int args[31];
-	byte name[1024];
 
 	b = fetchScriptByte();
 
@@ -1304,23 +1288,6 @@
 		_scriptPointer += resStrLen(_scriptPointer) + 1;
 
 		break;
-	case 194:		// HE 7.2
-		decodeScriptString(name, true);
-		switch (m) {
-		case 0:
-			actorTalk(name);
-			break;
-		case 1:
-			drawString(1, name);
-			break;
-		case 2:
-			unkMessage1(name);
-			break;
-		case 3:
-			unkMessage2(name);
-			break;
-		}
-		break;
 	case 0xF9:
 		color = pop();
 		if (color == 1) {

Index: script_v72he.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v72he.cpp,v
retrieving revision 2.45
retrieving revision 2.46
diff -u -d -r2.45 -r2.46
--- script_v72he.cpp	4 Sep 2004 23:58:15 -0000	2.45
+++ script_v72he.cpp	5 Sep 2004 09:36:51 -0000	2.46
@@ -242,8 +242,8 @@
 		OPCODE(o7_resourceRoutines),
 		/* 9C */
 		OPCODE(o6_roomOps),
-		OPCODE(o6_actorOps),
-		OPCODE(o6_verbOps),
+		OPCODE(o72_actorOps),
+		OPCODE(o72_verbOps),
 		OPCODE(o6_getActorFromXY),
 		/* A0 */
 		OPCODE(o6_findObject),
@@ -348,7 +348,7 @@
 		/* F0 */
 		OPCODE(o6_invalid),
 		OPCODE(o72_unknownF1),
-		OPCODE(o6_invalid),
+		OPCODE(o72_unknownF2),
 		OPCODE(o72_readINI),
 		/* F4 */
 		OPCODE(o72_writeINI),
@@ -383,8 +383,6 @@
 
 ScummEngine_v72he::ArrayHeader *ScummEngine_v72he::defineArray(int array, int type, int dim2start, int dim2end,
 											int dim1start, int dim1end) {
-	debug(5,"defineArray (array %d, dim2start %d, dim2end %d dim1start %d dim1end %d", array, dim2start, dim2end, dim1start, dim1end);
-
 	int id;
 	int size;
 	ArrayHeader *ah;
@@ -401,6 +399,8 @@
 
 	id = findFreeArrayId();
 
+	debug(5,"defineArray (array %d, dim2start %d, dim2end %d dim1start %d dim1end %d", id, dim2start, dim2end, dim1start, dim1end);
+
 	if (array & 0x80000000) {
 		error("Can't define bit variable as array pointer");
 	}
@@ -425,7 +425,7 @@
 }
 
 int ScummEngine_v72he::readArray(int array, int idx2, int idx1) {
-	debug(5, "readArray (array %d, idx2 %d, idx1 %d)", array, idx2, idx1);
+	debug(5, "readArray (array %d, idx2 %d, idx1 %d)", readVar(array), idx2, idx1);
 
 	if (readVar(array) == 0)
 		error("readArray: Reference to zeroed array pointer");
@@ -436,7 +436,7 @@
 		error("readArray: invalid array %d (%d)", array, readVar(array));
 
 	if (idx2 < (int)FROM_LE_32(ah->dim2start) || idx2 > (int)FROM_LE_32(ah->dim2end) || 
-		idx1 < (int)FROM_LE_32(ah->dim2start) || idx1 > (int)FROM_LE_32(ah->dim1end)) {
+		idx1 < (int)FROM_LE_32(ah->dim1start) || idx1 > (int)FROM_LE_32(ah->dim1end)) {
 		error("readArray: array %d out of bounds: [%d, %d] exceeds [%d..%d, %d..%d]",
 			  array, idx1, idx2, FROM_LE_32(ah->dim1start), FROM_LE_32(ah->dim1end),
 			  FROM_LE_32(ah->dim2start), FROM_LE_32(ah->dim2end));
@@ -461,7 +461,7 @@
 }
 
 void ScummEngine_v72he::writeArray(int array, int idx2, int idx1, int value) {
-	debug(5, "writeArray (array %d, idx2 %d, idx1 %d, value %d)", array, idx2, idx1, value);
+	debug(5, "writeArray (array %d, idx2 %d, idx1 %d, value %d)", readVar(array), idx2, idx1, value);
 
 	if (readVar(array) == 0)
 		error("writeArray: Reference to zeroed array pointer");
@@ -513,7 +513,28 @@
 	}
 }
 
-void ScummEngine_v6he::decodeScriptString(byte *dst, bool scriptString) {
+int ScummEngine_v72he::copyScriptString(byte *dst) {
+	int i = 0;
+	byte b;
+
+	int array = pop();
+	if (array == -1) {
+		int len = resStrLen(_stringBuffer) + 1;
+		while (len--)
+			*dst++ = _stringBuffer[i++];
+	} else {
+		writeVar(0, array);
+		while (b = readArray(0, 0, i) != 0) {
+			*dst++ = b;
+			i++;
+		}
+	}
+	*dst = 0;
+
+	return i;
+}
+
+void ScummEngine_v72he::decodeScriptString(byte *dst, bool scriptString) {
 	int args[31];
 	int num = 0, val = 0;
 	int len;
@@ -530,10 +551,6 @@
 		len = copyScriptString(name);
 	}
 
-	//FIXME Bad pop/push somewhere ?
-	if (len == -1)
-		return;
-
 	while (len--) {
 		chr = name[num++];
 		if (chr == 0x25) {
@@ -835,6 +852,304 @@
 	runInventoryScript(obj);
 }
 
+void ScummEngine_v72he::o72_actorOps() {
+	Actor *a;
+	int i, j, k;
+	int args[32];
+	byte b;
+	byte name[256];
+
+	b = fetchScriptByte();
+	if (b == 197) {
+		_curActor = pop();
+		return;
+	}
+
+	a = derefActorSafe(_curActor, "o6_actorOps");
+	if (!a)
+		return;
+
+	switch (b) {
+	case 21:
+		// HE 7.3 (Pajama Sam onwards)
+		k = getStackList(args, ARRAYSIZE(args));
+		break;
+	case 64:
+		_actorClipOverride.bottom = pop();
+		_actorClipOverride.right = pop();
+		_actorClipOverride.top = pop();
+		_actorClipOverride.left = pop();
+		break;
+	case 76:		// SO_COSTUME
+		a->setActorCostume(pop());
+		break;
+	case 77:		// SO_STEP_DIST
+		j = pop();
+		i = pop();
+		a->setActorWalkSpeed(i, j);
+		break;
+	case 78:		// SO_SOUND
+		k = getStackList(args, ARRAYSIZE(args));
+		for (i = 0; i < k; i++)
+			a->sound[i] = args[i];
+		break;
+	case 79:		// SO_WALK_ANIMATION
+		a->walkFrame = pop();
+		break;
+	case 80:		// SO_TALK_ANIMATION
+		a->talkStopFrame = pop();
+		a->talkStartFrame = pop();
+		break;
+	case 81:		// SO_STAND_ANIMATION
+		a->standFrame = pop();
+		break;
+	case 82:		// SO_ANIMATION
+		// dummy case in scumm6
+		pop();
+		pop();
+		pop();
+		break;
+	case 83:		// SO_DEFAULT
+		a->initActor(0);
+		break;
+	case 84:		// SO_ELEVATION
+		a->setElevation(pop());
+		break;
+	case 85:		// SO_ANIMATION_DEFAULT
+		a->initFrame = 1;
+		a->walkFrame = 2;
+		a->standFrame = 3;
+		a->talkStartFrame = 4;
+		a->talkStopFrame = 5;
+		break;
+	case 86:		// SO_PALETTE
+		j = pop();
+		i = pop();
+		checkRange(255, 0, i, "Illegal palette slot %d");
+		a->remapActorPaletteColor(i, j);
+		break;
+	case 87:		// SO_TALK_COLOR
+		a->talkColor = pop();
+		break;
+	case 88:		// SO_ACTOR_NAME
+		copyScriptString(name);
+		loadPtrToResource(rtActorName, a->number, name);
+		break;
+	case 89:		// SO_INIT_ANIMATION
+		a->initFrame = pop();
+		break;
+	case 91:		// SO_ACTOR_WIDTH
+		a->width = pop();
+		break;
+	case 92:		// SO_SCALE
+		i = pop();
+		a->setScale(i, i);
+		break;
+	case 93:		// SO_NEVER_ZCLIP
+		a->forceClip = 0;
+		break;
+	case 94:		// SO_ALWAYS_ZCLIP
+		a->forceClip = pop();
+		break;
+	case 95:		// SO_IGNORE_BOXES
+		a->ignoreBoxes = 1;
+		a->forceClip = 0;
+		if (a->isInCurrentRoom())
+			a->putActor(a->_pos.x, a->_pos.y, a->room);
+		break;
+	case 96:		// SO_FOLLOW_BOXES
+		a->ignoreBoxes = 0;
+		a->forceClip = 0;
+		if (a->isInCurrentRoom())
+			a->putActor(a->_pos.x, a->_pos.y, a->room);
+		break;
+	case 97:		// SO_ANIMATION_SPEED
+		a->setAnimSpeed(pop());
+		break;
+	case 98:		// SO_SHADOW
+		a->shadow_mode = pop();
+		break;
+	case 99:		// SO_TEXT_OFFSET
+		a->talkPosY = pop();
+		a->talkPosX = pop();
+		break;
+	case 156:		// HE 7.2
+		a->charset = pop();
+		break;
+	case 198:		// SO_ACTOR_VARIABLE
+		i = pop();
+		a->setAnimVar(pop(), i);
+		break;
+	case 215:		// SO_ACTOR_IGNORE_TURNS_ON
+		a->ignoreTurns = true;
+		break;
+	case 216:		// SO_ACTOR_IGNORE_TURNS_OFF
+		a->ignoreTurns = false;
+		break;
+	case 217:		// SO_ACTOR_NEW
+		a->initActor(2);
+		break;
+	case 218:		
+		{
+			int top_actor = a->top;
+			int bottom_actor = a->bottom;
+			a->drawToBackBuf = true;
+			a->needRedraw = true;
+			a->drawActorCostume();
+			a->drawToBackBuf = false;
+			a->needRedraw = true;
+			a->drawActorCostume();
+			a->needRedraw = false;
+
+			if (a->top > top_actor)
+				a->top = top_actor;
+			if (a->bottom < bottom_actor)
+				a->bottom = bottom_actor;
+
+		}
+		break;
+	case 219:
+		a->drawToBackBuf = false;
+		a->needRedraw = true;
+		a->needBgReset = true;
+		break;
+	case 225:
+		{
+		byte string[128];
+		copyScriptString(string);
+		int slot = pop();
+
+		int len = resStrLen(string) + 1;
+		addMessageToStack(string, _queueTalkString[slot], len);
+
+		_queueTalkPosX[slot] = a->talkPosX;
+		_queueTalkPosY[slot] = a->talkPosY;
+		_queueTalkColor[slot] = a->talkColor;
+		break;
+		}
+	default:
+		error("o72_actorOps: default case %d", b);
+	}
+}
+
+void ScummEngine_v72he::o72_verbOps() {
+	int slot, a, b;
+	VerbSlot *vs;
+	byte op;
+	byte name[200];
+
+	op = fetchScriptByte();
+	if (op == 196) {
+		_curVerb = pop();
+		_curVerbSlot = getVerbSlot(_curVerb, 0);
+		checkRange(_numVerbs - 1, 0, _curVerbSlot, "Illegal new verb slot %d");
+		return;
+	}
+	vs = &_verbs[_curVerbSlot];
+	slot = _curVerbSlot;
+	switch (op) {
+	case 124:		// SO_VERB_IMAGE
+		a = pop();
+		if (_curVerbSlot) {
+			setVerbObject(_roomResource, a, slot);
+			vs->type = kImageVerbType;
+			vs->imgindex = a;
+		}
+		break;
+	case 125:		// SO_VERB_NAME
+		copyScriptString(name);
+		loadPtrToResource(rtVerb, slot, name);
+		vs->type = kTextVerbType;
+		vs->imgindex = 0;
+		break;
+	case 126:		// SO_VERB_COLOR
+		vs->color = pop();
+		break;
+	case 127:		// SO_VERB_HICOLOR
+		vs->hicolor = pop();
+		break;
+	case 128:		// SO_VERB_AT
+		vs->curRect.top = pop();
+		vs->curRect.left = pop();
+		break;
+	case 129:		// SO_VERB_ON
+		vs->curmode = 1;
+		break;
+	case 130:		// SO_VERB_OFF
+		vs->curmode = 0;
+		break;
+	case 131:		// SO_VERB_DELETE
+		slot = getVerbSlot(pop(), 0);
+		killVerb(slot);
+		break;
+	case 132:		// SO_VERB_NEW
+		slot = getVerbSlot(_curVerb, 0);
+		if (slot == 0) {
+			for (slot = 1; slot < _numVerbs; slot++) {
+				if (_verbs[slot].verbid == 0)
+					break;
+			}
+			if (slot == _numVerbs)
+				error("Too many verbs");
+			_curVerbSlot = slot;
+		}
+		vs = &_verbs[slot];
+		vs->verbid = _curVerb;
+		vs->color = 2;
+		vs->hicolor = 0;
+		vs->dimcolor = 8;
+		vs->type = kTextVerbType;
+		vs->charset_nr = _string[0]._default.charset;
+		vs->curmode = 0;
+		vs->saveid = 0;
+		vs->key = 0;
+		vs->center = 0;
+		vs->imgindex = 0;
+		break;
+	case 133:		// SO_VERB_DIMCOLOR
+		vs->dimcolor = pop();
+		break;
+	case 134:		// SO_VERB_DIM
+		vs->curmode = 2;
+		break;
+	case 135:		// SO_VERB_KEY
+		vs->key = pop();
+		break;
+	case 136:		// SO_VERB_CENTER
+		vs->center = 1;
+		break;
+	case 137:		// SO_VERB_NAME_STR
+		a = pop();
+		if (a == 0) {
+			loadPtrToResource(rtVerb, slot, (const byte *)"");
+		} else {
+			loadPtrToResource(rtVerb, slot, getStringAddress(a));
+		}
+		vs->type = kTextVerbType;
+		vs->imgindex = 0;
+		break;
+	case 139:		// SO_VERB_IMAGE_IN_ROOM
+		b = pop();
+		a = pop();
+
+		if (slot && a != vs->imgindex) {
+			setVerbObject(b, a, slot);
+			vs->type = kImageVerbType;
+			vs->imgindex = a;
+		}
+		break;
+	case 140:		// SO_VERB_BAKCOLOR
+		vs->bkcolor = pop();
+		break;
+	case 255:
+		drawVerb(slot, 0);
+		verbMouseOver(0);
+		break;
+	default:
+		error("o72_verbops: default case %d", op);
+	}
+}
+
 void ScummEngine_v72he::o72_arrayOps() {
 	byte subOp = fetchScriptByte();
 	int array = fetchScriptWord();
@@ -1107,7 +1422,7 @@
 	byte filename[100];
 
 	mode = pop();
-	copyScriptString(filename, true);
+	copyScriptString(filename);
 	debug(1,"File %s", filename);
 	
 	for (r = strlen((char*)filename); r != 0; r--) {
@@ -1312,6 +1627,7 @@
 }
 
 void ScummEngine_v72he::o72_redimArray() {
+	printf("o72_redimArray\n");
 	int subcode, newX, newY;
 	newY = pop();
 	newX = pop();
@@ -1439,6 +1755,13 @@
 	push(-1);
 }
 
+void ScummEngine_v72he::o72_unknownF2() {
+	int a = pop();
+	int b = pop();
+	debug(1,"o7_unknownF2 stub (%d, %d)", b, a);
+	push(-1);
+}
+
 void ScummEngine_v72he::o72_readINI() {
 	byte option[100];
 	int type, retval;
@@ -1473,14 +1796,15 @@
 	byte option[256], option2[1024];
 
 	type = fetchScriptByte();
-	copyScriptString(option);
 
 	switch (type) {
 	case 6: // number
 		value = pop();
-		break;
+		copyScriptString(option);
 		debug(1,"o72_writeINI: %s set to %d", option, value);
+		break;
 	case 7: // string
+		copyScriptString(option);
 		copyScriptString(option2);
 		debug(1,"o72_writeINI: %s set to %s", option, option2);
 		break;
@@ -1561,9 +1885,9 @@
 
 void ScummEngine_v72he::o72_unknownF9() {
 	// File related
-	//byte filename[100];
-	//copyScriptString(filename);
-	//debug(1,"o72_unknownF9: %s", filename);
+	byte filename[100];
+	copyScriptString(filename);
+	debug(1,"o72_unknownF9: %s", filename);
 }
 
 void ScummEngine_v72he::o72_unknownFA() {
@@ -1599,4 +1923,102 @@
 	debug(1, "o72_unknownFB stub");
 }
 
+void ScummEngine_v72he::decodeParseString(int m, int n) {
+	byte b;
+	int i, color;
+	int args[31];
+	byte name[1024];
+
+	b = fetchScriptByte();
+
+	switch (b) {
+	case 65:		// SO_AT
+		_string[m].ypos = pop();
+		_string[m].xpos = pop();
+		_string[m].overhead = false;
+		break;
+	case 66:		// SO_COLOR
+		_string[m].color = pop();
+		break;
+	case 67:		// SO_CLIPPED
+		_string[m].right = pop();
+		break;
+	case 69:		// SO_CENTER
+		_string[m].center = true;
+		_string[m].overhead = false;
+		break;
+	case 71:		// SO_LEFT
+		_string[m].center = false;
+		_string[m].overhead = false;
+		break;
+	case 72:		// SO_OVERHEAD
+		_string[m].overhead = true;
+		_string[m].no_talk_anim = false;
+		break;
+	case 73:		// SO_SAY_VOICE
+		error("decodeParseString: case 73");
+		break;
+	case 74:		// SO_MUMBLE
+		_string[m].no_talk_anim = true;
+		break;
+	case 75:		// SO_TEXTSTRING
+		switch (m) {
+		case 0:
+			actorTalk(_scriptPointer);
+			break;
+		case 1:
+			drawString(1, _scriptPointer);
+			break;
+		case 2:
+			unkMessage1(_scriptPointer);
+			break;
+		case 3:
+			unkMessage2(_scriptPointer);
+			break;
+		}
+		_scriptPointer += resStrLen(_scriptPointer) + 1;
+
+		break;
+	case 194:
+		decodeScriptString(name, true);
+		switch (m) {
+		case 0:
+			actorTalk(name);
+			break;
+		case 1:
+			drawString(1, name);
+			break;
+		case 2:
+			unkMessage1(name);
+			break;
+		case 3:
+			unkMessage2(name);
+			break;
+		}
+		break;
+	case 0xF9:
+		color = pop();
+		if (color == 1) {
+			_string[m].color = pop();
+		} else {	
+			push(color);
+			getStackList(args, ARRAYSIZE(args));
+			for (i = 0; i < 16; i++)
+				_charsetColorMap[i] = _charsetData[_string[1]._default.charset][i] = (unsigned char)args[i];
+			_string[m].color = color;
+		}
+		break;
+	case 0xFE:
+		_string[m].loadDefault();
+		if (n)
+			_actorToPrintStrFor = pop();
+		break;
+	case 0xFF:
+		_string[m].saveDefault();
+		break;
+	default:
+		error("decodeParseString: default case 0x%x", b);
+	}
+}
+
 } // End of namespace Scumm

Index: scumm.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/scumm.cpp,v
retrieving revision 1.167
retrieving revision 1.168
diff -u -d -r1.167 -r1.168
--- scumm.cpp	4 Sep 2004 23:35:14 -0000	1.167
+++ scumm.cpp	5 Sep 2004 09:36:51 -0000	1.168
@@ -812,6 +812,8 @@
 	VAR_NUM_IMAGES = 0xFF;
 	VAR_NUM_CHARSETS = 0xFF;
 	VAR_NUM_GLOBAL_OBJS = 0xFF;
+	VAR_NUM_SOUND_CHANNELS = 0xFF;
+	VAR_WINDOWS_VERSION = 0xFF;
 
 	// Use g_scumm from error() ONLY
 	g_scumm = this;
@@ -1394,20 +1396,21 @@
 	} else if (_version >= 7) {
 		VAR(VAR_V6_EMSSPACE) = 10000;
 		VAR(VAR_NUM_GLOBAL_OBJS) = _numGlobalObjects - 1;
-	} else if (_heversion >= 71) {
-		// TODO
+	} else if (_heversion >= 72) {
+		VAR(VAR_NUM_SOUND_CHANNELS) = 3;
 
-		// Set amount of sound channels
-		VAR(9) = 8;
-		if (_heversion >= 72) {
-			VAR(VAR_NUM_ROOMS) = _numRooms - 1;
-			VAR(VAR_NUM_SCRIPTS) = _numScripts - 1;
-			VAR(VAR_NUM_SOUNDS) = _numSounds - 1;
-			VAR(VAR_NUM_COSTUMES) = _numCostumes - 1;
-			VAR(VAR_NUM_IMAGES) = _numImages - 1;
-			VAR(VAR_NUM_CHARSETS) = _numCharsets - 1;
-			VAR(VAR_NUM_GLOBAL_OBJS) = _numGlobalObjects - 1;
-		}
+		VAR(VAR_NUM_ROOMS) = _numRooms - 1;
+		VAR(VAR_NUM_SCRIPTS) = _numScripts - 1;
+		VAR(VAR_NUM_SOUNDS) = _numSounds - 1;
+		VAR(VAR_NUM_COSTUMES) = _numCostumes - 1;
+		VAR(VAR_NUM_IMAGES) = _numImages - 1;
+		VAR(VAR_NUM_CHARSETS) = _numCharsets - 1;
+		VAR(VAR_NUM_GLOBAL_OBJS) = _numGlobalObjects - 1;
+
+		if (_heversion >= 80)
+			VAR(VAR_WINDOWS_VERSION) = 40;
+	} else if (_heversion >= 70) {
+		VAR(VAR_NUM_SOUND_CHANNELS) = 3;
 	} else {
 		VAR(VAR_CURRENTDRIVE) = 0;
 		switch (_midiDriver) {

Index: scumm.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/scumm.h,v
retrieving revision 1.468
retrieving revision 1.469
diff -u -d -r1.468 -r1.469
--- scumm.h	4 Sep 2004 23:35:14 -0000	1.468
+++ scumm.h	5 Sep 2004 09:36:51 -0000	1.469
@@ -623,7 +623,7 @@
 	void beginOverride();
 	void endOverride();
 
-	int copyScriptString(byte *dst, bool override = false);
+	void copyScriptString(byte *dst);
 	int resStrLen(const byte *src) const;
 	void doSentence(int c, int b, int a);
 
@@ -1303,6 +1303,8 @@
 	byte VAR_NUM_IMAGES;
 	byte VAR_NUM_CHARSETS;
 	byte VAR_NUM_GLOBAL_OBJS;
+	byte VAR_NUM_SOUND_CHANNELS;
+	byte VAR_WINDOWS_VERSION;
 };
 
 // This is a constant lookup table of reverse bit masks

Index: vars.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/vars.cpp,v
retrieving revision 1.97
retrieving revision 1.98
diff -u -d -r1.97 -r1.98
--- vars.cpp	4 Sep 2004 23:35:14 -0000	1.97
+++ vars.cpp	5 Sep 2004 09:36:51 -0000	1.98
@@ -166,7 +166,10 @@
 	VAR_V6_EMSSPACE = 76;
 	VAR_RANDOM_NR = 118;
 	
-	VAR_V6_SOUNDMODE = 9;
+	if (_heversion >= 70)
+		VAR_NUM_SOUND_CHANNELS = 9;
+	else
+		VAR_V6_SOUNDMODE = 9;
 
 	VAR_TIMEDATE_YEAR = 119;
 	VAR_TIMEDATE_MONTH = 129;
@@ -229,6 +232,7 @@
 	VAR_SOUNDPARAM = 51;
 	VAR_MUSIC_TIMER = 52;
 
+	VAR_NUM_SOUND_CHANNELS = 56;
 	VAR_MEMORY_PERFORMANCE = 57;
 	VAR_VIDEO_PERFORMANCE = 58;
 	VAR_NEW_ROOM = 59;
@@ -249,6 +253,9 @@
 	VAR_NUM_CHARSETS = 73;
 	VAR_NUM_GLOBAL_OBJS = 74;
 
+	if (_heversion >= 80) {
+		VAR_WINDOWS_VERSION = 79;
+	}
 }
 
 void ScummEngine_v7::setupScummVars() {





More information about the Scummvm-git-logs mailing list