[Scummvm-cvs-logs] CVS: scummvm/scumm intern.h,2.489,2.490 object.cpp,1.240,1.241 room.cpp,1.13,1.14 script_c64.cpp,2.1,2.2

kirben kirben at users.sourceforge.net
Wed May 18 08:31:46 CEST 2005


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

Modified Files:
	intern.h object.cpp room.cpp script_c64.cpp 
Log Message:

Add some differences in C64 maniac.


Index: intern.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/intern.h,v
retrieving revision 2.489
retrieving revision 2.490
diff -u -d -r2.489 -r2.490
--- intern.h	18 May 2005 02:56:41 -0000	2.489
+++ intern.h	18 May 2005 15:30:30 -0000	2.490
@@ -397,7 +397,21 @@
 	virtual void executeOpcode(byte i);
 	virtual const char *getOpcodeDesc(byte i);
 
+	virtual void ifStateCommon(byte type);
+	virtual void ifNotStateCommon(byte type);
+	virtual void setStateCommon(byte type);
+	virtual void clearStateCommon(byte type);
+
 	/* Version 2 script opcodes */
+	void o_loadSound();
+	void o_move();
+	void o_isEqual();
+	void o_loadScript();
+	void o_unknown53();
+	void o_cursorCommand();
+	void o_lights();
+
+	void o_subtract();
 };
 
 class ScummEngine_v6 : public ScummEngine {

Index: object.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/object.cpp,v
retrieving revision 1.240
retrieving revision 1.241
diff -u -d -r1.240 -r1.241
--- object.cpp	14 May 2005 22:56:39 -0000	1.240
+++ object.cpp	18 May 2005 15:30:30 -0000	1.241
@@ -704,7 +704,11 @@
 	if (_features & GF_OLD_BUNDLE)
 		ptr -= 2;
 
-	od->obj_nr = READ_LE_UINT16(ptr + 6);
+	if (_gameId == GID_MANIAC && _platform == Common::kPlatformC64) {
+		od->obj_nr = *(ptr + 7);
+	} else {
+		od->obj_nr = READ_LE_UINT16(ptr + 6);
+	}
 
 	od->x_pos = *(ptr + 9) * 8;
 	od->y_pos = ((*(ptr + 10)) & 0x7F) * 8;

Index: room.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/room.cpp,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- room.cpp	14 May 2005 14:06:37 -0000	1.13
+++ room.cpp	18 May 2005 15:30:31 -0000	1.14
@@ -183,9 +183,11 @@
 
 	_egoPositioned = false;
 	runEntryScript();
-	if (_version <= 2)
+	if (_gameId == GID_MANIAC && _platform == Common::kPlatformC64) {
+		runScript(18, 0, 0, 0);
+	} else if (_version <= 2) {
 		runScript(5, 0, 0, 0);
-	else if (_version >= 5 && _version <= 6) {
+	} else if (_version >= 5 && _version <= 6) {
 		if (a && !_egoPositioned) {
 			int x, y;
 			getObjectXYPos(objectNr, x, y);

Index: script_c64.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_c64.cpp,v
retrieving revision 2.1
retrieving revision 2.2
diff -u -d -r2.1 -r2.2
--- script_c64.cpp	18 May 2005 02:32:25 -0000	2.1
+++ script_c64.cpp	18 May 2005 15:30:31 -0000	2.2
@@ -51,12 +51,12 @@
 		OPCODE(o2_assignVarWordIndirect),
 		OPCODE(o2_setObjPreposition),
 		/* 0C */
-		OPCODE(o2_resourceRoutines),
+		OPCODE(o_loadSound),
 		OPCODE(o5_walkActorToActor),
 		OPCODE(o2_putActorAtObject),
 		OPCODE(o2_ifNotState08),
 		/* 10 */
-		OPCODE(o5_getObjectOwner),
+		OPCODE(o5_breakHere),
 		OPCODE(o2_animateActor),
 		OPCODE(o2_panCameraTo),
 		OPCODE(o2_actorOps),
@@ -68,7 +68,7 @@
 		/* 18 */
 		OPCODE(o5_jumpRelative),
 		OPCODE(o2_doSentence),
-		OPCODE(o5_move),
+		OPCODE(o_move),
 		OPCODE(o2_setBitVar),
 		/* 1C */
 		OPCODE(o5_startSound),
@@ -82,13 +82,13 @@
 		OPCODE(o2_getActorY),
 		/* 24 */
 		OPCODE(o2_loadRoomWithEgo),
-		OPCODE(o2_drawObject),
+		OPCODE(o5_loadRoom),
 		OPCODE(o5_setVarRange),
 		OPCODE(o2_setState04),
 		/* 28 */
 		OPCODE(o5_equalZero),
 		OPCODE(o2_setOwnerOf),
-		OPCODE(o2_addIndirect),
+		OPCODE(o2_delay),
 		OPCODE(o5_delayVariable),
 		/* 2C */
 		OPCODE(o2_assignVarByte),
@@ -126,12 +126,12 @@
 		OPCODE(o5_increment),
 		OPCODE(o2_clearState08),
 		/* 48 */
-		OPCODE(o5_isEqual),
+		OPCODE(o_isEqual),
 		OPCODE(o5_faceActor),
 		OPCODE(o2_chainScript),
 		OPCODE(o2_setObjPreposition),
 		/* 4C */
-		OPCODE(o2_waitForSentence),
+		OPCODE(o_loadScript),
 		OPCODE(o5_walkActorToActor),
 		OPCODE(o2_putActorAtObject),
 		OPCODE(o2_ifState08),
@@ -139,7 +139,7 @@
 		OPCODE(o2_pickupObject),
 		OPCODE(o2_animateActor),
 		OPCODE(o5_actorFollowCamera),
-		OPCODE(o2_actorOps),
+		OPCODE(o_unknown53),
 		/* 54 */
 		OPCODE(o5_setObjectName),
 		OPCODE(o2_actorFromPos),
@@ -156,7 +156,7 @@
 		OPCODE(o2_walkActorTo),
 		OPCODE(o2_ifNotState02),
 		/* 60 */
-		OPCODE(o2_cursorCommand),
+		OPCODE(o_cursorCommand),
 		OPCODE(o2_putActor),
 		OPCODE(o2_stopScript),
 		OPCODE(o5_getActorFacing),
@@ -174,9 +174,9 @@
 		OPCODE(o2_getObjPreposition),
 		OPCODE(o5_putActorInRoom),
 		OPCODE(o2_dummy),
-		OPCODE(o2_ifState04),
+		OPCODE(o2_ifState08),
 		/* 70 */
-		OPCODE(o2_lights),
+		OPCODE(o_lights),
 		OPCODE(o5_getActorCostume),
 		OPCODE(o5_loadRoom),
 		OPCODE(o2_roomOps),
@@ -334,7 +334,7 @@
 		OPCODE(o2_getObjPreposition),
 		OPCODE(o5_putActorInRoom),
 		OPCODE(o2_dummy),
-		OPCODE(o2_ifState04),
+		OPCODE(o2_ifNotState08),
 		/* F0 */
 		OPCODE(o2_lights),
 		OPCODE(o5_getActorCostume),
@@ -375,6 +375,108 @@
 	return _opcodesC64[i].desc;
 }
 
+void ScummEngine_c64::setStateCommon(byte type) {
+	int obj = fetchScriptByte();
+	putState(obj, getState(obj) | type);
+}
+
+void ScummEngine_c64::clearStateCommon(byte type) {
+	int obj = fetchScriptByte();
+	putState(obj, getState(obj) & ~type);
+}
+
+void ScummEngine_c64::ifStateCommon(byte type) {
+	int obj = fetchScriptByte();
+
+	if ((getState(obj) & type) == 0)
+		o5_jumpRelative();
+	else
+		ignoreScriptWord();
+}
+
+void ScummEngine_c64::ifNotStateCommon(byte type) {
+	int obj = fetchScriptByte();
+
+	if ((getState(obj) & type) != 0)
+		o5_jumpRelative();
+	else
+		ignoreScriptWord();
+}
+
+void ScummEngine_c64::o_loadSound() {
+	int resid = fetchScriptByte();
+	ensureResourceLoaded(rtSound, resid);
+}
+
+void ScummEngine_c64::o_move() {
+	getResultPos();
+	setResult(getVarOrDirectByte(PARAM_1));
+}
+
+void ScummEngine_c64::o_isEqual() {
+	int16 a, b;
+	int var;
+
+	var = fetchScriptByte();
+	a = readVar(var);
+	b = getVarOrDirectByte(PARAM_1);
+
+	if (b == a)
+		ignoreScriptWord();
+	else
+		o5_jumpRelative();
+}
+
+void ScummEngine_c64::o_loadScript() {
+	int resid = fetchScriptByte();
+	ensureResourceLoaded(rtScript, resid);
+}
+
+void ScummEngine_c64::o_unknown53() {
+	debug(0, "o_unknown53 (%d)", fetchScriptByte());
+}
+
+void ScummEngine_c64::o_cursorCommand() {
+	// TODO
+
+	byte state = fetchScriptByte();
+	debug(0, "o_cursorCommand (%d)", state);
+
+	if (state == 1) {
+		_userPut = 1;
+		_cursor.state = 1;
+	} else {
+		_userPut = 0;
+		_cursor.state = 0;
+	}
+}
+
+void ScummEngine_c64::o_lights() {
+	int a;
+
+	a = getVarOrDirectByte(PARAM_1);
+	// Convert older light mode values into
+	// equivalent values.of later games
+	// 0 Darkness
+	// 1 Flashlight
+	// 2 Lighted area
+	if (a == 2)
+		VAR(VAR_CURRENT_LIGHTS) = 11; 
+	else if (a == 1)
+		VAR(VAR_CURRENT_LIGHTS) = 4;
+	else 
+		VAR(VAR_CURRENT_LIGHTS) = 0;
+
+	_fullRedraw = 1;
+}
+
+void ScummEngine_c64::o_subtract() {
+	int a;
+	getResultPos();
+	a = getVarOrDirectByte(PARAM_1);
+	_scummVars[_resultVarNumber] -= a;
+}
+
 #undef PARAM_1
 #undef PARAM_2
 #undef PARAM_3





More information about the Scummvm-git-logs mailing list