Patch #1181544 (AmigaOS 4 changes)

svn-id: r18011
This commit is contained in:
Max Horn 2005-05-09 21:21:21 +00:00
parent 1c6788797e
commit 52bbc86797
19 changed files with 133 additions and 9 deletions

View file

@ -20,6 +20,7 @@ The ScummVM team:
Jamieson Christian - iMUSE, MIDI, all things musical Jamieson Christian - iMUSE, MIDI, all things musical
Jerome Fisher - MT-32 emulator Jerome Fisher - MT-32 emulator
Jochen Hoenicke - Speaker & PCjr sound support, Adlib work Jochen Hoenicke - Speaker & PCjr sound support, Adlib work
Hans-Jorg Frieden - Port: AmigaOS 4
Retired Team Members: Retired Team Members:
Ralph Brorsen - Help with GUI implementation Ralph Brorsen - Help with GUI implementation
@ -53,6 +54,7 @@ Contributors:
Johannes Schickel - Thumbnails for ScummEngine Johannes Schickel - Thumbnails for ScummEngine
Andre Souza - SDL-based OpenGL renderer Andre Souza - SDL-based OpenGL renderer
Tim ??? - Initial MI1 CD music support Tim ??? - Initial MI1 CD music support
Juha Niemimaki - AmigaOS 4 port maintaining
And to all the contributors, users, and beta testers we've missed. And to all the contributors, users, and beta testers we've missed.
Thanks! Thanks!

View file

@ -19,10 +19,10 @@ MODULE_DIRS :=
include config.mak include config.mak
# Uncomment this for stricter compile time code verification # Uncomment this for stricter compile time code verification
# CXXFLAGS+= -Werror CXXFLAGS+= -Werror
CXXFLAGS:= -Wall $(CXXFLAGS) CXXFLAGS:= -Wall $(CXXFLAGS)
CXXFLAGS+= -O -Wuninitialized # CXXFLAGS+= -O -Wuninitialized
CXXFLAGS+= -Wno-long-long -Wno-multichar -Wno-unknown-pragmas CXXFLAGS+= -Wno-long-long -Wno-multichar -Wno-unknown-pragmas
# Even more warnings... # Even more warnings...
CXXFLAGS+= -pedantic -Wpointer-arith -Wcast-qual -Wconversion CXXFLAGS+= -pedantic -Wpointer-arith -Wcast-qual -Wconversion

4
NEWS
View file

@ -7,6 +7,10 @@ For a more comprehensive changelog for the latest experimental CVS code, see:
and "Inherit the Earth"). and "Inherit the Earth").
- Added Gob engine (for Goblins series) - Added Gob engine (for Goblins series)
New Ports:
- Added PlayStation 2 port
- Added AmigaOS 4 port
General: General:
- Reworked cursor handling in SDL backend. Now cursors can have their own - Reworked cursor handling in SDL backend. Now cursors can have their own
palette and scaling. This is used by Humongous Entertainment games now. palette and scaling. This is used by Humongous Entertainment games now.

10
README
View file

@ -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 etc. via Fink and into /sw. If you have installed SDL
in another way, you'll have to edit the Makefile). 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! Good Luck and Happy Adventuring!

View file

@ -5,6 +5,7 @@ MODULE_OBJS := \
backends/fs/posix/posix-fs.o \ backends/fs/posix/posix-fs.o \
backends/fs/morphos/abox-fs.o \ backends/fs/morphos/abox-fs.o \
backends/fs/windows/windows-fs.o \ backends/fs/windows/windows-fs.o \
backends/fs/amigaos4/amigaos4-fs.o \
backends/midi/alsa.o \ backends/midi/alsa.o \
backends/midi/coreaudio.o \ backends/midi/coreaudio.o \
backends/midi/morphos.o \ backends/midi/morphos.o \
@ -19,6 +20,7 @@ MODULE_DIRS += \
backends/fs/posix \ backends/fs/posix \
backends/fs/morphos \ backends/fs/morphos \
backends/fs/windows \ backends/fs/windows \
backends/fs/amigaos4 \
backends/midi backends/midi
# Include common rules # Include common rules

View file

@ -617,7 +617,7 @@ bool GameDetector::detectMain() {
warning("No path was provided. Assuming the data files are in the current directory"); warning("No path was provided. Assuming the data files are in the current directory");
gameDataPath = "./"; gameDataPath = "./";
} else if (gameDataPath.lastChar() != '/' } else if (gameDataPath.lastChar() != '/'
#ifdef __MORPHOS__ #if defined(__MORPHOS__) || defined(__amigaos4__)
&& gameDataPath.lastChar() != ':' && gameDataPath.lastChar() != ':'
#endif #endif
&& gameDataPath.lastChar() != '\\') { && gameDataPath.lastChar() != '\\') {

View file

@ -122,6 +122,11 @@ const char *gScummVMFeatures = ""
#endif #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) #if defined(WIN32) && defined(NO_CONSOLE)
#include <cstdio> #include <cstdio>
#define STDOUT_FILE TEXT("stdout.txt") #define STDOUT_FILE TEXT("stdout.txt")

View file

@ -85,6 +85,17 @@ static FILE *fopenNoCase(const char *filename, const char *directory, const char
file = fopen(buf, mode); 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; return file;
} }

View file

@ -156,7 +156,7 @@ static void join_paths(const char *filename, const char *directory,
const int dirLen = strlen(buf); const int dirLen = strlen(buf);
if (dirLen > 0) { if (dirLen > 0) {
#ifdef __MORPHOS__ #if defined(__MORPHOS__) || defined(__amigaos4__)
if (buf[dirLen-1] != ':' && buf[dirLen-1] != '/') if (buf[dirLen-1] != ':' && buf[dirLen-1] != '/')
#endif #endif

View file

@ -42,6 +42,20 @@ void HQ2x(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch,
#else #else
#ifdef HAS_ALTIVEC #ifdef HAS_ALTIVEC
#ifdef __amigaos4__
#include <proto/exec.h>
#include <altivec.h>
static bool isAltiVecAvailable() {
uint32 vecUnit;
IExec->GetCPUInfo(GCIT_VectorUnit, &vecUnit, TAG_DONE);
if (vecUnit == VECTORTYPE_NONE)
return false;
else
return true;
}
#else
#include <sys/sysctl.h> #include <sys/sysctl.h>
static bool isAltiVecAvailable() { static bool isAltiVecAvailable() {
@ -54,6 +68,7 @@ static bool isAltiVecAvailable() {
return false; return false;
} }
#endif #endif
#endif
#define PIXEL00_0 *(q) = w5; #define PIXEL00_0 *(q) = w5;
#define PIXEL00_10 *(q) = interpolate16_2<bitFormat,3,1>(w5, w1); #define PIXEL00_10 *(q) = interpolate16_2<bitFormat,3,1>(w5, w1);

View file

@ -42,6 +42,19 @@ void HQ3x(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch,
#else #else
#ifdef HAS_ALTIVEC #ifdef HAS_ALTIVEC
#ifdef __amigaos4__
#include <proto/exec.h>
static bool isAltiVecAvailable() {
uint32 vecUnit;
IExec->GetCPUInfo(GCIT_VectorUnit, &vecUnit, TAG_DONE);
if (vecUnit == VECTORTYPE_NONE)
return false;
else
return true;
}
#else
#include <sys/sysctl.h> #include <sys/sysctl.h>
static bool isAltiVecAvailable() { static bool isAltiVecAvailable() {
@ -54,6 +67,7 @@ static bool isAltiVecAvailable() {
return false; return false;
} }
#endif #endif
#endif
#define PIXEL00_1M *(q) = interpolate16_2<bitFormat,3,1>(w5, w1); #define PIXEL00_1M *(q) = interpolate16_2<bitFormat,3,1>(w5, w1);
#define PIXEL00_1U *(q) = interpolate16_2<bitFormat,3,1>(w5, w2); #define PIXEL00_1U *(q) = interpolate16_2<bitFormat,3,1>(w5, w2);

View file

@ -323,6 +323,32 @@
#define fsize(a) ps2_fsize(a) #define fsize(a) ps2_fsize(a)
extern void ps2_disableHandleCaching(void); extern void ps2_disableHandleCaching(void);
#elif defined (__amigaos4__)
#include <exec/types.h>
#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 #else
#error No system type defined #error No system type defined
#endif #endif

View file

@ -111,11 +111,13 @@
#endif #endif
#if !defined(macintosh) #if !defined(macintosh)
#include <sys/types.h> #include <sys/types.h>
#if !defined(__PLAYSTATION2__) #if !defined(__PLAYSTATION2__) && !defined(__amigaos4__)
#include <sys/uio.h> #include <sys/uio.h>
#endif #endif
#if !defined(__amigaos4__)
#include <sys/param.h> #include <sys/param.h>
#endif #endif
#endif
#if !defined (__BEOS__) #if !defined (__BEOS__)
#include <unistd.h> #include <unistd.h>
#endif #endif

14
configure vendored
View file

@ -434,6 +434,10 @@ arm-riscos-aof)
_host_os=riscos _host_os=riscos
_host_cpu=arm _host_cpu=arm
;; ;;
ppc-amigaos)
_host_os=amigaos
_host_cpu=ppc
;;
*) *)
guessed_host=`$_srcdir/config.guess` guessed_host=`$_srcdir/config.guess`
_host_cpu=`echo $guessed_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` _host_cpu=`echo $guessed_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
@ -613,6 +617,16 @@ if test -n "$_host"; then
type_2_byte='short' type_2_byte='short'
type_4_byte='int' 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." echo "Cross-compiling to unknown target, please add your target to configure."
exit 1 exit 1

View file

@ -11,7 +11,7 @@
Jonathan Gray & Engine: SCUMM, HE, Broken Sword II\\ Jonathan Gray & Engine: SCUMM, HE, Broken Sword II\\
Travis Howell & Engine: SCUMM, HE, Simon the Sorcerer\\ Travis Howell & Engine: SCUMM, HE, Simon the Sorcerer\\
Oliver Kiehl & Engine: Beneath a Steel Sky, Simon\\ 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\\ Andrew Kurushin & Engine: SAGA\\
Gregory Montoir & Engine: Flight of the Amazon Queen, HE\\ Gregory Montoir & Engine: Flight of the Amazon Queen, HE\\
Joost Peters & Engine: Beneath a Steel Sky, Flight of the Amazon Queen\\ Joost Peters & Engine: Beneath a Steel Sky, Flight of the Amazon Queen\\
@ -23,6 +23,7 @@
Jamieson Christian & iMUSE, MIDI, all things musical\\ Jamieson Christian & iMUSE, MIDI, all things musical\\
Jerome Fisher & MT-32 emulator\\ Jerome Fisher & MT-32 emulator\\
Jochen Hoenicke & Speaker \& PCjr sound support, Adlib work\\ Jochen Hoenicke & Speaker \& PCjr sound support, Adlib work\\
Hans-J\"org Frieden & Port: AmigaOS 4\\
\end{tabular} \end{tabular}
\item \textbf{Retired Team Members}\\ \item \textbf{Retired Team Members}\\
\begin{tabular}[h]{p{4cm}l} \begin{tabular}[h]{p{4cm}l}
@ -55,6 +56,7 @@
Johannes Schickel & Thumbnails for ScummEngine\\ Johannes Schickel & Thumbnails for ScummEngine\\
Andr\'e Souza & SDL-based OpenGL renderer\\ Andr\'e Souza & SDL-based OpenGL renderer\\
Tim ??? & Initial MI1 CD music support\\ Tim ??? & Initial MI1 CD music support\\
Juha Niemim\"aki & AmigaOS 4 port maintaining\\
\end{tabular} \end{tabular}
And to all the contributors, users, and beta testers we've missed. Thanks! And to all the contributors, users, and beta testers we've missed. Thanks!

View file

@ -42,6 +42,8 @@ static const char *credits[] = {
"\\L\\c2"" MT-32 emulator", "\\L\\c2"" MT-32 emulator",
"\\L\\c0"" Jochen Hoenicke", "\\L\\c0"" Jochen Hoenicke",
"\\L\\c2"" Speaker & PCjr sound support, Adlib work", "\\L\\c2"" Speaker & PCjr sound support, Adlib work",
"\\L\\c0"" Hans-Jorg Frieden",
"\\L\\c2"" Port: AmigaOS 4",
"\\L\\c0""", "\\L\\c0""",
"\\C\\c1""Retired Team Members:", "\\C\\c1""Retired Team Members:",
"\\L\\c0"" Ralph Brorsen", "\\L\\c0"" Ralph Brorsen",
@ -101,6 +103,8 @@ static const char *credits[] = {
"\\L\\c2"" SDL-based OpenGL renderer", "\\L\\c2"" SDL-based OpenGL renderer",
"\\L\\c0"" Tim ???", "\\L\\c0"" Tim ???",
"\\L\\c2"" Initial MI1 CD music support", "\\L\\c2"" Initial MI1 CD music support",
"\\L\\c0"" Juha Niemimaki",
"\\L\\c2"" AmigaOS 4 port maintaining",
"\\L\\c0""", "\\L\\c0""",
"\\L\\c0""And to all the contributors, users, and beta", "\\L\\c0""And to all the contributors, users, and beta",
"\\L\\c0""testers we've missed. Thanks!", "\\L\\c0""testers we've missed. Thanks!",

View file

@ -33,7 +33,7 @@
#include "sound/mididrv.h" #include "sound/mididrv.h"
#include "sound/mixer.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 <sys/param.h> #include <sys/param.h>
#include <unistd.h> #include <unistd.h>
#endif #endif

View file

@ -19,7 +19,11 @@
* IN THE SOFTWARE. * IN THE SOFTWARE.
*/ */
#ifdef __amigaos4__
#include <strings.h>
#else
#include <memory.h> #include <memory.h>
#endif
#include "mt32emu.h" #include "mt32emu.h"

View file

@ -61,6 +61,7 @@ sub html_entities_to_ascii {
# &eacute; -> e # &eacute; -> e
# &oslash; -> o # &oslash; -> o
# &ouml; -> o / oe # &ouml; -> o / oe
# &auml; -> a
# &amp; -> & # &amp; -> &
# &#322; -> l # &#322; -> l
$text =~ s/&aacute;/a/g; $text =~ s/&aacute;/a/g;
@ -68,6 +69,8 @@ sub html_entities_to_ascii {
$text =~ s/&oslash;/o/g; $text =~ s/&oslash;/o/g;
$text =~ s/&#322;/l/g; $text =~ s/&#322;/l/g;
$text =~ s/&auml;/a/g;
$text =~ s/&uuml;/u/g;
# HACK: Torbj*o*rn but G*oe*ffringmann and R*oe*ver # HACK: Torbj*o*rn but G*oe*ffringmann and R*oe*ver
$text =~ s/&ouml;r/or/g; $text =~ s/&ouml;r/or/g;
$text =~ s/&ouml;/oe/g; $text =~ s/&ouml;/oe/g;
@ -85,7 +88,10 @@ sub html_entities_to_rtf {
$text =~ s/&eacute;/\\'8e/g; $text =~ s/&eacute;/\\'8e/g;
$text =~ s/&oslash;/\\'bf/g; $text =~ s/&oslash;/\\'bf/g;
$text =~ s/&#322;/\\uc0\\u322 /g; $text =~ s/&#322;/\\uc0\\u322 /g;
$text =~ s/&auml;/\\'8a/g;
$text =~ s/&ouml;/\\'9a/g; $text =~ s/&ouml;/\\'9a/g;
$text =~ s/&uuml;/\\'9f/g;
$text =~ s/&amp;/&/g; $text =~ s/&amp;/&/g;
@ -99,8 +105,11 @@ sub html_entities_to_tex {
$text =~ s/&aacute;/\\'a/g; $text =~ s/&aacute;/\\'a/g;
$text =~ s/&eacute;/\\'e/g; $text =~ s/&eacute;/\\'e/g;
$text =~ s/&oslash;/{\\o}/g; $text =~ s/&oslash;/{\\o}/g;
$text =~ s/&#322;/l/g; # TODO $text =~ s/&#322;/{\\l}/g;
$text =~ s/&auml;/\\"a/g;
$text =~ s/&ouml;/\\"o/g; $text =~ s/&ouml;/\\"o/g;
$text =~ s/&uuml;/\\"u/g;
$text =~ s/&amp;/\\&/g; $text =~ s/&amp;/\\&/g;
@ -329,6 +338,7 @@ begin_credits("Credits");
add_person("Jamieson Christian", "jamieson630", "iMUSE, MIDI, all things musical"); add_person("Jamieson Christian", "jamieson630", "iMUSE, MIDI, all things musical");
add_person("Jerome Fisher", "KingGuppy", "MT-32 emulator"); add_person("Jerome Fisher", "KingGuppy", "MT-32 emulator");
add_person("Jochen Hoenicke", "hoenicke", "Speaker &amp; PCjr sound support, Adlib work"); add_person("Jochen Hoenicke", "hoenicke", "Speaker &amp; PCjr sound support, Adlib work");
add_person("Hans-J&ouml;rg Frieden", "", "Port: AmigaOS 4");
end_section(); end_section();
@ -363,6 +373,7 @@ begin_credits("Credits");
add_person("Johannes Schickel", "LordHoto", "Thumbnails for ScummEngine"); add_person("Johannes Schickel", "LordHoto", "Thumbnails for ScummEngine");
add_person("Andr&eacute; Souza", "", "SDL-based OpenGL renderer"); add_person("Andr&eacute; Souza", "", "SDL-based OpenGL renderer");
add_person("Tim ???", "realmz", "Initial MI1 CD music support"); add_person("Tim ???", "realmz", "Initial MI1 CD music support");
add_person("Juha Niemim&auml;ki", "", "AmigaOS 4 port maintaining");
end_section(); end_section();