From f84b5d327dc13da7412553cc31e80fb7199eab36 Mon Sep 17 00:00:00 2001 From: Nicolas Bacca Date: Thu, 31 Oct 2002 01:04:47 +0000 Subject: Real HPC support (work in progress) svn-id: r5357 --- backends/wince/findgame.cpp | 7 +++ backends/wince/gapi_keys.cpp | 11 ++++- backends/wince/missing/missing.cpp | 87 ++++++++++++++++++++++++++++++++++++++ backends/wince/pocketpc.cpp | 63 +++++++++++++++++++++++---- backends/wince/portdefs.h | 13 ++++++ backends/wince/screen.cpp | 2 +- 6 files changed, 172 insertions(+), 11 deletions(-) create mode 100644 backends/wince/portdefs.h (limited to 'backends/wince') diff --git a/backends/wince/findgame.cpp b/backends/wince/findgame.cpp index 6b822e8caa..e4aa7411f3 100644 --- a/backends/wince/findgame.cpp +++ b/backends/wince/findgame.cpp @@ -25,6 +25,13 @@ #include "stdafx.h" #include + +#if _WIN32_WCE < 300 + +#include +#include + +#endif #include #include #include "resource.h" diff --git a/backends/wince/gapi_keys.cpp b/backends/wince/gapi_keys.cpp index c9999237bb..4468ea5c23 100644 --- a/backends/wince/gapi_keys.cpp +++ b/backends/wince/gapi_keys.cpp @@ -25,9 +25,18 @@ #include "stdafx.h" #include + +#if _WIN32_WCE < 300 + +#include +#include +#include + +#endif + #include #include -#include +//#include #include #include "dynamic_imports.h" diff --git a/backends/wince/missing/missing.cpp b/backends/wince/missing/missing.cpp index 237014dfb2..742433f566 100644 --- a/backends/wince/missing/missing.cpp +++ b/backends/wince/missing/missing.cpp @@ -13,8 +13,17 @@ #include "dirent.h" /* forward declaration */ + +#if _WIN32_WCE < 300 + +#include "portdefs.h" + +#else + char *strdup(const char *strSource); +#endif + /* Limited dirent implementation. Used by UI.C and DEVICES.C */ static WIN32_FIND_DATA wfd; @@ -198,6 +207,7 @@ void mkdir(char* dirname, int mode) /* Used in DEVICES.C and UI.C for some purpose. Not critical in this port */ int system(const char* path) { return 0; } +#if 0 char *tmpnam(char *string) { @@ -224,6 +234,8 @@ FILE *tmpfile() return 0; } +#endif + void rewind(FILE *stream) { fseek(stream, 0, SEEK_SET); @@ -376,3 +388,78 @@ void *bsearch(const void *key, const void *base, size_t nmemb, return (void*)((size_t)base + size * i); return NULL; } + +#if _WIN32_WCE < 300 + +void *calloc(size_t n, size_t s) { + void *result = malloc(n * s); + if (result) + memset(result, 0, n * s); + + return result; +} + +int isdigit(int c) { + return (c >='0' && c <= '9'); +} + +void assert (int expression) { + if (!expression) + abort(); +} + +void assert (void *expression) { + if (!expression) + abort(); +} + +int stricmp( const char *string1, const char *string2 ) { + char src[4096]; + char dest[4096]; + int i; + + for (i=0; i= 'A' && string1[i] <= 'Z') + src[i] = string1[i] + 32; + else + src[i] = string1[i]; + src[i] = 0; + + for (i=0; i= 'A' && string2[i] <= 'Z') + dest[i] = string2[i] + 32; + else + dest[i] = string2[i]; + dest[i] = 0; + + return strcmp(src, dest); +} + +int _stricmp( const char *string1, const char *string2 ) { + return stricmp(string1, string2); +} + +char *strrchr(const char *s, int c) { + int i; + + for (i = strlen(s) - 1; i > 0; i++) + if (s[i] == c) + return (char*)(s + i); + + return NULL; +} + +long int strtol(const char *nptr, char **endptr, int base) { + // not correct but that's all we are using + + long int result; + + sscanf(nptr, "%ld", &result); + + return result; +} + + +#endif + + diff --git a/backends/wince/pocketpc.cpp b/backends/wince/pocketpc.cpp index 9326727ebc..c9bfd1d553 100644 --- a/backends/wince/pocketpc.cpp +++ b/backends/wince/pocketpc.cpp @@ -22,6 +22,60 @@ #include "stdafx.h" #include +//#include "commctrl.h" + +#if _WIN32_WCE < 300 + +#include +#include +#include + +#endif + +#include +#include +#include + +#if _WIN32_WCE >= 300 + +#include + +#else + +// Put in include file + +typedef enum tagSIPSTATE +{ + SIP_UP = 0, + SIP_DOWN, + SIP_FORCEDOWN, + SIP_UNCHANGED, + SIP_INPUTDIALOG, +} SIPSTATE; + +#define SHFS_SHOWTASKBAR 0x0001 +#define SHFS_HIDETASKBAR 0x0002 +#define SHFS_SHOWSIPBUTTON 0x0004 +#define SHFS_HIDESIPBUTTON 0x0008 +#define SHFS_SHOWSTARTICON 0x0010 +#define SHFS_HIDESTARTICON 0x0020 + +typedef struct +{ + DWORD cbSize; + HWND hwndLastFocus; + UINT fSipUp :1; + UINT fSipOnDeactivation :1; + UINT fActive :1; + UINT fReserved :29; +} SHACTIVATEINFO, *PSHACTIVATEINFO; + + +#endif + +#include +#include "resource.h" + #include "scumm.h" #include "debug.h" #include "screen.h" @@ -33,15 +87,6 @@ #include "config-file.h" -#include "commctrl.h" -#include -#include -#include -#include -#include -#include -#include "resource.h" - #include "SDL.h" #include "SDL_audio.h" #include "SDL_timer.h" diff --git a/backends/wince/portdefs.h b/backends/wince/portdefs.h new file mode 100644 index 0000000000..240880fc24 --- /dev/null +++ b/backends/wince/portdefs.h @@ -0,0 +1,13 @@ +#if _WIN32_WCE < 300 + +void *calloc(size_t n, size_t s); +int isdigit(int c); +char *strrchr(const char *s, int c); +char *strdup(const char *s); +int _stricmp( const char *string1, const char *string2 ); +int stricmp( const char *string1, const char *string2 ); +void assert( void* expression ); +void assert( int expression ); +long int strtol(const char *nptr, char **endptr, int base); +char *strdup( const char *s); +#endif diff --git a/backends/wince/screen.cpp b/backends/wince/screen.cpp index ec59d46fac..14ad6e4c99 100644 --- a/backends/wince/screen.cpp +++ b/backends/wince/screen.cpp @@ -24,7 +24,7 @@ /* Original GFX code by Vasyl Tsvirkunov */ #include -#include +//#include #include "gx.h" #include "screen.h" #include "resource.h" -- cgit v1.2.3