[Scummvm-cvs-logs] CVS: scummvm/scumm input.cpp,2.36,2.37 intern.h,2.525,2.526 script_c64.cpp,2.22,2.23 script_v5.cpp,1.293,1.294 scumm.cpp,1.586,1.587 sound.cpp,1.478,1.479 vars.cpp,1.144,1.145

kirben kirben at users.sourceforge.net
Fri Sep 23 22:27:22 CEST 2005


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

Modified Files:
	input.cpp intern.h script_c64.cpp script_v5.cpp scumm.cpp 
	sound.cpp vars.cpp 
Log Message:

Rename & update opcode in C64 maniac.
Remove unused SCUMM vars in C64 maniac


Index: input.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/input.cpp,v
retrieving revision 2.36
retrieving revision 2.37
diff -u -d -r2.36 -r2.37
--- input.cpp	14 Sep 2005 10:35:04 -0000	2.36
+++ input.cpp	24 Sep 2005 05:26:12 -0000	2.37
@@ -437,7 +437,8 @@
 			// Ensure that the input script also sees the key press.
 			// This is necessary so you can abort the airplane travel
 			// in Zak.
-			VAR(VAR_KEYPRESS) = VAR(VAR_CUTSCENEEXIT_KEY);
+			if (VAR_KEYPRESS != 0xFF)
+				VAR(VAR_KEYPRESS) = VAR(VAR_CUTSCENEEXIT_KEY);
 		}
 	} else if (_lastKeyHit == saveloadkey) {
 		if (VAR_SAVELOAD_SCRIPT != 0xFF && _currentRoom != 0)
@@ -490,7 +491,7 @@
 		// 1) Verb	2) Scene	3) Inv.		4) Key
 		// 5) Sentence Bar
 
-		if (_lastKeyHit) {		// Key Input
+		if (VAR_KEYPRESS != 0xFF && _lastKeyHit) {		// Key Input
 			VAR(VAR_KEYPRESS) = _lastKeyHit;
 		}
 	}

Index: intern.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/intern.h,v
retrieving revision 2.525
retrieving revision 2.526
diff -u -d -r2.525 -r2.526
--- intern.h	24 Sep 2005 00:32:03 -0000	2.525
+++ intern.h	24 Sep 2005 05:26:12 -0000	2.526
@@ -426,6 +426,7 @@
 	void o_getActorMoving();
 	void o_animateActor();
 	void o_putActorAtObject();
+	void o_lockSound();
 	void o_lockActor();
 	void o_loadActor();
 	void o_loadRoom();
@@ -450,6 +451,7 @@
 	void o_printEgo_c64();
 	void o_print_c64();
 	void o_unlockRoom();
+	void o_unlockSound();
 	void o_beginOverride();
 	void o_isEqual();
 	void o_isGreater();

Index: script_c64.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_c64.cpp,v
retrieving revision 2.22
retrieving revision 2.23
diff -u -d -r2.22 -r2.23
--- script_c64.cpp	24 Sep 2005 00:32:03 -0000	2.22
+++ script_c64.cpp	24 Sep 2005 05:26:12 -0000	2.23
@@ -139,7 +139,7 @@
 		OPCODE(o_nop),
 		OPCODE(o_animateActor),
 		OPCODE(o5_actorFollowCamera),
-		OPCODE(o5_startSound),
+		OPCODE(o_lockSound),
 		/* 54 */
 		OPCODE(o5_setObjectName),
 		OPCODE(o2_actorFromPos),
@@ -299,7 +299,7 @@
 		OPCODE(o_nop),
 		OPCODE(o_animateActor),
 		OPCODE(o5_actorFollowCamera),
-		OPCODE(o5_stopSound),
+		OPCODE(o_unlockSound),
 		/* D4 */
 		OPCODE(o5_setObjectName),
 		OPCODE(o2_actorFromPos),
@@ -487,6 +487,18 @@
 	ensureResourceLoaded(rtSound, resid);
 }
 
+void ScummEngine_c64::o_lockSound() {
+	int resid = fetchScriptByte();
+	res.lock(rtSound, resid);
+	debug(0, "o_lockSound (%d)", resid);
+}
+
+void ScummEngine_c64::o_unlockSound() {
+	int resid = fetchScriptByte();
+	res.unlock(rtSound, resid);
+	debug(0, "o_unlockSound (%d)", resid);
+}
+
 void ScummEngine_c64::o_loadActor() {
 	debug(0, "o_loadActor (%d)", getVarOrDirectByte(PARAM_1));
 }

Index: script_v5.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v5.cpp,v
retrieving revision 1.293
retrieving revision 1.294
diff -u -d -r1.293 -r1.294
--- script_v5.cpp	14 Aug 2005 01:41:52 -0000	1.293
+++ script_v5.cpp	24 Sep 2005 05:26:12 -0000	1.294
@@ -2183,7 +2183,8 @@
 		return;
 	}
 
-	VAR(VAR_MUSIC_TIMER) = 0;
+	if (VAR_MUSIC_TIMER != 0xFF)
+		VAR(VAR_MUSIC_TIMER) = 0;
 	_sound->addSoundToQueue(sound);
 }
 

Index: scumm.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/scumm.cpp,v
retrieving revision 1.586
retrieving revision 1.587
diff -u -d -r1.586 -r1.587
--- scumm.cpp	24 Sep 2005 02:06:38 -0000	1.586
+++ scumm.cpp	24 Sep 2005 05:26:12 -0000	1.587
@@ -2233,7 +2233,10 @@
 	}
 	if (_version <= 7)
 		VAR(VAR_HAVE_MSG) = (_haveMsg == 0xFE) ? 0xFF : _haveMsg;
-	if (_version <= 2) {
+
+	if (_platform == Common::kPlatformC64 && _gameId == GID_MANIAC) {
+		// TODO
+	} else if (_version <= 2) {
 		VAR(VAR_VIRT_MOUSE_X) = _virtualMouse.x / 8;
 		VAR(VAR_VIRT_MOUSE_Y) = _virtualMouse.y / 2;
 
@@ -2256,19 +2259,21 @@
 
 	if (_features & GF_AUDIOTRACKS) {
 		// Covered automatically by the Sound class
-	} else if (_musicEngine && VAR_MUSIC_TIMER != 0xFF) {
-		// The music engine generates the timer data for us.
-		VAR(VAR_MUSIC_TIMER) = _musicEngine->getMusicTimer();
-	} else if (_features & GF_SMALL_HEADER) {
-		// Used for Money Island 1 (Amiga)
-		// TODO: The music delay (given in milliseconds) might have to be tuned a little
-		// to get it correct for all games. Without the ability to watch/listen to the
-		// original games, I can't do that myself.
-		const int MUSIC_DELAY = 350;
-		_tempMusic += delta * 15;	// Convert delta to milliseconds
-		if (_tempMusic >= MUSIC_DELAY) {
-			_tempMusic -= MUSIC_DELAY;
-			VAR(VAR_MUSIC_TIMER) += 1;
+	} else if (VAR_MUSIC_TIMER != 0xFF) {
+		if (_musicEngine) {
+			// The music engine generates the timer data for us.
+			VAR(VAR_MUSIC_TIMER) = _musicEngine->getMusicTimer();
+		} else {
+			// Used for Money Island 1 (Amiga)
+			// TODO: The music delay (given in milliseconds) might have to be tuned a little
+			// to get it correct for all games. Without the ability to watch/listen to the
+			// original games, I can't do that myself.
+			const int MUSIC_DELAY = 350;
+			_tempMusic += delta * 15;	// Convert delta to milliseconds
+			if (_tempMusic >= MUSIC_DELAY) {
+				_tempMusic -= MUSIC_DELAY;
+				VAR(VAR_MUSIC_TIMER) += 1;
+			}
 		}
 	}
 

Index: sound.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/sound.cpp,v
retrieving revision 1.478
retrieving revision 1.479
diff -u -d -r1.478 -r1.479
--- sound.cpp	14 Sep 2005 10:49:53 -0000	1.478
+++ sound.cpp	24 Sep 2005 05:26:12 -0000	1.479
@@ -90,7 +90,8 @@
 }
 
 void Sound::addSoundToQueue(int sound, int heOffset, int heChannel, int heFlags) {
-	_vm->VAR(_vm->VAR_LAST_SOUND) = sound;
+	if (_vm->VAR_LAST_SOUND != 0xFF)
+		_vm->VAR(_vm->VAR_LAST_SOUND) = sound;
 	// HE music resources are in separate file
 	if (sound <= _vm->_numSounds)
 		_vm->ensureResourceLoaded(rtSound, sound);

Index: vars.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/vars.cpp,v
retrieving revision 1.144
retrieving revision 1.145
diff -u -d -r1.144 -r1.145
--- vars.cpp	14 Sep 2005 10:35:04 -0000	1.144
+++ vars.cpp	24 Sep 2005 05:26:12 -0000	1.145
@@ -105,39 +105,20 @@
 }
 
 void ScummEngine_c64::setupScummVars() {
+	// TODO
 	VAR_EGO = 0;
 	VAR_CAMERA_POS_X = 2;
 	VAR_HAVE_MSG = 3;
 	VAR_ROOM = 4;
 	VAR_OVERRIDE = 6;
-	VAR_CHARCOUNT = 7;
-	VAR_ACTIVE_VERB = 8;
-	VAR_ACTIVE_OBJECT1 = 9;
-	VAR_ACTIVE_OBJECT2 = 10;
-	VAR_NUM_ACTOR = 11;
+	VAR_CHARCOUNT = 10;
+
+	// FIXME: Should be removed
 	VAR_CURRENT_LIGHTS = 12;
-	VAR_CURRENTDRIVE = 13;
-	VAR_MUSIC_TIMER = 17;
-	VAR_VERB_ALLOWED = 18;
-	VAR_ACTOR_RANGE_MIN = 19;
-	VAR_ACTOR_RANGE_MAX = 20;
 	VAR_CURSORSTATE = 21;
 	VAR_CAMERA_MIN_X = 23;
 	VAR_CAMERA_MAX_X = 24;
 	VAR_TIMER_NEXT = 25;
-	VAR_SENTENCE_VERB = 26;
-	VAR_SENTENCE_OBJECT1 = 27;
-	VAR_SENTENCE_OBJECT2 = 28;
-	VAR_SENTENCE_PREPOSITION = 29;
-	VAR_VIRT_MOUSE_X = 30;
-	VAR_VIRT_MOUSE_Y = 31;
-	VAR_CLICK_AREA = 32;
-	VAR_ROOM_RESOURCE = 36;
-	VAR_LAST_SOUND = 37;
-	VAR_BACKUP_VERB = 38;
-	VAR_KEYPRESS = 39;
-	VAR_CUTSCENEEXIT_KEY = 40;
-	VAR_TALK_ACTOR = 41;
 }
 
 void ScummEngine_v2::setupScummVars() {





More information about the Scummvm-git-logs mailing list