[Scummvm-cvs-logs] CVS: scummvm/backends/PalmOS/Src globals.h,1.18,1.19

Chris Apers chrilith at users.sourceforge.net
Sat Nov 5 03:32:56 CET 2005


Update of /cvsroot/scummvm/scummvm/backends/PalmOS/Src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23944

Modified Files:
	globals.h 
Log Message:
- Moved kOpt* to a new file
- Reordered strcut to ease ARM export
- Added macros to export the struct to ARM

Index: globals.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/backends/PalmOS/Src/globals.h,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -d -r1.18 -r1.19
--- globals.h	18 Oct 2005 01:30:00 -0000	1.18
+++ globals.h	5 Nov 2005 11:32:22 -0000	1.19
@@ -24,99 +24,116 @@
 #define GLOBALS_H
 
 #include <VFSMgr.h>
-#include "scumm_globals.h"
-#include "arm/pnodefs.h"
+#include "stuffs.h"
 
-enum {
-	kOptNone				=	0,
-	kOptDeviceARM			=	1 <<	0x00,
-	kOptDeviceOS5			=	1 <<	0x01,
-	kOptDeviceClie			=	1 <<	0x02,
-	kOptDeviceZodiac		=	1 <<	0x03,
-	kOptModeWide			=	1 <<	0x04,
-	kOptModeLandscape		=	1 <<	0x05,
-	kOptMode16Bit			=	1 <<	0x06,
-	kOptModeHiDensity		=	1 <<	0x07,
-	kOptCollapsible			=	1 <<	0x08,
-	kOptDisableOnScrDisp	=	1 <<	0x09,
-	kOpt5WayNavigator		=	1 <<	0x0A,
-	kOptPalmSoundAPI		=	1 <<	0x0B,
-	kOptSonyPa1LibAPI		=	1 <<	0x0C,
+#ifdef PALMOS_68K
 
-	kOptDeviceProcX86		=	1 <<	0x1F	// DEBUG only
-};
+#include "scumm_globals.h"
+#include "arm/pnodefs.h"
 
 enum {
 	kMemScummOldCostGames = 0,
 	kMemScummNewCostGames,
-	kMemSimon1Games,
+	kMemSimon1Games,	
 	kMemSimon2Games,
 
 	kMemGamesCount
 };
 
+typedef struct {
+	char headerBuffer[sizeof(PnoEntryHeader) + 2];
+	PnoEntryHeader *alignedHeader;
+	PnoDescriptor pnoDesc;
+} PNOInitType;
+
+#endif
+
 enum {
 	INIT_VIBRATOR	= 1 <<	0x00,
 	INIT_PA1LIB		= 1 <<	0x01,
 	INIT_ARM		= 1 <<	0x02,
-	INIT_AUTOOFF	= 1 <<	0x03
+	INIT_AUTOOFF	= 1 <<	0x03,
+	INIT_GOLCD		= 1 <<	0x04
 };
 
-typedef struct {
-	char headerBuffer[sizeof(PnoEntryHeader) + 2];
-	PnoEntryHeader *alignedHeader;
-	PnoDescriptor pnoDesc;
-} PNOInitType;
+enum {
+	FM_QUALITY_LOW = 0,
+	FM_QUALITY_MED,
+	FM_QUALITY_HI,
+	FM_QUALITY_INI
+};
 
 typedef struct {
-	DmOpenRef globals[GBVARS_COUNT];
-	UInt32 memory[kMemGamesCount];
+	// common parts
+	UInt32 _4B, _2B;
 
-	UInt8 init;
+	// 4 bytes part
+	UInt32 startupMemory;
+	UInt32 slkVersion;
 	UInt32 options;
+	UInt32 screenPitch;
 
+	struct {
+		FileRef	logFile;
+		UInt32 cacheSize;
+		UInt16 volRefNum;
+		UInt16 dummy;
+	} VFS;
+
+	// 2 bytes part
 	UInt16 HRrefNum;
-	UInt16 volRefNum;
 	UInt16 slkRefNum;
-	UInt32 slkVersion;
-
-	FileRef	logFile;
+	Coord screenWidth, screenHeight;			// silkarea shown
+	Coord screenFullWidth, screenFullHeight;	// silkarea hidden
 
+	// 1 byte part
 	Boolean vibrator;
 	Boolean screenLocked;
 	Boolean stdPalette;
 	Boolean filter;
-	Coord screenWidth, screenHeight;			// silkarea shown
-	Coord screenFullWidth, screenFullHeight;	// silkarea hidden
-	UInt32 screenPitch;
-
-	PNOInitType arm[ARM_COUNT];
-
+	Boolean stylusClick;
+	UInt8 init;
+	UInt8 palmVolume;
+	UInt8 fmQuality;
 	struct {
+		UInt8 showLED;
 		UInt8 on;
 		UInt8 off;
 	} indicator;
 
-	struct {
-		UInt8 *pageAddr1;
-		UInt8 *pageAddr2;
-	} flipping;
-
+#ifdef PALMOS_68K
+	// 68k only part
 	struct {
 		Boolean enable;
 		UInt8 driver, format;
 		UInt16 defaultTrackLength;
 		UInt16 firstTrack;
-		UInt16 volume;
+		UInt8 volume;		
 	} CD;
 
+	DmOpenRef globals[GBVARS_COUNT];
+	UInt32 memory[kMemGamesCount];
+	PNOInitType arm[ARM_COUNT];
+#endif
+
 } GlobalsDataType, *GlobalsDataPtr;
 
 extern GlobalsDataPtr gVars;
 
-#define OPTIONS_TST(x)	(gVars->options & (x))
-#define OPTIONS_SET(x)	gVars->options |= (x)
-#define OPTIONS_RST(x)	gVars->options &= ~(x)
+#define VARS_EXPORT()		gVars->_4B = 6; \
+							gVars->_2B = 8;
+
+#define DO_VARS(z, t, o) \
+	{	Int8 *tmp = (Int8 *)gVars + o + 8; \
+		for (Int8 cnt = 0; cnt < gVars->z; cnt++) \
+			{ 	UInt##t val = *((UInt##t *)tmp);	\
+				val = ByteSwap##t(val);	\
+				*((UInt##t *)tmp) = val;	\
+				tmp += (t / 8);	\
+			}	\
+	}
+
+#define OPTIONS_DEF()		gVars->options
 
 #define HWR_INIT(x)			(gVars->init & (x))
 #define HWR_SET(x)			gVars->init |= (x)





More information about the Scummvm-git-logs mailing list