aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/sci/engine/game.cpp2
-rw-r--r--engines/sci/engine/kernel.cpp16
-rw-r--r--engines/sci/engine/kfile.cpp14
-rw-r--r--engines/sci/engine/savegame.cpp2
-rw-r--r--engines/sci/engine/scriptdebug.cpp2
-rw-r--r--engines/sci/gfx/gfx_crossblit.cpp4
-rw-r--r--engines/sci/gfx/gfx_pixmap_scale.cpp4
-rw-r--r--engines/sci/gfx/gfx_test.cpp4
-rw-r--r--engines/sci/gfx/gfx_tools.cpp2
-rw-r--r--engines/sci/gfx/resource/sci_view_0.cpp2
-rw-r--r--engines/sci/include/console.h4
-rw-r--r--engines/sci/include/resource.h15
-rw-r--r--engines/sci/include/sci_dos.h171
-rw-r--r--engines/sci/include/sci_memory.h4
-rw-r--r--engines/sci/include/sciresource.h2
-rw-r--r--engines/sci/include/scitypes.h8
-rw-r--r--engines/sci/scicore/resource.cpp2
-rw-r--r--engines/sci/scicore/resource_patch.cpp2
-rw-r--r--engines/sci/scicore/tools.cpp8
-rw-r--r--engines/sci/sfx/device/devices.cpp4
-rw-r--r--engines/sci/sfx/mixer/mixers.cpp4
-rw-r--r--engines/sci/sfx/pcm_device/pcm_devices.cpp4
-rw-r--r--engines/sci/sfx/seq/mt32.cpp4
-rw-r--r--engines/sci/sfx/softseq/opl2.cpp2
-rw-r--r--engines/sci/sfx/timer/timers.cpp4
-rw-r--r--engines/sci/tools/sciunpack.cpp6
26 files changed, 59 insertions, 237 deletions
diff --git a/engines/sci/engine/game.cpp b/engines/sci/engine/game.cpp
index cf33473907..6558529b34 100644
--- a/engines/sci/engine/game.cpp
+++ b/engines/sci/engine/game.cpp
@@ -593,11 +593,9 @@ script_free_vm_memory(state_t *s)
s->classtable = NULL;
/* Close all opened file handles */
-#ifndef _DOS
for (i = 1; i < s->file_handles_nr; i++)
if (s->file_handles[i])
fclose(s->file_handles[i]);
-#endif
sci_free(s->file_handles);
s->file_handles = NULL;
diff --git a/engines/sci/engine/kernel.cpp b/engines/sci/engine/kernel.cpp
index 3737cd4cad..538bdcd60c 100644
--- a/engines/sci/engine/kernel.cpp
+++ b/engines/sci/engine/kernel.cpp
@@ -28,7 +28,7 @@
#include "sci/engine/gc.h"
#include "sci/include/sciresource.h"
#include "sci/include/engine.h"
-#ifdef _WIN32
+#ifdef WIN32
# include <windows.h>
# include <mmsystem.h>
#endif
@@ -90,7 +90,7 @@ reg_t kGlobalToLocal(struct _state *s, int funct_nr, int argc, reg_t *argv);
reg_t kLocalToGlobal(struct _state *s, int funct_nr, int argc, reg_t *argv);
reg_t kWait(struct _state *s, int funct_nr, int argc, reg_t *argv);
reg_t kRestartGame(struct _state *s, int funct_nr, int argc, reg_t *argv);
-#ifdef _WIN32
+#ifdef WIN32
reg_t kDeviceInfo_Win32(struct _state *s, int funct_nr, int argc, reg_t *argv);
#else
reg_t kDeviceInfo_Unix(struct _state *s, int funct_nr, int argc, reg_t *argv);
@@ -300,9 +300,9 @@ sci_kernel_function_t kfunct_mappers[] = {
/*64*/ DEFUN("ValidPath", kValidPath, "r"),
/*65*/ DEFUN("CoordPri", kCoordPri, "i"),
/*66*/ DEFUN("StrAt", kStrAt, "rii*"),
-#ifdef _WIN32
+#ifdef WIN32
/*67*/ DEFUN("DeviceInfo", kDeviceInfo_Win32, "i.*"),
-#else /* !_WIN32 */
+#else /* !WIN32 */
/*67*/ DEFUN("DeviceInfo", kDeviceInfo_Unix, "i.*"),
#endif
/*68*/ DEFUN("GetSaveDir", kGetSaveDir, ""),
@@ -547,22 +547,22 @@ kGetTime(state_t *s, int funct_nr, int argc, reg_t *argv)
| KERNEL_OPT_FLAG_GOT_2NDEVENT);
#endif
-#ifdef _WIN32
+#ifdef WIN32
if (TIMERR_NOERROR != timeBeginPeriod(1))
{
fprintf(stderr, "timeBeginPeriod(1) failed in kGetTime!\n");
}
-#endif /* _WIN32 */
+#endif /* WIN32 */
the_time = time(NULL);
loc_time = localtime(&the_time);
-#ifdef _WIN32
+#ifdef WIN32
if (TIMERR_NOERROR != timeEndPeriod(1))
{
fprintf(stderr, "timeEndPeriod(1) failed in kGetTime!\n");
}
-#endif /* _WIN32 */
+#endif /* WIN32 */
if (s->version<SCI_VERSION_FTU_NEW_GETTIME) { /* Use old semantics */
if (argc) { /* Get seconds since last am/pm switch */
diff --git a/engines/sci/engine/kfile.cpp b/engines/sci/engine/kfile.cpp
index b7b2ae92fa..9c4235852f 100644
--- a/engines/sci/engine/kfile.cpp
+++ b/engines/sci/engine/kfile.cpp
@@ -30,12 +30,12 @@
#include "sci/include/engine.h"
-#ifdef _WIN32
+#ifdef WIN32
# define WIN32_LEAN_AND_MEAN
# include <windows.h>
# include <sys/types.h>
# include <sys/stat.h>
-#elif defined (_DREAMCAST)
+#elif defined (__DC__)
# include <dc.h>
#endif
@@ -405,7 +405,7 @@ delete_savegame(state_t *s, int savedir_nr)
#define K_DEVICE_INFO_GET_SAVECAT_NAME 7
#define K_DEVICE_INFO_GET_SAVEFILE_NAME 8
-#ifdef _WIN32
+#ifdef WIN32
reg_t
kDeviceInfo_Win32(state_t *s, int funct_nr, int argc, reg_t *argv)
@@ -487,7 +487,7 @@ kDeviceInfo_Win32(state_t *s, int funct_nr, int argc, reg_t *argv)
return s->r_acc;
}
-#else /* !_WIN32 */
+#else /* !WIN32 */
reg_t
kDeviceInfo_Unix(state_t *s, int funct_nr, int argc, reg_t *argv)
@@ -553,7 +553,7 @@ kDeviceInfo_Unix(state_t *s, int funct_nr, int argc, reg_t *argv)
return s->r_acc;
}
-#endif /* !_WIN32 */
+#endif /* !WIN32 */
reg_t
@@ -662,7 +662,7 @@ _k_find_savegame_by_name(char *game_id_file, char *name)
return 0;
}
-#ifdef _DREAMCAST
+#ifdef __DC__
static long
get_file_mtime(int fd)
{
@@ -1140,7 +1140,7 @@ kFileIO(state_t *s, int funct_nr, int argc, reg_t *argv)
reg_t buf = argv[2];
/* int attr = UKPV(3); */ /* We won't use this, Win32 might, though... */
-#ifndef _WIN32
+#ifndef WIN32
if (strcmp(mask, "*.*")==0) strcpy(mask, "*"); /* For UNIX */
#endif
first_file(s, ".", mask, buf);
diff --git a/engines/sci/engine/savegame.cpp b/engines/sci/engine/savegame.cpp
index 06dfb87329..4abda55847 100644
--- a/engines/sci/engine/savegame.cpp
+++ b/engines/sci/engine/savegame.cpp
@@ -41,7 +41,7 @@
#include <direct.h>
#endif
-#ifdef _WIN32
+#ifdef WIN32
#pragma warning( disable : 4101 )
#endif
diff --git a/engines/sci/engine/scriptdebug.cpp b/engines/sci/engine/scriptdebug.cpp
index 76cc9d1302..d5e8c9778f 100644
--- a/engines/sci/engine/scriptdebug.cpp
+++ b/engines/sci/engine/scriptdebug.cpp
@@ -36,7 +36,7 @@
#include "sci/include/sci_widgets.h"
#include "sci/include/reg_t_hashmap.h"
-#ifdef _WIN32
+#ifdef WIN32
# include <windows.h>
# include <mmsystem.h>
# include <io.h>
diff --git a/engines/sci/gfx/gfx_crossblit.cpp b/engines/sci/gfx/gfx_crossblit.cpp
index 89be4b911a..03ddb7642d 100644
--- a/engines/sci/gfx/gfx_crossblit.cpp
+++ b/engines/sci/gfx/gfx_crossblit.cpp
@@ -42,7 +42,7 @@
/* t on: use fast code */
/* y on: suppress creation of frame pointers on stack */
/* s off: disable minimize size code */
-#ifdef _WIN32
+#ifdef WIN32
# include <memory.h>
# ifndef SATISFY_PURIFY
# pragma optimize( "s", off )
@@ -104,6 +104,6 @@ static void FUNCTION_NAME(byte *dest, byte *src, int bytes_per_dest_line, int by
/* reset to original optimisations for Win32: */
/* (does not reset intrinsics) */
-#ifdef _WIN32
+#ifdef WIN32
# pragma optimize( "", on )
#endif
diff --git a/engines/sci/gfx/gfx_pixmap_scale.cpp b/engines/sci/gfx/gfx_pixmap_scale.cpp
index 0edd0365c8..006eef09b0 100644
--- a/engines/sci/gfx/gfx_pixmap_scale.cpp
+++ b/engines/sci/gfx/gfx_pixmap_scale.cpp
@@ -9,7 +9,7 @@
/* t on: use fast code */
/* y on: suppress creation of frame pointers on stack */
/* s off: disable minimize size code */
-#ifdef _WIN32
+#ifdef WIN32
# include <memory.h>
# ifndef SATISFY_PURIFY
# pragma optimize( "s", off )
@@ -492,6 +492,6 @@ FUNCNAME_TRILINEAR(gfx_mode_t *mode, gfx_pixmap_t *pxm, int scale)
/* reset to original optimisations for Win32: */
/* (does not reset intrinsics) */
-#ifdef _WIN32
+#ifdef WIN32
# pragma optimize( "", on )
#endif
diff --git a/engines/sci/gfx/gfx_test.cpp b/engines/sci/gfx/gfx_test.cpp
index 0170364b8d..56502384bf 100644
--- a/engines/sci/gfx/gfx_test.cpp
+++ b/engines/sci/gfx/gfx_test.cpp
@@ -84,7 +84,7 @@ sci_gettime(long *seconds, long *useconds)
{
struct timeval tv;
-#ifdef _WIN32
+#ifdef WIN32
timeBeginPeriod(0);
#endif
@@ -92,7 +92,7 @@ sci_gettime(long *seconds, long *useconds)
*seconds = time(NULL);
*useconds = tv.tv_usec;
-#ifdef _WIN32
+#ifdef WIN32
timeEndPeriod(0);
#endif
}
diff --git a/engines/sci/gfx/gfx_tools.cpp b/engines/sci/gfx/gfx_tools.cpp
index b768475f3f..4a8fdd58f7 100644
--- a/engines/sci/gfx/gfx_tools.cpp
+++ b/engines/sci/gfx/gfx_tools.cpp
@@ -29,7 +29,7 @@
#include "sci/include/gfx_tools.h"
/* set optimisations for Win32: */
-#ifdef _WIN32
+#ifdef WIN32
# include <memory.h>
# ifndef SATISFY_PURIFY
# pragma intrinsic( memcpy, memset )
diff --git a/engines/sci/gfx/resource/sci_view_0.cpp b/engines/sci/gfx/resource/sci_view_0.cpp
index 0101cac5f7..bea6377285 100644
--- a/engines/sci/gfx/resource/sci_view_0.cpp
+++ b/engines/sci/gfx/resource/sci_view_0.cpp
@@ -26,7 +26,7 @@
***************************************************************************/
/* set optimisations for Win32: */
-#ifdef _WIN32
+#ifdef WIN32
# include <memory.h>
//# pragma intrinsic( memcpy, memset )
#endif
diff --git a/engines/sci/include/console.h b/engines/sci/include/console.h
index 306582840d..a6858ae929 100644
--- a/engines/sci/include/console.h
+++ b/engines/sci/include/console.h
@@ -41,10 +41,6 @@
#include <config.h>
#endif /* HAVE_CONFIG_H */
-#ifdef _DOS
-#include <sci_dos.h>
-#endif
-
#define SCI_CONSOLE
#include "sci/include/gfx_operations.h"
diff --git a/engines/sci/include/resource.h b/engines/sci/include/resource.h
index 26a8318b76..88df611e59 100644
--- a/engines/sci/include/resource.h
+++ b/engines/sci/include/resource.h
@@ -44,7 +44,7 @@
#define SCI_INVALID_FD -1
#define IS_VALID_FD(a) ((a) != SCI_INVALID_FD) /* Tests validity of a file descriptor */
-#ifdef _WIN32
+#ifdef WIN32
# ifndef _Win32
# define _Win32
/* Work around problem with some versions of flex */
@@ -123,14 +123,12 @@
# include <sys/stat.h>
#endif
#include <assert.h>
-#ifdef _DOS
-# include <sci_dos.h>
-#endif
#ifdef HAVE_LIMITS_H
# include <limits.h>
#endif
-#if _MSC_VER || _DOS
+// FIXME: Get rid of G_DIR_SEPARATOR / G_DIR_SEPARATOR_S
+#if _MSC_VER
# define G_DIR_SEPARATOR_S "\\"
# define G_DIR_SEPARATOR '\\'
#else
@@ -138,6 +136,7 @@
# define G_DIR_SEPARATOR '/'
#endif
+// FIXME: Get rid of MIN / MAX, use common/util.h instead
#ifndef MIN
# define MIN(a, b) (((a) < (b)) ? (a) : (b))
#endif
@@ -161,13 +160,13 @@
#define MAX_HOMEDIR_SIZE 255
-#ifdef _WIN32
+#ifdef WIN32
# define FO_BINARY "b"
#else
# define FO_BINARY ""
#endif
-#ifdef _WIN32
+#ifdef WIN32
# define FO_TEXT "t"
#else
# define FO_TEXT ""
@@ -179,7 +178,7 @@
/**** FUNCTION DECLARATIONS ****/
-#ifdef _WIN32
+#ifdef WIN32
# define scimkdir(arg1,arg2) mkdir(arg1)
#else
# define scimkdir(arg1,arg2) mkdir(arg1,arg2)
diff --git a/engines/sci/include/sci_dos.h b/engines/sci/include/sci_dos.h
deleted file mode 100644
index 97e56f712d..0000000000
--- a/engines/sci/include/sci_dos.h
+++ /dev/null
@@ -1,171 +0,0 @@
-/***************************************************************************
- sci_dos.h Copyright (C) 1999 Rink Springer
-
-
- This program may be modified and copied freely according to the terms of
- the GNU general public license (GPL), as long as the above copyright
- notice and the licensing information contained herein are preserved.
-
- Please refer to www.gnu.org for licensing details.
-
- This work is provided AS IS, without warranty of any kind, expressed or
- implied, including but not limited to the warranties of merchantibility,
- noninfringement, and fitness for a specific purpose. The author will not
- be held liable for any damage caused by this work or derivatives of it.
-
- By using this source code, you agree to the licensing terms as stated
- above.
-
-
- Please contact the maintainer for bug reports or inquiries.
-
- Current Maintainer:
-
- Rink Springer [rink@springer.cx]
-
-***************************************************************************/
-
-#ifndef _SCI_DOS_H_
-#define _SCI_DOS_H_
-
-#include <stdarg.h>
-
-#ifndef HAVE_DIRENT_H
-#define HAVE_DIRENT_H
-#endif
-
-#define TRUE (!FALSE)
-#define FALSE (0)
-
-typedef signed char gint8;
-typedef signed short gint16;
-typedef signed long gint32;
-
-typedef unsigned char guint8;
-typedef unsigned short guint16;
-typedef unsigned long guint32;
-
-typedef char gchar;
-typedef unsigned char guchar;
-typedef int gint;
-typedef unsigned int guint;
-typedef long glong;
-typedef unsigned long gulong;
-
-typedef gint gboolean;
-
-typedef void* gpointer;
-
-#define g_new0(type, count) ((type*)g_malloc0((unsigned)sizeof(type) * (count)))
-#define g_new(type, count) ((type*)sci_malloc((unsigned)sizeof(type) * (count)))
-
-#define g_malloc(x) sci_malloc(x)
-#define g_free(x) sci_free(x)
-#define g_realloc(x,y) sci_realloc(x,y)
-
-extern gpointer g_malloc0(guint32 size);
-
-/* Name of package */
-#define PACKAGE "freesci"
-
-/* Version number of package */
-#define VERSION "0.3.0"
-
-/* directory separator */
-#define G_DIR_SEPARATOR_S "/"
-
-#define SSIZE_MAX 1024
-
-#define g_get_current_time(x) gettimeofday(x,NULL)
-
-#define g_strcasecmp(x,y) strcasecmp(x,y)
-#define g_strncasecmp(x,y,z) strncasecmp(x,y,z)
-
-extern gint g_vsnprintf(gchar*,gulong,gchar const*,va_list);
-extern gpointer g_memdup (gpointer mem, guint byte_size);
-
-#define DGFX_KEYUP 72
-#define DGFX_KEYDOWN 80
-#define DGFX_KEYLEFT 75
-#define DGFX_KEYRIGHT 77
-#define DGFX_KEYSTOP 76 /* numberic 5 */
-
-#define DGFX_KEY_ESCAPE 1 /* escape */
-#define DGFX_KEY_1 2 /* 1 */
-#define DGFX_KEY_2 3 /* 2 */
-#define DGFX_KEY_3 4 /* 3 */
-#define DGFX_KEY_4 5 /* 4 */
-#define DGFX_KEY_5 6 /* 5 */
-#define DGFX_KEY_6 7 /* 6 */
-#define DGFX_KEY_7 8 /* 7 */
-#define DGFX_KEY_8 9 /* 8 */
-#define DGFX_KEY_9 10 /* 9 */
-#define DGFX_KEY_0 11 /* 0 */
-#define DGFX_KEY_MINUS 12 /* -/_ */
-#define DGFX_KEY_EQUAL 13 /* =/+ */
-#define DGFX_KEY_BSPACE 14 /* backspace */
-#define DGFX_KEY_TAB 15 /* enter */
-#define DGFX_KEY_Q 16 /* q */
-#define DGFX_KEY_W 17 /* w */
-#define DGFX_KEY_E 18 /* e */
-#define DGFX_KEY_R 19 /* r */
-#define DGFX_KEY_T 20 /* t */
-#define DGFX_KEY_Y 21 /* y */
-#define DGFX_KEY_U 22 /* u */
-#define DGFX_KEY_I 23 /* i */
-#define DGFX_KEY_O 24 /* o */
-#define DGFX_KEY_P 25 /* p */
-#define DGFX_KEY_LBRACKET 26 /* [/{ */
-#define DGFX_KEY_RBRACKET 27 /* ]/} */
-#define DGFX_KEY_ENTER 28 /* enter */
-#define DGFX_KEY_CTRL 29 /* control */
-#define DGFX_KEY_A 30 /* a */
-#define DGFX_KEY_S 31 /* s */
-#define DGFX_KEY_D 32 /* d */
-#define DGFX_KEY_F 33 /* f */
-#define DGFX_KEY_G 34 /* g */
-#define DGFX_KEY_H 35 /* h */
-#define DGFX_KEY_J 36 /* j */
-#define DGFX_KEY_K 37 /* k */
-#define DGFX_KEY_L 38 /* l */
-#define DGFX_KEY_COLON 39 /* ;/: */
-#define DGFX_KEY_TILDE 41 /* tilde */
-#define DGFX_KEY_LSHIFT 42 /* left shift */
-#define DGFX_KEY_Z 44 /* z */
-#define DGFX_KEY_X 45 /* x */
-#define DGFX_KEY_C 46 /* c */
-#define DGFX_KEY_V 47 /* v */
-#define DGFX_KEY_B 48 /* b */
-#define DGFX_KEY_N 49 /* n */
-#define DGFX_KEY_M 50 /* m */
-#define DGFX_KEY_COMMA 51 /* ,/< */
-#define DGFX_KEY_DOT 52 /* ./> */
-#define DGFX_KEY_SLASH 53 /* / / ? */
-#define DGFX_KEY_RSHIFT 54 /* right shift */
-#define DGFX_KEY_ALT 56 /* alt key */
-#define DGFX_KEY_SPACE 57 /* space bar */
-#define DGFX_KEY_F1 59 /* f1 */
-#define DGFX_KEY_F2 60 /* f2 */
-#define DGFX_KEY_F3 61 /* f3 */
-#define DGFX_KEY_F4 62 /* f4 */
-#define DGFX_KEY_F5 63 /* f5 */
-#define DGFX_KEY_F6 64 /* f6 */
-#define DGFX_KEY_F7 65 /* f7 */
-#define DGFX_KEY_F8 66 /* f8 */
-#define DGFX_KEY_F9 67 /* f9 */
-#define DGFX_KEY_F10 68 /* f10 */
-
-#define DGFX_KEY_HOME 71 /* home */
-#define DGFX_KEY_PAGEUP 73 /* page up */
-#define DGFX_KEY_END 79 /* end */
-#define DGFX_KEY_PAGEDOWN 81 /* page down */
-#define DGFX_KEY_INSERT 82 /* insert */
-#define DGFX_KEY_DELETE 83 /* delete */
-
-#define DGFX_KEY_KPSUB 74 /* keypad - */
-#define DGFX_KEY_KPADD 78 /* keypad + */
-
-#define DGFX_KEY_F11 87 /* f11 */
-#define DGFX_KEY_F12 88 /* f12 (emergency exit) */
-
-#endif /* _SCI_DOS_H_ */
diff --git a/engines/sci/include/sci_memory.h b/engines/sci/include/sci_memory.h
index 37ecea5b58..138466d4a3 100644
--- a/engines/sci/include/sci_memory.h
+++ b/engines/sci/include/sci_memory.h
@@ -71,7 +71,7 @@
#include "common/scummsys.h"
#include "sci/include/resource.h"
-#ifdef _WIN32
+#ifdef WIN32
# undef scim_inline /* just to be sure it is not defined */
# define scim_inline __inline
#elif defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199900L
@@ -371,7 +371,7 @@ sci_refcount_memdup(void *data, size_t len);
/********** other memory/debug related routines **********/
-#ifdef _WIN32
+#ifdef WIN32
extern void
debug_win32_memory(int dbg_setting);
/* Sets debugging for Win32 memory.
diff --git a/engines/sci/include/sciresource.h b/engines/sci/include/sciresource.h
index c2d70f594f..ead97fe647 100644
--- a/engines/sci/include/sciresource.h
+++ b/engines/sci/include/sciresource.h
@@ -41,7 +41,7 @@
#define SCI_MAX_RESOURCE_SIZE 0x0400000
/* The maximum allowed size for a compressed or decompressed resource */
-#ifdef _WIN32
+#ifdef WIN32
# define DIR_SEPARATOR_STR "\\"
# define PATH_SEPARATOR_STR ";"
#else
diff --git a/engines/sci/include/scitypes.h b/engines/sci/include/scitypes.h
index 3de058e4bf..73968572ad 100644
--- a/engines/sci/include/scitypes.h
+++ b/engines/sci/include/scitypes.h
@@ -62,15 +62,15 @@ typedef uint32 guint32;
# include <sys/types.h>
# include <dirent.h>
#endif
-#ifdef _WIN32
+#ifdef WIN32
# include <io.h>
# include <sci_win32.h>
#endif
-#ifdef _DREAMCAST
+#ifdef __DC__
# include <stdio.h>
#endif
-#if defined(_WIN32) && defined(_MSC_VER)
+#if defined(WIN32) && defined(_MSC_VER)
# define TYPE_16 short
# define TYPE_32 int
#endif
@@ -124,7 +124,7 @@ typedef struct {
} GTimeVal;
typedef struct {
-#ifdef _WIN32
+#ifdef WIN32
long search;
struct _finddata_t fileinfo;
#else
diff --git a/engines/sci/scicore/resource.cpp b/engines/sci/scicore/resource.cpp
index 5d9dff5091..ea02a7e693 100644
--- a/engines/sci/scicore/resource.cpp
+++ b/engines/sci/scicore/resource.cpp
@@ -36,7 +36,7 @@
#include <ctype.h>
-#ifdef _WIN32
+#ifdef WIN32
#include <direct.h>
#endif
diff --git a/engines/sci/scicore/resource_patch.cpp b/engines/sci/scicore/resource_patch.cpp
index 037b082476..6702bd5d0d 100644
--- a/engines/sci/scicore/resource_patch.cpp
+++ b/engines/sci/scicore/resource_patch.cpp
@@ -29,7 +29,7 @@
#include "sci/include/sciresource.h"
#include "sci/include/sci_memory.h"
-#ifdef _WIN32
+#ifdef WIN32
#include <direct.h>
#endif
diff --git a/engines/sci/scicore/tools.cpp b/engines/sci/scicore/tools.cpp
index 01f8de1225..1ffea5a69a 100644
--- a/engines/sci/scicore/tools.cpp
+++ b/engines/sci/scicore/tools.cpp
@@ -71,7 +71,7 @@ void usleep (long usec);
} while (0);
#endif
-#ifdef _DREAMCAST
+#ifdef __DC__
# include <kos/thread.h>
#endif
@@ -512,7 +512,7 @@ sci_get_homedir(void)
return _path_buf;
#elif defined(__unix__) || !defined(X_DISPLAY_MISSING) || defined (__BEOS__) || defined(MACOSX)
return getenv("HOME");
-#elif defined(_DREAMCAST)
+#elif defined(__DC__)
return NULL;
#elif defined(__amigaos4__)
return "/PROGDIR/";
@@ -581,7 +581,7 @@ sci_sched_yield(void)
sched_yield();
}
-#elif defined (_DREAMCAST)
+#elif defined (__DC__)
void
sci_sched_yield()
@@ -736,7 +736,7 @@ sci_getcwd(void)
return NULL;
}
-#ifdef _DREAMCAST
+#ifdef __DC__
int
sci_fd_size(int fd)
diff --git a/engines/sci/sfx/device/devices.cpp b/engines/sci/sfx/device/devices.cpp
index 2e54b1df4f..f51c928d7e 100644
--- a/engines/sci/sfx/device/devices.cpp
+++ b/engines/sci/sfx/device/devices.cpp
@@ -35,7 +35,7 @@
#ifdef HAVE_ALSA
extern struct _midi_device sfx_device_midi_alsa;
#endif
-#if !defined(_DOS) && !defined(_WIN32) && !defined(_DREAMCAST) && !defined(__MORPHOS__) && !defined(ARM_WINCE) && !defined(_GP32)
+#if !defined(WIN32) && !defined(__DC__) && !defined(__MORPHOS__) && !defined(ARM_WINCE) && !defined(_GP32)
extern struct _midi_device sfx_device_midi_unixraw;
#endif
@@ -54,7 +54,7 @@ static struct _midi_device *devices_midi[] = {
#ifdef HAVE_ALSA
&sfx_device_midi_alsa,
#endif
-#if !defined(_DOS) && !defined(_WIN32) && !defined(_DREAMCAST) && !defined(__MORPHOS__) && !defined(ARM_WINCE) && !defined(_GP32)
+#ifdef UNIX
&sfx_device_midi_unixraw,
#endif
#endif // SCUMMVM
diff --git a/engines/sci/sfx/mixer/mixers.cpp b/engines/sci/sfx/mixer/mixers.cpp
index 997525f173..c0af0e3a53 100644
--- a/engines/sci/sfx/mixer/mixers.cpp
+++ b/engines/sci/sfx/mixer/mixers.cpp
@@ -30,12 +30,12 @@
extern sfx_pcm_mixer_t sfx_pcm_mixer_soft_linear;
-#ifdef _DREAMCAST
+#ifdef __DC__
extern sfx_pcm_mixer_t sfx_pcm_mixer_dc;
#endif
static sfx_pcm_mixer_t *mixers[] = {
-#ifdef _DREAMCAST
+#ifdef __DC__
&sfx_pcm_mixer_dc,
#endif
&sfx_pcm_mixer_soft_linear,
diff --git a/engines/sci/sfx/pcm_device/pcm_devices.cpp b/engines/sci/sfx/pcm_device/pcm_devices.cpp
index a29de8896f..09e20bb07b 100644
--- a/engines/sci/sfx/pcm_device/pcm_devices.cpp
+++ b/engines/sci/sfx/pcm_device/pcm_devices.cpp
@@ -30,7 +30,7 @@ extern sfx_pcm_device_t sfx_pcm_driver_sdl;
# ifdef HAVE_ALSA
extern sfx_pcm_device_t sfx_pcm_driver_alsa;
# endif
-# ifdef _DREAMCAST
+# ifdef __DC__
extern sfx_pcm_device_t sfx_pcm_driver_dc;
# endif
#endif // SCUMMVM
@@ -47,7 +47,7 @@ sfx_pcm_device_t *pcmout_drivers[] = {
# ifdef HAVE_ALSA
&sfx_pcm_driver_alsa,
# endif
-# ifdef _DREAMCAST
+# ifdef __DC__
&sfx_pcm_driver_dc,
# endif
#endif // SCUMMVM
diff --git a/engines/sci/sfx/seq/mt32.cpp b/engines/sci/sfx/seq/mt32.cpp
index b71d474927..de478cf4f6 100644
--- a/engines/sci/sfx/seq/mt32.cpp
+++ b/engines/sci/sfx/seq/mt32.cpp
@@ -26,7 +26,7 @@
#include "instrument-map.h"
#include <resource.h>
-#ifdef _WIN32
+#ifdef WIN32
# include <win32/sci_win32.h>
# include <windows.h>
#endif
@@ -381,7 +381,7 @@ midi_mt32_sysex_delay(void)
/* Under Win32, we won't get any sound, in any case... */
#ifdef HAVE_USLEEP
usleep(320 * 63); /* One MIDI byte is 320us, 320us * 63 > 20ms */
-#elif defined (_WIN32)
+#elif defined (WIN32)
Sleep(((320 * 63) / 1000) + 1);
#elif defined (__BEOS__)
snooze(320 * 63);
diff --git a/engines/sci/sfx/softseq/opl2.cpp b/engines/sci/sfx/softseq/opl2.cpp
index f6e60215b0..80b6adf162 100644
--- a/engines/sci/sfx/softseq/opl2.cpp
+++ b/engines/sci/sfx/softseq/opl2.cpp
@@ -25,7 +25,7 @@
#include "fmopl.h"
-#ifdef _DREAMCAST
+#ifdef __DC__
#define SAMPLE_RATE 22050
#define CHANNELS SFX_PCM_MONO
#define STEREO 0
diff --git a/engines/sci/sfx/timer/timers.cpp b/engines/sci/sfx/timer/timers.cpp
index 353ae11ca7..71e6e75c96 100644
--- a/engines/sci/sfx/timer/timers.cpp
+++ b/engines/sci/sfx/timer/timers.cpp
@@ -36,7 +36,7 @@ extern sfx_timer_t sfx_timer_scummvm;
extern sfx_timer_t sfx_timer_sigalrm;
#endif
-#ifdef _DREAMCAST
+#ifdef __DC__
extern sfx_timer_t sfx_timer_pthread;
#endif
#endif // SCUMMVM
@@ -48,7 +48,7 @@ sfx_timer_t *sfx_timers[] = {
#ifdef HAVE_SETITIMER
&sfx_timer_sigalrm,
#endif
-#ifdef _DREAMCAST
+#ifdef __DC__
&sfx_timer_pthread,
#endif
#endif // SCUMMVM
diff --git a/engines/sci/tools/sciunpack.cpp b/engines/sci/tools/sciunpack.cpp
index e5b3b39a2e..21b7a39050 100644
--- a/engines/sci/tools/sciunpack.cpp
+++ b/engines/sci/tools/sciunpack.cpp
@@ -49,7 +49,7 @@
#endif
#ifdef HAVE_GETOPT_H
-# ifndef _WIN32
+# ifndef WIN32
# include <getopt.h>
# else
# include <win32/getopt.h>
@@ -62,7 +62,7 @@
# endif /* HAVE_LIBPNG */
#endif /* DRAW_GRAPHICS */
-#if defined (_MSC_VER) || defined (__BEOS__) || defined(_DOS) || defined(__amigaos4__)
+#if defined (_MSC_VER) || defined (__BEOS__) || defined(__amigaos4__)
/* [DJ] fchmod is not in Visual C++ RTL - and probably not needed,anyway */
/* [RS] (see comment above, but read MS-DOS instead of Visual C++ RTL) */
# define fchmod(file,mode)
@@ -92,7 +92,7 @@ static guint8 midimask = 0x01; /* MT-32 */
resource_mgr_t *resmgr;
-#ifdef _WIN32
+#ifdef WIN32
#define fchmod(arg1, arg2)
#endif