diff options
-rw-r--r-- | common/scummsys.h | 609 | ||||
-rw-r--r-- | scumm/resource.cpp | 246 | ||||
-rw-r--r-- | scumm/smush/scumm_renderer.cpp | 2 | ||||
-rw-r--r-- | scumm/string.cpp | 16 | ||||
-rw-r--r-- | simon/simon.cpp | 2 |
5 files changed, 433 insertions, 442 deletions
diff --git a/common/scummsys.h b/common/scummsys.h index f6b613ff95..fda37b18bd 100644 --- a/common/scummsys.h +++ b/common/scummsys.h @@ -18,353 +18,344 @@ * $Header$ * */ -#ifndef __SCUMMSYS_H_ -#define __SCUMMSYS_H_ +#ifndef SCUMMSYS_H +#define SCUMMSYS_H #include <stdlib.h> +// TODO - use config.h, generated by configure +//#include "config.h" + #if defined(HAVE_NO_BOOL) typedef int bool; const bool true(1), false(0); #endif /* HAVE_NO_BOOL */ #if defined(_MSC_VER) - -//#pragma warning (disable: 4244) -//#pragma warning (disable: 4101) - -#define scumm_stricmp stricmp -#define snprintf _snprintf - -#if defined(CHECK_HEAP) -#undef CHECK_HEAP -#define CHECK_HEAP checkHeap(); -#else -#define CHECK_HEAP -#endif - -#define SCUMM_LITTLE_ENDIAN - -#define FORCEINLINE __forceinline -#define NORETURN _declspec(noreturn) - -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 pack (push,1) -#define END_PACK_STRUCTS pack(pop) -#define GCC_PACK + + //#pragma warning (disable: 4244) + //#pragma warning (disable: 4101) + + #define scumm_stricmp stricmp + #define snprintf _snprintf + + #if defined(CHECK_HEAP) + #undef CHECK_HEAP + #define CHECK_HEAP checkHeap(); + #else + #define CHECK_HEAP + #endif + + #define SCUMM_LITTLE_ENDIAN + + #define FORCEINLINE __forceinline + #define NORETURN _declspec(noreturn) + + 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 pack (push,1) + #define END_PACK_STRUCTS pack(pop) + #define GCC_PACK #elif defined(__MINGW32__) - -#define scumm_stricmp stricmp -#define CHECK_HEAP -#define SCUMM_LITTLE_ENDIAN - -#define FORCEINLINE inline -#define NORETURN __attribute__((__noreturn__)) -#define GCC_PACK __attribute__((packed)) -#define _HEAPOK 0 - -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 pack (push,1) -#define END_PACK_STRUCTS pack(pop) - + + #define scumm_stricmp stricmp + #define CHECK_HEAP + #define SCUMM_LITTLE_ENDIAN + + #define FORCEINLINE inline + #define NORETURN __attribute__((__noreturn__)) + #define GCC_PACK __attribute__((packed)) + #define _HEAPOK 0 + + 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 pack (push,1) + #define END_PACK_STRUCTS pack(pop) + #elif defined(UNIX) || defined(__APPLE__) - -#define scumm_stricmp strcasecmp - -#define CHECK_HEAP - -#ifdef X11_BACKEND - -/* You need to set those manually */ -#define SCUMM_LITTLE_ENDIAN -/* #define SCUMM_NEED_ALIGNMENT */ - -#else -/* need this for the SDL_BYTEORDER define */ -#include <SDL_byteorder.h> - -#if SDL_BYTEORDER == SDL_LIL_ENDIAN -#define SCUMM_LITTLE_ENDIAN -#elif SDL_BYTEORDER == SDL_BIG_ENDIAN -#define SCUMM_BIG_ENDIAN -#define SCUMM_NEED_ALIGNMENT -#else -#error Neither SDL_BIG_ENDIAN nor SDL_LITTLE_ENDIAN is set. -#endif -#endif - -#define FORCEINLINE inline -#define CDECL - -typedef unsigned char byte; -typedef unsigned char uint8; -typedef unsigned short uint16; -typedef unsigned int uint; -typedef signed char int8; -typedef signed short int16; - -# if defined(__DECCXX) // Assume alpha architecture - -# define INVERSE_MKID -# define SCUMM_NEED_ALIGNMENT - -typedef unsigned int uint32; -typedef signed int int32; - -# else - -typedef unsigned long uint32; -typedef signed long int32; - -# endif - - -#if defined(__GNUC__) -#define START_PACK_STRUCTS -#define END_PACK_STRUCTS -#define GCC_PACK __attribute__((packed)) -#define NORETURN __attribute__((__noreturn__)) -#else -#define START_PACK_STRUCTS pack (1) -#define END_PACK_STRUCTS pack () -#define GCC_PACK -#define NORETURN -#endif - + + #define scumm_stricmp strcasecmp + + #define CHECK_HEAP + + #ifdef X11_BACKEND + + /* You need to set those manually */ +// #define SCUMM_LITTLE_ENDIAN + /* #define SCUMM_NEED_ALIGNMENT */ + + #else + /* need this for the SDL_BYTEORDER define */ + #include <SDL_byteorder.h> + + #if SDL_BYTEORDER == SDL_LIL_ENDIAN + #define SCUMM_LITTLE_ENDIAN + #elif SDL_BYTEORDER == SDL_BIG_ENDIAN + #define SCUMM_BIG_ENDIAN + #define SCUMM_NEED_ALIGNMENT + #else + #error Neither SDL_BIG_ENDIAN nor SDL_LITTLE_ENDIAN is set. + #endif + #endif + + #define FORCEINLINE inline + #define CDECL + + #ifndef CONFIG_H + typedef unsigned char byte; + typedef unsigned char uint8; + typedef unsigned short uint16; + typedef unsigned int uint; + typedef unsigned int uint32; + typedef signed char int8; + typedef signed short int16; + typedef signed int int32; + #endif + + + # if defined(__DECCXX) // Assume alpha architecture + # define INVERSE_MKID + # define SCUMM_NEED_ALIGNMENT + # endif + + + #if defined(__GNUC__) + #define START_PACK_STRUCTS + #define END_PACK_STRUCTS + #define GCC_PACK __attribute__((packed)) + #define NORETURN __attribute__((__noreturn__)) + #else + #define START_PACK_STRUCTS pack (1) + #define END_PACK_STRUCTS pack () + #define GCC_PACK + #define NORETURN + #endif + #elif defined(macintosh) -#include <stdio.h> - -#include "macos.h" - -#define scumm_stricmp strcmp - -#define CHECK_HEAP -#define SCUMM_BIG_ENDIAN - -#define FORCEINLINE inline -#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 pack (1) -#define END_PACK_STRUCTS pack () -#define GCC_PACK -#define NORETURN -#define USE_QTMUSIC -#define NEED_STRDUP + #include <stdio.h> + + #include "macos.h" + + #define scumm_stricmp strcmp// FIXME - this is definitly wrong. Try strcasecmp? + + #define CHECK_HEAP + #define SCUMM_BIG_ENDIAN + + #define FORCEINLINE inline + #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 pack (1) + #define END_PACK_STRUCTS pack () + #define GCC_PACK + #define NORETURN + #define USE_QTMUSIC + #define NEED_STRDUP #elif defined(__MORPHOS__) -#define scumm_stricmp stricmp -#define CHECK_HEAP - -#define SCUMM_BIG_ENDIAN -#define SCUMM_NEED_ALIGNMENT - -#define FORCEINLINE inline -#define CDECL + #define scumm_stricmp stricmp + #define CHECK_HEAP + + #define SCUMM_BIG_ENDIAN + #define SCUMM_NEED_ALIGNMENT + + #define FORCEINLINE inline + #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; + + #if defined(__GNUC__) + #define START_PACK_STRUCTS + #define END_PACK_STRUCTS + #define GCC_PACK __attribute__((packed)) + #define NORETURN __attribute__((__noreturn__)) + #else + #define START_PACK_STRUCTS pack (1) + #define END_PACK_STRUCTS pack () + #define GCC_PACK + #define NORETURN + #endif + #define main morphos_main -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; - -#if defined(__GNUC__) - #define START_PACK_STRUCTS - #define END_PACK_STRUCTS - #define GCC_PACK __attribute__((packed)) - #define NORETURN __attribute__((__noreturn__)) -#else - #define START_PACK_STRUCTS pack (1) - #define END_PACK_STRUCTS pack () - #define GCC_PACK - #define NORETURN -#endif -#define main morphos_main #elif defined(__DC__) -#define scumm_stricmp strcasecmp -#define CHECK_HEAP -#define SCUMM_LITTLE_ENDIAN -#define SCUMM_NEED_ALIGNMENT - -#define FORCEINLINE inline -#define NORETURN __attribute__((__noreturn__)) -#define GCC_PACK __attribute__((packed)) -#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 pack (push,1) -#define END_PACK_STRUCTS pack(pop) - + #define scumm_stricmp strcasecmp + #define CHECK_HEAP + #define SCUMM_LITTLE_ENDIAN + #define SCUMM_NEED_ALIGNMENT + + #define FORCEINLINE inline + #define NORETURN __attribute__((__noreturn__)) + #define GCC_PACK __attribute__((packed)) + #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 pack (push,1) + #define END_PACK_STRUCTS pack(pop) + #else -#error No system type defined + #error No system type defined #endif #define SWAP_BYTES(a) ((((a)>>24)&0xFF) | (((a)>>8)&0xFF00) | (((a)<<8)&0xFF0000) | (((a)<<24)&0xFF000000)) #if defined(SCUMM_LITTLE_ENDIAN) - -//#if defined(SCUMM_NEED_ALIGNMENT) -//#error Little endian processors that need alignment is not implemented -//#endif - - -#define PROTO_MKID(a) SWAP_BYTES(a) -#define PROTO_MKID_BE(a) (a & 0xffffffff) - -#if defined(INVERSE_MKID) -# define MKID(a) PROTO_MKID_BE(a) -# define MKID_BE(a) PROTO_MKID(a) -#else -# define MKID(a) PROTO_MKID(a) -# define MKID_BE(a) PROTO_MKID_BE(a) -#endif - - -#if defined(SCUMM_NEED_ALIGNMENT) - FORCEINLINE uint READ_LE_UINT16(void *ptr) { - return (((byte*)ptr)[1]<<8)|((byte*)ptr)[0]; - } -#else - FORCEINLINE uint READ_LE_UINT16(void *ptr) { - return *(uint16*)(ptr); - } -#endif - -FORCEINLINE uint READ_BE_UINT16(void *ptr) { - return (((byte*)ptr)[0]<<8)|((byte*)ptr)[1]; -} - -#if defined(SCUMM_NEED_ALIGNMENT) - FORCEINLINE uint32 READ_LE_UINT32(void *ptr) { - byte *b = (byte*)ptr; - return (b[3]<<24)+(b[2]<<16)+(b[1]<<8)+(b[0]); - } -#else - FORCEINLINE uint32 READ_LE_UINT32(void *ptr) { - return *(uint32*)(ptr); - } -#endif - -FORCEINLINE uint32 READ_BE_UINT32(void *ptr) { - byte *b = (byte*)ptr; - return (b[0]<<24)+(b[1]<<16)+(b[2]<<8)+(b[3]); -} - -#define READ_BE_UINT32_UNALIGNED READ_BE_UINT32 -#define READ_BE_UINT16_UNALIGNED READ_BE_UINT16 - -#define READ_UINT32_UNALIGNED(a) READ_LE_UINT32(a) - -#define FROM_LE_32(__a__) __a__ -#define FROM_LE_16(__a__) __a__ - -#define TO_LE_32(__a__) __a__ -#define TO_LE_16(__a__) __a__ - -#define TO_BE_32(a) SWAP_BYTES(a) - -uint16 FORCEINLINE TO_BE_16(uint16 a) { return (a>>8) | (a<<8); } + + #define PROTO_MKID(a) SWAP_BYTES(a) + #define PROTO_MKID_BE(a) (a & 0xffffffff) + + #if defined(INVERSE_MKID) + # define MKID(a) PROTO_MKID_BE(a) + # define MKID_BE(a) PROTO_MKID(a) + #else + # define MKID(a) PROTO_MKID(a) + # define MKID_BE(a) PROTO_MKID_BE(a) + #endif + + + #if defined(SCUMM_NEED_ALIGNMENT) + FORCEINLINE uint READ_LE_UINT16(void *ptr) { + return (((byte*)ptr)[1]<<8)|((byte*)ptr)[0]; + } + #else + FORCEINLINE uint READ_LE_UINT16(void *ptr) { + return *(uint16*)(ptr); + } + #endif + + FORCEINLINE uint READ_BE_UINT16(void *ptr) { + return (((byte*)ptr)[0]<<8)|((byte*)ptr)[1]; + } + + #if defined(SCUMM_NEED_ALIGNMENT) + FORCEINLINE uint32 READ_LE_UINT32(void *ptr) { + byte *b = (byte*)ptr; + return (b[3]<<24)+(b[2]<<16)+(b[1]<<8)+(b[0]); + } + #else + FORCEINLINE uint32 READ_LE_UINT32(void *ptr) { + return *(uint32*)(ptr); + } + #endif + + FORCEINLINE uint32 READ_BE_UINT32(void *ptr) { + byte *b = (byte*)ptr; + return (b[0]<<24)+(b[1]<<16)+(b[2]<<8)+(b[3]); + } + + #define READ_BE_UINT32_UNALIGNED READ_BE_UINT32 + #define READ_BE_UINT16_UNALIGNED READ_BE_UINT16 + + #define READ_UINT32_UNALIGNED(a) READ_LE_UINT32(a) + + #define FROM_LE_32(__a__) __a__ + #define FROM_LE_16(__a__) __a__ + + #define TO_LE_32(__a__) __a__ + #define TO_LE_16(__a__) __a__ + + #define TO_BE_32(a) SWAP_BYTES(a) + + uint16 FORCEINLINE TO_BE_16(uint16 a) { return (a>>8) | (a<<8); } #elif defined(SCUMM_BIG_ENDIAN) -#define MKID(a) (a) -#define MKID_BE(a) (a) -//#define MKID_BE(a) SWAP_BYTES(a) - -uint32 FORCEINLINE FROM_LE_32(uint32 a) { - return ((a>>24)&0xFF) + ((a>>8)&0xFF00) + ((a<<8)&0xFF0000) + ((a<<24)&0xFF000000); -} - -uint16 FORCEINLINE FROM_LE_16(uint16 a) { - return ((a>>8)&0xFF) + ((a<<8)&0xFF00); -} + #define MKID(a) (a) + #define MKID_BE(a) (a) + //#define MKID_BE(a) SWAP_BYTES(a) + + uint32 FORCEINLINE FROM_LE_32(uint32 a) { + return ((a>>24)&0xFF) + ((a>>8)&0xFF00) + ((a<<8)&0xFF0000) + ((a<<24)&0xFF000000); + } + + uint16 FORCEINLINE FROM_LE_16(uint16 a) { + return ((a>>8)&0xFF) + ((a<<8)&0xFF00); + } + + #define TO_LE_32 FROM_LE_32 + #define TO_LE_16 FROM_LE_16 + + uint32 FORCEINLINE READ_LE_UINT32(void *ptr) { + byte *b = (byte*)ptr; + return (b[3]<<24)+(b[2]<<16)+(b[1]<<8)+(b[0]); + } + + uint32 FORCEINLINE READ_BE_UINT32(void *ptr) { + return *(uint32*)(ptr); + } + + uint FORCEINLINE READ_LE_UINT16(void *ptr) { + byte *b = (byte*)ptr; + return (b[1]<<8) + b[0]; + } + + uint FORCEINLINE READ_BE_UINT16(void *ptr) { + return *(uint16*)(ptr); + } + + uint FORCEINLINE READ_BE_UINT16_UNALIGNED(void *ptr) { + return (((byte*)ptr)[0]<<8)|((byte*)ptr)[1]; + } + + uint32 FORCEINLINE READ_BE_UINT32_UNALIGNED(void *ptr) { + byte *b = (byte*)ptr; + return (b[0]<<24)+(b[1]<<16)+(b[2]<<8)+(b[3]); + } + + #define READ_UINT32_UNALIGNED READ_BE_UINT32_UNALIGNED + + #define TO_BE_32(a) (a) + #define TO_BE_16(a) (a) -#define TO_LE_32 FROM_LE_32 -#define TO_LE_16 FROM_LE_16 - -uint32 FORCEINLINE READ_LE_UINT32(void *ptr) { - byte *b = (byte*)ptr; - return (b[3]<<24)+(b[2]<<16)+(b[1]<<8)+(b[0]); -} - -uint32 FORCEINLINE READ_BE_UINT32(void *ptr) { - return *(uint32*)(ptr); -} - -uint FORCEINLINE READ_LE_UINT16(void *ptr) { - byte *b = (byte*)ptr; - return (b[1]<<8) + b[0]; -} - -uint FORCEINLINE READ_BE_UINT16(void *ptr) { - return *(uint16*)(ptr); -} - -uint FORCEINLINE READ_BE_UINT16_UNALIGNED(void *ptr) { - return (((byte*)ptr)[0]<<8)|((byte*)ptr)[1]; -} - -uint32 FORCEINLINE READ_BE_UINT32_UNALIGNED(void *ptr) { - byte *b = (byte*)ptr; - return (b[0]<<24)+(b[1]<<16)+(b[2]<<8)+(b[3]); -} - -#define READ_UINT32_UNALIGNED READ_BE_UINT32_UNALIGNED - -#define TO_BE_32(a) (a) -#define TO_BE_16(a) (a) #else -#error No endianness defined + #error No endianness defined #endif -#ifdef NEED_STRDUP -char *strdup(const char *s); -#endif /* Initialized operator new */ void * operator new(size_t size); - void operator delete(void *ptr); #endif diff --git a/scumm/resource.cpp b/scumm/resource.cpp index 1edbcd8b05..f5d39eeec0 100644 --- a/scumm/resource.cpp +++ b/scumm/resource.cpp @@ -159,7 +159,7 @@ void Scumm::readRoomsOffsets() _fileHandle.seek(16, SEEK_SET); } else { - _fileHandle.seek(12, SEEK_SET); // Directlry searching for the room offset block would be more generic... + _fileHandle.seek(12, SEEK_SET); // Directly searching for the room offset block would be more generic... } num = _fileHandle.readByte(); @@ -730,7 +730,7 @@ int Scumm::readSoundResource(int type, int idx) _fileHandle.read(createResource(type, idx, total_size), total_size - 8); return 1; } else { - fprintf(stderr, "WARNING: Unrecognized base tag 0x%08lx in sound %d\n", basetag, idx); + fprintf(stderr, "WARNING: Unrecognized base tag 0x%08x in sound %d\n", basetag, idx); } res.roomoffs[type][idx] = 0xFFFFFFFF; return 0; @@ -738,126 +738,126 @@ int Scumm::readSoundResource(int type, int idx) // FIXME: some default MIDI instruments for INDY3/MI1 static char OLD256_MIDI_HACK[] = - // 0 - "\x00\xf0\x14\x7d\x00" // sysex 00: part on/off - "\x00\x00\x03" // part/channel - "\x00\x00\x07\x0f\x00\x00\x08\x00\x00\x00\x00\x02\x00\x00\xf7" - "\x04\xf0\x41\x7d\x10" // sysex 16: set instrument - "\x00" // part/channel - "\x01\x06\x02\x0a\x08\x09\x0d\x08\x04\x04" - "\x04\x06\x02\x02\x03\x07\x0f\x0d" - "\x05\x04\x0c\x00\x03\x01\x01\x00" - "\x00\x00\x01\x01\x0e\x00\x02\x02" - "\x01\x00\x01\x00\x01\x02\x00\x01" - "\x08\x00\x00\x00\x01\x02\x04\x00" - "\x06\x02\x00\x00\x04\x00\x03\x02" - "\x04\x00\x00\xf7" - "\x00\xb0\x07\x64" // Controller 7 = 100 - // 1 - "\x00\xf0\x14\x7d\x00" // sysex 00: part on/off - "\x01\x00\x03" // part/channel - "\x00\x00\x07\x0f\x00\x00\x08\x00\x00\x00\x00\x02\x00\x00\xf7" - "\x04\xf0\x41\x7d\x10" // sysex 16: set instrument - "\x01" // part/channel - "\x01\x06\x02\x0a\x08\x09\x0d\x08\x04\x04" - "\x04\x06\x02\x02\x03\x07\x0f\x0d" - "\x05\x04\x0c\x00\x03\x01\x01\x00" - "\x00\x00\x01\x01\x0e\x00\x02\x02" - "\x01\x00\x01\x00\x01\x02\x00\x01" - "\x08\x00\x00\x00\x01\x02\x04\x00" - "\x06\x02\x00\x00\x04\x00\x03\x02" - "\x04\x00\x00\xf7" - "\x00\xb1\x07\x64" // Controller 7 = 100 - // 2 - "\x00\xf0\x14\x7d\x00" // sysex 00: part on/off - "\x02\x00\x03" // part/channel - "\x00\x00\x07\x0f\x00\x00\x08\x00\x00\x00\x00\x02\x00\x00\xf7" - "\x04\xf0\x41\x7d\x10" // sysex 16: set instrument - "\x02" // part/channel - "\x01\x06\x02\x0a\x08\x09\x0d\x08\x04\x04" - "\x04\x06\x02\x02\x03\x07\x0f\x0d" - "\x05\x04\x0c\x00\x03\x01\x01\x00" - "\x00\x00\x01\x01\x0e\x00\x02\x02" - "\x01\x00\x01\x00\x01\x02\x00\x01" - "\x08\x00\x00\x00\x01\x02\x04\x00" - "\x06\x02\x00\x00\x04\x00\x03\x02" - "\x04\x00\x00\xf7" - "\x00\xb2\x07\x64" // Controller 7 = 100 - // 3 - "\x00\xf0\x14\x7d\x00" // sysex 00: part on/off - "\x03\x00\x03" // part/channel - "\x00\x00\x07\x0f\x00\x00\x08\x00\x00\x00\x00\x02\x00\x00\xf7" - "\x04\xf0\x41\x7d\x10" // sysex 16: set instrument - "\x03" // part/channel - "\x01\x06\x02\x0a\x08\x09\x0d\x08\x04\x04" - "\x04\x06\x02\x02\x03\x07\x0f\x0d" - "\x05\x04\x0c\x00\x03\x01\x01\x00" - "\x00\x00\x01\x01\x0e\x00\x02\x02" - "\x01\x00\x01\x00\x01\x02\x00\x01" - "\x08\x00\x00\x00\x01\x02\x04\x00" - "\x06\x02\x00\x00\x04\x00\x03\x02" - "\x04\x00\x00\xf7" - "\x00\xb3\x07\x64" // Controller 7 = 100 - // 4 - "\x00\xf0\x14\x7d\x00" // sysex 00: part on/off - "\x04\x00\x03" // part/channel - "\x00\x00\x07\x0f\x00\x00\x08\x00\x00\x00\x00\x02\x00\x00\xf7" - "\x04\xf0\x41\x7d\x10" // sysex 16: set instrument - "\x04" // part/channel - "\x01\x06\x02\x0a\x08\x09\x0d\x08\x04\x04" - "\x04\x06\x02\x02\x03\x07\x0f\x0d" - "\x05\x04\x0c\x00\x03\x01\x01\x00" - "\x00\x00\x01\x01\x0e\x00\x02\x02" - "\x01\x00\x01\x00\x01\x02\x00\x01" - "\x08\x00\x00\x00\x01\x02\x04\x00" - "\x06\x02\x00\x00\x04\x00\x03\x02" - "\x04\x00\x00\xf7" - "\x00\xb4\x07\x64" // Controller 7 = 100 - // 5 - "\x00\xf0\x14\x7d\x00" // sysex 00: part on/off - "\x05\x00\x03" // part/channel - "\x00\x00\x07\x0f\x00\x00\x08\x00\x00\x00\x00\x02\x00\x00\xf7" - "\x04\xf0\x41\x7d\x10" // sysex 16: set instrument - "\x05" // part/channel - "\x01\x06\x02\x0a\x08\x09\x0d\x08\x04\x04" - "\x04\x06\x02\x02\x03\x07\x0f\x0d" - "\x05\x04\x0c\x00\x03\x01\x01\x00" - "\x00\x00\x01\x01\x0e\x00\x02\x02" - "\x01\x00\x01\x00\x01\x02\x00\x01" - "\x08\x00\x00\x00\x01\x02\x04\x00" - "\x06\x02\x00\x00\x04\x00\x03\x02" - "\x04\x00\x00\xf7" - "\x00\xb5\x07\x64" // Controller 7 = 100 - // 6 - "\x00\xf0\x14\x7d\x00" // sysex 00: part on/off - "\x06\x00\x03" // part/channel - "\x00\x00\x07\x0f\x00\x00\x08\x00\x00\x00\x00\x02\x00\x00\xf7" - "\x04\xf0\x41\x7d\x10" // sysex 16: set instrument - "\x06" // part/channel - "\x01\x06\x02\x0a\x08\x09\x0d\x08\x04\x04" - "\x04\x06\x02\x02\x03\x07\x0f\x0d" - "\x05\x04\x0c\x00\x03\x01\x01\x00" - "\x00\x00\x01\x01\x0e\x00\x02\x02" - "\x01\x00\x01\x00\x01\x02\x00\x01" - "\x08\x00\x00\x00\x01\x02\x04\x00" - "\x06\x02\x00\x00\x04\x00\x03\x02" - "\x04\x00\x00\xf7" - "\x00\xb6\x07\x64" // Controller 7 = 100 - // 7 - "\x00\xf0\x14\x7d\x00" // sysex 00: part on/off - "\x07\x00\x03" // part/channel - "\x00\x00\x07\x0f\x00\x00\x08\x00\x00\x00\x00\x02\x00\x00\xf7" - "\x04\xf0\x41\x7d\x10" // sysex 16: set instrument - "\x07" // part/channel - "\x01\x06\x02\x0a\x08\x09\x0d\x08\x04\x04" - "\x04\x06\x02\x02\x03\x07\x0f\x0d" - "\x05\x04\x0c\x00\x03\x01\x01\x00" - "\x00\x00\x01\x01\x0e\x00\x02\x02" - "\x01\x00\x01\x00\x01\x02\x00\x01" - "\x08\x00\x00\x00\x01\x02\x04\x00" - "\x06\x02\x00\x00\x04\x00\x03\x02" - "\x04\x00\x00\xf7" - "\x00\xb7\x07\x64"; // Controller 7 = 100 + // 0 + "\x00\xf0\x14\x7d\x00" // sysex 00: part on/off + "\x00\x00\x03" // part/channel + "\x00\x00\x07\x0f\x00\x00\x08\x00\x00\x00\x00\x02\x00\x00\xf7" + "\x04\xf0\x41\x7d\x10" // sysex 16: set instrument + "\x00" // part/channel + "\x01\x06\x02\x0a\x08\x09\x0d\x08\x04\x04" + "\x04\x06\x02\x02\x03\x07\x0f\x0d" + "\x05\x04\x0c\x00\x03\x01\x01\x00" + "\x00\x00\x01\x01\x0e\x00\x02\x02" + "\x01\x00\x01\x00\x01\x02\x00\x01" + "\x08\x00\x00\x00\x01\x02\x04\x00" + "\x06\x02\x00\x00\x04\x00\x03\x02" + "\x04\x00\x00\xf7" + "\x00\xb0\x07\x64" // Controller 7 = 100 + // 1 + "\x00\xf0\x14\x7d\x00" // sysex 00: part on/off + "\x01\x00\x03" // part/channel + "\x00\x00\x07\x0f\x00\x00\x08\x00\x00\x00\x00\x02\x00\x00\xf7" + "\x04\xf0\x41\x7d\x10" // sysex 16: set instrument + "\x01" // part/channel + "\x01\x06\x02\x0a\x08\x09\x0d\x08\x04\x04" + "\x04\x06\x02\x02\x03\x07\x0f\x0d" + "\x05\x04\x0c\x00\x03\x01\x01\x00" + "\x00\x00\x01\x01\x0e\x00\x02\x02" + "\x01\x00\x01\x00\x01\x02\x00\x01" + "\x08\x00\x00\x00\x01\x02\x04\x00" + "\x06\x02\x00\x00\x04\x00\x03\x02" + "\x04\x00\x00\xf7" + "\x00\xb1\x07\x64" // Controller 7 = 100 + // 2 + "\x00\xf0\x14\x7d\x00" // sysex 00: part on/off + "\x02\x00\x03" // part/channel + "\x00\x00\x07\x0f\x00\x00\x08\x00\x00\x00\x00\x02\x00\x00\xf7" + "\x04\xf0\x41\x7d\x10" // sysex 16: set instrument + "\x02" // part/channel + "\x01\x06\x02\x0a\x08\x09\x0d\x08\x04\x04" + "\x04\x06\x02\x02\x03\x07\x0f\x0d" + "\x05\x04\x0c\x00\x03\x01\x01\x00" + "\x00\x00\x01\x01\x0e\x00\x02\x02" + "\x01\x00\x01\x00\x01\x02\x00\x01" + "\x08\x00\x00\x00\x01\x02\x04\x00" + "\x06\x02\x00\x00\x04\x00\x03\x02" + "\x04\x00\x00\xf7" + "\x00\xb2\x07\x64" // Controller 7 = 100 + // 3 + "\x00\xf0\x14\x7d\x00" // sysex 00: part on/off + "\x03\x00\x03" // part/channel + "\x00\x00\x07\x0f\x00\x00\x08\x00\x00\x00\x00\x02\x00\x00\xf7" + "\x04\xf0\x41\x7d\x10" // sysex 16: set instrument + "\x03" // part/channel + "\x01\x06\x02\x0a\x08\x09\x0d\x08\x04\x04" + "\x04\x06\x02\x02\x03\x07\x0f\x0d" + "\x05\x04\x0c\x00\x03\x01\x01\x00" + "\x00\x00\x01\x01\x0e\x00\x02\x02" + "\x01\x00\x01\x00\x01\x02\x00\x01" + "\x08\x00\x00\x00\x01\x02\x04\x00" + "\x06\x02\x00\x00\x04\x00\x03\x02" + "\x04\x00\x00\xf7" + "\x00\xb3\x07\x64" // Controller 7 = 100 + // 4 + "\x00\xf0\x14\x7d\x00" // sysex 00: part on/off + "\x04\x00\x03" // part/channel + "\x00\x00\x07\x0f\x00\x00\x08\x00\x00\x00\x00\x02\x00\x00\xf7" + "\x04\xf0\x41\x7d\x10" // sysex 16: set instrument + "\x04" // part/channel + "\x01\x06\x02\x0a\x08\x09\x0d\x08\x04\x04" + "\x04\x06\x02\x02\x03\x07\x0f\x0d" + "\x05\x04\x0c\x00\x03\x01\x01\x00" + "\x00\x00\x01\x01\x0e\x00\x02\x02" + "\x01\x00\x01\x00\x01\x02\x00\x01" + "\x08\x00\x00\x00\x01\x02\x04\x00" + "\x06\x02\x00\x00\x04\x00\x03\x02" + "\x04\x00\x00\xf7" + "\x00\xb4\x07\x64" // Controller 7 = 100 + // 5 + "\x00\xf0\x14\x7d\x00" // sysex 00: part on/off + "\x05\x00\x03" // part/channel + "\x00\x00\x07\x0f\x00\x00\x08\x00\x00\x00\x00\x02\x00\x00\xf7" + "\x04\xf0\x41\x7d\x10" // sysex 16: set instrument + "\x05" // part/channel + "\x01\x06\x02\x0a\x08\x09\x0d\x08\x04\x04" + "\x04\x06\x02\x02\x03\x07\x0f\x0d" + "\x05\x04\x0c\x00\x03\x01\x01\x00" + "\x00\x00\x01\x01\x0e\x00\x02\x02" + "\x01\x00\x01\x00\x01\x02\x00\x01" + "\x08\x00\x00\x00\x01\x02\x04\x00" + "\x06\x02\x00\x00\x04\x00\x03\x02" + "\x04\x00\x00\xf7" + "\x00\xb5\x07\x64" // Controller 7 = 100 + // 6 + "\x00\xf0\x14\x7d\x00" // sysex 00: part on/off + "\x06\x00\x03" // part/channel + "\x00\x00\x07\x0f\x00\x00\x08\x00\x00\x00\x00\x02\x00\x00\xf7" + "\x04\xf0\x41\x7d\x10" // sysex 16: set instrument + "\x06" // part/channel + "\x01\x06\x02\x0a\x08\x09\x0d\x08\x04\x04" + "\x04\x06\x02\x02\x03\x07\x0f\x0d" + "\x05\x04\x0c\x00\x03\x01\x01\x00" + "\x00\x00\x01\x01\x0e\x00\x02\x02" + "\x01\x00\x01\x00\x01\x02\x00\x01" + "\x08\x00\x00\x00\x01\x02\x04\x00" + "\x06\x02\x00\x00\x04\x00\x03\x02" + "\x04\x00\x00\xf7" + "\x00\xb6\x07\x64" // Controller 7 = 100 + // 7 + "\x00\xf0\x14\x7d\x00" // sysex 00: part on/off + "\x07\x00\x03" // part/channel + "\x00\x00\x07\x0f\x00\x00\x08\x00\x00\x00\x00\x02\x00\x00\xf7" + "\x04\xf0\x41\x7d\x10" // sysex 16: set instrument + "\x07" // part/channel + "\x01\x06\x02\x0a\x08\x09\x0d\x08\x04\x04" + "\x04\x06\x02\x02\x03\x07\x0f\x0d" + "\x05\x04\x0c\x00\x03\x01\x01\x00" + "\x00\x00\x01\x01\x0e\x00\x02\x02" + "\x01\x00\x01\x00\x01\x02\x00\x01" + "\x08\x00\x00\x00\x01\x02\x04\x00" + "\x06\x02\x00\x00\x04\x00\x03\x02" + "\x04\x00\x00\xf7" + "\x00\xb7\x07\x64"; // Controller 7 = 100 int Scumm::readSoundResourceSmallHeader(int type, int idx) { @@ -1483,7 +1483,7 @@ void Scumm::resourceStats() } } - printf("Total allocated size=%ld, locked=%ld(%ld)\n", _allocatedSize, lockedSize, lockedNum); + printf("Total allocated size=%d, locked=%d(%d)\n", _allocatedSize, lockedSize, lockedNum); } void Scumm::heapClear(int mode) diff --git a/scumm/smush/scumm_renderer.cpp b/scumm/smush/scumm_renderer.cpp index 89cc8dadb5..f5e8dafd6d 100644 --- a/scumm/smush/scumm_renderer.cpp +++ b/scumm/smush/scumm_renderer.cpp @@ -111,7 +111,7 @@ bool ScummMixer::addChannel(_Channel * c) { fprintf(stderr, "_nextIndex == %d\n", _nextIndex); for(i = _mixer->_beginSlots; i < SoundMixer::NUM_CHANNELS; i++) { - fprintf(stderr, "channel %d : %p(%ld, %d) %d %d\n", i, _channels[i].chan, + fprintf(stderr, "channel %d : %p(%d, %d) %d %d\n", i, _channels[i].chan, _channels[i].chan ? _channels[i].chan->getTrackIdentifier() : -1, _channels[i].chan ? _channels[i].chan->isTerminated() : 1, _channels[i].first, _channels[i].mixer_index); diff --git a/scumm/string.cpp b/scumm/string.cpp index f574635dbd..a8e1dd2ff7 100644 --- a/scumm/string.cpp +++ b/scumm/string.cpp @@ -253,7 +253,7 @@ void Scumm::CHARSET_1() if (!(_features & GF_OLD256)) // FIXME for (i = 0; i < 4; i++) if (_features & GF_SMALL_HEADER) - charset._colorMap[i] = _charsetData[charset._curId][i - 12]; + charset._colorMap[i] = _charsetData[charset._curId][i - 12]; // FIXME - do we really want to access index -12 to -9 ? else charset._colorMap[i] = _charsetData[charset._curId][i]; @@ -343,7 +343,7 @@ void Scumm::CHARSET_1() charset._xpos2 -= charset.getStringWidth(0, buffer, 0) >> 1; } if (_features & GF_SMALL_HEADER) - charset._ypos2 += getResourceAddress(rtCharset, charset._curId)[18]; + charset._ypos2 += getResourceAddress(rtCharset, charset._curId)[30 - 12]; else charset._ypos2 += getResourceAddress(rtCharset, charset._curId)[30]; charset._disableOffsX = 1; @@ -418,7 +418,7 @@ void Scumm::CHARSET_1() case 14: { int oldy; if (_features & GF_SMALL_HEADER) - oldy = getResourceAddress(rtCharset, charset._curId)[18]; + oldy = getResourceAddress(rtCharset, charset._curId)[30 - 12]; else oldy = getResourceAddress(rtCharset, charset._curId)[30]; @@ -426,11 +426,11 @@ void Scumm::CHARSET_1() buffer += 2; for (i = 0; i < 4; i++) if (_features & GF_SMALL_HEADER) - charset._colorMap[i] = _charsetData[charset._curId][i - 12]; + charset._colorMap[i] = _charsetData[charset._curId][i - 12]; // FIXME - do we really want to access index -12 to -9 ? else charset._colorMap[i] = _charsetData[charset._curId][i]; if (_features & GF_SMALL_HEADER) - charset._ypos2 -= getResourceAddress(rtCharset, charset._curId)[18] - oldy; + charset._ypos2 -= getResourceAddress(rtCharset, charset._curId)[30 - 12] - oldy; else charset._ypos2 -= getResourceAddress(rtCharset, charset._curId)[30] - oldy; break; @@ -596,7 +596,7 @@ void Scumm::drawString(int a) for (i = 0; i < 4; i++) if (_features & GF_SMALL_HEADER) - charset._colorMap[i] = _charsetData[charset._curId][i - 12]; + charset._colorMap[i] = _charsetData[charset._curId][i - 12]; // FIXME - do we really want to access index -12 to -9 ? else charset._colorMap[i] = _charsetData[charset._curId][i]; @@ -876,7 +876,7 @@ void Scumm::initCharset(int charsetno) for (i = 0; i < 0x10; i++) if (_features & GF_SMALL_HEADER) - charset._colorMap[i] = _charsetData[charset._curId][i - 12]; + charset._colorMap[i] = _charsetData[charset._curId][i - 12]; // FIXME - do we really want to access index -12 to -9 ? else charset._colorMap[i] = _charsetData[charset._curId][i]; } @@ -1159,7 +1159,7 @@ void Scumm::translateText(char * text, char * trans_buff) { number[2] = *(text + l + 3); number[3] = 0; num = atol(number); - sprintf(num_s, "%ld", num); + sprintf(num_s, "%d", num); char * buf = _languageBuffer; pos = 0; diff --git a/simon/simon.cpp b/simon/simon.cpp index b55f8788ab..0307f433b3 100644 --- a/simon/simon.cpp +++ b/simon/simon.cpp @@ -4794,7 +4794,7 @@ void SimonState::playSound(uint sound) _effects_file->read(&size, 4); // FIXME - do we really want to read a block of 4 bytes, ignoring endian issues? - printf("FOO %08lx 7 %ld \n", size, size & 0xffffff); + printf("FOO %08x / %d (please report this to Fingolfin)\n", size, size & 0xffffff); size = size & 0xffffff; _effects_file->seek(-1, SEEK_CUR); _effects_file->read(&voc_block_hdr, sizeof(voc_block_hdr)); |