[Scummvm-cvs-logs] CVS: scummvm/scumm intern.h,2.494,2.495 script_c64.cpp,2.5,2.6

kirben kirben at users.sourceforge.net
Thu May 19 23:31:12 CEST 2005


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

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

Add more opcode differences in C64 maniac.


Index: intern.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/intern.h,v
retrieving revision 2.494
retrieving revision 2.495
diff -u -d -r2.494 -r2.495
--- intern.h	19 May 2005 14:33:51 -0000	2.494
+++ intern.h	20 May 2005 06:29:34 -0000	2.495
@@ -403,31 +403,38 @@
 	virtual void clearStateCommon(byte type);
 
 	/* Version 2 script opcodes */
-	void o_unknown13();
-	void o_loadActor();
+	void o_isGreaterEqual();
+	void o_stopScript();
+	void o_getDist();
+	void o_isNotEqual();
 	void o_loadSound();
+	void o_putActorAtObject();
+	void o_unfreezeScripts();
+	void o_unknown13();
+	void o_clearState08();
 	void o_move();
+	void o_loadActor();
+	void o_freezeScript();
+	void o_walkActorToObject();
+	void o_isLessEqual();
+	void o_subtract();
+	void o_isLess();
+	void o_increment();
 	void o_isEqual();
 	void o_loadRoom();
-	void o_unknown4D();
 	void o_loadScript();
+	void o_unknown4D();
 	void o_unknown53();
+	void o_add();
 	void o_cursorCommand();
 	void o_lights();
 	void o_getObjectOwner();
-	void o_add();
-	void o_subtract();
-	void o_isNotEqual();
 	void o_isGreater();
-	void o_isGreaterEqual();
-	void o_isLess();
-	void o_isLessEqual();
+	void o_pickupObject();
 	void o_unknown93();
-	void o_freezeScript();
+	void o_setState08();
 	void o_unfreezeScript();
-	void o_getDist();
-	void o_putActorAtObject();
-	void o_walkActorToObject();
+	void o_decrement();
 };
 
 class ScummEngine_v6 : public ScummEngine {

Index: script_c64.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_c64.cpp,v
retrieving revision 2.5
retrieving revision 2.6
diff -u -d -r2.5 -r2.6
--- script_c64.cpp	19 May 2005 14:33:52 -0000	2.5
+++ script_c64.cpp	20 May 2005 06:29:34 -0000	2.6
@@ -42,7 +42,7 @@
 		OPCODE(o5_getActorRoom),
 		/* 04 */
 		OPCODE(o_isGreaterEqual),
-		OPCODE(o2_drawObject),
+		OPCODE(o_stopScript),
 		OPCODE(o_getDist),
 		OPCODE(o5_getActorRoom),
 		/* 08 */
@@ -56,7 +56,7 @@
 		OPCODE(o_putActorAtObject),
 		OPCODE(o2_ifNotState08),
 		/* 10 */
-		OPCODE(o5_breakHere),
+		OPCODE(o_unfreezeScripts),
 		OPCODE(o2_animateActor),
 		OPCODE(o2_panCameraTo),
 		OPCODE(o_unknown13),
@@ -64,7 +64,7 @@
 		OPCODE(o5_print),
 		OPCODE(o2_actorFromPos),
 		OPCODE(o5_getRandomNr),
-		OPCODE(o2_clearState02),
+		OPCODE(o_clearState08),
 		/* 18 */
 		OPCODE(o5_jumpRelative),
 		OPCODE(o2_doSentence),
@@ -114,7 +114,7 @@
 		OPCODE(o5_stopSound),
 		OPCODE(o2_setActorElevation),
 		OPCODE(o2_walkActorTo),
-		OPCODE(o2_ifNotState01),
+		OPCODE(o2_ifState02),
 		/* 40 */
 		OPCODE(o2_cutscene),
 		OPCODE(o2_putActor),
@@ -123,7 +123,7 @@
 		/* 44 */
 		OPCODE(o_isLess),
 		OPCODE(o2_drawObject),
-		OPCODE(o5_increment),
+		OPCODE(o_increment),
 		OPCODE(o2_getActorX),
 		/* 48 */
 		OPCODE(o_isEqual),
@@ -144,21 +144,21 @@
 		OPCODE(o5_setObjectName),
 		OPCODE(o2_actorFromPos),
 		OPCODE(o5_getActorMoving),
-		OPCODE(o2_setState02),
+		OPCODE(o_clearState08),
 		/* 58 */
 		OPCODE(o2_beginOverride),
 		OPCODE(o2_doSentence),
 		OPCODE(o_add),
 		OPCODE(o2_setBitVar),
 		/* 5C */
-		OPCODE(o2_dummy),
+		OPCODE(o5_startSound),
 		OPCODE(o2_ifClassOfIs),
 		OPCODE(o2_walkActorTo),
 		OPCODE(o2_ifNotState02),
 		/* 60 */
 		OPCODE(o_cursorCommand),
 		OPCODE(o2_putActor),
-		OPCODE(o2_stopScript),
+		OPCODE(o_stopScript),
 		OPCODE(o5_getActorFacing),
 		/* 64 */
 		OPCODE(o2_loadRoomWithEgo),
@@ -216,7 +216,7 @@
 		OPCODE(o_putActorAtObject),
 		OPCODE(o2_ifNotState08),
 		/* 90 */
-		OPCODE(o5_getObjectOwner),
+		OPCODE(o_pickupObject),
 		OPCODE(o2_animateActor),
 		OPCODE(o2_panCameraTo),
 		OPCODE(o_unknown93),
@@ -224,7 +224,7 @@
 		OPCODE(o5_print),
 		OPCODE(o2_actorFromPos),
 		OPCODE(o5_getRandomNr),
-		OPCODE(o2_clearState02),
+		OPCODE(o_setState08),
 		/* 98 */
 		OPCODE(o2_restart),
 		OPCODE(o2_doSentence),
@@ -234,7 +234,7 @@
 		OPCODE(o5_startSound),
 		OPCODE(o2_ifClassOfIs),
 		OPCODE(o2_walkActorTo),
-		OPCODE(o2_ifState02),
+		OPCODE(o2_ifNotState04),
 		/* A0 */
 		OPCODE(o5_stopObjectCode),
 		OPCODE(o2_putActor),
@@ -242,7 +242,7 @@
 		OPCODE(o2_getActorY),
 		/* A4 */
 		OPCODE(o2_loadRoomWithEgo),
-		OPCODE(o2_drawObject),
+		OPCODE(o5_loadRoom),
 		OPCODE(o5_setVarRange),
 		OPCODE(o2_getActorY),
 		/* A8 */
@@ -254,7 +254,7 @@
 		OPCODE(o2_drawSentence),
 		OPCODE(o5_putActorInRoom),
 		OPCODE(o2_waitForMessage),
-		OPCODE(o2_ifNotState04),
+		OPCODE(o2_ifNotState08),
 		/* B0 */
 		OPCODE(o_loadActor),
 		OPCODE(o2_getBitVar),
@@ -264,7 +264,7 @@
 		OPCODE(o_getDist),
 		OPCODE(o2_findObject),
 		OPCODE(o_walkActorToObject),
-		OPCODE(o2_setState01),
+		OPCODE(o2_setState04),
 		/* B8 */
 		OPCODE(o_isLessEqual),
 		OPCODE(o2_doSentence),
@@ -283,7 +283,7 @@
 		/* C4 */
 		OPCODE(o_isLess),
 		OPCODE(o2_drawObject),
-		OPCODE(o5_decrement),
+		OPCODE(o_decrement),
 		OPCODE(o2_getActorX),
 		/* C8 */
 		OPCODE(o_isEqual),
@@ -304,21 +304,21 @@
 		OPCODE(o5_setObjectName),
 		OPCODE(o2_actorFromPos),
 		OPCODE(o5_getActorMoving),
-		OPCODE(o2_setState02),
+		OPCODE(o_setState08),
 		/* D8 */
 		OPCODE(o5_printEgo),
 		OPCODE(o2_doSentence),
 		OPCODE(o_add),
 		OPCODE(o2_setBitVar),
 		/* DC */
-		OPCODE(o2_dummy),
+		OPCODE(o5_startSound),
 		OPCODE(o2_ifClassOfIs),
 		OPCODE(o2_walkActorTo),
-		OPCODE(o2_ifNotState02),
+		OPCODE(o2_ifNotState04),
 		/* E0 */
 		OPCODE(o2_cursorCommand),
 		OPCODE(o2_putActor),
-		OPCODE(o2_stopScript),
+		OPCODE(o_stopScript),
 		OPCODE(o5_getActorFacing),
 		/* E4 */
 		OPCODE(o2_loadRoomWithEgo),
@@ -344,7 +344,7 @@
 		OPCODE(o_getDist),
 		OPCODE(o2_findObject),
 		OPCODE(o_walkActorToObject),
-		OPCODE(o2_clearState01),
+		OPCODE(o2_setState04),
 		/* F8 */
 		OPCODE(o_isGreater),
 		OPCODE(o2_doSentence),
@@ -403,11 +403,47 @@
 		ignoreScriptWord();
 }
 
+void ScummEngine_c64::o_setState08() {
+	int obj = getVarOrDirectWord(PARAM_1);
+	putState(obj, getState(obj) | 0x08);
+	markObjectRectAsDirty(obj);
+	clearDrawObjectQueue();
+}
+
+void ScummEngine_c64::o_clearState08() {
+	int obj = getVarOrDirectWord(PARAM_1);
+	putState(obj, getState(obj) & ~0x08);
+	markObjectRectAsDirty(obj);
+	clearDrawObjectQueue();
+}
+
+void ScummEngine_c64::o_stopScript() {
+	int script;
+
+	if (_opcode == 0x05) {
+		script = 0;
+	} else {
+		script = getVarOrDirectByte(PARAM_1);
+	}
+
+	if (script == 0)
+		script = vm.slot[_currentScript].number;
+
+	if (_currentScript != 0 && vm.slot[_currentScript].number == script)
+		stopObjectCode();
+	else
+		stopScript(script);
+}
+
 void ScummEngine_c64::o_loadSound() {
 	int resid = fetchScriptByte();
 	ensureResourceLoaded(rtSound, resid);
 }
 
+void ScummEngine_c64::o_unfreezeScripts() {
+	unfreezeScripts();
+}
+
 void ScummEngine_c64::o_move() {
 	getResultPos();
 	setResult(getVarOrDirectByte(PARAM_1));
@@ -553,6 +589,16 @@
 	_scummVars[_resultVarNumber] -= a;
 }
 
+void ScummEngine_c64::o_increment() {
+	int var = getVarOrDirectByte(PARAM_1);
+	setResult(readVar(var) + 1);
+}
+
+void ScummEngine_c64::o_decrement() {
+	int var = getVarOrDirectByte(PARAM_1);
+	setResult(readVar(var) - 1);
+}
+
 void ScummEngine_c64::o_unknown93() {
 	debug(0, "o_unknown93 (Actor %d)", fetchScriptByte());
 }
@@ -579,6 +625,28 @@
 	setResult(r);
 }
 
+void ScummEngine_c64::o_pickupObject() {
+	int obj = fetchScriptByte();
+
+	if (obj < 1) {
+		error("pickupObject received invalid index %d (script %d)", obj, vm.slot[_currentScript].number);
+	}
+
+	if (getObjectIndex(obj) == -1)
+		return;
+
+	if (whereIsObject(obj) == WIO_INVENTORY)	/* Don't take an */
+		return;											/* object twice */
+
+	addObjectToInventory(obj, _roomResource);
+	markObjectRectAsDirty(obj);
+	putOwner(obj, VAR(VAR_EGO));
+	putState(obj, getState(obj) | 0xA);
+	clearDrawObjectQueue();
+
+	runInventoryScript(1);
+}
+
 void ScummEngine_c64::o_putActorAtObject() {
 	int obj, x, y;
 	Actor *a;





More information about the Scummvm-git-logs mailing list