[Scummvm-cvs-logs] CVS: scummvm gapi_keys.h,NONE,1.1 object.cpp,1.41,1.42 saveload.cpp,1.31,1.32 scumm.h,1.81,1.82

James Brown ender at users.sourceforge.net
Thu Mar 14 06:56:32 CET 2002


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

Modified Files:
	object.cpp saveload.cpp scumm.h 
Added Files:
	gapi_keys.h 
Log Message:
winCE part 2 - still gui.cpp and scummvm.cpp left



--- NEW FILE: gapi_keys.h ---
#ifdef _WIN32_WCE

typedef void (*pAction)();

enum ActionType {
	ACTION_NONE = 0,
	ACTION_PAUSE = 1,
	ACTION_SAVE = 2,
	ACTION_QUIT = 3,
	ACTION_SKIP = 4,
	ACTION_HIDE = 5,
	ACTION_KEYBOARD = 6,
	ACTION_SOUND = 7,
	ACTION_RIGHTCLICK = 8
};

struct oneAction {
	unsigned char	action_key;
	int				action_type;
};


#define NUMBER_ACTIONS 5
#define TOTAL_ACTIONS 8

#define GAPI_KEY_BASE 1000
#define GAPI_KEY_VKA 1
#define GAPI_KEY_VKB 2
#define GAPI_KEY_VKC 3
#define GAPI_KEY_VKSTART 4
#define GAPI_KEY_CALENDAR 5
#define GAPI_KEY_CONTACTS 6
#define GAPI_KEY_INBOX 7
#define GAPI_KEY_ITASK 8

#define INTERNAL_KEY_CALENDAR 0xc1
#define INTERNAL_KEY_CONTACTS 0xc2
#define INTERNAL_KEY_INBOX 0xc3
#define INTERNAL_KEY_ITASK 0xc4

void GAPIKeysInit(pAction*);
void GAPIKeysGetReference(void);
const unsigned char getGAPIKeyMapping(short);
const char* getGAPIKeyName(unsigned char);
struct oneAction* getAction(int);
void processAction (short);
void clearActionKey (unsigned char);
const unsigned char* getActionKeys(void);
void setActionKeys(unsigned char *);
const char* getActionName(int);
void setActionTypes(unsigned char *);
const unsigned char* getActionTypes();
void setNextType(int);
void setPreviousType(int);

#endif

Index: object.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/object.cpp,v
retrieving revision 1.41
retrieving revision 1.42
diff -C2 -d -r1.41 -r1.42
*** object.cpp	13 Mar 2002 04:57:32 -0000	1.41
--- object.cpp	14 Mar 2002 14:45:03 -0000	1.42
***************
*** 1160,1164 ****
  	assert(ptr);
  	ptr = findResource(IMxx_tags[eo->l], ptr);
! 	assert(ptr);
  	bomp = findResourceData(MKID('BOMP'), ptr);
  
--- 1160,1166 ----
  	assert(ptr);
  	ptr = findResource(IMxx_tags[eo->l], ptr);
! //        assert(ptr);
!         if (!ptr)               /* FIXME: Sam and Max highway subgame */
!                 return;
  	bomp = findResourceData(MKID('BOMP'), ptr);
  

Index: saveload.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saveload.cpp,v
retrieving revision 1.31
retrieving revision 1.32
diff -C2 -d -r1.31 -r1.32
*** saveload.cpp	8 Mar 2002 17:04:40 -0000	1.31
--- saveload.cpp	14 Mar 2002 14:45:03 -0000	1.32
***************
*** 31,36 ****
--- 31,52 ----
  };
  
+ #ifdef _WIN32_WCE
+ 
+ // Support for "old" savegames (made with 2501 CVS build)
+ // Can be useful for other ports too :)
+ 
+ #define VER_V8 8
+ #define VER_V7 7
+ 
+ #define CURRENT_VER VER_V8
+ 
+ static uint32 _current_version = CURRENT_VER;
+ 
+ #else
+ 
  #define CURRENT_VER 7
  
+ #endif
+ 
  bool Scumm::saveState(int slot, bool compat) {
  	char filename[256];
***************
*** 48,52 ****
--- 64,77 ----
  	hdr.type = MKID('SCVM');
  	hdr.size = 0;
+ 
+ #ifdef _WIN32_WCE
+ 
+ 	hdr.ver = _current_version;
+ 
+ #else
+ 
  	hdr.ver = CURRENT_VER;
+ 
+ #endif
  	
  	out.fwrite(&hdr, sizeof(hdr), 1);
***************
*** 80,84 ****
--- 105,118 ----
  	}
  
+ #ifdef _WIN32_WCE	
+ 
+ 	if (hdr.ver != VER_V8 && hdr.ver != VER_V7) {
+ 
+ #else
+ 
  	if (hdr.ver != CURRENT_VER) {
+ 
+ #endif
+ 
  		warning("Invalid version of '%s'", filename);
  		out.fclose();
***************
*** 86,89 ****
--- 120,129 ----
  	}
  
+ #ifdef _WIN32_WCE
+ 
+ 	_current_version = hdr.ver;
+ 
+ #endif
+ 
  	memcpy(_saveLoadName, hdr.name, sizeof(hdr.name));
  
***************
*** 145,148 ****
--- 185,191 ----
  
  void Scumm::makeSavegameName(char *out, int slot, bool compatible) {
+ 
+ #ifndef _WIN32_WCE			
+ 
  	#if !defined(__APPLE__CW)
  	const char *dir = getenv("SCUMMVM_SAVEPATH");
***************
*** 151,156 ****
--- 194,206 ----
  	const char *dir = "";
  	#endif
+ 
  	/* snprintf should be used here, but it's not portable enough */
  	sprintf(out, "%s%s.%c%.2d", dir, _exe_name, compatible ? 'c': 's', slot);
+ 
+ #else
+ 
+ 	sprintf(out, "%s%s.%c%.2d", _savegame_dir, _exe_name, compatible ? 'c': 's', slot);
+ 
+ #endif
  }
  
***************
*** 173,178 ****
  		return false;
  	}
! 	
! 	if (hdr.ver != CURRENT_VER) {
  		strcpy(desc, "Invalid version");
  		return false;
--- 223,237 ----
  		return false;
  	}
! 
! #ifdef _WIN32_WCE				
! 
! 	if (hdr.ver != VER_V8 && hdr.ver != VER_V7) {
! 
! #else
! 
!     if (hdr.ver != CURRENT_VER) {
! 
! #endif
! 
  		strcpy(desc, "Invalid version");
  		return false;
***************
*** 307,311 ****
  	};
  	
! 	const SaveLoadEntry mainEntries[] = {
  		MKLINE(Scumm,_scrWidth,sleUint16),
  		MKLINE(Scumm,_scrHeight,sleUint16),
--- 366,372 ----
  	};
  	
! #ifdef _WIN32_WCE
! 
! 		const SaveLoadEntry mainEntries1[] = {
  		MKLINE(Scumm,_scrWidth,sleUint16),
  		MKLINE(Scumm,_scrHeight,sleUint16),
***************
*** 327,330 ****
--- 388,395 ----
  		MKARRAY(Scumm,_charsetData[0][0],sleByte,10*16),
  		MKLINE(Scumm,_curExecScript,sleUint16),
+ 		MKEND()
+ 	};
+ 
+ 	const SaveLoadEntry mainEntries2V8[] = {
  
  		MKLINE(Scumm,camera._dest.x,sleInt16),
***************
*** 343,346 ****
--- 408,429 ----
  		MKLINE(Scumm,camera._rightTrigger,sleInt16),
  		MKLINE(Scumm,camera._movingToActor,sleUint16),
+ 		MKEND()
+ 	};
+ 
+ 	const SaveLoadEntry mainEntries2V7[] = {
+ 		MKLINE(Scumm,camera._dest.x,sleInt16),
+ 		MKLINE(Scumm,camera._cur.x,sleInt16),
+ 		MKLINE(Scumm,camera._last.x,sleInt16),
+ 		MKLINE(Scumm,_screenStartStrip,sleInt16),
+ 		MKLINE(Scumm,_screenEndStrip,sleInt16),
+ 		MKLINE(Scumm,camera._mode,sleByte),
+ 		MKLINE(Scumm,camera._follows,sleByte),
+ 		MKLINE(Scumm,camera._leftTrigger,sleInt16),
+ 		MKLINE(Scumm,camera._rightTrigger,sleInt16),
+ 		MKLINE(Scumm,camera._movingToActor,sleUint16),
+ 		MKEND()
+ 	};
+ 
+ 	const SaveLoadEntry mainEntries3[] = {
  		
  		MKLINE(Scumm,_actorToPrintStrFor,sleByte),
***************
*** 404,407 ****
--- 487,591 ----
  	};
  
+ #else
+ 
+ 		const SaveLoadEntry mainEntries[] = {
+ 		MKLINE(Scumm,_scrWidth,sleUint16),
+ 		MKLINE(Scumm,_scrHeight,sleUint16),
+ 		MKLINE(Scumm,_ENCD_offs,sleUint32),
+ 		MKLINE(Scumm,_EXCD_offs,sleUint32),
+ 		MKLINE(Scumm,_IM00_offs,sleUint32),
+ 		MKLINE(Scumm,_CLUT_offs,sleUint32),
+ 		MKLINE(Scumm,_EPAL_offs,sleUint32),
+ 		MKLINE(Scumm,_PALS_offs,sleUint32),
+ 		MKLINE(Scumm,_curPalIndex,sleByte),
+ 		MKLINE(Scumm,_currentRoom,sleByte),
+ 		MKLINE(Scumm,_roomResource,sleByte),
+ 		MKLINE(Scumm,_numObjectsInRoom,sleByte),
+ 		MKLINE(Scumm,_currentScript,sleByte),
+ 		MKARRAY(Scumm,_localScriptList[0],sleUint32,NUM_LOCALSCRIPT),
+ 		MKARRAY(Scumm,vm.localvar[0][0],sleUint16,NUM_SCRIPT_SLOT*17),
+ 		MKARRAY(Scumm,_resourceMapper[0],sleByte,128),
+ 		MKARRAY(Scumm,charset._colorMap[0],sleByte,16),
+ 		MKARRAY(Scumm,_charsetData[0][0],sleByte,10*16),
+ 		MKLINE(Scumm,_curExecScript,sleUint16),
+ 
+ 		MKLINE(Scumm,camera._dest.x,sleInt16),
+ 		MKLINE(Scumm,camera._dest.y,sleInt16),
+ 		MKLINE(Scumm,camera._cur.x,sleInt16),
+ 		MKLINE(Scumm,camera._cur.y,sleInt16),
+ 		MKLINE(Scumm,camera._last.x,sleInt16),
+ 		MKLINE(Scumm,camera._last.y,sleInt16),
+ 		MKLINE(Scumm,camera._accel.x,sleInt16),
+ 		MKLINE(Scumm,camera._accel.y,sleInt16),
+ 		MKLINE(Scumm,_screenStartStrip,sleInt16),
+ 		MKLINE(Scumm,_screenEndStrip,sleInt16),
+ 		MKLINE(Scumm,camera._mode,sleByte),
+ 		MKLINE(Scumm,camera._follows,sleByte),
+ 		MKLINE(Scumm,camera._leftTrigger,sleInt16),
+ 		MKLINE(Scumm,camera._rightTrigger,sleInt16),
+ 		MKLINE(Scumm,camera._movingToActor,sleUint16),
+ 		
+ 		MKLINE(Scumm,_actorToPrintStrFor,sleByte),
+ 		MKLINE(Scumm,_charsetColor,sleByte),
+ 		/* XXX Convert into word next time format changes */
+ 		MKLINE(Scumm,charset._bufPos,sleByte),
+ 		MKLINE(Scumm,_haveMsg,sleByte),
+ 		MKLINE(Scumm,_useTalkAnims,sleByte),
+ 
+ 		MKLINE(Scumm,_talkDelay,sleInt16),
+ 		MKLINE(Scumm,_defaultTalkDelay,sleInt16),
+ 		MKLINE(Scumm,_numInMsgStack,sleInt16),
+ 		MKLINE(Scumm,_sentenceNum,sleByte),
+ 
+ 		MKLINE(Scumm,vm.cutSceneStackPointer,sleByte),
+ 		MKARRAY(Scumm,vm.cutScenePtr[0],sleUint32,5),
+ 		MKARRAY(Scumm,vm.cutSceneScript[0],sleByte,5),
+ 		MKARRAY(Scumm,vm.cutSceneData[0],sleInt16,5),
+ 		MKLINE(Scumm,vm.cutSceneScriptIndex,sleInt16),
+ 		
+ 		/* nest */
+ 		MKLINE(Scumm,_numNestedScripts,sleByte),
+ 		MKLINE(Scumm,_userPut,sleByte),
+ 		MKLINE(Scumm,_cursorState,sleByte),
+ 		MKLINE(Scumm,gdi._cursorActive,sleByte),
+ 		MKLINE(Scumm,gdi._currentCursor,sleByte),
+ 
+ 		MKLINE(Scumm,_doEffect,sleByte),
+ 		MKLINE(Scumm,_switchRoomEffect,sleByte),
+ 		MKLINE(Scumm,_newEffect,sleByte),
+ 		MKLINE(Scumm,_switchRoomEffect2,sleByte),
+ 		MKLINE(Scumm,_BgNeedsRedraw,sleByte),
+ 
+ 		MKARRAY(Scumm,gfxUsageBits[0],sleUint32,200),
+ 		MKLINE(Scumm,gdi._transparency,sleByte),
+ 		MKARRAY(Scumm,_currentPalette[0],sleByte,768),
+ 		/* virtscr */
+ 
+ 		MKARRAY(Scumm,charset._buffer[0],sleByte,256),
+ 
+ 		MKLINE(Scumm,_egoPositioned,sleByte),
+ 
+ 		MKARRAY(Scumm,gdi._imgBufOffs[0],sleUint16,4),
+ 		MKLINE(Scumm,gdi._numZBuffer,sleByte),
+ 
+ 		MKLINE(Scumm,_screenEffectFlag,sleByte),
+ 
+ 		MKLINE(Scumm,_randSeed1,sleUint32),
+ 		MKLINE(Scumm,_randSeed2,sleUint32),
+ 
+ 		/* XXX: next time the save game format changes,
+ 		 * convert _shakeEnabled to boolean and add a _shakeFrame field */
+ 		MKLINE(Scumm,_shakeEnabled,sleInt16),
+ 
+ 		MKLINE(Scumm,_keepText,sleByte),
+ 
+ 		MKLINE(Scumm,_screenB,sleUint16),
+ 		MKLINE(Scumm,_screenH,sleUint16),
+ 
+ 		MKEND()
+ 	};
+ 
+ #endif
+ 
  	const SaveLoadEntry scriptSlotEntries[] = {
  		MKLINE(ScriptSlot,offs,sleUint32),
***************
*** 469,475 ****
--- 653,680 ----
  	int var98Backup;
  	
+ #ifdef _WIN32_WCE
+ 
+ 	s->saveLoadEntries(this, mainEntries1);
+ 	s->saveLoadEntries(this, (_current_version == VER_V8 ? mainEntries2V8 : mainEntries2V7));
+ 	s->saveLoadEntries(this, mainEntries3);
+ 
+ #else
+ 
  	s->saveLoadEntries(this,mainEntries);
  
+ #endif
+ 
+ #ifdef _WIN32_WCE
+ 
+ 	// Probably not necessary anymore with latest NUM_ACTORS values
+ 
+ 	s->saveLoadArrayOf(actor, (_current_version == VER_V8 ? NUM_ACTORS : 13), sizeof(actor[0]), actorEntries);
+ 
+ #else
+ 	
  	s->saveLoadArrayOf(actor, NUM_ACTORS, sizeof(actor[0]), actorEntries);
+ 
+ #endif
+ 
  	s->saveLoadArrayOf(vm.slot, NUM_SCRIPT_SLOT, sizeof(vm.slot[0]), scriptSlotEntries);
  	s->saveLoadArrayOf(_objs, _numLocalObjects, sizeof(_objs[0]), objectEntries);
***************
*** 570,573 ****
--- 775,794 ----
  		_saveLoadStream.fread(b, 1, len);
  }
+ 
+ #ifdef _WIN32_WCE
+ 
+ // Perhaps not necessary anymore with latest checks
+ 
+ bool Serializer::checkEOFLoadStream() {
+ 	if (!fseek(_saveLoadStream.out, 1, SEEK_CUR))
+ 		return true;
+ 	if (feof(_saveLoadStream.out))
+ 		return true;
+ 	fseek(_saveLoadStream.out, -1, SEEK_CUR);
+ 	return false;
+ }
+ 
+ #endif
+ 
  
  void Serializer::saveUint32(uint32 d) {

Index: scumm.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm.h,v
retrieving revision 1.81
retrieving revision 1.82
diff -C2 -d -r1.81 -r1.82
*** scumm.h	14 Mar 2002 08:04:21 -0000	1.81
--- scumm.h	14 Mar 2002 14:45:03 -0000	1.82
***************
*** 29,34 ****
  #endif
  
! #define SCUMMVM_VERSION "0.1.0 devel"
  
  #define SWAP(a,b) do{int tmp=a; a=b; b=tmp; } while(0)
  #define ARRAYSIZE(x) (sizeof(x)/sizeof(x[0]))
--- 29,39 ----
  #endif
  
! #define SCUMMVM_VERSION "0.2.0 devel"
! #ifdef _WIN32_WCE
!         // Additional build information for easier bug report
  
+         #define POCKETSCUMM_BUILD "031302"
+         #define SCUMMVM_CVS "031002"
+ #endif
  #define SWAP(a,b) do{int tmp=a; a=b; b=tmp; } while(0)
  #define ARRAYSIZE(x) (sizeof(x)/sizeof(x[0]))
***************
*** 49,53 ****
  	NUM_LOCALSCRIPT = 60,
  	NUM_SHADOW_PALETTE = 8,
! 	MAX_ACTORS = 30
  };
  
--- 54,59 ----
  	NUM_LOCALSCRIPT = 60,
  	NUM_SHADOW_PALETTE = 8,
!     MAX_ACTORS = 30,
!     KEY_SET_OPTIONS = 3456 // WinCE
  };
  
***************
*** 891,895 ****
  	char *_exe_name;
  	char *_gameDataPath;
! 
  	int akos_findManyDirection(int16 ManyDirection, uint16 facing);
  	
--- 897,901 ----
  	char *_exe_name;
  	char *_gameDataPath;
!         char *_savegame_dir;
  	int akos_findManyDirection(int16 ManyDirection, uint16 facing);
  	
***************
*** 902,906 ****
  
  	bool _soundsPaused;
! 
  	bool _useTalkAnims;
  	
--- 908,912 ----
  
  	bool _soundsPaused;
!         bool _soundsPaused2;
  	bool _useTalkAnims;
  	
***************
*** 1072,1076 ****
  	int16 _palManipStart;
  	int16 _palManipEnd;
! 	int16 _palManipCounter;
  
  	struct {
--- 1078,1086 ----
  	int16 _palManipStart;
  	int16 _palManipEnd;
!         int16 _palManipCounter;
! 
! 	int16 _sound_volume_master;
! 	int16 _sound_volume_music;
! 	int16 _sound_volume_sfx;
  
  	struct {
***************
*** 1747,1750 ****
--- 1757,1761 ----
  	void decodeParseString();
  	void pauseGame(bool user);
+ // FIXME        void setOptions(void);
  	void shutDown(int i);
  	void lock(int type, int i);





More information about the Scummvm-git-logs mailing list