aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEnrico Rolfi2002-05-05 19:06:51 +0000
committerEnrico Rolfi2002-05-05 19:06:51 +0000
commit38d048b86bd96796511a44b62b020ac6f6dfea3b (patch)
treeee3fd5d3eafd3d240eacbdea0af8a33c5fe83f48
parent00f35bec5a387a2bd4dc983372245edb8e4a7c8f (diff)
downloadscummvm-rg350-38d048b86bd96796511a44b62b020ac6f6dfea3b.tar.gz
scummvm-rg350-38d048b86bd96796511a44b62b020ac6f6dfea3b.tar.bz2
scummvm-rg350-38d048b86bd96796511a44b62b020ac6f6dfea3b.zip
Fixed some things for Macintosh ports
svn-id: r4212
-rw-r--r--gameDetector.cpp13
-rw-r--r--gui.cpp5
-rw-r--r--insane.cpp2
-rw-r--r--main.cpp8
-rw-r--r--resource.cpp2
-rw-r--r--saveload.cpp7
-rw-r--r--script_v2.cpp18
-rw-r--r--scumm.h4
-rw-r--r--scummsys.h35
-rw-r--r--scummvm.cpp7
-rw-r--r--sound.cpp6
-rw-r--r--stdafx.h9
12 files changed, 71 insertions, 45 deletions
diff --git a/gameDetector.cpp b/gameDetector.cpp
index 917e7ccff1..ddafb69f2e 100644
--- a/gameDetector.cpp
+++ b/gameDetector.cpp
@@ -23,8 +23,13 @@
#include "stdafx.h"
#include "scumm.h"
+#ifndef macintosh
#include "sound/mididrv.h"
#include "sound/imuse.h"
+#else
+#include "mididrv.h"
+#include "imuse.h"
+#endif
#include "gameDetector.h"
@@ -118,7 +123,7 @@ void GameDetector::updateconfig()
void GameDetector::parseCommandLine(int argc, char **argv)
{
-#if !defined(__APPLE__CW)
+#if !defined(MACOS_CARBON)
int i;
char *s;
char *current_option = NULL;
@@ -556,7 +561,7 @@ MidiDriver *GameDetector::createMidi() {
#if defined (WIN32) && !defined(_WIN32_WCE)
/* MD_WINDOWS is default MidiDriver on windows targets */
if (drv == MD_AUTO) drv = MD_WINDOWS;
-#elif defined(__APPLE__)
+#elif defined(__APPLE__) || defined(macintosh)
/* MD_QTMUSIC is default MidiDriver on MacOS targets */
if (drv == MD_AUTO) drv = MD_QTMUSIC;
#endif
@@ -573,8 +578,10 @@ MidiDriver *GameDetector::createMidi() {
#if defined(UNIX) && !defined(__BEOS__)
case MD_SEQ: return MidiDriver_SEQ_create();
#endif
-#if defined(__APPLE__)
+#if defined(__APPLE__) || defined(macintosh)
case MD_QTMUSIC: return MidiDriver_QT_create();
+#endif
+#if defined(__APPLE__)
case MD_COREAUDIO: return MidiDriver_CORE_create();
#endif
}
diff --git a/gui.cpp b/gui.cpp
index a8488773f9..cd8200a554 100644
--- a/gui.cpp
+++ b/gui.cpp
@@ -21,8 +21,13 @@
#include "stdafx.h"
#include "scumm.h"
+#ifndef macintosh
#include "sound/mididrv.h"
#include "sound/imuse.h"
+#else
+#include "mididrv.h"
+#include "imuse.h"
+#endif
#include "gui.h"
#include "guimaps.h"
diff --git a/insane.cpp b/insane.cpp
index fa38a826ff..87bcddbddb 100644
--- a/insane.cpp
+++ b/insane.cpp
@@ -19,7 +19,7 @@
*
*/
-#if !defined(__APPLE__CW) && !defined(__MORPHOS__)
+#if !defined(macintosh) && !defined(__MORPHOS__)
#define NEED_SDL_HEADERS
#endif
diff --git a/main.cpp b/main.cpp
index 45ee85725c..d0debd964d 100644
--- a/main.cpp
+++ b/main.cpp
@@ -25,7 +25,11 @@
#include "mididrv.h"
#include "gameDetector.h"
#include "gui.h"
+#ifndef macintosh
#include "simon/simon.h"
+#else
+#include "simon.h"
+#endif
#include "config-file.h"
GameDetector detector;
@@ -94,8 +98,8 @@ static void do_memory_test(void) {
int main(int argc, char *argv[])
{
-#if defined(MACOS)
- // support for config file on macos
+#if defined(MACOS_SDL)
+ /* support for config file for macos SDL port */
char *argitem;
char *argstr;
diff --git a/resource.cpp b/resource.cpp
index 1a50cf684f..ef9d241063 100644
--- a/resource.cpp
+++ b/resource.cpp
@@ -178,7 +178,7 @@ bool Scumm::openResourceFile(const char *filename)
debug(9, "openResourceFile(%s)", filename);
if (_resFilePath) {
-#if defined(__APPLE__CW)
+#if defined(macintosh)
sprintf(buf, ":%s.%d:%s", _resFilePath, _resFilePathId, filename);
#else
sprintf(buf, "%s.%d\\%s", _resFilePath, _resFilePathId, filename);
diff --git a/saveload.cpp b/saveload.cpp
index 33ec427329..c7a10c7a04 100644
--- a/saveload.cpp
+++ b/saveload.cpp
@@ -22,8 +22,13 @@
#include "stdafx.h"
#include "scumm.h"
+#ifndef macintosh
#include "sound/mididrv.h"
#include "sound/imuse.h"
+#else
+#include "mididrv.h"
+#include "imuse.h"
+#endif
struct SaveGameHeader {
uint32 type;
@@ -158,7 +163,7 @@ void Scumm::makeSavegameName(char *out, int slot, bool compatible)
#ifndef _WIN32_WCE
-#if !defined(__APPLE__CW)
+#if !defined(macintosh)
const char *dir = getenv("SCUMMVM_SAVEPATH");
if (dir == NULL)
dir = "";
diff --git a/script_v2.cpp b/script_v2.cpp
index 1e839699ff..c7f2c87432 100644
--- a/script_v2.cpp
+++ b/script_v2.cpp
@@ -24,9 +24,13 @@
#include "stdafx.h"
#include "scumm.h"
+#ifndef macintosh
#include "sound/mididrv.h"
-
#include "sound/imuse.h"
+#else
+#include "mididrv.h"
+#include "imuse.h"
+#endif
void Scumm::setupOpcodes2()
{
@@ -2709,6 +2713,7 @@ void Scumm::o6_miscOps()
break;
case 13:
remapActor(derefActorSafe(args[1], "o6_miscOps:14"), args[2], args[3],
+
args[4], -1);
break;
case 14:
@@ -2914,16 +2919,27 @@ void Scumm::o6_kernelFunction()
break;
case 211:
warning("o6_kernelFunction: getInput(%d)", args[1]);
+
/*
+
13 = thrust
+
336 = thrust
+
328 = thrust
+
27 = abord
+
97 = left
+
331 = left
+
115 = right
+
333 = tight
+
*/
+
push(0);
break;
case 212:
diff --git a/scumm.h b/scumm.h
index b5755e104d..ed8b9ac418 100644
--- a/scumm.h
+++ b/scumm.h
@@ -21,7 +21,11 @@
#include "scummsys.h"
#include "system.h"
+#ifndef macintosh
#include "sound/mixer.h"
+#else
+#include "mixer.h"
+#endif
#include "config-file.h"
#define SCUMMVM_VERSION "0.2.0 devel"
diff --git a/scummsys.h b/scummsys.h
index d82fb309c6..ce56fee14a 100644
--- a/scummsys.h
+++ b/scummsys.h
@@ -131,10 +131,12 @@ typedef signed long int32;
#define NORETURN
#endif
-#elif defined(__APPLE__CW)
+#elif defined(macintosh)
#include <stdlib.h>
#include <stdio.h>
+#include "macos.h"
+
#define scumm_stricmp strcmp
inline char* strdup(char *buf) {return (char*)buf;};
@@ -215,37 +217,6 @@ typedef signed long int32;
#define START_PACK_STRUCTS pack (push,1)
#define END_PACK_STRUCTS pack(pop)
-#elif (defined(__MWERKS__) && defined(macintosh) && !defined(__APPLE__CW))
-
- #define scumm_stricmp strcmp
-
- #define MACOS
- #define NEED_STRDUP
-
- #define CHECK_HEAP
-
- #define SCUMM_BIG_ENDIAN
- #define SCUMM_NEED_ALIGNMENT
-
- #define FORCEINLINE inline
-
- #define NORETURN
-
- #define CDECL
-
- 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 options align=packed
- #define END_PACK_STRUCTS options align=reset
- #define GCC_PACK
-
#else
#error No system type defined
#endif
diff --git a/scummvm.cpp b/scummvm.cpp
index fb2ca8cf61..a676efb693 100644
--- a/scummvm.cpp
+++ b/scummvm.cpp
@@ -22,8 +22,13 @@
#include "stdafx.h"
#include "scumm.h"
+#ifndef macintosh
#include "sound/mididrv.h"
#include "sound/imuse.h"
+#else
+#include "mididrv.h"
+#include "imuse.h"
+#endif
#include "gui.h"
#include "string.h"
#include "gameDetector.h"
@@ -737,7 +742,7 @@ void Scumm::dumpResource(char *tag, int idx, byte *ptr)
else
size = READ_BE_UINT32_UNALIGNED(ptr + 4);
-#if defined(__APPLE__CW)
+#if defined(macintosh)
sprintf(buf, ":dumps:%s%d.dmp", tag, idx);
#else
sprintf(buf, "dumps/%s%d.dmp", tag, idx);
diff --git a/sound.cpp b/sound.cpp
index 849a5b1db9..fd301ec242 100644
--- a/sound.cpp
+++ b/sound.cpp
@@ -22,9 +22,15 @@
#include "stdafx.h"
#include "scumm.h"
+#ifndef macintosh
#include "sound/mididrv.h"
#include "sound/imuse.h"
#include <sys/stat.h>
+#else
+#include "mididrv.h"
+#include "imuse.h"
+#include <stat.h>
+#endif
#ifdef _WIN32_WCE
extern void *bsearch(const void *, const void *, size_t,
diff --git a/stdafx.h b/stdafx.h
index cf56ddbf63..0528578301 100644
--- a/stdafx.h
+++ b/stdafx.h
@@ -2,6 +2,9 @@
* $Id$
*
* $Log$
+ * Revision 1.15 2002/05/05 19:06:51 drigo
+ * Fixed some things for Macintosh ports
+ *
* Revision 1.14 2002/04/18 21:40:23 tomjoad
* Reenable MorphOS Midi driver, small updates to CD open code (only when CD audio is requested) and start options
*
@@ -99,7 +102,7 @@
#include <devices/timer.h>
#undef CMD_INVALID
#endif
-#if !defined(__APPLE__CW) && !(defined(__MWERKS__) && defined(macintosh))
+#if !defined(macintosh)
#include <sys/types.h>
#include <sys/uio.h>
#endif
@@ -129,8 +132,8 @@
#define SCUMMVM_PLATFORM_VERSION "X11 version"
#else
-#ifdef __APPLE__CW
-#define SCUMMVM_PLATFORM_VERSION "Carbon Mac version"
+#ifdef macintosh
+#define SCUMMVM_PLATFORM_VERSION "Macintosh version"
#else
#ifdef SDL_COMPILEDVERSION