[Scummvm-cvs-logs] CVS: scummvm gui.cpp,1.17,1.18 gui.h,1.10,1.11 resource.cpp,1.53,1.54 script.cpp,1.35,1.36 scumm.h,1.85,1.86 scummvm.cpp,1.82,1.83

James Brown ender at users.sourceforge.net
Sat Mar 16 10:04:03 CET 2002


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

Modified Files:
	gui.cpp gui.h resource.cpp script.cpp scumm.h scummvm.cpp 
Log Message:
Update to my latest local tree. Various stuff - and a fixme hack by khalek to stop loom intro crashing.


Index: gui.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/gui.cpp,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -d -r1.17 -r1.18
*** gui.cpp	16 Mar 2002 05:33:25 -0000	1.17
--- gui.cpp	16 Mar 2002 18:03:27 -0000	1.18
***************
*** 661,669 ****
  }
  
! const char *Gui::queryString(int string, int id) {
  	static char namebuf[64];
! 	if (!_s->_gameId)
! 		return "blah!";
! 
  	if (id>=20 && id<=28) {
  		sprintf(namebuf, "%2d. %s", id-20+_slotIndex, game_names[id-20]);
--- 661,668 ----
  }
  
! const char *Gui::queryString(int stringno, int id) {
  	static char namebuf[64];
! 	char *result;
! 	int  string;
  	if (id>=20 && id<=28) {
  		sprintf(namebuf, "%2d. %s", id-20+_slotIndex, game_names[id-20]);
***************
*** 671,684 ****
  	}
  
! 	if (string == 0)
  		return NULL;
  
! 	if (_s->_features&GF_AFTER_V6) {
! 		string = _s->_vars[string_map_table_v6[string-1]];
! 	} else {
! 		string = string_map_table_v5[string-1];
! 	}
  	
! 	return (char*)_s->getStringAddress(string);
  }
  
--- 670,690 ----
  	}
  
! 	if (stringno == 0)
  		return NULL;
  
! 	if (_s->_features&GF_AFTER_V6)
! 		string = _s->_vars[string_map_table_v6[stringno-1].num];
! 	else
! 		string = string_map_table_v5[stringno-1].num;
  	
! 	result = (char*)_s->getStringAddress(string);
! 
! 	if (!result)	// Gracelessly degrade to english :)
! 		if (_s->_features&GF_AFTER_V6)
! 			return string_map_table_v6[stringno-1].string;
! 		else
! 			return string_map_table_v5[stringno-1].string;
! 
! 	return result;
  }
  

Index: gui.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/gui.h,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** gui.h	16 Mar 2002 05:33:25 -0000	1.10
--- gui.h	16 Mar 2002 18:03:28 -0000	1.11
***************
*** 2,5 ****
--- 2,10 ----
  #define gui_h
  
+ struct ResString {
+ 	int num;
+ 	char string[80];
+ };
+ 
  enum {
  	GUI_NONE = 0,
***************
*** 44,71 ****
  };
  
! static const byte string_map_table_v6[] = {
! 	117, /* How may I serve you? */
! 	109, /* Select a game to LOAD */
! 	108, /* Name your SAVE game */
! 	96,  /* Save */
! 	97,  /* Load */
! 	98,  /* Play */
! 	99,  /* Cancel */
! 	100, /* Quit */
! 	101, /* Ok */
! 	93  /* Game paused */
  };
  
! static const byte string_map_table_v5[] = {
! 	0, /* How may I serve you? */
! 	20, /* Select a game to LOAD */
! 	19, /* Name your SAVE game */
! 	7,  /* Save */
! 	8,  /* Load */
! 	9,  /* Play */
! 	10,  /* Cancel */
! 	11, /* Quit */
! 	12, /* Ok */
! 	4  /* Game paused */
  };
  
--- 49,76 ----
  };
  
! static ResString string_map_table_v6[] = {
! 	{117, "How may I serve you?"}, 
! 	{109, "Select a game to LOAD"}, 
! 	{108, "Name your SAVE game"}, 
! 	{96, "Save"}, 
! 	{97, "Load"}, 
! 	{98, "Play"}, 
! 	{99, "Cancel"}, 
! 	{100, "Quit"}, 
! 	{101, "Ok"}, 
! 	{93, "Game paused"}, 
  };
  
! static ResString string_map_table_v5[] = {
! 	{0, "How may I serve you?"}, 
! 	{20, "Select a game to LOAD"},
! 	{19, "Name your SAVE game"},
! 	{7, "Save"},
! 	{8, "Load"},
! 	{9, "Play"},
! 	{10, "Cancel"},
! 	{11, "Quit"},
! 	{12, "Ok"},
! 	{4, "Game paused"}
  };
  

Index: resource.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/resource.cpp,v
retrieving revision 1.53
retrieving revision 1.54
diff -C2 -d -r1.53 -r1.54
*** resource.cpp	16 Mar 2002 05:33:25 -0000	1.53
--- resource.cpp	16 Mar 2002 18:03:28 -0000	1.54
***************
*** 516,525 ****
  
  void Scumm::loadCharset(int no) {
! 	int i;
  	byte *ptr;
! 
  	debug(9, "loadCharset(%d)",no);
!         if(_features & GF_EXTERNAL_CHARSET) {
!                 uint32 size;
                  checkRange(4 ,0 ,no , "Loading illegal charset %d");
                  openRoom(-1);
--- 516,526 ----
  
  void Scumm::loadCharset(int no) {
! 	int i, line = 0;
  	byte *ptr;
! 	
  	debug(9, "loadCharset(%d)",no);
!         if(_features & GF_EXTERNAL_CHARSET) {                
! 				uint32 size;
! 
                  checkRange(4 ,0 ,no , "Loading illegal charset %d");
                  openRoom(-1);
***************
*** 544,547 ****
--- 545,559 ----
  		_charsetData[no][i+1] = ptr[i+14];
  	}
+  printf("byte *font[] = {");   
+  while(*ptr) {	 
+    line++;
+    printf("%d,", ptr[i]);
+    if (line > 80) {
+     printf("\n");
+     line = 0;
+    }
+    ptr++;
+   }
+   printf("};\n");
  }
  
***************
*** 727,737 ****
  
  	validateResource("getResourceAddress", type, idx);
! 	
  	if (res.mode[type] && !res.address[type][idx]) {
  		ensureResourceLoaded(type, idx);
  	}	
  
! 	ptr=(byte*)res.address[type][idx];
! 	if (!ptr)
  		return NULL;
  
--- 739,751 ----
  
  	validateResource("getResourceAddress", type, idx);
! 	if (!res.address[type])
! 		return NULL;
! 
  	if (res.mode[type] && !res.address[type][idx]) {
  		ensureResourceLoaded(type, idx);
  	}	
  
! 	
! 	if (!(ptr = (byte*)res.address[type][idx]))
  		return NULL;
  
***************
*** 791,795 ****
  void Scumm::validateResource(const char *str, int type, int idx) {
  	if (type<rtFirst || type>rtLast || (uint)idx >= (uint)res.num[type]) {
! 		error("%s Illegal Glob type %d num %d", str, type, idx);
  	}
  }
--- 805,809 ----
  void Scumm::validateResource(const char *str, int type, int idx) {
  	if (type<rtFirst || type>rtLast || (uint)idx >= (uint)res.num[type]) {
! 		warning("%s Illegal Glob type %d num %d", str, type, idx);
  	}
  }

Index: script.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/script.cpp,v
retrieving revision 1.35
retrieving revision 1.36
diff -C2 -d -r1.35 -r1.36
*** script.cpp	11 Mar 2002 14:25:42 -0000	1.35
--- script.cpp	16 Mar 2002 18:03:28 -0000	1.36
***************
*** 23,26 ****
--- 23,27 ----
  #include "scumm.h"
  
+ /* Start executing script 'script' with parameters 'a' and 'b' */
  void Scumm::runScript(int script, int a, int b, int16 *lvarptr) {
  	byte *scriptPtr;
***************
*** 66,69 ****
--- 67,71 ----
  }
  
+ /* Stop script 'script' */
  void Scumm::stopScriptNr(int script) {
  	ScriptSlot *ss;
***************
*** 84,88 ****
  			error("Script %d stopped with active cutscene/override", script);
  		ss->number = 0;
! 		ss->status = 0;
  		if (_currentScript == i)
  			_currentScript = 0xFF;
--- 86,90 ----
  			error("Script %d stopped with active cutscene/override", script);
  		ss->number = 0;
! 		ss->status = ssDead;
  		if (_currentScript == i)
  			_currentScript = 0xFF;
***************
*** 104,107 ****
--- 106,110 ----
  }
  
+ /* Stop an object script 'script'*/
  void Scumm::stopObjectScript(int script) {
  	ScriptSlot *ss;
***************
*** 120,124 ****
  				error("Object %d stopped with active cutscene/override", script);
  			ss->number = 0;
! 			ss->status = 0;
  			if (_currentScript == i)
  				_currentScript = 0xFF;
--- 123,127 ----
  				error("Object %d stopped with active cutscene/override", script);
  			ss->number = 0;
! 			ss->status = ssDead;
  			if (_currentScript == i)
  				_currentScript = 0xFF;
***************
*** 143,146 ****
--- 146,150 ----
  }
  
+ /* Return a free script slot */
  int Scumm::getScriptSlot() {
  	ScriptSlot *ss;
***************
*** 155,158 ****
--- 159,163 ----
  }
  
+ /* Run script 'script' nested - eg, within the parent script.*/
  void Scumm::runScriptNested(int script) {
  	NestedScript *nest;
***************
*** 206,209 ****
--- 211,215 ----
  }
  
+ /* Get the code pointer to a script */
  void Scumm::getScriptBaseAddress() {
  	ScriptSlot *ss;
***************
*** 249,252 ****
--- 255,259 ----
  }
  
+ /* Execute a script - Read opcode, and execute it from the table */
  void Scumm::executeScript() {
  	OpcodeProc op;
***************
*** 439,443 ****
  	} else {
  		if (ss->cutsceneOverride)
! 			error("Script %d ending with active cutscene/override", ss->number);
  	}
  	ss->number = 0;
--- 446,454 ----
  	} else {
  		if (ss->cutsceneOverride)
! 			// FIXME: Loom workaround, fix properly :) - khalek
! 			if ((_gameId == GID_LOOM256) && (ss->number==44))
! 				this->exitCutscene();
! 			else
! 				error("Script %d ending with active cutscene/override", ss->number);
  	}
  	ss->number = 0;
***************
*** 471,475 ****
  
  	for(i=1; i<NUM_SCRIPT_SLOT; i++) {
! 		if (_currentScript!=i && vm.slot[i].status!=0 && (vm.slot[i].unk1==0 || flag>=0x80)) {
  			vm.slot[i].status |= 0x80;
  			vm.slot[i].freezeCount++;
--- 482,486 ----
  
  	for(i=1; i<NUM_SCRIPT_SLOT; i++) {
! 		if (_currentScript!=i && vm.slot[i].status!=ssDead && (vm.slot[i].unk1==0 || flag>=0x80)) {
  			vm.slot[i].status |= 0x80;
  			vm.slot[i].freezeCount++;
***************
*** 510,514 ****
  	_currentScript = 0xFF;
  	for(_curExecScript = 0; _curExecScript<NUM_SCRIPT_SLOT; _curExecScript++) {
! 		if (vm.slot[_curExecScript].status == 2 &&
  			vm.slot[_curExecScript].didexec == 0) {
  			_currentScript = (char)_curExecScript;
--- 521,525 ----
  	_currentScript = 0xFF;
  	for(_curExecScript = 0; _curExecScript<NUM_SCRIPT_SLOT; _curExecScript++) {
! 		if (vm.slot[_curExecScript].status == ssRunning &&
  			vm.slot[_curExecScript].didexec == 0) {
  			_currentScript = (char)_curExecScript;
***************
*** 525,529 ****
  	if (_EXCD_offs) {
  		int slot = getScriptSlot();
! 		vm.slot[slot].status = 2;
  		vm.slot[slot].number = 10001;
  		vm.slot[slot].where = WIO_ROOM;
--- 536,540 ----
  	if (_EXCD_offs) {
  		int slot = getScriptSlot();
! 		vm.slot[slot].status = ssRunning;
  		vm.slot[slot].number = 10001;
  		vm.slot[slot].where = WIO_ROOM;
***************
*** 543,547 ****
  	if (_ENCD_offs) {
  		int slot = getScriptSlot();
! 		vm.slot[slot].status = 2;
  		vm.slot[slot].number = 10002;
  		vm.slot[slot].where = WIO_ROOM;
--- 554,558 ----
  	if (_ENCD_offs) {
  		int slot = getScriptSlot();
! 		vm.slot[slot].status = ssRunning;
  		vm.slot[slot].number = 10002;
  		vm.slot[slot].where = WIO_ROOM;
***************
*** 671,675 ****
  	vm.slot[slot].number = object;
  	vm.slot[slot].offs = obcd + offs;
! 	vm.slot[slot].status = 2;
  	vm.slot[slot].where = where;
  	vm.slot[slot].unk1 = a;
--- 682,686 ----
  	vm.slot[slot].number = object;
  	vm.slot[slot].offs = obcd + offs;
! 	vm.slot[slot].status = ssRunning;
  	vm.slot[slot].where = where;
  	vm.slot[slot].unk1 = a;

Index: scumm.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm.h,v
retrieving revision 1.85
retrieving revision 1.86
diff -C2 -d -r1.85 -r1.86
*** scumm.h	16 Mar 2002 05:33:25 -0000	1.85
--- scumm.h	16 Mar 2002 18:03:28 -0000	1.86
***************
*** 54,57 ****
--- 54,58 ----
  };
  
+ /* Sound output type - MIDI */
  enum {
  	MIDI_NULL = 0,
***************
*** 59,63 ****
  	MIDI_TIMIDITY = 2,
  	MIDI_SEQ = 3,
! 	MIDI_QTMUSIC = 4
  };
  
--- 60,71 ----
  	MIDI_TIMIDITY = 2,
  	MIDI_SEQ = 3,
! 	MIDI_QTMUSIC = 4,	
! };
! 
! /* Script status type (slot.status) */
! enum {
! 	ssDead = 0,
! 	ssPaused = 1,
! 	ssRunning = 2
  };
  
***************
*** 2282,2287 ****
  	uint32 loadUint32();
  
! 	bool isSaving() { return _saveOrLoad; }
! 
  	bool Serializer::checkEOFLoadStream();
  
--- 2290,2297 ----
  	uint32 loadUint32();
  
! 	bool isSaving() { return _saveOrLoad; }
! 
! 
! 
  	bool Serializer::checkEOFLoadStream();
  

Index: scummvm.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scummvm.cpp,v
retrieving revision 1.82
retrieving revision 1.83
diff -C2 -d -r1.82 -r1.83
*** scummvm.cpp	14 Mar 2002 22:45:22 -0000	1.82
--- scummvm.cpp	16 Mar 2002 18:03:28 -0000	1.83
***************
*** 285,295 ****
  }
  
! int Scumm::scummLoop(int delta) {
! 
! #ifndef _WIN32_WCE
  
  	if (_debugger)
! 		_debugger->on_frame();
! 
  #endif
  	
--- 285,300 ----
  }
  
! int Scumm::scummLoop(int delta) {
! 
! 
! 
! #ifndef _WIN32_WCE
! 
  
  	if (_debugger)
! 		_debugger->on_frame();
! 
! 
! 
  #endif
  	
***************
*** 585,588 ****
--- 590,594 ----
          {"loomcd",      "Loom (256 color CD version)",                  GID_LOOM256,    5, 1, 42, GF_SMALL_HEADER|GF_USE_KEY|GF_AUDIOTRACKS},
          {"monkey",      "Monkey Island 1",                              GID_MONKEY,     5, 2, 2,  GF_USE_KEY|GF_AUDIOTRACKS},
+ 		{"monkey1",     "Monkey Island 1 (alt)",                              GID_MONKEY,     5, 2, 2,  GF_USE_KEY|GF_AUDIOTRACKS},
          {"monkey2",     "Monkey Island 2: LeChuck's revenge",           GID_MONKEY2,    5, 2, 2,  GF_USE_KEY},
          {"atlantis",    "Indiana Jones 4 and the Fate of Atlantis",     GID_INDY4,      5, 5, 0,  GF_USE_KEY},
***************
*** 690,694 ****
  	_currentRoom = room;
  	_vars[VAR_ROOM] = room;
! 
  	if (room >= 0x80)
  		_roomResource = _resourceMapper[room&0x7F];
--- 696,700 ----
  	_currentRoom = room;
  	_vars[VAR_ROOM] = room;
! 	printf("startscene with room 0x%x", room);
  	if (room >= 0x80)
  		_roomResource = _resourceMapper[room&0x7F];





More information about the Scummvm-git-logs mailing list