[Scummvm-cvs-logs] CVS: scummvm actor.cpp,1.29,1.30 debug.cpp,1.15,1.16 script.cpp,1.26,1.27 script_v2.cpp,1.27,1.28 scumm.h,1.63,1.64 scummvm.cpp,1.60,1.61

James Brown ender at users.sourceforge.net
Wed Mar 6 02:04:02 CET 2002


Update of /cvsroot/scummvm/scummvm
In directory usw-pr-cvs1:/tmp/cvs-serv3642

Modified Files:
	actor.cpp debug.cpp script.cpp script_v2.cpp scumm.h 
	scummvm.cpp 
Log Message:
Fixed some more Sam and Max bugs. Is now playable to BumpusVille.
Added two new debug commands, one to read and set variables, the other
to set a 'watch' on variables.



Index: actor.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/actor.cpp,v
retrieving revision 1.29
retrieving revision 1.30
diff -C2 -d -r1.29 -r1.30
*** actor.cpp	6 Mar 2002 09:40:21 -0000	1.29
--- actor.cpp	6 Mar 2002 10:02:59 -0000	1.30
***************
*** 466,470 ****
  	uint threshold;
  	uint best;
! 	int box;
  	byte flags, b;
  	
--- 466,470 ----
  	uint threshold;
  	uint best;
! 	int box, iterations;	/* Use inerations for those odd times we get stuck in the loop */
  	byte flags, b;
  	
***************
*** 480,483 ****
--- 480,485 ----
  		
  		while(1) {
+ 			iterations++;
+ 			if (iterations > 1000) return abr;	/* Safety net */
  			box = getNumBoxes() - 1;
  			best = (uint)0xFFFF;

Index: debug.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/debug.cpp,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** debug.cpp	24 Feb 2002 17:25:02 -0000	1.15
--- debug.cpp	6 Mar 2002 10:02:59 -0000	1.16
***************
*** 41,45 ****
  	CMD_SCRIPTS,
  	CMD_LOAD_ROOM,
!         CMD_DUMPBOX,
  	CMD_EXIT
  };
--- 41,47 ----
  	CMD_SCRIPTS,
  	CMD_LOAD_ROOM,
!     CMD_DUMPBOX,
! 	CMD_VAR,	
! 	CMD_WATCH,
  	CMD_EXIT
  };
***************
*** 118,121 ****
--- 120,148 ----
  		}
  		return true;
+ 	case CMD_VAR:
+ 		if (!_parameters[0]) {
+ 			printf("Enter a variable\n");
+ 		} else {			
+ 			char *tok = strtok(_parameters, " ");
+ 			int var = atoi(tok);
+ 			tok = strtok(NULL, "");
+ 			if (tok) 
+ 				_s->writeVar(var, atoi(tok));		
+ 
+ 			printf("Var[%d] = %d\n", var, _s->readVar(var));
+ 		}			
+ 		return true;
+ 	case CMD_WATCH:
+ 		if (!_parameters[0]) {
+ 			printf("Clearing all watches..\n");
+ 			_s->_varwatch = -1;
+ 		} else {
+ 			_s->_varwatch = atoi(_parameters);
+ 			if (_s->_varwatch == 0) 
+ 				printf("Watching all variables\n");
+ 			else
+ 				printf("Watching vars[%d]\n", _s->_varwatch);
+ 		}
+ 		return true;
  	case CMD_EXIT:
  		exit(1);
***************
*** 162,166 ****
  	{ "s", 1, CMD_SCRIPTS },
  	{ "r", 1, CMD_LOAD_ROOM },
!         { "b", 1, CMD_DUMPBOX},
  	{ "e", 1, CMD_EXIT },
  	{ 0, 0, 0 },
--- 189,195 ----
  	{ "s", 1, CMD_SCRIPTS },
  	{ "r", 1, CMD_LOAD_ROOM },
!     { "b", 1, CMD_DUMPBOX},
! 	{ "v", 1, CMD_VAR},
! 	{ "w", 1, CMD_WATCH},
  	{ "e", 1, CMD_EXIT },
  	{ 0, 0, 0 },

Index: script.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/script.cpp,v
retrieving revision 1.26
retrieving revision 1.27
diff -C2 -d -r1.26 -r1.27
*** script.cpp	6 Mar 2002 00:18:22 -0000	1.26
--- script.cpp	6 Mar 2002 10:03:00 -0000	1.27
***************
*** 334,337 ****
--- 334,340 ----
  		checkRange(_numVariables-1, 0, var, "Variable %d out of range(w)");
  		_vars[var] = value;
+ 
+ 		if ((_varwatch == var) || (_varwatch == 0))
+ 			printf("vars[%d] = %d (via script %d)\n", var, value, &vm.slot[_currentScript].number);
  		return;
  	}
***************
*** 730,739 ****
  
  void Scumm::push(int a) {
! 	assert(_scummStackPos >=0 && _scummStackPos < ARRAYSIZE(_scummStack)-1);
  	_scummStack[_scummStackPos++] = a;	
  }
  
  int Scumm::pop() {
! 	assert(_scummStackPos >0 && _scummStackPos < ARRAYSIZE(_scummStack));
  	return _scummStack[--_scummStackPos];
  }
--- 733,742 ----
  
  void Scumm::push(int a) {
! 	assert(_scummStackPos >=0 && _scummStackPos <= ARRAYSIZE(_scummStack)-1);
  	_scummStack[_scummStackPos++] = a;	
  }
  
  int Scumm::pop() {
! 	assert(_scummStackPos >0 && _scummStackPos <= ARRAYSIZE(_scummStack));
  	return _scummStack[--_scummStackPos];
  }

Index: script_v2.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/script_v2.cpp,v
retrieving revision 1.27
retrieving revision 1.28
diff -C2 -d -r1.27 -r1.28
*** script_v2.cpp	6 Mar 2002 09:40:21 -0000	1.27
--- script_v2.cpp	6 Mar 2002 10:03:00 -0000	1.28
***************
*** 263,267 ****
  	/* BC */
  	&Scumm::o6_dim,
! 	&Scumm::o6_invalid,
  	&Scumm::o6_runVerbCodeQuick,
  	&Scumm::o6_runScriptQuick,
--- 263,267 ----
  	/* BC */
  	&Scumm::o6_dim,
! 	&Scumm::o5_dummy,
  	&Scumm::o6_runVerbCodeQuick,
  	&Scumm::o6_runScriptQuick,
***************
*** 2366,2370 ****
  		return;
  	default:
! 		error("o6_dim: default case");
  	}
  
--- 2366,2370 ----
  		return;
  	default:
! 		error("o6_dim	: default case");
  	}
  
***************
*** 2635,2639 ****
  
  		case 122:
! 			error("stub o6_miscOps_122(%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d)", 
  				args[1],args[2],args[3],args[4],
  				args[5],args[6],args[7],args[8],
--- 2635,2639 ----
  
  		case 122:
! 			warning("stub o6_miscOps_122(%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d)", 
  				args[1],args[2],args[3],args[4],
  				args[5],args[6],args[7],args[8],

Index: scumm.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm.h,v
retrieving revision 1.63
retrieving revision 1.64
diff -C2 -d -r1.63 -r1.64
*** scumm.h	6 Mar 2002 09:40:21 -0000	1.63
--- scumm.h	6 Mar 2002 10:03:00 -0000	1.64
***************
*** 860,863 ****
--- 860,864 ----
  	uint16 *_newNames;
  	int16 *_vars;
+ 	int16 _varwatch;
  	byte *_bitVars;
  

Index: scummvm.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scummvm.cpp,v
retrieving revision 1.60
retrieving revision 1.61
diff -C2 -d -r1.60 -r1.61
*** scummvm.cpp	6 Mar 2002 09:40:21 -0000	1.60
--- scummvm.cpp	6 Mar 2002 10:03:00 -0000	1.61
***************
*** 120,123 ****
--- 120,124 ----
  	_haveMsg = 0;
  
+ 	_varwatch = -1;
  	_screenStartStrip = 0;
  





More information about the Scummvm-git-logs mailing list