diff options
Diffstat (limited to 'common')
-rw-r--r-- | common/file.cpp | 11 | ||||
-rw-r--r-- | common/savefile.cpp | 2 | ||||
-rw-r--r-- | common/scaler/hq2x.cpp | 15 | ||||
-rw-r--r-- | common/scaler/hq3x.cpp | 14 | ||||
-rw-r--r-- | common/scummsys.h | 26 | ||||
-rw-r--r-- | common/stdafx.h | 4 |
6 files changed, 70 insertions, 2 deletions
diff --git a/common/file.cpp b/common/file.cpp index 1be6f6a7a5..7f948f7bc7 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 993dd104db..e5b7a3501c 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 3599c01b9b..fd6d2eb094 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 <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> 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<bitFormat,3,1>(w5, w1); diff --git a/common/scaler/hq3x.cpp b/common/scaler/hq3x.cpp index f0a92c533c..43bc0dd432 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 <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> static bool isAltiVecAvailable() { @@ -54,6 +67,7 @@ static bool isAltiVecAvailable() { return false; } #endif +#endif #define PIXEL00_1M *(q) = interpolate16_2<bitFormat,3,1>(w5, w1); #define PIXEL00_1U *(q) = interpolate16_2<bitFormat,3,1>(w5, w2); diff --git a/common/scummsys.h b/common/scummsys.h index 3eee1976c2..58b01b3902 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 <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 #error No system type defined #endif diff --git a/common/stdafx.h b/common/stdafx.h index e3d96f2741..c40cac985e 100644 --- a/common/stdafx.h +++ b/common/stdafx.h @@ -111,11 +111,13 @@ #endif #if !defined(macintosh) #include <sys/types.h> -#if !defined(__PLAYSTATION2__) +#if !defined(__PLAYSTATION2__) && !defined(__amigaos4__) #include <sys/uio.h> #endif +#if !defined(__amigaos4__) #include <sys/param.h> #endif +#endif #if !defined (__BEOS__) #include <unistd.h> #endif |