diff --git a/AUTHORS b/AUTHORS index b631becb288..60db99ace99 100644 --- a/AUTHORS +++ b/AUTHORS @@ -20,6 +20,7 @@ The ScummVM team: Jamieson Christian - iMUSE, MIDI, all things musical Jerome Fisher - MT-32 emulator Jochen Hoenicke - Speaker & PCjr sound support, Adlib work + Hans-Jorg Frieden - Port: AmigaOS 4 Retired Team Members: Ralph Brorsen - Help with GUI implementation @@ -53,6 +54,7 @@ Contributors: Johannes Schickel - Thumbnails for ScummEngine Andre Souza - SDL-based OpenGL renderer Tim ??? - Initial MI1 CD music support + Juha Niemimaki - AmigaOS 4 port maintaining And to all the contributors, users, and beta testers we've missed. Thanks! diff --git a/Makefile b/Makefile index b0ce3c417c1..88104f6e0b6 100644 --- a/Makefile +++ b/Makefile @@ -19,10 +19,10 @@ MODULE_DIRS := include config.mak # Uncomment this for stricter compile time code verification -# CXXFLAGS+= -Werror +CXXFLAGS+= -Werror CXXFLAGS:= -Wall $(CXXFLAGS) -CXXFLAGS+= -O -Wuninitialized +# CXXFLAGS+= -O -Wuninitialized CXXFLAGS+= -Wno-long-long -Wno-multichar -Wno-unknown-pragmas # Even more warnings... CXXFLAGS+= -pedantic -Wpointer-arith -Wcast-qual -Wconversion diff --git a/NEWS b/NEWS index 1ad43d29580..0af8919a60b 100644 --- a/NEWS +++ b/NEWS @@ -7,6 +7,10 @@ For a more comprehensive changelog for the latest experimental CVS code, see: and "Inherit the Earth"). - Added Gob engine (for Goblins series) + New Ports: + - Added PlayStation 2 port + - Added AmigaOS 4 port + General: - Reworked cursor handling in SDL backend. Now cursors can have their own palette and scaling. This is used by Humongous Entertainment games now. diff --git a/README b/README index d13ba99db68..299f34f2bbd 100644 --- a/README +++ b/README @@ -1247,7 +1247,15 @@ messages (see http://www.sysinternals.com/ntw2k/freeware/debugview.shtml). etc. via Fink and into /sw. If you have installed SDL in another way, you'll have to edit the Makefile). - + AmigaOS 4 (Cross-compiling with Cygwin): + * Make sure that you have SDL installed, you may also need + libogg, libvorbis, libvorbisfile, zlib, libmad. + * Type ./configure --host=ppc-amigaos + * If you got an error about sdl-config, use --with-sdl-prefix + parameter to set the path. + * Check 'config.mak' file and if everything seems to fine: + * Run 'make'. + * Cross-compiling with Linux may be as easy. ------------------------------------------------------------------------ Good Luck and Happy Adventuring! diff --git a/backends/module.mk b/backends/module.mk index 0a2a8d0cf81..737f126c6a6 100644 --- a/backends/module.mk +++ b/backends/module.mk @@ -5,6 +5,7 @@ MODULE_OBJS := \ backends/fs/posix/posix-fs.o \ backends/fs/morphos/abox-fs.o \ backends/fs/windows/windows-fs.o \ + backends/fs/amigaos4/amigaos4-fs.o \ backends/midi/alsa.o \ backends/midi/coreaudio.o \ backends/midi/morphos.o \ @@ -19,6 +20,7 @@ MODULE_DIRS += \ backends/fs/posix \ backends/fs/morphos \ backends/fs/windows \ + backends/fs/amigaos4 \ backends/midi # Include common rules diff --git a/base/gameDetector.cpp b/base/gameDetector.cpp index a3b1fcdc328..aa08306e75c 100644 --- a/base/gameDetector.cpp +++ b/base/gameDetector.cpp @@ -617,7 +617,7 @@ bool GameDetector::detectMain() { warning("No path was provided. Assuming the data files are in the current directory"); gameDataPath = "./"; } else if (gameDataPath.lastChar() != '/' -#ifdef __MORPHOS__ +#if defined(__MORPHOS__) || defined(__amigaos4__) && gameDataPath.lastChar() != ':' #endif && gameDataPath.lastChar() != '\\') { diff --git a/base/main.cpp b/base/main.cpp index bddbbed2c24..287b0a891a7 100644 --- a/base/main.cpp +++ b/base/main.cpp @@ -122,6 +122,11 @@ const char *gScummVMFeatures = "" #endif ; +#if defined(__amigaos4__) +// Set the stack cookie, 640 KB should be enough for everyone +const char* stackCookie = "$STACK: 655360\0"; +#endif + #if defined(WIN32) && defined(NO_CONSOLE) #include #define STDOUT_FILE TEXT("stdout.txt") diff --git a/common/file.cpp b/common/file.cpp index 1be6f6a7a51..7f948f7bc7f 100644 --- a/common/file.cpp +++ b/common/file.cpp @@ -85,6 +85,17 @@ static FILE *fopenNoCase(const char *filename, const char *directory, const char file = fopen(buf, mode); } +#ifdef __amigaos4__ + // + // Work around for possibility that someone uses AmigaOS "newlib" build with SmartFileSystem (blocksize 512 bytes), leading + // to buffer size being only 512 bytes. "Clib2" sets the buffer size to 8KB, resulting smooth movie playback. This forces the buffer + // to be enough also when using "newlib" compile on SFS. + // + if (file) { + setvbuf(file, NULL, _IOFBF, 8192); + } +#endif + return file; } diff --git a/common/savefile.cpp b/common/savefile.cpp index 993dd104dbc..e5b7a3501c4 100644 --- a/common/savefile.cpp +++ b/common/savefile.cpp @@ -156,7 +156,7 @@ static void join_paths(const char *filename, const char *directory, const int dirLen = strlen(buf); if (dirLen > 0) { -#ifdef __MORPHOS__ +#if defined(__MORPHOS__) || defined(__amigaos4__) if (buf[dirLen-1] != ':' && buf[dirLen-1] != '/') #endif diff --git a/common/scaler/hq2x.cpp b/common/scaler/hq2x.cpp index 3599c01b9b7..fd6d2eb0940 100644 --- a/common/scaler/hq2x.cpp +++ b/common/scaler/hq2x.cpp @@ -42,6 +42,20 @@ void HQ2x(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, #else #ifdef HAS_ALTIVEC + +#ifdef __amigaos4__ +#include +#include +static bool isAltiVecAvailable() { + uint32 vecUnit; + IExec->GetCPUInfo(GCIT_VectorUnit, &vecUnit, TAG_DONE); + if (vecUnit == VECTORTYPE_NONE) + return false; + else + return true; +} +#else + #include static bool isAltiVecAvailable() { @@ -54,6 +68,7 @@ static bool isAltiVecAvailable() { return false; } #endif +#endif #define PIXEL00_0 *(q) = w5; #define PIXEL00_10 *(q) = interpolate16_2(w5, w1); diff --git a/common/scaler/hq3x.cpp b/common/scaler/hq3x.cpp index f0a92c533cb..43bc0dd4320 100644 --- a/common/scaler/hq3x.cpp +++ b/common/scaler/hq3x.cpp @@ -42,6 +42,19 @@ void HQ3x(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, #else #ifdef HAS_ALTIVEC + +#ifdef __amigaos4__ +#include +static bool isAltiVecAvailable() { + uint32 vecUnit; + IExec->GetCPUInfo(GCIT_VectorUnit, &vecUnit, TAG_DONE); + if (vecUnit == VECTORTYPE_NONE) + return false; + else + return true; +} +#else + #include static bool isAltiVecAvailable() { @@ -54,6 +67,7 @@ static bool isAltiVecAvailable() { return false; } #endif +#endif #define PIXEL00_1M *(q) = interpolate16_2(w5, w1); #define PIXEL00_1U *(q) = interpolate16_2(w5, w2); diff --git a/common/scummsys.h b/common/scummsys.h index 3eee1976c2a..58b01b3902a 100644 --- a/common/scummsys.h +++ b/common/scummsys.h @@ -323,6 +323,32 @@ #define fsize(a) ps2_fsize(a) extern void ps2_disableHandleCaching(void); + +#elif defined (__amigaos4__) + #include + + #define scumm_stricmp strcasecmp + #define scumm_strnicmp strncasecmp + + #define CHECK_HEAP + + #define SCUMM_BIG_ENDIAN + + // You need to set this manually if necessary + #define SCUMM_NEED_ALIGNMENT + + #define FORCEINLINE inline + #define CDECL + + #ifndef HAVE_CONFIG_H + typedef unsigned char byte; + typedef unsigned int uint; + #endif + + #define START_PACK_STRUCTS + #define END_PACK_STRUCTS + #define GCC_PACK __attribute__((packed)) + #define NORETURN __attribute__((__noreturn__)) #else #error No system type defined #endif diff --git a/common/stdafx.h b/common/stdafx.h index e3d96f27415..c40cac985e0 100644 --- a/common/stdafx.h +++ b/common/stdafx.h @@ -111,11 +111,13 @@ #endif #if !defined(macintosh) #include -#if !defined(__PLAYSTATION2__) +#if !defined(__PLAYSTATION2__) && !defined(__amigaos4__) #include #endif +#if !defined(__amigaos4__) #include #endif +#endif #if !defined (__BEOS__) #include #endif diff --git a/configure b/configure index 0635e127c29..debfb93e18b 100755 --- a/configure +++ b/configure @@ -434,6 +434,10 @@ arm-riscos-aof) _host_os=riscos _host_cpu=arm ;; +ppc-amigaos) + _host_os=amigaos + _host_cpu=ppc + ;; *) guessed_host=`$_srcdir/config.guess` _host_cpu=`echo $guessed_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` @@ -613,6 +617,16 @@ if test -n "$_host"; then type_2_byte='short' type_4_byte='int' ;; + ppc-amigaos) + echo "Cross-compiling to $_host, forcing endianness, alignment and type sizes" + _def_endianness='#define SCUMM_BIG_ENDIAN' + _def_align='#define SCUMM_NEED_ALIGNMENT' + type_1_byte='char' + type_2_byte='short' + type_4_byte='long' + CXXFLAGS="$CFLAGS -newlib -mstrict-align -mcpu=750 -mtune=7400" + LDFLAGS="$LDFLAGS -newlib" + ;; *) echo "Cross-compiling to unknown target, please add your target to configure." exit 1 diff --git a/doc/10.tex b/doc/10.tex index 8bcd112c047..0a2f3106dc6 100644 --- a/doc/10.tex +++ b/doc/10.tex @@ -11,7 +11,7 @@ Jonathan Gray & Engine: SCUMM, HE, Broken Sword II\\ Travis Howell & Engine: SCUMM, HE, Simon the Sorcerer\\ Oliver Kiehl & Engine: Beneath a Steel Sky, Simon\\ - Pawel Kolodziejski & Engine: SCUMM (Codecs, iMUSE, Smush, etc.)\\ + Pawe{\l} Ko{\l}odziejski & Engine: SCUMM (Codecs, iMUSE, Smush, etc.)\\ Andrew Kurushin & Engine: SAGA\\ Gregory Montoir & Engine: Flight of the Amazon Queen, HE\\ Joost Peters & Engine: Beneath a Steel Sky, Flight of the Amazon Queen\\ @@ -23,6 +23,7 @@ Jamieson Christian & iMUSE, MIDI, all things musical\\ Jerome Fisher & MT-32 emulator\\ Jochen Hoenicke & Speaker \& PCjr sound support, Adlib work\\ + Hans-J\"org Frieden & Port: AmigaOS 4\\ \end{tabular} \item \textbf{Retired Team Members}\\ \begin{tabular}[h]{p{4cm}l} @@ -55,6 +56,7 @@ Johannes Schickel & Thumbnails for ScummEngine\\ Andr\'e Souza & SDL-based OpenGL renderer\\ Tim ??? & Initial MI1 CD music support\\ + Juha Niemim\"aki & AmigaOS 4 port maintaining\\ \end{tabular} And to all the contributors, users, and beta testers we've missed. Thanks! diff --git a/gui/credits.h b/gui/credits.h index 2b17d4c68a9..465c10ca5b8 100644 --- a/gui/credits.h +++ b/gui/credits.h @@ -42,6 +42,8 @@ static const char *credits[] = { "\\L\\c2"" MT-32 emulator", "\\L\\c0"" Jochen Hoenicke", "\\L\\c2"" Speaker & PCjr sound support, Adlib work", +"\\L\\c0"" Hans-Jorg Frieden", +"\\L\\c2"" Port: AmigaOS 4", "\\L\\c0""", "\\C\\c1""Retired Team Members:", "\\L\\c0"" Ralph Brorsen", @@ -101,6 +103,8 @@ static const char *credits[] = { "\\L\\c2"" SDL-based OpenGL renderer", "\\L\\c0"" Tim ???", "\\L\\c2"" Initial MI1 CD music support", +"\\L\\c0"" Juha Niemimaki", +"\\L\\c2"" AmigaOS 4 port maintaining", "\\L\\c0""", "\\L\\c0""And to all the contributors, users, and beta", "\\L\\c0""testers we've missed. Thanks!", diff --git a/gui/options.cpp b/gui/options.cpp index e35c11fd090..9384c97b503 100644 --- a/gui/options.cpp +++ b/gui/options.cpp @@ -33,7 +33,7 @@ #include "sound/mididrv.h" #include "sound/mixer.h" -#if (!( defined(__PALM_OS__) || defined(__DC__) || defined(__GP32__)) && !defined(_MSC_VER)) +#if (!( defined(__PALM_OS__) || defined(__DC__) || defined(__GP32__) || defined(__amigaos4__) ) && !defined(_MSC_VER)) #include #include #endif diff --git a/sound/softsynth/mt32/partialManager.cpp b/sound/softsynth/mt32/partialManager.cpp index 51e55a7d691..fb6973a0b2b 100644 --- a/sound/softsynth/mt32/partialManager.cpp +++ b/sound/softsynth/mt32/partialManager.cpp @@ -19,7 +19,11 @@ * IN THE SOFTWARE. */ +#ifdef __amigaos4__ +#include +#else #include +#endif #include "mt32emu.h" diff --git a/tools/credits.pl b/tools/credits.pl index ab6e24ca491..6aa8bb99f13 100755 --- a/tools/credits.pl +++ b/tools/credits.pl @@ -61,6 +61,7 @@ sub html_entities_to_ascii { # é -> e # ø -> o # ö -> o / oe + # ä -> a # & -> & # ł -> l $text =~ s/á/a/g; @@ -68,6 +69,8 @@ sub html_entities_to_ascii { $text =~ s/ø/o/g; $text =~ s/ł/l/g; + $text =~ s/ä/a/g; + $text =~ s/ü/u/g; # HACK: Torbj*o*rn but G*oe*ffringmann and R*oe*ver $text =~ s/ör/or/g; $text =~ s/ö/oe/g; @@ -85,7 +88,10 @@ sub html_entities_to_rtf { $text =~ s/é/\\'8e/g; $text =~ s/ø/\\'bf/g; $text =~ s/ł/\\uc0\\u322 /g; + + $text =~ s/ä/\\'8a/g; $text =~ s/ö/\\'9a/g; + $text =~ s/ü/\\'9f/g; $text =~ s/&/&/g; @@ -99,8 +105,11 @@ sub html_entities_to_tex { $text =~ s/á/\\'a/g; $text =~ s/é/\\'e/g; $text =~ s/ø/{\\o}/g; - $text =~ s/ł/l/g; # TODO + $text =~ s/ł/{\\l}/g; + + $text =~ s/ä/\\"a/g; $text =~ s/ö/\\"o/g; + $text =~ s/ü/\\"u/g; $text =~ s/&/\\&/g; @@ -329,6 +338,7 @@ begin_credits("Credits"); add_person("Jamieson Christian", "jamieson630", "iMUSE, MIDI, all things musical"); add_person("Jerome Fisher", "KingGuppy", "MT-32 emulator"); add_person("Jochen Hoenicke", "hoenicke", "Speaker & PCjr sound support, Adlib work"); + add_person("Hans-Jörg Frieden", "", "Port: AmigaOS 4"); end_section(); @@ -363,6 +373,7 @@ begin_credits("Credits"); add_person("Johannes Schickel", "LordHoto", "Thumbnails for ScummEngine"); add_person("André Souza", "", "SDL-based OpenGL renderer"); add_person("Tim ???", "realmz", "Initial MI1 CD music support"); + add_person("Juha Niemimäki", "", "AmigaOS 4 port maintaining"); end_section();