[Scummvm-cvs-logs] CVS: scummvm/common engine.cpp,1.9,1.10 gameDetector.cpp,1.40,1.41 scummsys.h,1.11,1.12 system.h,1.9,1.10 util.h,1.6,1.7
Peter Moraliyski
ph0x at users.sourceforge.net
Sat Nov 30 08:04:05 CET 2002
Update of /cvsroot/scummvm/scummvm/common
In directory sc8-pr-cvs1:/tmp/cvs-serv14547/common
Modified Files:
engine.cpp gameDetector.cpp scummsys.h system.h util.h
Log Message:
gp32 port stuff
Index: engine.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/common/engine.cpp,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- engine.cpp 10 Nov 2002 17:19:42 -0000 1.9
+++ engine.cpp 30 Nov 2002 16:03:45 -0000 1.10
@@ -102,7 +102,11 @@
vsprintf(buf, s, va);
va_end(va);
+#ifdef __GP32__ //ph0x FIXME: implement fprint?
+ printf("WARNING: %s\n", buf);
+#else
fprintf(stderr, "WARNING: %s!\n", buf);
+#endif
#if defined( USE_WINDBG )
strcat(buf, "\n");
OutputDebugString(buf);
Index: gameDetector.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/common/gameDetector.cpp,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -d -r1.40 -r1.41
--- gameDetector.cpp 23 Nov 2002 16:08:37 -0000 1.40
+++ gameDetector.cpp 30 Nov 2002 16:03:45 -0000 1.41
@@ -120,6 +120,8 @@
_gfx_driver = GD_WINCE;
#elif defined(MACOS_CARBON)
_gfx_driver = GD_MAC;
+#elif defined(__GP32__) // ph0x
+ _gfx_driver = GD_GP32;
#else
/* SDL is the default driver for now */
_gfx_driver = GD_SDL;
@@ -621,6 +623,9 @@
#elif defined(USE_NULL_DRIVER)
case GD_NULL:
return OSystem_NULL_create();
+#elif defined(__GP32__) //ph0x
+ case GD_GP32:
+ return OSystem_GP32_create(GFX_NORMAL, true);
#else
case GD_SDL:
return OSystem_SDL_create(_gfx_mode, _fullScreen);
Index: scummsys.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/common/scummsys.h,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- scummsys.h 29 Nov 2002 14:11:37 -0000 1.11
+++ scummsys.h 30 Nov 2002 16:03:45 -0000 1.12
@@ -88,11 +88,11 @@
typedef unsigned char byte;
typedef unsigned char uint8;
typedef unsigned short uint16;
- typedef unsigned int uint32;
+ typedef unsigned long uint32;
typedef unsigned int uint;
typedef signed char int8;
typedef signed short int16;
- typedef signed int int32;
+ typedef signed long int32;
#define START_PACK_STRUCTS pack (push,1)
#define END_PACK_STRUCTS pack(pop)
@@ -241,10 +241,34 @@
#define START_PACK_STRUCTS pack (push,1)
#define END_PACK_STRUCTS pack(pop)
+#elif defined __GP32__ //ph0x
+ #define CDECL
+ #define SCUMM_NEED_ALIGNMENT
+ #define SCUMM_LITTLE_ENDIAN
+ #define NONSTANDARD_SAVE
+
+ #define scumm_stricmp stricmp
+ #define CHECK_HEAP
+
+ #define FORCEINLINE inline
+ #define NORETURN __attribute__((__noreturn__))
+ #define GCC_PACK __attribute__((packed))
+ #define _HEAPOK 0
+
+ typedef unsigned char byte;
+ typedef unsigned char uint8;
+ typedef unsigned short uint16;
+ typedef unsigned long uint32;
+ typedef unsigned int uint;
+ typedef signed char int8;
+ typedef signed short int16;
+ typedef signed long int32;
+
+ #define START_PACK_STRUCTS pack (push,1)
+ #define END_PACK_STRUCTS pack(pop)
#else
#error No system type defined
#endif
-
#define SWAP_BYTES(a) ((((a)>>24)&0xFF) | (((a)>>8)&0xFF00) | (((a)<<8)&0xFF0000) | (((a)<<24)&0xFF000000))
Index: system.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/common/system.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- system.h 19 Nov 2002 08:05:48 -0000 1.9
+++ system.h 30 Nov 2002 16:03:45 -0000 1.10
@@ -183,6 +183,7 @@
extern OSystem *OSystem_WINCE3_create();
extern OSystem *OSystem_X11_create();
extern OSystem *OSystem_MAC_create(int gfx_mode, bool full_screen);
+extern OSystem *OSystem_GP32_create(int gfx_mode, bool full_screen); //ph0x
enum {
GFX_NORMAL = 0,
@@ -203,7 +204,8 @@
GD_MORPHOS,
GD_WINCE,
GD_MAC,
- GD_DC
+ GD_DC,
+ GD_GP32 //ph0x
};
enum {
Index: util.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/common/util.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- util.h 22 Oct 2002 23:36:28 -0000 1.6
+++ util.h 30 Nov 2002 16:03:46 -0000 1.7
@@ -45,6 +45,13 @@
#define GREEN_FROM_16(x) ((((x)>>5)&0x1F) << 3)
#define BLUE_FROM_16(x) (((x)&0x1F) << 3)
+#elif defined(__GP32__) //ph0x
+// GP32 format 5-5-5-1 (first bit means intensity)
+#define RGB_TO_16(r,g,b) (((((r)>>3)&0x1F) << 11) | ((((g)>>3)&0x1F) << 6) | (((b)>>3)&0x1F)<<1)
+#define RED_FROM_16(x) ((((x)>>11)&0x1F) << 3)
+#define GREEN_FROM_16(x) ((((x)>>6) &0x1F) << 3)
+#define BLUE_FROM_16(x) ((((x)>>1) &0x1F) << 3)
+
#else
// Assume the 16 bit graphics data is in 5-6-5 format
#define RGB_TO_16(r,g,b) (((((r)>>3)&0x1F) << 11) | ((((g)>>2)&0x3F) << 5) | (((b)>>3)&0x1F))
More information about the Scummvm-git-logs
mailing list