diff options
Diffstat (limited to 'engines')
-rw-r--r-- | engines/sci/engine/kfile.cpp | 11 | ||||
-rw-r--r-- | engines/sci/engine/scriptconsole.cpp | 1 | ||||
-rw-r--r-- | engines/sci/module.mk | 3 | ||||
-rw-r--r-- | engines/sci/sci.cpp | 2 | ||||
-rw-r--r-- | engines/sci/scicore/resource.cpp | 4 | ||||
-rw-r--r-- | engines/sci/scicore/resource_map.cpp | 5 | ||||
-rw-r--r-- | engines/sci/sfx/device/devices.cpp | 7 | ||||
-rw-r--r-- | engines/sci/sfx/iterator.cpp | 7 | ||||
-rw-r--r-- | engines/sci/sfx/seq/oss-adlib.cpp | 5 | ||||
-rw-r--r-- | engines/sci/tools.cpp | 7 | ||||
-rw-r--r-- | engines/sci/tools.h | 29 |
11 files changed, 30 insertions, 51 deletions
diff --git a/engines/sci/engine/kfile.cpp b/engines/sci/engine/kfile.cpp index e6cd961d80..16daa38f84 100644 --- a/engines/sci/engine/kfile.cpp +++ b/engines/sci/engine/kfile.cpp @@ -38,12 +38,23 @@ #include <errno.h> #include <sys/stat.h> // for S_IREAD/S_IWRITE +// FIXME: Get rid of the following (needed for O_RDONLY etc.) +#include <fcntl.h> + + namespace Sci { #ifndef O_BINARY #define O_BINARY 0 #endif +#ifdef WIN32 +# define FO_BINARY "b" +#else +# define FO_BINARY "" +#endif + + static int _savegame_indices_nr = -1; // means 'uninitialized' static struct _savegame_index_struct { diff --git a/engines/sci/engine/scriptconsole.cpp b/engines/sci/engine/scriptconsole.cpp index f710619457..65cf110f61 100644 --- a/engines/sci/engine/scriptconsole.cpp +++ b/engines/sci/engine/scriptconsole.cpp @@ -696,7 +696,6 @@ static int c_version(EngineState * s) { return -1; } - sciprintf("FreeSCI, version " VERSION "\n"); sciprintf("Resource file version: %s\n", sci_version_types[s->resmgr->sci_version]); sciprintf("Emulated interpreter version: %d.%03d.%03d\n", SCI_VERSION_MAJOR(s->version), SCI_VERSION_MINOR(s->version), SCI_VERSION_PATCHLEVEL(s->version)); diff --git a/engines/sci/module.mk b/engines/sci/module.mk index 6e6c73716f..00dfdbb0cf 100644 --- a/engines/sci/module.mk +++ b/engines/sci/module.mk @@ -79,6 +79,9 @@ MODULE_OBJS = \ sfx/player/players.o \ sfx/player/polled.o \ sfx/player/realtime.o \ + sfx/seq/gm.o \ + sfx/seq/instrument-map.o \ + sfx/seq/map-mt32-to-gm.o \ sfx/seq/sequencers.o \ sfx/softseq/amiga.o \ sfx/softseq/opl2.o \ diff --git a/engines/sci/sci.cpp b/engines/sci/sci.cpp index 17a9f5114a..fc262334c1 100644 --- a/engines/sci/sci.cpp +++ b/engines/sci/sci.cpp @@ -229,8 +229,6 @@ Common::Error SciEngine::go() { map_MIDI_instruments(resmgr); #endif - sciprintf("Imported FreeSCI, version "VERSION"\n"); - EngineState* gamestate = (EngineState *) sci_malloc(sizeof(EngineState)); memset(gamestate, 0, sizeof(EngineState)); gamestate->resmgr = resmgr; diff --git a/engines/sci/scicore/resource.cpp b/engines/sci/scicore/resource.cpp index d12d261c01..5f2e2ce277 100644 --- a/engines/sci/scicore/resource.cpp +++ b/engines/sci/scicore/resource.cpp @@ -396,7 +396,7 @@ static int _scir_scan_new_sources(ResourceManager *mgr, int *detected_version, R return NULL; } if (resource_error == SCI_ERROR_RESMAP_NOT_FOUND) { - // fixme: Try reading w/o resource.map + // FIXME: Try reading w/o resource.map resource_error = SCI_ERROR_NO_RESOURCE_FILES_FOUND; } @@ -414,7 +414,7 @@ static int _scir_scan_new_sources(ResourceManager *mgr, int *detected_version, R resource_error = sci1_read_resource_map(mgr, source, scir_get_volume(mgr, source, 0), &mgr->_resources, &mgr->_resourcesNr, detected_version); if (resource_error == SCI_ERROR_RESMAP_NOT_FOUND) { - // fixme: Try reading w/o resource.map + // FIXME: Try reading w/o resource.map resource_error = SCI_ERROR_NO_RESOURCE_FILES_FOUND; } diff --git a/engines/sci/scicore/resource_map.cpp b/engines/sci/scicore/resource_map.cpp index c30525584a..93129f193d 100644 --- a/engines/sci/scicore/resource_map.cpp +++ b/engines/sci/scicore/resource_map.cpp @@ -106,10 +106,7 @@ static int detect_odd_sci01(Common::File &file) { if (read_ok) { sprintf(filename, "resource.%03i", SCI0_RESFILE_GET_FILE(buf + 2)); - Common::File temp; - - // FIXME: Maybe better to use File::exists here? - if (!temp.open(filename)) { + if (!Common::File::exists(filename)) { files_ok = 0; break; } diff --git a/engines/sci/sfx/device/devices.cpp b/engines/sci/sfx/device/devices.cpp index c15c6e03a2..a2d2cd58b3 100644 --- a/engines/sci/sfx/device/devices.cpp +++ b/engines/sci/sfx/device/devices.cpp @@ -23,11 +23,8 @@ * */ -#ifdef HAVE_CONFIG_H -# include <config.h> -#endif -#include "../device.h" -#include <stdio.h> +#include "common/scummsys.h" +#include "sci/sfx/device.h" #include "sci/tools.h" diff --git a/engines/sci/sfx/iterator.cpp b/engines/sci/sfx/iterator.cpp index 7e04883ffc..baa6572658 100644 --- a/engines/sci/sfx/iterator.cpp +++ b/engines/sci/sfx/iterator.cpp @@ -48,9 +48,7 @@ void print_tabs_id(int nr, songit_id_t id) { fprintf(stderr, "[%08lx] ", id); } -#ifndef HAVE_MEMCHR -static void * -memchr(void *_data, int c, int n) { +static unsigned char *sci_memchr(void *_data, int c, int n) { unsigned char *data = (unsigned char *) _data; while (n && !(*data == c)) { @@ -63,7 +61,6 @@ memchr(void *_data, int c, int n) { else return NULL; } -#endif static void _common_init(base_song_iterator_t *self) { self->fade.action = FADE_ACTION_NONE; @@ -491,7 +488,7 @@ static int _sci0_get_pcm_data(sci0_song_iterator_t *self, while ((tries--) && (offset < self->size) && (!found_it)) { /* Search through the garbage manually */ - unsigned char *fc = (unsigned char*)memchr(self->data + offset, + unsigned char *fc = sci_memchr(self->data + offset, SCI0_END_OF_SONG, self->size - offset); diff --git a/engines/sci/sfx/seq/oss-adlib.cpp b/engines/sci/sfx/seq/oss-adlib.cpp index 24f936e089..f1c7bbf1b9 100644 --- a/engines/sci/sfx/seq/oss-adlib.cpp +++ b/engines/sci/sfx/seq/oss-adlib.cpp @@ -23,10 +23,7 @@ * */ -#include <stdio.h> -#ifdef HAVE_UNISTD_H -# include <unistd.h> -#endif +#include "common/scummsys.h" #include "../sequencer.h" #ifdef HAVE_SYS_SOUNDCARD_H diff --git a/engines/sci/tools.cpp b/engines/sci/tools.cpp index 95b5dd1275..95558afdb8 100644 --- a/engines/sci/tools.cpp +++ b/engines/sci/tools.cpp @@ -47,6 +47,9 @@ #include "sci/include/engine.h" +// FIXME: Get rid of the following (needed for O_RDONLY etc.) +#include <fcntl.h> + namespace Sci { // FIXME: Get rid of G_DIR_SEPARATOR / G_DIR_SEPARATOR_S @@ -59,7 +62,7 @@ namespace Sci { #endif -#ifdef HAVE_SYS_TIME_H +#ifndef _MSC_VER # include <sys/time.h> #endif @@ -148,7 +151,7 @@ void _SCIGNUkdebug(const char *funcname, EngineState *s, const char *file, int l } -#if defined(HAVE_GETTIMEOFDAY) +#ifndef _MSC_VER void sci_gettime(long *seconds, long *useconds) { struct timeval tv; diff --git a/engines/sci/tools.h b/engines/sci/tools.h index a40c763b89..7528035742 100644 --- a/engines/sci/tools.h +++ b/engines/sci/tools.h @@ -44,27 +44,6 @@ /*#define _SCI_RESOURCE_DEBUG */ /*#define _SCI_DECOMPRESS_DEBUG*/ -//TODO: Remove these defines by replacing their functionality by their ScummVM counterparts -#define HAVE_MEMCHR -#define HAVE_FCNTL_H -#ifndef _MSC_VER -#define HAVE_UNISTD_H -#define HAVE_SYS_TIME_H -#define HAVE_GETTIMEOFDAY -#endif -#define VERSION "0.6.4" - -// FIXME: Mostly for close() in lots of places. Get rid of this! -#ifndef _MSC_VER -#include <unistd.h> -#endif - -// FIXME: Get rid of the following (needed for O_RDONLY etc.) -#ifdef HAVE_FCNTL_H -# include <fcntl.h> -#endif - - // FIXME: rework sci_dir_t to use common/fs.h and remove these includes #include <sys/types.h> #ifndef _MSC_VER @@ -73,11 +52,9 @@ #include <io.h> #endif - -#ifdef WIN32 -# define FO_BINARY "b" -#else -# define FO_BINARY "" +// FIXME: For chdir() etc. +#ifndef _MSC_VER +#include <unistd.h> #endif namespace Sci { |