aboutsummaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
Diffstat (limited to 'common')
-rw-r--r--common/engine.cpp4
-rw-r--r--common/gameDetector.cpp5
-rw-r--r--common/scummsys.h30
-rw-r--r--common/system.h4
-rw-r--r--common/util.h7
5 files changed, 46 insertions, 4 deletions
diff --git a/common/engine.cpp b/common/engine.cpp
index 4540a99fcb..2ccc9a9a4a 100644
--- a/common/engine.cpp
+++ b/common/engine.cpp
@@ -102,7 +102,11 @@ void CDECL warning(const char *s, ...)
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);
diff --git a/common/gameDetector.cpp b/common/gameDetector.cpp
index 8dd4d6a318..3389cc7a5b 100644
--- a/common/gameDetector.cpp
+++ b/common/gameDetector.cpp
@@ -120,6 +120,8 @@ GameDetector::GameDetector()
_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 @@ OSystem *GameDetector::createSystem() {
#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);
diff --git a/common/scummsys.h b/common/scummsys.h
index de56a78121..a8e06f9cf0 100644
--- a/common/scummsys.h
+++ b/common/scummsys.h
@@ -88,11 +88,11 @@ const bool true(1), false(0);
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,11 +241,35 @@ const bool true(1), false(0);
#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))
#if defined(SCUMM_LITTLE_ENDIAN)
diff --git a/common/system.h b/common/system.h
index 5cae9b691d..d6447f2537 100644
--- a/common/system.h
+++ b/common/system.h
@@ -183,6 +183,7 @@ extern OSystem *OSystem_Dreamcast_create();
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 @@ enum {
GD_MORPHOS,
GD_WINCE,
GD_MAC,
- GD_DC
+ GD_DC,
+ GD_GP32 //ph0x
};
enum {
diff --git a/common/util.h b/common/util.h
index 3218a8546d..37576bd8af 100644
--- a/common/util.h
+++ b/common/util.h
@@ -45,6 +45,13 @@ static inline void SWAP(int &a, int &b) { int tmp=a; a=b; b=tmp; }
#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))