diff options
487 files changed, 27724 insertions, 37865 deletions
@@ -170,7 +170,7 @@ AGOS Games by Adventuresoft / Horrorsoft: - Swampy Adventures [swampy] The Feeble Files [feeble] -GOB Games by Cocktel Vision: +GOB Games by Coktel Vision: Bargon Attack [bargon] Gobliiins [gob1] Gobliins 2 [gob2] @@ -248,7 +248,7 @@ by ScummVM (yet): Other Humongous Entertainment games -Please be aware that the engine may contain bugs and unimplemented features +Please be aware that the engines may contain bugs and unimplemented features that sometimes make it impossible to finish the game. Save often, and please file a bug report (instructions on submitting bug reports are above) if you encounter such a bug in a 'supported' game. @@ -296,7 +296,7 @@ yet playable. Simply name the D64 disks "maniac1.d64" and should be able to automatically detect the game if you point it at the right directory. -Alternatively, you can use extract_mm_c64 from the tools package to +Alternatively, you can use 'extract_mm_c64' from the tools package to extract the data files. But then the game will not be properly autodetected by ScummVM, and you must make sure that the platform is set to Commodore64. We recommend using the much simpler approach @@ -326,7 +326,7 @@ Most common mistakes which prevents the game from running: * You try to feed ScummVM with the FULL ROM and not just the PRG section. It is also possible to extract the separate LFL files from the PRG section. -To do so use the extract_mm_nes utility from the tools package. +To do so use the 'extract_mm_nes' utility from the tools package. 3.4) Macintosh games notes: @@ -346,7 +346,7 @@ extra tools in order to copy it). ScummVM is able to directly use such a data fi simply point ScummVM at the directory containing it, and it should work (just like with every other supported game). -We also provide a tool called 'rescumm' in the tools package to extract the +We also provide a tool called 'extract_scumm_mac' in the tools package to extract the data from these data files, but this is neither required nor recommended. For further information on copying Macintosh game files to your hard disk see: @@ -366,15 +366,6 @@ Fortunately, ScummVM has no problems running the games entirely from hard disk, if you create a directory with the correct combination of files. Usually, when a file appears on more than one CD you can pick either of them. -These instructions are written for the PC versions (which in some case is the -only version) of the games. Windows and DOS use case-insensitive file systems, -so if one CD has a file called MONKEY.DAT and another has a file called -monkey.dat, they are the same files. These instructions give file names in all -lower-case names, even if that's not always how they appear on the CDs. In -fact, on case-sensitive file systems you will have to make sure that all -filenames use either all upper- or all lower-case letters for ScummVM to be -able to find the files. - 3.6) The Curse of Monkey Island notes: ---- --------------------------------- @@ -400,12 +391,12 @@ re-encoded Broken Sword cutscenes for download on our website: These cutscenes are provided in DXA format with FLAC audio. Their quality is equal to the original games due to the use of lossless compression. Viewing these cutscenes requires a version of ScummVM compiled with both -FLAC and zLib support. +FLAC and zlib support. For systems that are too slow to handle the decoding of FLAC audio, -the audio for these cutscenes is provided separately as OGG Vorbis audio -too. Viewing these cutscenes with OGG Vorbis audio requires a version of -ScummVM compiled with both libVorbis and zLib support. +the audio for these cutscenes is also provided separately as OGG Vorbis audio. +Viewing these cutscenes with OGG Vorbis audio requires a version of ScummVM +compiled with both libVorbis and zlib support. The cutscenes should be placed in the main game data directory. Note that currently this requires either copying the game to hard disk or burning @@ -711,12 +702,6 @@ Use at your own risk! 5.0) Running ScummVM: ---- ---------------- -Before you run the engine, you need to put the game's data files in a -directory. The filenames must not be in mixed case on *nix systems -(for example, these are valid names: "monkey2.000", "MONKEY2.000", while -this is a bad one: "Monkey2.000"). If you use a game with speech, the file -monster.sou must reside in the same directory as the data files. - Please note that by default, ScummVM will save games in the directory it is executed from, so you should refrain from running it from more than one location. Further information, including how to specify a specific save @@ -790,10 +775,10 @@ arguments -- see the next section. Steel Sky and Flight of the Amazon Queen --copy-protection Enable copy protection in games, when ScummVM disables it by default. + --talkspeed=NUM Set talk speed for games (default: 60) --demo-mode Start demo mode of Maniac Mansion (Classic version) --tempo=NUM Set music tempo (in percent, 50-200) for SCUMM games (default: 100) - --talkspeed=NUM Set talk speed for games The meaning of most long options (that is, those options starting with a @@ -832,6 +817,10 @@ option does *not* change the language of the game (which usually is hardcoded), but rather is only used to select the appropriate font (e.g. for a German version of a game, one containing umlauts). +An exception are The Dig and The Curse of Monkey Island - non-English versions +can be set to 'English.' This however only affects subtitles; game speech will +remain the same. + Maniac Mansion and Zak McKracken en - English (default) de - German @@ -933,7 +922,7 @@ will be scaled to 1280x960 and 1920x1440. ---- --------- TODO TODO: Rework this section to clearly state which hotkeys are implemented in *all* -TODO game (and for which backends). +TODO games (and for which backends). TODO: It would also be nice to add information about control on devices w/o a keyboard; TODO I.e. document how input on DC, DS, PSP, PS2, PalmOS, WinCE, ... works for each game TODO Or at the very least give points as to were one can read up on these. @@ -1077,7 +1066,7 @@ other games. t - Switch between 'Voice only', 'Voice and Text' and 'Text only' -Note that using ctrl-f or ctrl-g is not recommended: games can crash when +Note that using Ctrl-f or Ctrl-g is not recommended: games can crash when being run faster than their normal speed, as scripts will lose synchronisation. Note for WinCE users: Due to the limited keyboard input in most devices, a @@ -1189,7 +1178,7 @@ strongly recommended. ---- ---------------------------------- Some games (such as Sam & Max) only contain MIDI music data. This once prevented music for these games from working on platforms that do not support -MIDI, or soundcards that do not provide MIDI drivers (e.g, many soundcards will +MIDI, or soundcards that do not provide MIDI drivers (e.g. many soundcards will not play MIDI under Linux). ScummVM can now emulate MIDI mode using sampled waves and Adlib, FluidSynth MIDI emulation or MT-32 emulation using the -eadlib, -efluidsynth or -emt32 options respectively. However, if you are @@ -1339,7 +1328,7 @@ affect the encoding time and resulting filesize. 7.7.3) Compressing MONSTER.SOU with MP3: ------ --------------------------------- -You need LAME, and our compress_scumm_sou utility from the scummvm-tools +You need LAME, and our 'compress_scumm_sou' utility from the scummvm-tools package to perform this task, and ScummVM must be compiled with MAD support. compress_scumm_sou monster.sou @@ -1375,7 +1364,7 @@ to read the encoder documentation before you use other values. 7.7.6) Compressing music/sfx/speech in AGOS games ------ ----------------------------------------------------------------- -Use our compress_agos utility from the scummvm-tools package to perform this +Use our 'compress_agos' utility from the scummvm-tools package to perform this task. You can choose between multiple target formats, but note that you can only use each if ScummVM was compiled with the respective decoder support enabled. @@ -1410,7 +1399,7 @@ file to your game directory. You can safely remove the old file. 7.7.7) Compressing speech/music in Broken Sword 1 ------ ------------------------------------------ -The compress_sword1 tool from the scummvm-tools package can encode music and +The 'compress_sword1' tool from the scummvm-tools package can encode music and speech to MP3 as well as Ogg Vorbis. The easiest way to encode the files is simply copying the executable into your BS1 directory (together with the lame encoder) and run it from there. @@ -1429,7 +1418,7 @@ Use "compress_sword1 --help" to get a full list of the options. 7.7.8) Compressing speech/music in Broken Sword 2 ------ ------------------------------------------ -Use our compress_sword2 utility from the scummvm-tools package to perform this +Use our 'compress_sword2' utility from the scummvm-tools package to perform this task. You can choose between multiple target formats, but note that you can only use each if ScummVM was compiled with the respective decoder support enabled. diff --git a/backends/factories/fs-factory-maker.h b/backends/factories/fs-factory-maker.h deleted file mode 100644 index f9fc0ff85f..0000000000 --- a/backends/factories/fs-factory-maker.h +++ /dev/null @@ -1,76 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL: $ - * $Id: $ - */ - -#ifndef FS_FACTORY_MAKER_H -#define FS_FACTORY_MAKER_H - -#include "backends/factories/abstract-fs-factory.h" - -/* - * All the following includes choose, at compile time, which specific backend will be used - * during the execution of the ScummVM. - * - * It has to be done this way because not all the necessary libraries will be available in - * all build environments. Additionally, this results in smaller binaries. - */ -#if defined(__amigaos4__) - #include "backends/factories/amigaos4/amigaos4-fs-factory.cpp" -#elif defined(__DC__) - #include "backends/factories/dc/ronincd-fs-factory.cpp" -#elif defined(__DS__) - #include "backends/factories/ds/ds-fs-factory.cpp" -#elif defined(__GP32__) - #include "backends/factories/gp32/gp32-fs-factory.cpp" -#elif defined(__MORPHOS__) - #include "backends/factories/morphos/abox-fs-factory.cpp" -#elif defined(PALMOS_MODE) - #include "backends/factories/palmos/palmos-fs-factory.cpp" -#elif defined(__PLAYSTATION2__) - #include "backends/factories/ps2/ps2-fs-factory.cpp" -#elif defined(__PSP__) - #include "backends/factories/psp/psp-fs-factory.cpp" -#elif defined(__SYMBIAN32__) - #include "backends/factories/symbian/symbian-fs-factory.cpp" -#elif defined(UNIX) - #include "backends/factories/posix/posix-fs-factory.cpp" -#elif defined(WIN32) - #include "backends/factories/windows/windows-fs-factory.cpp" -#endif - -/** - * Creates concrete FilesystemFactory and FileFactory objects depending on the current architecture. - */ -class FilesystemFactoryMaker { -public: - - /** - * Returns the correct concrete filesystem factory depending on the current build architecture. - */ - static AbstractFilesystemFactory *makeFactory(); - -protected: - FilesystemFactoryMaker() {}; // avoid instances of this class -}; - -#endif //FS_FACTORY_MAKER_H diff --git a/backends/factories/gp32/gp32-fs-factory.h b/backends/factories/gp32/gp32-fs-factory.h deleted file mode 100644 index b5e5df3b6b..0000000000 --- a/backends/factories/gp32/gp32-fs-factory.h +++ /dev/null @@ -1,28 +0,0 @@ -#ifndef GP32_FILESYSTEM_FACTORY_H -#define GP32_FILESYSTEM_FACTORY_H - -#include "common/singleton.h" -#include "backends/factories/abstract-fs-factory.h" - -/** - * Creates GP32FilesystemNode objects. - * - * Parts of this class are documented in the base interface class, AbstractFilesystemFactory. - */ -class GP32FilesystemFactory : public AbstractFilesystemFactory, public Common::Singleton<GP32FilesystemFactory> { -public: - typedef Common::String String; - - virtual AbstractFilesystemNode *makeRootFileNode() const; - virtual AbstractFilesystemNode *makeCurrentDirectoryFileNode() const; - virtual AbstractFilesystemNode *makeFileNodePath(const String &path) const; - virtual BaseFile *makeBaseFile() const; - -protected: - GP32FilesystemFactory() {}; - -private: - friend class Common::Singleton<SingletonBaseType>; -}; - -#endif /*GP32_FILESYSTEM_FACTORY_H*/ diff --git a/backends/factories/palmos/palmos-fs-factory.h b/backends/factories/palmos/palmos-fs-factory.h deleted file mode 100644 index 65af4e2fe6..0000000000 --- a/backends/factories/palmos/palmos-fs-factory.h +++ /dev/null @@ -1,28 +0,0 @@ -#ifndef PALMOS_FILESYSTEM_FACTORY_H -#define PALMOS_FILESYSTEM_FACTORY_H - -#include "common/singleton.h" -#include "backends/factories/abstract-fs-factory.h" - -/** - * Creates PalmOSFilesystemNode objects. - * - * Parts of this class are documented in the base interface class, AbstractFilesystemFactory. - */ -class PalmOSFilesystemFactory : public AbstractFilesystemFactory, public Common::Singleton<PalmOSFilesystemFactory> { -public: - typedef Common::String String; - - virtual AbstractFilesystemNode *makeRootFileNode() const; - virtual AbstractFilesystemNode *makeCurrentDirectoryFileNode() const; - virtual AbstractFilesystemNode *makeFileNodePath(const String &path) const; - virtual BaseFile *makeBaseFile() const; - -protected: - PalmOSFilesystemFactory() {}; - -private: - friend class Common::Singleton<SingletonBaseType>; -}; - -#endif /*PALMOS_FILESYSTEM_FACTORY_H*/ diff --git a/backends/factories/posix/posix-fs-factory.h b/backends/factories/posix/posix-fs-factory.h deleted file mode 100644 index 0122f7ac58..0000000000 --- a/backends/factories/posix/posix-fs-factory.h +++ /dev/null @@ -1,28 +0,0 @@ -#ifndef POSIX_FILESYSTEM_FACTORY_H -#define POSIX_FILESYSTEM_FACTORY_H - -#include "common/singleton.h" -#include "backends/factories/abstract-fs-factory.h" - -/** - * Creates POSIXFilesystemNode objects. - * - * Parts of this class are documented in the base interface class, AbstractFilesystemFactory. - */ -class POSIXFilesystemFactory : public AbstractFilesystemFactory, public Common::Singleton<POSIXFilesystemFactory> { -public: - typedef Common::String String; - - virtual AbstractFilesystemNode *makeRootFileNode() const; - virtual AbstractFilesystemNode *makeCurrentDirectoryFileNode() const; - virtual AbstractFilesystemNode *makeFileNodePath(const String &path) const; - virtual Common::BaseFile *makeBaseFile() const; - -protected: - POSIXFilesystemFactory() {}; - -private: - friend class Common::Singleton<SingletonBaseType>; -}; - -#endif /*POSIX_FILESYSTEM_FACTORY_H*/ diff --git a/backends/file/base-file.cpp b/backends/file/base-file.cpp deleted file mode 100644 index e42f50ce98..0000000000 --- a/backends/file/base-file.cpp +++ /dev/null @@ -1,230 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL: https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/branches/gsoc2007-fsnode/common/file.cpp $ - * $Id: file.cpp 28150 2007-07-20 19:42:38Z david_corrales $ - * - */ - -#include "backends/file/base-file.h" -#include "common/fs.h" -#include "common/hashmap.h" -#include "common/util.h" -#include "common/hash-str.h" - -#if defined(UNIX) || defined(__SYMBIAN32__) -#include <errno.h> -#endif - -#ifdef MACOSX -#include "CoreFoundation/CoreFoundation.h" -#endif - -namespace Common { - -BaseFile::BaseFile() { - _handle = 0; - _ioFailed = false; -} - -//#define DEBUG_FILE_REFCOUNT - -BaseFile::~BaseFile() { -#ifdef DEBUG_FILE_REFCOUNT - warning("File::~File on file '%s'", _name.c_str()); -#endif - close(); -} - -bool BaseFile::open(const String &filename, AccessMode mode) { - assert(mode == kFileReadMode || mode == kFileWriteMode); - - if (filename.empty()) { - error("File::open: No filename was specified"); - } - - if (_handle) { - error("File::open: This file object already is opened (%s), won't open '%s'", _name.c_str(), filename.c_str()); - } - - _name.clear(); - clearIOFailed(); - - const char *modeStr = (mode == kFileReadMode) ? "rb" : "wb"; - _handle = _fopen(filename.c_str(), modeStr); - - if (_handle == NULL) { - if (mode == kFileReadMode) - debug(2, "File %s not found", filename.c_str()); - else - debug(2, "File %s not opened", filename.c_str()); - return false; - } - - _name = filename; - -#ifdef DEBUG_FILE_REFCOUNT - warning("File::open on file '%s'", _name.c_str()); -#endif - - return true; -} - -bool BaseFile::remove(const String &filename){ - if (remove(filename.c_str()) != 0) { - if(errno == EACCES) - ;//TODO: read-only file - if(errno == ENOENT) - ;//TODO: non-existent file - - return false; - } else { - return true; - } -} - -void BaseFile::close() { - if (_handle) - _fclose((FILE *)_handle); - _handle = NULL; -} - -bool BaseFile::isOpen() const { - return _handle != NULL; -} - -bool BaseFile::ioFailed() const { - return _ioFailed != 0; -} - -void BaseFile::clearIOFailed() { - _ioFailed = false; -} - -bool BaseFile::eof() const { - if (_handle == NULL) { - error("File::eof: File is not open!"); - return false; - } - - return _feof((FILE *)_handle) != 0; -} - -uint32 BaseFile::pos() const { - if (_handle == NULL) { - error("File::pos: File is not open!"); - return 0; - } - - return _ftell((FILE *)_handle); -} - -uint32 BaseFile::size() const { - if (_handle == NULL) { - error("File::size: File is not open!"); - return 0; - } - - uint32 oldPos = _ftell((FILE *)_handle); - _fseek((FILE *)_handle, 0, SEEK_END); - uint32 length = _ftell((FILE *)_handle); - _fseek((FILE *)_handle, oldPos, SEEK_SET); - - return length; -} - -void BaseFile::seek(int32 offs, int whence) { - if (_handle == NULL) { - error("File::seek: File is not open!"); - return; - } - - if (_fseek((FILE *)_handle, offs, whence) != 0) - _clearerr((FILE *)_handle); -} - -uint32 BaseFile::read(void *ptr, uint32 len) { - byte *ptr2 = (byte *)ptr; - uint32 real_len; - - if (_handle == NULL) { - error("File::read: File is not open!"); - return 0; - } - - if (len == 0) - return 0; - - real_len = _fread(ptr2, 1, len, (FILE *)_handle); - if (real_len < len) { - _ioFailed = true; - } - - return real_len; -} - -/*uint32 File::write(const void *ptr, uint32 len) { - if (_handle == NULL) { - error("File::write: File is not open!"); - return 0; - } - - if (len == 0) - return 0; - - if ((uint32)_fwrite(ptr, 1, len, (FILE *)_handle) != len) { - _ioFailed = true; - } - - return len; -}*/ - -void BaseFile::_clearerr(FILE *stream) { - clearerr(stream); -} - -int BaseFile::_fclose(FILE *stream) { - return fclose(stream); -} - -int BaseFile::_feof(FILE *stream) const { - return feof(stream); -} -FILE *BaseFile::_fopen(const char * filename, const char * mode) { - return fopen(filename, mode); -} - -int BaseFile::_fread(void *buffer, size_t obj_size, size_t num, FILE *stream) { - return fread(buffer, obj_size, num, stream); -} - -int BaseFile::_fseek(FILE * stream, long int offset, int origin) const { - return fseek(stream, offset, origin); -} - -long BaseFile::_ftell(FILE *stream) const { - return ftell(stream); -} - -int BaseFile::_fwrite(const void * ptr, size_t obj_size, size_t count, FILE * stream) { - return fwrite(ptr, obj_size, count, stream); -} - -} // End of namespace Common diff --git a/backends/file/base-file.h b/backends/file/base-file.h deleted file mode 100644 index d28655b31e..0000000000 --- a/backends/file/base-file.h +++ /dev/null @@ -1,184 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL: $ - * $Id: $ - */ - -#ifndef BACKENDS_BASE_FILE_H -#define BACKENDS_BASE_FILE_H - -#include "common/stdafx.h" -#include "common/scummsys.h" -#include "common/str.h" -#include "common/stream.h" - -//using namespace Common; - -namespace Common { - -/** - * Implements several file related functions used by the Common::File wrapper. - */ -class BaseFile : public SeekableReadStream { -protected: - /** File handle to the actual file; 0 if no file is open. */ - void *_handle; - - /** Status flag which tells about recent I/O failures. */ - bool _ioFailed; - - /** The name of this file, for debugging. */ - String _name; - - /** - * The following functions are meant to be redefined by subclasses if needed. E.g. ps2-file.h or ds-file.h - * They behave as the C++ standard I/O methods so refer to the standard documentation for usage. - * - * This design was inspired on the Template pattern. - */ - void _clearerr(FILE *stream); - int _fclose(FILE *stream); - int _feof(FILE *stream) const; - FILE *_fopen(const char * filename, const char * mode); - int _fread(void *buffer, size_t obj_size, size_t num, FILE *stream); - int _fseek(FILE * stream, long int offset, int origin) const; - long _ftell(FILE *stream) const; - int _fwrite(const void * ptr, size_t obj_size, size_t count, FILE * stream); - -private: - // Disallow copying BaseFile objects. There is not strict reason for this, - // except that so far we never had real need for such a feature, and - // code that accidentally copied File objects tended to break in strange - // ways. - BaseFile(const BaseFile &f); - BaseFile &operator =(const BaseFile &f); - -public: - enum AccessMode { - kFileReadMode = 1, - kFileWriteMode = 2 - }; - - BaseFile(); - virtual ~BaseFile(); - - /** - * Clears the flag for the last ocurred IO failure. - */ - void clearIOFailed(); - - /** - * Closes the file handle. - */ - virtual void close(); - - /** - * Checks for end of file. - * - * @return: true if the end of file is reached, false otherwise. - */ - bool eof() const; - - /** - * Checks for the end of the stream. In this case it's equivalent to eof(). - * - * @return: true if the end of the stream is reached, false otherwise. - */ - bool eos() const { return eof(); } - - /** - * Checks whether the last IO operation failed. - * - * @return: true if the last IO operation failed, false otherwise. - */ - bool ioFailed() const; - - /** - * Obtain the filename of the opened file. - * - * @return: the filename of the opened file. - */ - const char *name() const { return _name.c_str(); } - - /** - * Checks if the object opened a file successfully. - * - * @return: true if any file is opened, false otherwise. - */ - bool isOpen() const; - - /** - * Opens a given file. - * - * @param filename Path of the file to be opened. - * @param mode Mode to open to file. Read or write. - */ - virtual bool open(const String &filename, AccessMode mode = kFileReadMode); - - /** - * Obtain the position of the seek pointer. - * - * @return The position of the seek pointer within the file. - */ - uint32 pos() const; - - /** - * Read a chunk of data from the file. - * - * @param dataPtr Buffer to the place the read contents. - * @param dataSize Amount of bytes to read from the file. - * @return Amount of read bytes. - */ - uint32 read(void *dataPtr, uint32 dataSize); - - /** - * Remove a given file from the filesystem. - * - * @param filename Path to the file to be removed. - * @return true if the file was removed succesfully, false otherwise. - */ - virtual bool remove(const String &filename); - - /** - * Move the seek pointer within the file. - * - * @param offs Amount of bytes to move the pointer within the file. - * @param whence Starting point of the seek cursor. - */ - void seek(int32 offs, int whence = SEEK_SET); - - /** - * Obtain the size of the file. - * - * @return The size of the file in bytes. - */ - uint32 size() const; - - //TODO: Remove the write functions? Also remove the enum then - /** - * Write a chunk of data to the file. - */ - //uint32 write(const void *dataPtr, uint32 dataSize); -}; - -} // End of namespace Common - -#endif //BACKENDS_BASE_FILE_H diff --git a/backends/file/ds/ds-file.cpp b/backends/file/ds/ds-file.cpp deleted file mode 100644 index e69de29bb2..0000000000 --- a/backends/file/ds/ds-file.cpp +++ /dev/null diff --git a/backends/file/ds/ds-file.h b/backends/file/ds/ds-file.h deleted file mode 100644 index e133def548..0000000000 --- a/backends/file/ds/ds-file.h +++ /dev/null @@ -1,46 +0,0 @@ -#ifdef __DS__ - - // These functions replease the standard library functions of the same name. - // As this header is included after the standard one, I have the chance to #define - // all of these to my own code. - // - // A #define is the only way, as redefinig the functions would cause linker errors. - - // These functions need to be #undef'ed, as their original definition - // in devkitarm is done with #includes (ugh!) - #undef feof - #undef clearerr - //#undef getc - //#undef ferror - - - //void std_fprintf(FILE* handle, const char* fmt, ...); // used in common/util.cpp - //void std_fflush(FILE* handle); // used in common/util.cpp - - //char* std_fgets(char* str, int size, FILE* file); // not used - //int std_getc(FILE* handle); // not used - //char* std_getcwd(char* dir, int dunno); // not used - //void std_cwd(char* dir); // not used - //int std_ferror(FILE* handle); // not used - - // Only functions used in the ScummVM source have been defined here! - #define fopen(name, mode) DS::std_fopen(name, mode) - #define fclose(handle) DS::std_fclose(handle) - #define fread(ptr, size, items, file) DS::std_fread(ptr, size, items, file) - #define fwrite(ptr, size, items, file) DS::std_fwrite(ptr, size, items, file) - #define feof(handle) DS::std_feof(handle) - #define ftell(handle) DS::std_ftell(handle) - #define fseek(handle, offset, whence) DS::std_fseek(handle, offset, whence) - #define clearerr(handle) DS::std_clearerr(handle) - - //#define printf(fmt, ...) consolePrintf(fmt, ##__VA_ARGS__) - - //#define fprintf(file, fmt, ...) { char str[128]; sprintf(str, fmt, ##__VA_ARGS__); DS::std_fwrite(str, strlen(str), 1, file); } - //#define fflush(file) DS::std_fflush(file) // used in common/util.cpp - - //#define fgets(str, size, file) DS::std_fgets(str, size, file) // not used - //#define getc(handle) DS::std_getc(handle) // not used - //#define getcwd(dir, dunno) DS::std_getcwd(dir, dunno) // not used - //#define ferror(handle) DS::std_ferror(handle) // not used - -#endif
\ No newline at end of file diff --git a/backends/file/posix/posix-file.cpp b/backends/file/posix/posix-file.cpp deleted file mode 100644 index 7419161ccd..0000000000 --- a/backends/file/posix/posix-file.cpp +++ /dev/null @@ -1,45 +0,0 @@ -#include "backends/file/posix/posix-file.h" - -namespace Common { - -POSIXFile::POSIXFile() : BaseFile() { - // -} - -POSIXFile::~POSIXFile() { - close(); -} - -void POSIXFile::_clearerr(FILE *stream) { - clearerr(stream); -} - -int POSIXFile::_fclose(FILE *stream) { - return fclose(stream); -} - -int POSIXFile::_feof(FILE *stream) const { - return feof(stream); -} -FILE *POSIXFile::_fopen(const char * filename, const char * mode) { - printf("Opened a file!\n"); - return fopen(filename, mode); -} - -int POSIXFile::_fread(void *buffer, size_t obj_size, size_t num, FILE *stream) { - return fread(buffer, obj_size, num, stream); -} - -int POSIXFile::_fseek(FILE * stream, long int offset, int origin) const { - return fseek(stream, offset, origin); -} - -long POSIXFile::_ftell(FILE *stream) const { - return ftell(stream); -} - -int POSIXFile::_fwrite(const void * ptr, size_t obj_size, size_t count, FILE * stream) { - return fwrite(ptr, obj_size, count, stream); -} - -} // End of namespace Common diff --git a/backends/file/posix/posix-file.h b/backends/file/posix/posix-file.h deleted file mode 100644 index e74338b8d8..0000000000 --- a/backends/file/posix/posix-file.h +++ /dev/null @@ -1,54 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL: $ - * $Id: $ - */ - -#ifndef BACKENDS_POSIX_FILE_H -#define BACKENDS_POSIX_FILE_H - -#include "backends/file/base-file.cpp" - -namespace Common { - -/** - * Implements several POSIX specific file related functions used by the Common::File wrapper. - * - * Parts of this class are documented in the base file class, BaseFile. - */ -class POSIXFile : public BaseFile { -public: - POSIXFile(); - ~POSIXFile(); -protected: - void _clearerr(FILE *stream); - int _fclose(FILE *stream); - int _feof(FILE *stream) const; - FILE *_fopen(const char * filename, const char * mode); - int _fread(void *buffer, size_t obj_size, size_t num, FILE *stream); - int _fseek(FILE * stream, long int offset, int origin) const; - long _ftell(FILE *stream) const; - int _fwrite(const void * ptr, size_t obj_size, size_t count, FILE * stream); -}; - -} // End of namespace Common - -#endif //BACKENDS_POSIX_FILE_H diff --git a/backends/file/ps2/ps2-file.cpp b/backends/file/ps2/ps2-file.cpp deleted file mode 100644 index e69de29bb2..0000000000 --- a/backends/file/ps2/ps2-file.cpp +++ /dev/null diff --git a/backends/file/ps2/ps2-file.h b/backends/file/ps2/ps2-file.h deleted file mode 100644 index e7acfd801f..0000000000 --- a/backends/file/ps2/ps2-file.h +++ /dev/null @@ -1,24 +0,0 @@ -#ifdef __PLAYSTATION2__ - // for those replaced fopen/fread/etc functions - typedef unsigned long uint64; - typedef signed long int64; - #include "backends/platform/ps2/fileio.h" - - #define fopen(a, b) ps2_fopen(a, b) - #define fclose(a) ps2_fclose(a) - #define fseek(a, b, c) ps2_fseek(a, b, c) - #define ftell(a) ps2_ftell(a) - #define feof(a) ps2_feof(a) - #define fread(a, b, c, d) ps2_fread(a, b, c, d) - #define fwrite(a, b, c, d) ps2_fwrite(a, b, c, d) - - //#define fprintf ps2_fprintf // used in common/util.cpp - //#define fflush(a) ps2_fflush(a) // used in common/util.cpp - - //#define fgetc(a) ps2_fgetc(a) // not used - //#define fgets(a, b, c) ps2_fgets(a, b, c) // not used - //#define fputc(a, b) ps2_fputc(a, b) // not used - //#define fputs(a, b) ps2_fputs(a, b) // not used - - //#define fsize(a) ps2_fsize(a) // not used -- and it is not a standard function either -#endif
\ No newline at end of file diff --git a/backends/file/symbian/symbian-file.cpp b/backends/file/symbian/symbian-file.cpp deleted file mode 100644 index e69de29bb2..0000000000 --- a/backends/file/symbian/symbian-file.cpp +++ /dev/null diff --git a/backends/file/symbian/symbian-file.h b/backends/file/symbian/symbian-file.h deleted file mode 100644 index 7807a9355a..0000000000 --- a/backends/file/symbian/symbian-file.h +++ /dev/null @@ -1,29 +0,0 @@ -#ifdef __SYMBIAN32__ - #undef feof - #undef clearerr - - #define FILE void - - FILE* symbian_fopen(const char* name, const char* mode); - void symbian_fclose(FILE* handle); - size_t symbian_fread(const void* ptr, size_t size, size_t numItems, FILE* handle); - size_t symbian_fwrite(const void* ptr, size_t size, size_t numItems, FILE* handle); - bool symbian_feof(FILE* handle); - long int symbian_ftell(FILE* handle); - int symbian_fseek(FILE* handle, long int offset, int whence); - void symbian_clearerr(FILE* handle); - - // Only functions used in the ScummVM source have been defined here! - #define fopen(name, mode) symbian_fopen(name, mode) - #define fclose(handle) symbian_fclose(handle) - #define fread(ptr, size, items, file) symbian_fread(ptr, size, items, file) - #define fwrite(ptr, size, items, file) symbian_fwrite(ptr, size, items, file) - #define feof(handle) symbian_feof(handle) - #define ftell(handle) symbian_ftell(handle) - #define fseek(handle, offset, whence) symbian_fseek(handle, offset, whence) - #define clearerr(handle) symbian_clearerr(handle) -#endif - -#if defined(UNIX) || defined(__SYMBIAN32__) -#include <errno.h> -#endif
\ No newline at end of file diff --git a/backends/factories/abstract-fs-factory.h b/backends/fs/abstract-fs-factory.h index 4238baf5c2..c826ef2745 100644 --- a/backends/factories/abstract-fs-factory.h +++ b/backends/fs/abstract-fs-factory.h @@ -18,8 +18,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL: $ - * $Id: $ + * $URL$ + * $Id$ */ #ifndef ABSTRACT_FILESYSTEM_FACTORY_H @@ -27,7 +27,6 @@ #include "common/str.h" #include "backends/fs/abstract-fs.h" -#include "backends/file/base-file.h" /** * Creates concrete FilesystemNode objects depending on the current architecture. @@ -69,12 +68,6 @@ public: * On Windows, it will be a special node which "contains" all drives (C:, D:, E:). */ virtual AbstractFilesystemNode *makeRootFileNode() const = 0; - - /** - * Creates a base file usable by the Common::File wrapper to implement several - * methods. - */ - virtual Common::BaseFile *makeBaseFile() const = 0; }; #endif /*ABSTRACT_FILESYSTEM_FACTORY_H*/ diff --git a/backends/fs/abstract-fs.h b/backends/fs/abstract-fs.h index e506d96a0b..aeae0ac1c2 100644 --- a/backends/fs/abstract-fs.h +++ b/backends/fs/abstract-fs.h @@ -103,18 +103,6 @@ public: virtual String getDisplayName() const { return getName(); } /** - * Returns the last component of a given path. - * - * Examples: - * /foo/bar.txt would return /bar.txt - * /foo/bar/ would return /bar/ - * - * @param str String containing the path. - * @return Pointer to the first char of the last component inside str. - */ - virtual const char *getLastPathComponent(const Common::String &str) const = 0; - - /** * Returns a string with an architecture dependent path description. */ virtual String getName() const = 0; diff --git a/backends/factories/amigaos4/amigaos4-fs-factory.cpp b/backends/fs/amigaos4/amigaos4-fs-factory.cpp index 15847e37fc..7307deb4bf 100644 --- a/backends/factories/amigaos4/amigaos4-fs-factory.cpp +++ b/backends/fs/amigaos4/amigaos4-fs-factory.cpp @@ -18,13 +18,12 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL: $ - * $Id: $ + * $URL$ + * $Id$ */ -#include "backends/factories/amigaos4/amigaos4-fs-factory.h" +#include "backends/fs/amigaos4/amigaos4-fs-factory.h" #include "backends/fs/amigaos4/amigaos4-fs.cpp" -#include "backends/file/amigaos4/amigaos4-file.h" DECLARE_SINGLETON(AmigaOSFilesystemFactory); @@ -39,7 +38,3 @@ AbstractFilesystemNode *AmigaOSFilesystemFactory::makeCurrentDirectoryFileNode() AbstractFilesystemNode *AmigaOSFilesystemFactory::makeFileNodePath(const String &path) const { return new AmigaOSFilesystemNode(path); } - -BaseFile *AmigaOSFilesystemFactory::makeBaseFile() const { - return new AmigaOSFile(); -} diff --git a/backends/factories/amigaos4/amigaos4-fs-factory.h b/backends/fs/amigaos4/amigaos4-fs-factory.h index 6243303166..01a976bdd7 100644 --- a/backends/factories/amigaos4/amigaos4-fs-factory.h +++ b/backends/fs/amigaos4/amigaos4-fs-factory.h @@ -18,15 +18,15 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL: $ - * $Id: $ + * $URL$ + * $Id$ */ #ifndef AMIGAOS_FILESYSTEM_FACTORY_H #define AMIGAOS_FILESYSTEM_FACTORY_H #include "common/singleton.h" -#include "backends/factories/abstract-fs-factory.h" +#include "backends/fs/abstract-fs-factory.h" /** * Creates AmigaOSFilesystemNode objects. @@ -40,7 +40,6 @@ public: virtual AbstractFilesystemNode *makeRootFileNode() const; virtual AbstractFilesystemNode *makeCurrentDirectoryFileNode() const; virtual AbstractFilesystemNode *makeFileNodePath(const String &path) const; - virtual BaseFile *makeBaseFile() const; protected: AmigaOSFilesystemFactory() {}; diff --git a/backends/factories/dc/ronincd-fs-factory.cpp b/backends/fs/dc/ronincd-fs-factory.cpp index f87aa0b9d5..f72906c2aa 100644 --- a/backends/factories/dc/ronincd-fs-factory.cpp +++ b/backends/fs/dc/ronincd-fs-factory.cpp @@ -18,13 +18,12 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL: $ - * $Id: $ + * $URL$ + * $Id$ */ -#include "backends/factories/dc/ronincd-fs-factory.h" +#include "backends/fs/dc/ronincd-fs-factory.h" #include "backends/fs/dc/dc-fs.cpp" -#include "backends/file/base-file.h" DECLARE_SINGLETON(RoninCDFilesystemFactory); @@ -39,7 +38,3 @@ AbstractFilesystemNode *RoninCDFilesystemFactory::makeCurrentDirectoryFileNode() AbstractFilesystemNode *RoninCDFilesystemFactory::makeFileNodePath(const String &path) const { return new RoninCDFilesystemNode(path, true); } - -BaseFile *RoninCDFilesystemFactory::makeBaseFile() const { - return new BaseFile(); -} diff --git a/backends/factories/dc/ronincd-fs-factory.h b/backends/fs/dc/ronincd-fs-factory.h index f41c3e81f0..d827cc51e3 100644 --- a/backends/factories/dc/ronincd-fs-factory.h +++ b/backends/fs/dc/ronincd-fs-factory.h @@ -18,15 +18,15 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL: $ - * $Id: $ + * $URL$ + * $Id$ */ #ifndef RONINCD_FILESYSTEM_FACTORY_H #define RONINCD_FILESYSTEM_FACTORY_H #include "common/singleton.h" -#include "backends/factories/abstract-fs-factory.h" +#include "backends/fs/abstract-fs-factory.h" /** * Creates RoninCDFilesystemNode objects. @@ -40,7 +40,6 @@ public: virtual AbstractFilesystemNode *makeRootFileNode() const; virtual AbstractFilesystemNode *makeCurrentDirectoryFileNode() const; virtual AbstractFilesystemNode *makeFileNodePath(const String &path) const; - virtual BaseFile *makeBaseFile() const; protected: RoninCDFilesystemFactory() {}; diff --git a/backends/factories/ds/ds-fs-factory.cpp b/backends/fs/ds/ds-fs-factory.cpp index fab45c92e9..0de284d1eb 100644 --- a/backends/factories/ds/ds-fs-factory.cpp +++ b/backends/fs/ds/ds-fs-factory.cpp @@ -18,13 +18,12 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL: $ - * $Id: $ + * $URL$ + * $Id$ */ -#include "backends/factories/ds/ds-fs-factory.h" +#include "backends/fs/ds/ds-fs-factory.h" #include "backends/fs/ds/ds-fs.cpp" -#include "backends/file/ds/ds-file.h" #include "dsmain.h" //for the isGBAMPAvailable() function DECLARE_SINGLETON(DSFilesystemFactory); @@ -52,7 +51,3 @@ AbstractFilesystemNode *DSFilesystemFactory::makeFileNodePath(const String &path return new DS::DSFileSystemNode(path); } } - -BaseFile *DSFilesystemFactory::makeBaseFile() const { - return new DSFile(); -} diff --git a/backends/factories/ds/ds-fs-factory.h b/backends/fs/ds/ds-fs-factory.h index c076f1cb99..a6a7bf6532 100644 --- a/backends/factories/ds/ds-fs-factory.h +++ b/backends/fs/ds/ds-fs-factory.h @@ -18,15 +18,15 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL: $ - * $Id: $ + * $URL$ + * $Id$ */ #ifndef DS_FILESYSTEM_FACTORY_H #define DS_FILESYSTEM_FACTORY_H #include "common/singleton.h" -#include "backends/factories/abstract-fs-factory.h" +#include "backends/fs/abstract-fs-factory.h" /** * Creates DSFilesystemNode objects. @@ -40,7 +40,6 @@ public: virtual AbstractFilesystemNode *makeRootFileNode() const; virtual AbstractFilesystemNode *makeCurrentDirectoryFileNode() const; virtual AbstractFilesystemNode *makeFileNodePath(const String &path) const; - virtual BaseFile *makeBaseFile() const; protected: DSFilesystemFactory() {}; diff --git a/backends/factories/fs-factory-maker.cpp b/backends/fs/fs-factory-maker.cpp index 1056726887..045f30cb28 100644 --- a/backends/factories/fs-factory-maker.cpp +++ b/backends/fs/fs-factory-maker.cpp @@ -18,13 +18,49 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL: $ - * $Id: $ + * $URL$ + * $Id$ */ -#include "backends/factories/fs-factory-maker.h" +#include "backends/fs/abstract-fs-factory.h" -AbstractFilesystemFactory *FilesystemFactoryMaker::makeFactory(){ +/* + * All the following includes choose, at compile time, which specific backend will be used + * during the execution of the ScummVM. + * + * It has to be done this way because not all the necessary libraries will be available in + * all build environments. Additionally, this results in smaller binaries. + */ +#if defined(__amigaos4__) + #include "backends/fs/amigaos4/amigaos4-fs-factory.cpp" +#elif defined(__DC__) + #include "backends/fs/dc/ronincd-fs-factory.cpp" +#elif defined(__DS__) + #include "backends/fs/ds/ds-fs-factory.cpp" +#elif defined(__GP32__) + #include "backends/fs/gp32/gp32-fs-factory.cpp" +#elif defined(__MORPHOS__) + #include "backends/fs/morphos/abox-fs-factory.cpp" +#elif defined(PALMOS_MODE) + #include "backends/fs/palmos/palmos-fs-factory.cpp" +#elif defined(__PLAYSTATION2__) + #include "backends/fs/ps2/ps2-fs-factory.cpp" +#elif defined(__PSP__) + #include "backends/fs/psp/psp-fs-factory.cpp" +#elif defined(__SYMBIAN32__) + #include "backends/fs/symbian/symbian-fs-factory.cpp" +#elif defined(UNIX) + #include "backends/fs/posix/posix-fs-factory.cpp" +#elif defined(WIN32) + #include "backends/fs/windows/windows-fs-factory.cpp" +#endif + +/** + * Creates concrete FilesystemFactory objects depending on the current architecture. + * + * @return AbstractFilesystemFactory* The specific factory for the current architecture. + */ +static AbstractFilesystemFactory *makeFSFactory() { #if defined(__amigaos4__) return &AmigaOSFilesystemFactory::instance(); #elif defined(__DC__) diff --git a/backends/factories/gp32/gp32-fs-factory.cpp b/backends/fs/gp32/gp32-fs-factory.cpp index 43d6a5330c..62cdaedf45 100644 --- a/backends/factories/gp32/gp32-fs-factory.cpp +++ b/backends/fs/gp32/gp32-fs-factory.cpp @@ -18,13 +18,12 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL: $ - * $Id: $ + * $URL$ + * $Id$ */ -#include "backends/factories/gp32/gp32-fs-factory.h" +#include "backends/fs/gp32/gp32-fs-factory.h" #include "backends/fs/gp32/gp32-fs.cpp" -#include "backends/file/base-file.h" DECLARE_SINGLETON(GP32FilesystemFactory); @@ -39,7 +38,3 @@ AbstractFilesystemNode *GP32FilesystemFactory::makeCurrentDirectoryFileNode() co AbstractFilesystemNode *GP32FilesystemFactory::makeFileNodePath(const String &path) const { return new GP32FilesystemNode(path); } - -BaseFile *GP32FilesystemFactory::makeBaseFile() const { - return new BaseFile(); -} diff --git a/backends/fs/gp32/gp32-fs-factory.h b/backends/fs/gp32/gp32-fs-factory.h new file mode 100644 index 0000000000..0810695152 --- /dev/null +++ b/backends/fs/gp32/gp32-fs-factory.h @@ -0,0 +1,51 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * $URL$ + * $Id$ + */ + +#ifndef GP32_FILESYSTEM_FACTORY_H +#define GP32_FILESYSTEM_FACTORY_H + +#include "common/singleton.h" +#include "backends/fs/abstract-fs-factory.h" + +/** + * Creates GP32FilesystemNode objects. + * + * Parts of this class are documented in the base interface class, AbstractFilesystemFactory. + */ +class GP32FilesystemFactory : public AbstractFilesystemFactory, public Common::Singleton<GP32FilesystemFactory> { +public: + typedef Common::String String; + + virtual AbstractFilesystemNode *makeRootFileNode() const; + virtual AbstractFilesystemNode *makeCurrentDirectoryFileNode() const; + virtual AbstractFilesystemNode *makeFileNodePath(const String &path) const; + +protected: + GP32FilesystemFactory() {}; + +private: + friend class Common::Singleton<SingletonBaseType>; +}; + +#endif /*GP32_FILESYSTEM_FACTORY_H*/ diff --git a/backends/factories/morphos/abox-fs-factory.cpp b/backends/fs/morphos/abox-fs-factory.cpp index 961a7cbb9d..e182513002 100644 --- a/backends/factories/morphos/abox-fs-factory.cpp +++ b/backends/fs/morphos/abox-fs-factory.cpp @@ -18,13 +18,12 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL: $ - * $Id: $ + * $URL$ + * $Id$ */ -#include "backends/factories/morphos/abox-fs-factory.h" +#include "backends/fs/morphos/abox-fs-factory.h" #include "backends/fs/morphos/abox-fs.cpp" -#include "backends/file/base-file.h" DECLARE_SINGLETON(ABoxFilesystemFactory); @@ -39,7 +38,3 @@ AbstractFilesystemNode *ABoxFilesystemFactory::makeCurrentDirectoryFileNode() co AbstractFilesystemNode *ABoxFilesystemFactory::makeFileNodePath(const String &path) const { return new ABoxFilesystemNode(path); } - -BaseFile *ABoxFilesystemFactory::makeBaseFile() const { - return new BaseFile(); -} diff --git a/backends/factories/morphos/abox-fs-factory.h b/backends/fs/morphos/abox-fs-factory.h index c265b464a4..19ef2b097f 100644 --- a/backends/factories/morphos/abox-fs-factory.h +++ b/backends/fs/morphos/abox-fs-factory.h @@ -18,15 +18,15 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL: $ - * $Id: $ + * $URL$ + * $Id$ */ #ifndef ABOX_FILESYSTEM_FACTORY_H #define ABOX_FILESYSTEM_FACTORY_H #include "common/singleton.h" -#include "backends/factories/abstract-fs-factory.h" +#include "backends/fs/abstract-fs-factory.h" /** * Creates ABoxFilesystemNode objects. @@ -40,7 +40,6 @@ public: virtual AbstractFilesystemNode *makeRootFileNode() const; virtual AbstractFilesystemNode *makeCurrentDirectoryFileNode() const; virtual AbstractFilesystemNode *makeFileNodePath(const String &path) const; - virtual BaseFile *makeBaseFile() const; protected: ABoxFilesystemFactory() {}; diff --git a/backends/factories/palmos/palmos-fs-factory.cpp b/backends/fs/palmos/palmos-fs-factory.cpp index bb90857eac..9f24bcd596 100644 --- a/backends/factories/palmos/palmos-fs-factory.cpp +++ b/backends/fs/palmos/palmos-fs-factory.cpp @@ -18,13 +18,12 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL: $ - * $Id: $ + * $URL$ + * $Id$ */ -#include "backends/factories/palmos/palmos-fs-factory.h" +#include "backends/fs/palmos/palmos-fs-factory.h" #include "backends/fs/palmos/palmos-fs.cpp" -#include "backends/file/base-file.h" DECLARE_SINGLETON(PalmOSFilesystemFactory); @@ -39,7 +38,3 @@ AbstractFilesystemNode *PalmOSFilesystemFactory::makeCurrentDirectoryFileNode() AbstractFilesystemNode *PalmOSFilesystemFactory::makeFileNodePath(const String &path) const { return new PalmOSFilesystemNode(path); } - -BaseFile *PalmOSFilesystemFactory::makeBaseFile() const { - return new BaseFile(); -} diff --git a/backends/fs/palmos/palmos-fs-factory.h b/backends/fs/palmos/palmos-fs-factory.h new file mode 100644 index 0000000000..575ad8fbfc --- /dev/null +++ b/backends/fs/palmos/palmos-fs-factory.h @@ -0,0 +1,51 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * $URL$ + * $Id$ + */ + +#ifndef PALMOS_FILESYSTEM_FACTORY_H +#define PALMOS_FILESYSTEM_FACTORY_H + +#include "common/singleton.h" +#include "backends/fs/abstract-fs-factory.h" + +/** + * Creates PalmOSFilesystemNode objects. + * + * Parts of this class are documented in the base interface class, AbstractFilesystemFactory. + */ +class PalmOSFilesystemFactory : public AbstractFilesystemFactory, public Common::Singleton<PalmOSFilesystemFactory> { +public: + typedef Common::String String; + + virtual AbstractFilesystemNode *makeRootFileNode() const; + virtual AbstractFilesystemNode *makeCurrentDirectoryFileNode() const; + virtual AbstractFilesystemNode *makeFileNodePath(const String &path) const; + +protected: + PalmOSFilesystemFactory() {}; + +private: + friend class Common::Singleton<SingletonBaseType>; +}; + +#endif /*PALMOS_FILESYSTEM_FACTORY_H*/ diff --git a/backends/factories/posix/posix-fs-factory.cpp b/backends/fs/posix/posix-fs-factory.cpp index 1887aa8d5f..13212fb51f 100644 --- a/backends/factories/posix/posix-fs-factory.cpp +++ b/backends/fs/posix/posix-fs-factory.cpp @@ -18,14 +18,12 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL: $ - * $Id: $ + * $URL$ + * $Id$ */ -#include "backends/factories/posix/posix-fs-factory.h" +#include "backends/fs/posix/posix-fs-factory.h" #include "backends/fs/posix/posix-fs.cpp" -#include "backends/file/posix/posix-file.cpp" -//#include "backends/file/base-file.cpp" DECLARE_SINGLETON(POSIXFilesystemFactory); @@ -42,7 +40,3 @@ AbstractFilesystemNode *POSIXFilesystemFactory::makeCurrentDirectoryFileNode() c AbstractFilesystemNode *POSIXFilesystemFactory::makeFileNodePath(const String &path) const { return new POSIXFilesystemNode(path, true); } - -Common::BaseFile *POSIXFilesystemFactory::makeBaseFile() const { - return new Common::POSIXFile(); -} diff --git a/backends/fs/posix/posix-fs-factory.h b/backends/fs/posix/posix-fs-factory.h new file mode 100644 index 0000000000..a714175548 --- /dev/null +++ b/backends/fs/posix/posix-fs-factory.h @@ -0,0 +1,51 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * $URL$ + * $Id$ + */ + +#ifndef POSIX_FILESYSTEM_FACTORY_H +#define POSIX_FILESYSTEM_FACTORY_H + +#include "common/singleton.h" +#include "backends/fs/abstract-fs-factory.h" + +/** + * Creates POSIXFilesystemNode objects. + * + * Parts of this class are documented in the base interface class, AbstractFilesystemFactory. + */ +class POSIXFilesystemFactory : public AbstractFilesystemFactory, public Common::Singleton<POSIXFilesystemFactory> { +public: + typedef Common::String String; + + virtual AbstractFilesystemNode *makeRootFileNode() const; + virtual AbstractFilesystemNode *makeCurrentDirectoryFileNode() const; + virtual AbstractFilesystemNode *makeFileNodePath(const String &path) const; + +protected: + POSIXFilesystemFactory() {}; + +private: + friend class Common::Singleton<SingletonBaseType>; +}; + +#endif /*POSIX_FILESYSTEM_FACTORY_H*/ diff --git a/backends/fs/posix/posix-fs.cpp b/backends/fs/posix/posix-fs.cpp index 9fd5b8a185..3708acd2a8 100644 --- a/backends/fs/posix/posix-fs.cpp +++ b/backends/fs/posix/posix-fs.cpp @@ -64,7 +64,6 @@ public: virtual bool exists() const { return access(_path.c_str(), F_OK) == 0; } virtual String getDisplayName() const { return _displayName; } - virtual const char *getLastPathComponent(const Common::String &str) const; virtual String getName() const { return _displayName; } virtual String getPath() const { return _path; } virtual bool isDirectory() const { return _isDirectory; } @@ -82,6 +81,27 @@ private: virtual void setFlags(); }; +/** + * Returns the last component of a given path. + * + * Examples: + * /foo/bar.txt would return /bar.txt + * /foo/bar/ would return /bar/ + * + * @param str String containing the path. + * @return Pointer to the first char of the last component inside str. + */ +static const char *lastPathComponent(const Common::String &str) { + const char *start = str.c_str(); + const char *cur = start + str.size() - 2; + + while (cur >= start && *cur != '/') { + --cur; + } + + return cur + 1; +} + void POSIXFilesystemNode::setFlags() { struct stat st; @@ -122,7 +142,7 @@ POSIXFilesystemNode::POSIXFilesystemNode(const String &p, bool verify) { assert(p.size() > 0); _path = p; - _displayName = getLastPathComponent(_path); + _displayName = lastPathComponent(_path); if (verify) { setFlags(); @@ -216,23 +236,12 @@ bool POSIXFilesystemNode::getChildren(AbstractFSList &myList, ListMode mode, boo return true; } -const char *POSIXFilesystemNode::getLastPathComponent(const Common::String &str) const { - const char *start = str.c_str(); - const char *cur = start + str.size() - 2; - - while (cur >= start && *cur != '/') { - --cur; - } - - return cur + 1; -} - AbstractFilesystemNode *POSIXFilesystemNode::getParent() const { if (_path == "/") return 0; const char *start = _path.c_str(); - const char *end = getLastPathComponent(_path); + const char *end = lastPathComponent(_path); return new POSIXFilesystemNode(String(start, end - start), true); } diff --git a/backends/factories/ps2/ps2-fs-factory.cpp b/backends/fs/ps2/ps2-fs-factory.cpp index a56f376ec8..570fbd008c 100644 --- a/backends/factories/ps2/ps2-fs-factory.cpp +++ b/backends/fs/ps2/ps2-fs-factory.cpp @@ -18,13 +18,12 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL: $ - * $Id: $ + * $URL$ + * $Id$ */ -#include "backends/factories/ps2/ps2-fs-factory.h" +#include "backends/fs/ps2/ps2-fs-factory.h" #include "backends/fs/ps2/ps2-fs.cpp" -#include "backends/file/ps2/ps2-file.h" DECLARE_SINGLETON(Ps2FilesystemFactory); @@ -39,7 +38,3 @@ AbstractFilesystemNode *Ps2FilesystemFactory::makeCurrentDirectoryFileNode() con AbstractFilesystemNode *Ps2FilesystemFactory::makeFileNodePath(const String &path) const { return new Ps2FilesystemNode(path); } - -BaseFile *Ps2FilesystemFactory::makeBaseFile() const { - return new Ps2File(); -} diff --git a/backends/factories/ps2/ps2-fs-factory.h b/backends/fs/ps2/ps2-fs-factory.h index 413842789f..9798b2b497 100644 --- a/backends/factories/ps2/ps2-fs-factory.h +++ b/backends/fs/ps2/ps2-fs-factory.h @@ -18,15 +18,15 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL: $ - * $Id: $ + * $URL$ + * $Id$ */ #ifndef PS2_FILESYSTEM_FACTORY_H #define PS2_FILESYSTEM_FACTORY_H #include "common/singleton.h" -#include "backends/factories/abstract-fs-factory.h" +#include "backends/fs/abstract-fs-factory.h" /** * Creates PS2FilesystemNode objects. @@ -40,7 +40,6 @@ public: virtual AbstractFilesystemNode *makeRootFileNode() const; virtual AbstractFilesystemNode *makeCurrentDirectoryFileNode() const; virtual AbstractFilesystemNode *makeFileNodePath(const String &path) const; - virtual BaseFile *makeBaseFile() const; protected: Ps2FilesystemFactory() {}; diff --git a/backends/factories/psp/psp-fs-factory.cpp b/backends/fs/psp/psp-fs-factory.cpp index 0791904d96..e1d2b8fb49 100644 --- a/backends/factories/psp/psp-fs-factory.cpp +++ b/backends/fs/psp/psp-fs-factory.cpp @@ -18,13 +18,12 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL: $ - * $Id: $ + * $URL$ + * $Id$ */ -#include "backends/factories/psp/psp-fs-factory.h" +#include "backends/fs/psp/psp-fs-factory.h" #include "backends/fs/psp/psp_fs.cpp" -#include "backends/file/base-file.h" DECLARE_SINGLETON(PSPFilesystemFactory); @@ -39,7 +38,3 @@ AbstractFilesystemNode *PSPFilesystemFactory::makeCurrentDirectoryFileNode() con AbstractFilesystemNode *PSPFilesystemFactory::makeFileNodePath(const String &path) const { return new PSPFilesystemNode(path, true); } - -BaseFile *PSPFilesystemFactory::makeBaseFile() const { - return new BaseFile(); -} diff --git a/backends/factories/psp/psp-fs-factory.h b/backends/fs/psp/psp-fs-factory.h index 10a9bcc711..83a59dcc6a 100644 --- a/backends/factories/psp/psp-fs-factory.h +++ b/backends/fs/psp/psp-fs-factory.h @@ -18,15 +18,15 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL: $ - * $Id: $ + * $URL$ + * $Id$ */ #ifndef PSP_FILESYSTEM_FACTORY_H #define PSP_FILESYSTEM_FACTORY_H #include "common/singleton.h" -#include "backends/factories/abstract-fs-factory.h" +#include "backends/fs/abstract-fs-factory.h" /** * Creates PSPFilesystemNode objects. @@ -40,7 +40,6 @@ public: virtual AbstractFilesystemNode *makeRootFileNode() const; virtual AbstractFilesystemNode *makeCurrentDirectoryFileNode() const; virtual AbstractFilesystemNode *makeFileNodePath(const String &path) const; - virtual BaseFile *makeBaseFile() const; protected: PSPFilesystemFactory() {}; diff --git a/backends/factories/symbian/symbian-fs-factory.cpp b/backends/fs/symbian/symbian-fs-factory.cpp index 04fb3195d9..195402e0bb 100644 --- a/backends/factories/symbian/symbian-fs-factory.cpp +++ b/backends/fs/symbian/symbian-fs-factory.cpp @@ -18,13 +18,12 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL: $ - * $Id: $ + * $URL$ + * $Id$ */ -#include "backends/factories/symbian/symbian-fs-factory.h" +#include "backends/fs/symbian/symbian-fs-factory.h" #include "backends/fs/symbian/symbian-fs.cpp" -#include "backends/file/symbian/symbian-file.h" DECLARE_SINGLETON(SymbianFilesystemFactory); @@ -41,7 +40,3 @@ AbstractFilesystemNode *SymbianFilesystemFactory::makeCurrentDirectoryFileNode() AbstractFilesystemNode *SymbianFilesystemFactory::makeFileNodePath(const String &path) const { return new SymbianFilesystemNode(path); } - -BaseFile *SymbianFilesystemFactory::makeBaseFile() const { - return new SymbianFile(); -} diff --git a/backends/factories/symbian/symbian-fs-factory.h b/backends/fs/symbian/symbian-fs-factory.h index edf39969d2..b30ca89f99 100644 --- a/backends/factories/symbian/symbian-fs-factory.h +++ b/backends/fs/symbian/symbian-fs-factory.h @@ -18,15 +18,15 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL: $ - * $Id: $ + * $URL$ + * $Id$ */ #ifndef SYMBIAN_FILESYSTEM_FACTORY_H #define SYMBIAN_FILESYSTEM_FACTORY_H #include "common/singleton.h" -#include "backends/factories/abstract-fs-factory.h" +#include "backends/fs/abstract-fs-factory.h" /** * Creates SymbianFilesystemNode objects. @@ -40,7 +40,6 @@ public: virtual AbstractFilesystemNode *makeRootFileNode() const; virtual AbstractFilesystemNode *makeCurrentDirectoryFileNode() const; virtual AbstractFilesystemNode *makeFileNodePath(const String &path) const; - virtual BaseFile *makeBaseFile() const; protected: SymbianFilesystemFactory() {}; diff --git a/backends/factories/windows/windows-fs-factory.cpp b/backends/fs/windows/windows-fs-factory.cpp index 57976b6ad9..4a4ef018fb 100644 --- a/backends/factories/windows/windows-fs-factory.cpp +++ b/backends/fs/windows/windows-fs-factory.cpp @@ -18,13 +18,12 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL: $ - * $Id: $ + * $URL$ + * $Id$ */ -#include "backends/factories/windows/windows-fs-factory.h" +#include "backends/fs/windows/windows-fs-factory.h" #include "backends/fs/windows/windows-fs.cpp" -#include "backends/file/base-file.h" DECLARE_SINGLETON(WindowsFilesystemFactory); @@ -39,7 +38,3 @@ AbstractFilesystemNode *WindowsFilesystemFactory::makeCurrentDirectoryFileNode() AbstractFilesystemNode *WindowsFilesystemFactory::makeFileNodePath(const String &path) const { return new WindowsFilesystemNode(path, false); } - -BaseFile *WindowsFilesystemFactory::makeBaseFile() const { - return new BaseFile(); -} diff --git a/backends/factories/windows/windows-fs-factory.h b/backends/fs/windows/windows-fs-factory.h index b1272a6bcb..eb8ade1a8e 100644 --- a/backends/factories/windows/windows-fs-factory.h +++ b/backends/fs/windows/windows-fs-factory.h @@ -18,15 +18,15 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL: $ - * $Id: $ + * $URL$ + * $Id$ */ #ifndef WINDOWS_FILESYSTEM_FACTORY_H #define WINDOWS_FILESYSTEM_FACTORY_H #include "common/singleton.h" -#include "backends/factories/abstract-fs-factory.h" +#include "backends/fs/abstract-fs-factory.h" /** * Creates WindowsFilesystemNode objects. @@ -40,7 +40,6 @@ public: virtual AbstractFilesystemNode *makeRootFileNode() const; virtual AbstractFilesystemNode *makeCurrentDirectoryFileNode() const; virtual AbstractFilesystemNode *makeFileNodePath(const String &path) const; - virtual BaseFile *makeBaseFile() const; protected: WindowsFilesystemFactory() {}; diff --git a/backends/midi/quicktime.cpp b/backends/midi/quicktime.cpp index 2abbad757a..3267bb3415 100644 --- a/backends/midi/quicktime.cpp +++ b/backends/midi/quicktime.cpp @@ -38,7 +38,7 @@ #endif -// FIXME - the following disables reverb support in the QuickTime / CoreAudio +// FIXME: the following disables reverb support in the QuickTime / CoreAudio // midi backends. For some reasons, reverb will suck away a *lot* of CPU time. // Until we know for sure what is causing this and if there is a better way to // fix the problem, we just disable all reverb for these backends. diff --git a/backends/platform/PalmOS/Rsc/Resource.Frk/builder.rsrc b/backends/platform/PalmOS/Rsc/Resource.Frk/builder.rsrc Binary files differdeleted file mode 100644 index 18adade224..0000000000 --- a/backends/platform/PalmOS/Rsc/Resource.Frk/builder.rsrc +++ /dev/null diff --git a/backends/platform/PalmOS/Rsc/builder.rsrc b/backends/platform/PalmOS/Rsc/builder.rsrc deleted file mode 100644 index e69de29bb2..0000000000 --- a/backends/platform/PalmOS/Rsc/builder.rsrc +++ /dev/null diff --git a/backends/platform/PalmOS/Src/base_event.cpp b/backends/platform/PalmOS/Src/base_event.cpp index a3913529b6..3ca2722243 100644 --- a/backends/platform/PalmOS/Src/base_event.cpp +++ b/backends/platform/PalmOS/Src/base_event.cpp @@ -188,7 +188,7 @@ bool OSystem_PalmBase::pollEvent(Common::Event &event) { } else if (keyCurrentState & _keyExtra.bitUp) { _keyExtraPressed |= _keyExtra.bitUp; - event.kbd.keycode = Common::EVENT_KEYUP; + event.kbd.keycode = Common::KEYCODE_UP; } else if (keyCurrentState & _keyExtra.bitDown) { _keyExtraPressed |= _keyExtra.bitDown; @@ -233,7 +233,7 @@ bool OSystem_PalmBase::pollEvent(Common::Event &event) { #endif if (ev.eType == keyUpEvent) { - int k = 0; + Common::KeyCode k = Common::KEYCODE_INVALID; switch (ev.data.keyUp.chr) { // arrow keys @@ -256,7 +256,7 @@ bool OSystem_PalmBase::pollEvent(Common::Event &event) { } } else if (ev.eType == keyDownEvent) { - int k = 0; + Common::KeyCode k = Common::KEYCODE_INVALID; switch (ev.data.keyDown.chr) { // ESC key case vchrLaunch: @@ -345,7 +345,7 @@ bool OSystem_PalmBase::pollEvent(Common::Event &event) { (3 * (3 * y / _screenHeight)); event.type = Common::EVENT_KEYDOWN; - event.kbd.keycode = num; + event.kbd.keycode = (Common::KeyCode)num; event.kbd.ascii = num; event.kbd.flags = 0; @@ -411,13 +411,8 @@ bool OSystem_PalmBase::pollEvent(Common::Event &event) { // F1 -> F10 key if (key >= '0' && key <= '9' && mask == (Common::KBD_CTRL|Common::KBD_ALT)) { - key = (key - '0' + 10 - 1) % 10; // '0' -> 9, '1' -> 0, '2' -> 1, ... - _wasKey = true; - event.type = Common::EVENT_KEYDOWN; - event.kbd.keycode = Common::KEYCODE_F1 + key; - event.kbd.ascii = Common::ASCII_F1 + key; - event.kbd.flags = 0; - return true; + key = (key == '0') ? 324 : (315 + key - '1'); + mask = 0; #ifdef STDLIB_TRACE_MEMORY // print memory @@ -440,7 +435,7 @@ bool OSystem_PalmBase::pollEvent(Common::Event &event) { // other keys _wasKey = true; event.type = Common::EVENT_KEYDOWN; - event.kbd.keycode = key; + event.kbd.keycode = (Common::KeyCode)key; event.kbd.ascii = key; event.kbd.flags = mask; return true; diff --git a/backends/platform/PalmOS/Src/base_gfx.cpp b/backends/platform/PalmOS/Src/base_gfx.cpp index d45ade4e73..822663c6ab 100644 --- a/backends/platform/PalmOS/Src/base_gfx.cpp +++ b/backends/platform/PalmOS/Src/base_gfx.cpp @@ -25,10 +25,6 @@ #include "be_base.h" -#ifdef PALMOS_68K -# include <BmpGlue.h> -#endif - /* * Graphics modes * @@ -144,27 +140,6 @@ void OSystem_PalmBase::updateScreen() { WinPalette(winPaletteSet, _paletteDirtyStart, _paletteDirtyEnd - _paletteDirtyStart, _currentPalette + _paletteDirtyStart); _paletteDirtyEnd = 0; //_redawOSD = true; - -#ifdef PALMOS_68Ks - UInt8 oldCol; - oldCol = gVars->indicator.on; - gVars->indicator.on = RGBToColor(0,255,0); - - if (oldCol != gVars->indicator.on) - _redrawOSD = true; - -/* { - // redraw if needed - if (_lastKeyModifier) - draw1BitGfx((kDrawKeyState + _lastKeyModifier - 1), 2, getHeight() + 2, true); - - if(_useNumPad) - draw1BitGfx(kDrawNumPad, (getWidth() >> 1) - 32, getHeight() + 2, true); - - if (_showBatLow) - draw1BitGfx(kDrawBatLow, (getWidth() >> 1), -16, true); - }*/ -#endif } if (_redawOSD) { _redawOSD = false; @@ -184,11 +159,7 @@ void OSystem_PalmBase::clearScreen() { void OSystem_PalmBase::draw_osd(UInt16 id, Int32 x, Int32 y, Boolean show, UInt8 color) { //return; -#ifdef PALMOS_68K - MemHandle hTemp = DmGetResource(bitmapRsc, id); -#else MemHandle hTemp = DmGetResource('abmp', id + 100); -#endif if (hTemp) { /*static const UInt32 pal[3] = { @@ -201,11 +172,8 @@ void OSystem_PalmBase::draw_osd(UInt16 id, Int32 x, Int32 y, Boolean show, UInt8 bmTemp = (BitmapType *)MemHandleLock(hTemp); Coord w, h; -#ifdef PALMOS_68K - BmpGlueGetDimensions(bmTemp, &w, &h, 0); -#else BmpGetDimensions(bmTemp, &w, &h, 0); -#endif + PointType dst = { _screenOffset.x + x, _screenOffset.y + y }; RectangleType r = { dst.x, dst.y, w, h }; @@ -233,49 +201,4 @@ void OSystem_PalmBase::draw_osd(UInt16 id, Int32 x, Int32 y, Boolean show, UInt8 MemPtrUnlock(bmTemp); DmReleaseResource(hTemp); } - -/* MemHandle hTemp = DmGetResource(bitmapRsc, id); - - if (hTemp) { - BitmapType *bmTemp; - UInt32 *bmData; - UInt8 ih, iw, ib; - Coord w, h; - Int16 blocks, next; - - UInt8 *scr = _screenP + x + _screenPitch * y; - bmTemp = (BitmapType *)MemHandleLock(hTemp); - bmData = (UInt32 *)BmpGetBits(bmTemp); - -#ifdef PALMOS_68K - BmpGlueGetDimensions(bmTemp, &w, &h, 0); -#else - BmpGetDimensions(bmTemp, &w, &h, 0); -#endif - - blocks = w >> 5; - next = w - (blocks << 5); - - if (next) - blocks++; - - for (ih = 0; ih < h; ih++) { // line - for (ib = 0; ib < blocks; ib++) { // 32pix block - next = w - (ib << 5); - next = MIN(next, (Coord)32); - - for (iw = 0; iw < next; iw++) { // row - *scr++ = ((*bmData & (1 << (31 - iw))) && show) ? - gVars->indicator.on : - gVars->indicator.off; - } - - bmData++; - } - scr += _screenPitch - w; - } - - MemHandleUnlock(hTemp); - DmReleaseResource(hTemp); - }*/ } diff --git a/backends/platform/PalmOS/Src/be_base.h b/backends/platform/PalmOS/Src/be_base.h index 7881275358..0520d4bfdc 100644 --- a/backends/platform/PalmOS/Src/be_base.h +++ b/backends/platform/PalmOS/Src/be_base.h @@ -33,6 +33,7 @@ #include "common/scummsys.h" #include "common/system.h" #include "common/events.h" +#include "graphics/surface.h" namespace Audio { class Mixer; diff --git a/backends/platform/PalmOS/Src/builder/agos/bs_agos.c b/backends/platform/PalmOS/Src/builder/agos/bs_agos.c deleted file mode 100644 index 59f9df5c4f..0000000000 --- a/backends/platform/PalmOS/Src/builder/agos/bs_agos.c +++ /dev/null @@ -1,377 +0,0 @@ -#include <PalmOS.h> -#include "b_globals.h" -/////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////// - -typedef struct { -#if 0 // original struct - const char *gme_filename; - const char *wav_filename; - const char *voc_filename; - const char *mp3_filename; - const char *vorbis_filename; - const char *voc_effects_filename; - const char *mp3_effects_filename; - const char *vorbis_effects_filename; - const char *gamepc_filename; - #else - const char gme_filename[12]; - const char wav_filename[12]; - const char voc_filename[12]; - const char mp3_filename[12]; - const char flac_filename[12]; - const char vorbis_filename[12]; - const char voc_effects_filename[12]; - const char mp3_effects_filename[12]; - const char vorbis_effects_filename[12]; - const char flac_effects_filename[12]; - const char gamepc_filename[12]; - #endif -} GameSpecificSettings; -/////////////////////////////////////////////////////////////////// -static void addAGOS_simon1_settings() { - - - GameSpecificSettings simon1_settings = { - "SIMON.GME", // gme_filename - "SIMON.WAV", // wav_filename - "SIMON.VOC", // voc_filename - "SIMON.MP3", // mp3_filename - "SIMON.OGG", // vorbis_filename - "SIMON.FLA", // flac_filename - "EFFECTS.VOC", // voc_effects_filename - "EFFECTS.MP3", // mp3_effects_filename - "EFFECTS.OGG", // vorbis_effects_filename - "EFFECTS.FLA", // flac_effects_filename - "GAMEPC", // gamepc_filename - }; - - writeRecord(&simon1_settings, sizeof(simon1_settings), GBVARS_SIMON1SETTINGS_INDEX, GBVARS_AGOS); -} -/////////////////////////////////////////////////////////////////// -static void addAGOS_simon1acorn_settings() { - - - GameSpecificSettings simon1acorn_settings = { - "DATA", // gme_filename - "", // wav_filename - "SIMON", // voc_filename - "SIMON.MP3", // mp3_filename - "SIMON.OGG", // vorbis_filename - "SIMON.FLA", // flac_filename - "EFFECTS", // voc_effects_filename - "EFFECTS.MP3", // mp3_effects_filename - "EFFECTS.OGG", // vorbis_effects_filename - "EFFECTS.FLA", // flac_effects_filename - "GAMEBASE", // gamepc_filename -}; - - writeRecord(&simon1acorn_settings, sizeof(simon1acorn_settings), GBVARS_SIMON1ACORNSETTINGS_INDEX, GBVARS_AGOS); -} -/////////////////////////////////////////////////////////////////// -static void addAGOS_simon1amiga_settings() { - - - GameSpecificSettings simon1amiga_settings = { - "", // gme_filename - "", // wav_filename - "", // voc_filename - "SIMON.MP3", // mp3_filename - "SIMON.OGG", // vorbis_filename - "SIMON.FLA", // flac_filename - "", // voc_effects_filename - "", // mp3_effects_filename - "", // vorbis_effects_filename - "", // flac_effects_filename - "gameamiga", // gamepc_filename -}; - - - writeRecord(&simon1amiga_settings, sizeof(simon1amiga_settings), GBVARS_SIMON1AMIGASETTINGS_INDEX, GBVARS_AGOS); -} -/////////////////////////////////////////////////////////////////// - -static void addAGOS_simon1demo_settings() { - - - GameSpecificSettings simon1demo_settings = { - "", // gme_filename - "", // wav_filename - "", // voc_filename - "", // mp3_filename - "", // vorbis_filename - "", // flac_filename - "", // voc_effects_filename - "", // mp3_effects_filename - "", // vorbis_effects_filename - "", // flac_effects_filename - "GDEMO", // gamepc_filename -}; - - writeRecord(&simon1demo_settings, sizeof(simon1demo_settings), GBVARS_SIMON1DEMOSETTINGS_INDEX, GBVARS_AGOS); -} -/////////////////////////////////////////////////////////////////// -static void addAGOS_simon2win_settings() { - - - GameSpecificSettings simon2win_settings = { - "SIMON2.GME", // gme_filename - "SIMON2.WAV", // wav_filename - "SIMON2.VOC", // voc_filename - "SIMON2.MP3", // mp3_filename - "SIMON2.OGG", // vorbis_filename - "SIMON2.FLA", // flac_filename - "", // voc_effects_filename - "", // mp3_effects_filename - "", // vorbis_effects_filename - "", // flac_effects_filename - "GSPTR30", // gamepc_filename -}; - - - writeRecord(&simon2win_settings, sizeof(simon2win_settings), GBVARS_SIMON2WINSETTINGS_INDEX, GBVARS_AGOS); -} -/////////////////////////////////////////////////////////////////// -static void addAGOS_simon2dos_settings() { - - - GameSpecificSettings simon2dos_settings = { - "SIMON2.GME", // gme_filename - "", // wav_filename - "", // voc_filename - "", // mp3_filename - "", // vorbis_filename - "", // flac_filename - "", // voc_effects_filename - "", // mp3_effects_filename - "", // vorbis_effects_filename - "", // flac_effects_filename - "GAME32", // gamepc_filename -}; - - writeRecord(&simon2dos_settings, sizeof(simon2dos_settings), GBVARS_SIMON2DOSSETTINGS_INDEX, GBVARS_AGOS); -} - -typedef unsigned char byte; -static void addAGOS_simon1_cursor() { - - - byte _simon1_cursor[256] = { - 0xe1,0xe0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, - 0xe1,0xe1,0xe0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, - 0xe1,0xe1,0xe1,0xe0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, - 0xe1,0xe1,0xe1,0xe1,0xe0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, - 0xe1,0xe1,0xe1,0xe1,0xe1,0xe0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, - 0xe1,0xe1,0xe1,0xe1,0xe1,0xe1,0xe0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, - 0xe1,0xe1,0xe1,0xe1,0xe0,0xe0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, - 0xe1,0xff,0xff,0xe1,0xe0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, - 0xff,0xff,0xff,0xff,0xe1,0xe0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, - 0xff,0xff,0xff,0xff,0xe1,0xe0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, - 0xff,0xff,0xff,0xff,0xff,0xe1,0xe0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, - 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, - 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, - 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, - 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, - 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, -}; - - writeRecord(&_simon1_cursor, sizeof(_simon1_cursor), GBVARS_SIMON1CURSOR_INDEX, GBVARS_AGOS); -} -/* -static void addAGOS_simon2_cursors() { - - - byte _simon2_cursors[10][256] = { - // cross hair - { 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xec,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, - 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xec,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, - 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xec,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, - 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xec,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, - 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xec,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, - 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xef,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, - 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, - 0xec,0xec,0xec,0xec,0xec,0xef,0xff,0xea,0xff,0xef,0xec,0xec,0xec,0xec,0xec,0xff, - 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, - 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xef,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, - 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xec,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, - 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xec,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, - 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xec,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, - 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xec,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, - 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xec,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, - 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff }, - // examine - { 0xff,0xff,0xef,0xef,0xef,0xef,0xef,0xef,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, - 0xff,0xef,0xee,0xeb,0xe4,0xe4,0xe4,0xee,0xef,0xff,0xff,0xff,0xff,0xff,0xff,0xff, - 0xef,0xee,0xeb,0xee,0xef,0xef,0xee,0xec,0xee,0xef,0xff,0xff,0xff,0xff,0xff,0xff, - 0xef,0xeb,0xee,0xef,0xee,0xee,0xef,0xee,0xe4,0xef,0xff,0xff,0xff,0xff,0xff,0xff, - 0xef,0xeb,0xef,0xef,0xef,0xec,0xee,0xef,0xe4,0xef,0xff,0xff,0xff,0xff,0xff,0xff, - 0xef,0xeb,0xef,0xef,0xee,0xef,0xef,0xef,0xe4,0xef,0xff,0xff,0xff,0xff,0xff,0xff, - 0xef,0xeb,0xee,0xef,0xef,0xef,0xef,0xee,0xe4,0xef,0xff,0xff,0xff,0xff,0xff,0xff, - 0xef,0xee,0xeb,0xee,0xef,0xef,0xee,0xe4,0xee,0xef,0xff,0xff,0xff,0xff,0xff,0xff, - 0xff,0xef,0xee,0xeb,0xeb,0xeb,0xeb,0xee,0xe4,0xec,0xef,0xff,0xff,0xff,0xff,0xff, - 0xff,0xff,0xef,0xef,0xef,0xef,0xef,0xef,0xeb,0xe4,0xee,0xef,0xff,0xff,0xff,0xff, - 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xef,0xee,0xe4,0xeb,0xef,0xff,0xff,0xff, - 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xef,0xeb,0xe4,0xeb,0xef,0xff,0xff, - 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xef,0xeb,0xec,0xeb,0xef,0xff, - 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xef,0xeb,0xe4,0xef,0xff, - 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xef,0xef,0xff,0xff, - 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff }, - // pick up - { 0xff,0xff,0xff,0xff,0xff,0xe5,0xe5,0xe5,0xe5,0xe5,0xe5,0xff,0xff,0xff,0xff,0xff, - 0xff,0xff,0xff,0xff,0xe5,0xe6,0xe6,0xe7,0xe7,0xe6,0xe6,0xe5,0xff,0xff,0xff,0xff, - 0xff,0xff,0xff,0xe5,0xe7,0xe7,0xe7,0xe7,0xe8,0xe8,0xe8,0xe8,0xe5,0xff,0xff,0xff, - 0xff,0xff,0xe5,0xe6,0xe7,0xe7,0xe7,0xe7,0xe7,0xe7,0xe8,0xe9,0xe7,0xe5,0xff,0xff, - 0xff,0xe5,0xe6,0xe7,0xe6,0xe5,0xff,0xff,0xff,0xff,0xe5,0xe6,0xe8,0xe6,0xe5,0xff, - 0xff,0xe5,0xe7,0xe7,0xe5,0xff,0xff,0xff,0xff,0xff,0xff,0xe5,0xe8,0xe7,0xe5,0xff, - 0xff,0xe5,0xe7,0xe7,0xe5,0xff,0xff,0xff,0xff,0xff,0xff,0xe5,0xe7,0xe7,0xe5,0xff, - 0xff,0xef,0xeb,0xeb,0xef,0xff,0xff,0xff,0xff,0xff,0xff,0xef,0xeb,0xeb,0xef,0xff, - 0xff,0xef,0xee,0xeb,0xee,0xef,0xff,0xff,0xff,0xff,0xef,0xee,0xeb,0xee,0xef,0xff, - 0xff,0xff,0xef,0xeb,0xeb,0xef,0xff,0xff,0xff,0xff,0xef,0xeb,0xeb,0xef,0xff,0xff, - 0xff,0xff,0xef,0xee,0xe4,0xee,0xef,0xff,0xff,0xef,0xee,0xe4,0xee,0xef,0xff,0xff, - 0xff,0xff,0xff,0xef,0xe4,0xeb,0xef,0xff,0xff,0xef,0xeb,0xe4,0xef,0xff,0xff,0xff, - 0xff,0xff,0xff,0xff,0xeb,0xeb,0xeb,0xef,0xef,0xeb,0xeb,0xeb,0xff,0xff,0xff,0xff, - 0xff,0xff,0xff,0xff,0xef,0xee,0xee,0xee,0xee,0xe1,0xe1,0xef,0xff,0xff,0xff,0xe4, - 0xef,0xee,0xeb,0xeb,0xeb,0xeb,0xeb,0xe4,0xe4,0xe4,0xe4,0xe4,0xe4,0xe4,0xeb,0xec, - 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xe4 }, - // give - { 0xff,0xff,0xff,0xff,0xff,0xe5,0xe7,0xe5,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, - 0xff,0xff,0xff,0xff,0xe5,0xe7,0xe8,0xe7,0xe5,0xff,0xff,0xff,0xff,0xff,0xff,0xff, - 0xff,0xff,0xff,0xe9,0xe7,0xe8,0xe8,0xe8,0xe7,0xe9,0xff,0xff,0xff,0xff,0xff,0xff, - 0xff,0xff,0xe5,0xe7,0xea,0xe8,0xe8,0xe8,0xea,0xe7,0xe5,0xff,0xff,0xff,0xff,0xff, - 0xff,0xe5,0xe7,0xe8,0xe8,0xea,0xe9,0xea,0xe8,0xe8,0xe7,0xe5,0xff,0xff,0xff,0xff, - 0xe5,0xe7,0xe9,0xe8,0xe8,0xe9,0xec,0xe9,0xe8,0xe8,0xe8,0xe7,0xe5,0xff,0xff,0xff, - 0xe5,0xe7,0xe7,0xe9,0xe8,0xec,0xe9,0xec,0xe8,0xe9,0xe7,0xe6,0xe5,0xff,0xff,0xff, - 0xe5,0xe7,0xe7,0xe8,0xec,0xe9,0xe9,0xe9,0xec,0xe7,0xe6,0xe6,0xe5,0xff,0xff,0xff, - 0xe5,0xe7,0xe7,0xea,0xe8,0xe9,0xe9,0xe9,0xe7,0xec,0xec,0xe4,0xe5,0xff,0xff,0xff, - 0xe5,0xe7,0xe7,0xe9,0xe7,0xe8,0xe9,0xe7,0xe6,0xec,0xe4,0xec,0xe4,0xef,0xff,0xff, - 0xe5,0xe6,0xe7,0xe9,0xe7,0xe7,0xe8,0xe6,0xe6,0xe4,0xec,0xe4,0xec,0xe4,0xef,0xff, - 0xff,0xe5,0xe6,0xe9,0xe7,0xe7,0xe8,0xe6,0xe6,0xe8,0xe4,0xec,0xe4,0xec,0xeb,0xff, - 0xff,0xff,0xe5,0xe9,0xe7,0xe7,0xe8,0xe6,0xe6,0xe8,0xe6,0xe4,0xec,0xeb,0xef,0xff, - 0xff,0xff,0xff,0xe8,0xe7,0xe7,0xe8,0xe6,0xe6,0xe7,0xff,0xef,0xeb,0xef,0xff,0xff, - 0xff,0xff,0xff,0xff,0xe5,0xe7,0xe8,0xe6,0xe5,0xff,0xff,0xff,0xff,0xff,0xff,0xff, - 0xff,0xff,0xff,0xff,0xff,0xe5,0xe6,0xe5,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff }, - // talk - { 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, - 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, - 0xff,0xff,0xff,0xe5,0xe5,0xe5,0xe5,0xe5,0xe5,0xff,0xff,0xff,0xff,0xff,0xff,0xff, - 0xff,0xff,0xe5,0xe7,0xe8,0xe8,0xe8,0xe7,0xe6,0xe5,0xe5,0xe5,0xff,0xff,0xff,0xff, - 0xff,0xe5,0xe6,0xe9,0xea,0xe6,0xea,0xe9,0xe8,0xe9,0xe8,0xe7,0xe5,0xff,0xff,0xff, - 0xff,0xe5,0xe7,0xe5,0xef,0xe5,0xec,0xea,0xe5,0xea,0xec,0xe5,0xe9,0xe6,0xff,0xff, - 0xff,0xe5,0xe6,0xe5,0xef,0xef,0xef,0xe5,0xef,0xef,0xe5,0xef,0xef,0xe8,0xe5,0xff, - 0xff,0xe5,0xe9,0xea,0xe5,0xe8,0xe7,0xe6,0xe6,0xe8,0xe7,0xe5,0xec,0xe9,0xe5,0xff, - 0xff,0xe5,0xe9,0xe8,0xe5,0xe7,0xe8,0xe8,0xe9,0xe9,0xe8,0xe5,0xe9,0xe9,0xe5,0xff, - 0xff,0xe5,0xe6,0xec,0xea,0xe5,0xe6,0xe6,0xe7,0xe7,0xe6,0xe5,0xec,0xe8,0xe5,0xff, - 0xff,0xff,0xe5,0xe9,0xe8,0xe9,0xe5,0xe8,0xe5,0xe8,0xe5,0xe9,0xe9,0xe7,0xe5,0xff, - 0xff,0xff,0xe5,0xe7,0xe9,0xec,0xe8,0xec,0xe8,0xec,0xe8,0xec,0xe8,0xe5,0xff,0xff, - 0xff,0xff,0xff,0xe5,0xe6,0xe8,0xe9,0xe9,0xe9,0xe9,0xe9,0xe8,0xe5,0xff,0xff,0xff, - 0xff,0xff,0xff,0xff,0xe5,0xe5,0xe5,0xe5,0xe5,0xe5,0xe5,0xe5,0xff,0xff,0xff,0xff, - 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, - 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff }, - // use - { 0xff,0xff,0xff,0xff,0xff,0xee,0xe1,0xeb,0xee,0xef,0xef,0xff,0xff,0xff,0xff,0xff, - 0xff,0xff,0xff,0xff,0xff,0xef,0xef,0xef,0xe4,0xeb,0xee,0xe5,0xff,0xff,0xff,0xff, - 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xeb,0xe4,0xe4,0xeb,0xe5,0xff,0xff,0xff, - 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xeb,0xe4,0xec,0xe4,0xef,0xff,0xff,0xff, - 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xeb,0xeb,0xe4,0xe4,0xee,0xef,0xff,0xff, - 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xee,0xeb,0xeb,0xeb,0xe1,0xef,0xee,0xef, - 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xe5,0xe6,0xef,0xef,0xee,0xeb,0xeb,0xe4,0xee, - 0xff,0xff,0xff,0xff,0xff,0xff,0xe5,0xe6,0xff,0xff,0xff,0xef,0xeb,0xec,0xeb,0xef, - 0xff,0xff,0xff,0xff,0xff,0xe5,0xe6,0xe5,0xff,0xff,0xff,0xee,0xe4,0xeb,0xef,0xff, - 0xff,0xff,0xff,0xe5,0xe5,0xe6,0xe5,0xff,0xff,0xff,0xff,0xef,0xee,0xef,0xff,0xff, - 0xff,0xff,0xe5,0xe6,0xe8,0xe5,0xff,0xff,0xff,0xff,0xff,0xff,0xef,0xff,0xff,0xff, - 0xff,0xe5,0xe6,0xe8,0xe6,0xe5,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, - 0xe5,0xe6,0xe8,0xe6,0xe5,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, - 0xe5,0xe6,0xe6,0xe5,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, - 0xff,0xe5,0xe5,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, - 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff }, - // wear - { 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, - 0xff,0xff,0xff,0xef,0xef,0xef,0xef,0xef,0xef,0xef,0xef,0xef,0xef,0xff,0xff,0xff, - 0xff,0xff,0xff,0xef,0xeb,0xed,0xe4,0xe2,0xeb,0xee,0xee,0xee,0xef,0xff,0xff,0xff, - 0xff,0xff,0xff,0xef,0xe2,0xec,0xe2,0xe1,0xee,0xef,0xef,0xee,0xef,0xff,0xff,0xff, - 0xff,0xff,0xff,0xef,0xeb,0xed,0xeb,0xee,0xef,0xef,0xef,0xee,0xef,0xff,0xff,0xff, - 0xff,0xff,0xff,0xef,0xee,0xe4,0xeb,0xee,0xef,0xef,0xee,0xef,0xef,0xff,0xff,0xff, - 0xff,0xff,0xff,0xff,0xef,0xe4,0xeb,0xee,0xef,0xef,0xee,0xef,0xff,0xff,0xff,0xff, - 0xff,0xff,0xff,0xff,0xef,0xe2,0xeb,0xee,0xef,0xef,0xee,0xef,0xff,0xff,0xff,0xff, - 0xff,0xff,0xff,0xff,0xef,0xeb,0xe1,0xee,0xef,0xef,0xee,0xef,0xff,0xff,0xff,0xff, - 0xff,0xff,0xff,0xff,0xef,0xeb,0xe1,0xee,0xef,0xef,0xef,0xef,0xff,0xff,0xff,0xff, - 0xff,0xef,0xef,0xef,0xe1,0xe4,0xe4,0xe4,0xe1,0xeb,0xee,0xef,0xef,0xef,0xff,0xff, - 0xef,0xee,0xee,0xef,0xee,0xee,0xee,0xee,0xee,0xef,0xef,0xef,0xee,0xee,0xef,0xff, - 0xff,0xef,0xef,0xee,0xe1,0xe2,0xe4,0xe4,0xe4,0xeb,0xe1,0xee,0xef,0xef,0xff,0xff, - 0xff,0xff,0xff,0xef,0xef,0xef,0xef,0xef,0xef,0xef,0xef,0xef,0xff,0xff,0xff,0xff, - 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, - 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff }, - // move - { 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, - 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, - 0xff,0xe1,0xe1,0xe1,0xe1,0xe1,0xe1,0xe1,0xe1,0xe1,0xe1,0xe1,0xe1,0xe1,0xe1,0xff, - 0xff,0xe1,0xe2,0xe2,0xe2,0xe2,0xe2,0xe2,0xe2,0xe2,0xe2,0xe2,0xe2,0xe2,0xe1,0xff, - 0xff,0xe1,0xe3,0xe3,0xe3,0xed,0xe3,0xe3,0xe3,0xe3,0xed,0xe3,0xe3,0xe3,0xe1,0xff, - 0xff,0xe1,0xe3,0xe3,0xed,0xec,0xe3,0xe3,0xe3,0xe3,0xec,0xed,0xe3,0xe3,0xe1,0xff, - 0xff,0xe1,0xe3,0xed,0xec,0xec,0xec,0xec,0xec,0xec,0xec,0xec,0xed,0xe3,0xe1,0xff, - 0xff,0xe1,0xed,0xec,0xec,0xec,0xec,0xec,0xec,0xec,0xec,0xec,0xec,0xed,0xe1,0xff, - 0xff,0xe1,0xe3,0xed,0xec,0xec,0xec,0xec,0xec,0xec,0xec,0xec,0xed,0xe3,0xe1,0xff, - 0xff,0xe1,0xe3,0xe3,0xed,0xec,0xe3,0xe3,0xe3,0xe3,0xec,0xed,0xe3,0xe3,0xe1,0xff, - 0xff,0xe1,0xe3,0xe3,0xe3,0xed,0xe3,0xe3,0xe3,0xe3,0xed,0xe3,0xe3,0xe3,0xe1,0xff, - 0xff,0xe1,0xe2,0xe2,0xe2,0xe2,0xe2,0xe2,0xe2,0xe2,0xe2,0xe2,0xe2,0xe2,0xe1,0xff, - 0xff,0xe1,0xe1,0xe1,0xe1,0xe1,0xe1,0xe1,0xe1,0xe1,0xe1,0xe1,0xe1,0xe1,0xe1,0xff, - 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, - 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, - 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff }, - // open - { 0xff,0xff,0xe5,0xe8,0xe8,0xe7,0xe5,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, - 0xff,0xff,0xe5,0xe8,0xe7,0xe5,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, - 0xff,0xff,0xe5,0xe7,0xe5,0xe7,0xe5,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, - 0xff,0xff,0xff,0xe5,0xff,0xe5,0xe7,0xe6,0xe9,0xff,0xff,0xff,0xff,0xff,0xff,0xff, - 0xff,0xff,0xff,0xff,0xff,0xff,0xe6,0xea,0xe6,0xff,0xff,0xff,0xff,0xff,0xff,0xff, - 0xff,0xff,0xff,0xff,0xff,0xe6,0xea,0xe6,0xe7,0xe5,0xff,0xe5,0xff,0xff,0xff,0xff, - 0xff,0xff,0xff,0xff,0xe6,0xea,0xe6,0xff,0xe5,0xe7,0xe5,0xe7,0xe5,0xff,0xff,0xff, - 0xff,0xff,0xff,0xe6,0xea,0xe6,0xff,0xff,0xff,0xe5,0xe7,0xe8,0xe5,0xff,0xff,0xff, - 0xff,0xe5,0xe6,0xea,0xe6,0xff,0xff,0xff,0xe5,0xe7,0xe8,0xe8,0xe5,0xff,0xff,0xff, - 0xff,0xe5,0xe9,0xea,0xea,0xea,0xea,0xea,0xea,0xea,0xea,0xe5,0xff,0xff,0xff,0xff, - 0xff,0xe5,0xe9,0xe7,0xe7,0xe7,0xe7,0xe7,0xe7,0xe7,0xea,0xe5,0xff,0xff,0xff,0xff, - 0xff,0xe5,0xe9,0xe5,0xe5,0xe5,0xe5,0xe5,0xe5,0xe5,0xe9,0xe5,0xff,0xff,0xff,0xff, - 0xff,0xe5,0xe9,0xe8,0xe8,0xe8,0xe8,0xe8,0xe7,0xe7,0xe9,0xe5,0xff,0xff,0xff,0xff, - 0xff,0xe5,0xe9,0xe6,0xe6,0xe6,0xe6,0xe6,0xe6,0xe5,0xe9,0xe5,0xff,0xff,0xff,0xff, - 0xff,0xe5,0xe9,0xe8,0xe8,0xe8,0xe8,0xe8,0xe8,0xe7,0xe9,0xe5,0xff,0xff,0xff,0xff, - 0xff,0xe5,0xe9,0xe9,0xe9,0xe9,0xe9,0xe9,0xe9,0xe9,0xe9,0xe5,0xff,0xff,0xff,0xff }, - // question mark - { 0xff,0xff,0xff,0xff,0xff,0xe5,0xe5,0xe5,0xe5,0xe5,0xe5,0xff,0xff,0xff,0xff,0xff, - 0xff,0xff,0xff,0xff,0xe5,0xe7,0xea,0xec,0xec,0xec,0xe9,0xe5,0xff,0xff,0xff,0xff, - 0xff,0xff,0xff,0xe5,0xe7,0xea,0xec,0xea,0xe9,0xea,0xec,0xe9,0xe5,0xff,0xff,0xff, - 0xff,0xff,0xff,0xe5,0xe9,0xec,0xe9,0xe8,0xe7,0xe8,0xea,0xec,0xe5,0xff,0xff,0xff, - 0xff,0xff,0xff,0xe5,0xe8,0xe9,0xe8,0xe5,0xe5,0xe8,0xe9,0xec,0xe5,0xff,0xff,0xff, - 0xff,0xff,0xff,0xff,0xe5,0xe5,0xe5,0xe5,0xe8,0xe9,0xec,0xe9,0xe5,0xff,0xff,0xff, - 0xff,0xff,0xff,0xff,0xff,0xff,0xe5,0xe9,0xec,0xec,0xe9,0xe5,0xff,0xff,0xff,0xff, - 0xff,0xff,0xff,0xff,0xff,0xe5,0xe8,0xec,0xea,0xe8,0xe5,0xff,0xff,0xff,0xff,0xff, - 0xff,0xff,0xff,0xff,0xff,0xe5,0xe9,0xec,0xe9,0xe5,0xff,0xff,0xff,0xff,0xff,0xff, - 0xff,0xff,0xff,0xff,0xff,0xe5,0xe9,0xea,0xe9,0xe5,0xff,0xff,0xff,0xff,0xff,0xff, - 0xff,0xff,0xff,0xff,0xff,0xe5,0xe7,0xe9,0xe7,0xe5,0xff,0xff,0xff,0xff,0xff,0xff, - 0xff,0xff,0xff,0xff,0xff,0xff,0xe5,0xe5,0xe5,0xff,0xff,0xff,0xff,0xff,0xff,0xff, - 0xff,0xff,0xff,0xff,0xff,0xe5,0xe8,0xe9,0xe8,0xe5,0xff,0xff,0xff,0xff,0xff,0xff, - 0xff,0xff,0xff,0xff,0xff,0xe5,0xe9,0xec,0xe9,0xe5,0xff,0xff,0xff,0xff,0xff,0xff, - 0xff,0xff,0xff,0xff,0xff,0xe5,0xe8,0xe9,0xe8,0xe5,0xff,0xff,0xff,0xff,0xff,0xff, - 0xff,0xff,0xff,0xff,0xff,0xff,0xe5,0xe5,0xe5,0xff,0xff,0xff,0xff,0xff,0xff,0xff }, -}; - - writeRecord(&_simon2_cursors, sizeof(_simon2_cursors), GBVARS_SIMON2CURSORS_INDEX, GBVARS_AGOS); -}*/ -/////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////// - -void addAGOS() { - addAGOS_simon1_settings(); - addAGOS_simon1acorn_settings(); - addAGOS_simon1amiga_settings(); - addAGOS_simon1demo_settings(); - addAGOS_simon2win_settings(); - addAGOS_simon2dos_settings(); - - addAGOS_simon1_cursor(); -// addAGOS_simon2_cursors(); -} diff --git a/backends/platform/PalmOS/Src/builder/agos/bs_charset.c b/backends/platform/PalmOS/Src/builder/agos/bs_charset.c deleted file mode 100644 index 662884682f..0000000000 --- a/backends/platform/PalmOS/Src/builder/agos/bs_charset.c +++ /dev/null @@ -1,745 +0,0 @@ -#include <PalmOS.h> -#include "b_globals.h" - -static void addCharset_russian_video_font() { - byte russian_video_font[] = { - 0, 0, 0, 0, 0, 0, 0, 0, - 32, 112, 112, 32, 32, 0, 32, 0, - 48, 48, 96, 0, 0, 0, 0, 0, - 0, 0, 100, 40, 48, 40, 100, 0, - 0, 0, 96, 48, 40, 40, 112, 0, - 60, 68, 68, 60, 36, 68, 68, 0, - 0, 16, 40, 16, 42, 68, 58, 0, - 48, 48, 96, 0, 0, 0, 0, 0, - 0, 4, 8, 8, 8, 8, 4, 0, - 0, 32, 16, 16, 16, 16, 32, 0, - 72, 84, 84, 116, 84, 84, 72, 0, - 0, 0, 60, 68, 60, 36, 100, 0, - 0, 0, 0, 0, 0, 48, 48, 96, - 0, 0, 0, 240, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 48, 48, 0, - 16, 32, 0, 120, 112, 64, 56, 0, - 112, 136, 152, 168, 200, 136, 112, 0, - 32, 96, 32, 32, 32, 32, 112, 0, - 112, 136, 8, 48, 64, 136, 248, 0, - 112, 136, 8, 48, 8, 136, 112, 0, - 16, 48, 80, 144, 248, 16, 56, 0, - 248, 128, 240, 8, 8, 136, 112, 0, - 48, 64, 128, 240, 136, 136, 112, 0, - 248, 136, 8, 16, 32, 32, 32, 0, - 112, 136, 136, 112, 136, 136, 112, 0, - 112, 136, 136, 120, 8, 16, 96, 0, - 0, 0, 48, 48, 0, 48, 48, 0, - 32, 16, 0, 112, 8, 248, 120, 0, - 0, 0, 96, 48, 40, 40, 112, 0, - 0, 0, 112, 88, 20, 20, 56, 0, - 0, 0, 120, 4, 28, 4, 120, 0, - 112, 136, 8, 16, 32, 0, 32, 0, - 0, 0, 84, 84, 84, 84, 56, 4, - 56, 68, 68, 124, 68, 68, 68, 0, - 124, 36, 32, 56, 36, 36, 120, 0, - 120, 36, 36, 56, 36, 36, 120, 0, - 124, 36, 32, 32, 32, 32, 112, 0, - 56, 40, 40, 40, 40, 40, 124, 68, - 124, 36, 32, 56, 32, 36, 124, 0, - 84, 84, 84, 56, 84, 84, 84, 0, - 56, 68, 4, 24, 4, 68, 56, 0, - 68, 68, 76, 84, 100, 68, 68, 0, - 100, 40, 40, 48, 40, 36, 100, 0, - 28, 36, 36, 36, 36, 36, 100, 0, - 68, 108, 84, 68, 68, 68, 68, 0, - 68, 68, 68, 124, 68, 68, 68, 0, - 56, 68, 68, 68, 68, 68, 56, 0, - 124, 68, 68, 68, 68, 68, 68, 0, - 120, 36, 36, 56, 32, 32, 112, 0, - 56, 68, 64, 64, 64, 68, 56, 0, - 124, 84, 16, 16, 16, 16, 56, 0, - 100, 36, 36, 28, 4, 4, 56, 0, - 56, 84, 84, 84, 56, 16, 56, 0, - 108, 40, 16, 16, 40, 40, 108, 0, - 72, 72, 72, 72, 72, 72, 60, 4, - 76, 72, 72, 56, 8, 8, 28, 0, - 84, 84, 84, 84, 84, 84, 60, 0, - 84, 84, 84, 84, 84, 84, 56, 4, - 56, 68, 4, 28, 4, 68, 56, 0, - 0, 0, 68, 100, 84, 84, 100, 0, - 0, 0, 72, 84, 116, 84, 72, 0, - 0, 0, 60, 68, 60, 36, 100, 0, - 0, 0, 120, 4, 24, 4, 120, 0, - 0, 0, 100, 40, 48, 40, 100, 0, - 60, 68, 68, 60, 36, 68, 68, 0, - 0, 0, 56, 4, 60, 68, 60, 0, - 60, 64, 32, 56, 68, 68, 56, 0, - 48, 72, 80, 120, 68, 68, 56, 0, - 0, 0, 120, 4, 56, 64, 60, 0, - 56, 4, 4, 60, 68, 68, 56, 0, - 0, 0, 56, 68, 120, 64, 56, 0, - 40, 0, 56, 68, 120, 64, 56, 0, - 0, 0, 84, 84, 56, 84, 84, 0, - 64, 0, 192, 64, 64, 64, 224, 0, - 0, 0, 68, 68, 68, 68, 60, 0, - 56, 0, 68, 68, 68, 68, 60, 0, - 192, 64, 64, 64, 64, 64, 224, 0, - 0, 0, 28, 36, 36, 36, 100, 0, - 0, 0, 68, 108, 84, 68, 68, 0, - 0, 0, 56, 68, 68, 68, 56, 0, - 0, 0, 68, 68, 124, 68, 68, 0, - 0, 0, 124, 68, 68, 68, 68, 0, - 0, 0, 120, 36, 36, 56, 32, 112, - 0, 0, 60, 64, 64, 64, 60, 0, - 0, 0, 124, 84, 16, 16, 56, 0, - 0, 0, 68, 68, 60, 4, 56, 0, - 48, 16, 56, 84, 84, 56, 16, 56, - 0, 0, 68, 40, 16, 40, 68, 0, - 0, 0, 72, 72, 72, 72, 60, 4, - 0, 0, 76, 72, 72, 56, 8, 28, - 0, 0, 84, 84, 84, 84, 60, 0, - 32, 80, 0, 96, 144, 144, 96, 0, - 0, 14, 8, 48, 8, 8, 14, 0, - 0, 8, 8, 8, 8, 8, 8, 0, - 0, 112, 16, 12, 16, 16, 112, 0, - 0, 0, 0, 0, 0, 0, 248, 0, - 252, 252, 252, 252, 252, 252, 252, 252, - 240, 240, 240, 240, 240, 240, 240, 240, - }; - writeRecord(russian_video_font, sizeof(russian_video_font), GBVARS_RUSSIANVIDEOFONT_INDEX , GBVARS_SIMON); -} - -static void addCharset_french_video_font() { - byte french_video_font[] = { - 0, 0, 0, 0, 0, 0, 0, 0, - 32, 112, 112, 32, 32, 0, 32, 0, - 48, 48, 96, 0, 0, 0, 0, 0, - 32, 80, 0, 112, 136, 136, 112, 0, - 32, 80, 0, 112, 8, 248, 120, 0, - 112, 136, 128, 128, 136, 112, 32, 96, - 0, 16, 40, 16, 42, 68, 58, 0, - 48, 48, 96, 0, 0, 0, 0, 0, - 0, 4, 8, 8, 8, 8, 4, 0, - 0, 32, 16, 16, 16, 16, 32, 0, - 0, 0, 20, 8, 62, 8, 20, 0, - 112, 136, 128, 128, 136, 112, 32, 96, - 0, 0, 0, 0, 0, 48, 48, 96, - 0, 0, 0, 240, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 48, 48, 0, - 32, 64, 0, 112, 248, 128, 112, 0, - 112, 136, 152, 168, 200, 136, 112, 0, - 32, 96, 32, 32, 32, 32, 112, 0, - 112, 136, 8, 48, 64, 136, 248, 0, - 112, 136, 8, 48, 8, 136, 112, 0, - 16, 48, 80, 144, 248, 16, 56, 0, - 248, 128, 240, 8, 8, 136, 112, 0, - 48, 64, 128, 240, 136, 136, 112, 0, - 248, 136, 8, 16, 32, 32, 32, 0, - 112, 136, 136, 112, 136, 136, 112, 0, - 112, 136, 136, 120, 8, 16, 96, 0, - 0, 0, 48, 48, 0, 48, 48, 0, - 32, 16, 0, 112, 8, 248, 120, 0, - 32, 80, 0, 144, 144, 144, 104, 0, - 32, 16, 0, 112, 248, 128, 112, 0, - 32, 80, 0, 112, 248, 128, 112, 0, - 112, 136, 8, 16, 32, 0, 32, 0, - 32, 80, 0, 192, 64, 64, 224, 0, - 112, 136, 136, 248, 136, 136, 136, 0, - 240, 72, 72, 112, 72, 72, 240, 0, - 48, 72, 128, 128, 128, 72, 48, 0, - 224, 80, 72, 72, 72, 80, 224, 0, - 248, 72, 64, 112, 64, 72, 248, 0, - 248, 72, 64, 112, 64, 64, 224, 0, - 48, 72, 128, 152, 136, 72, 56, 0, - 136, 136, 136, 248, 136, 136, 136, 0, - 248, 32, 32, 32, 32, 32, 248, 0, - 24, 8, 8, 8, 136, 136, 112, 0, - 200, 72, 80, 96, 80, 72, 200, 0, - 224, 64, 64, 64, 64, 72, 248, 0, - 136, 216, 168, 168, 136, 136, 136, 0, - 136, 200, 168, 152, 136, 136, 136, 0, - 112, 136, 136, 136, 136, 136, 112, 0, - 240, 72, 72, 112, 64, 64, 224, 0, - 112, 136, 136, 136, 136, 168, 112, 8, - 240, 72, 72, 112, 72, 72, 200, 0, - 112, 136, 128, 112, 8, 136, 112, 0, - 248, 168, 32, 32, 32, 32, 112, 0, - 136, 136, 136, 136, 136, 136, 120, 0, - 136, 136, 136, 80, 80, 32, 32, 0, - 136, 136, 136, 136, 168, 216, 136, 0, - 136, 136, 80, 32, 80, 136, 136, 0, - 136, 136, 136, 112, 32, 32, 112, 0, - 248, 136, 16, 32, 64, 136, 248, 0, - 0, 14, 8, 8, 8, 8, 14, 0, - 0, 128, 64, 32, 16, 8, 4, 0, - 0, 112, 16, 16, 16, 16, 112, 0, - 0, 0, 112, 136, 128, 112, 32, 96, - 160, 0, 192, 64, 64, 64, 224, 0, - 32, 16, 0, 144, 144, 144, 104, 0, - 0, 0, 112, 8, 120, 136, 120, 0, - 192, 64, 80, 104, 72, 72, 112, 0, - 0, 0, 112, 136, 128, 136, 112, 0, - 24, 16, 80, 176, 144, 144, 112, 0, - 0, 0, 112, 136, 248, 128, 112, 0, - 48, 72, 64, 224, 64, 64, 224, 0, - 0, 0, 104, 144, 144, 112, 136, 112, - 192, 64, 80, 104, 72, 72, 200, 0, - 64, 0, 192, 64, 64, 64, 224, 0, - 8, 0, 8, 8, 8, 8, 136, 112, - 192, 64, 72, 80, 96, 80, 200, 0, - 192, 64, 64, 64, 64, 64, 224, 0, - 0, 0, 144, 216, 168, 136, 136, 0, - 0, 0, 240, 136, 136, 136, 136, 0, - 0, 0, 112, 136, 136, 136, 112, 0, - 0, 0, 176, 72, 72, 112, 64, 224, - 0, 0, 104, 144, 144, 112, 16, 56, - 0, 0, 176, 72, 72, 64, 224, 0, - 0, 0, 120, 128, 112, 8, 240, 0, - 64, 64, 240, 64, 64, 72, 48, 0, - 0, 0, 144, 144, 144, 144, 104, 0, - 0, 0, 136, 136, 136, 80, 32, 0, - 0, 0, 136, 136, 168, 216, 144, 0, - 0, 0, 136, 80, 32, 80, 136, 0, - 0, 0, 136, 136, 136, 112, 32, 192, - 0, 0, 248, 144, 32, 72, 248, 0, - 32, 80, 0, 96, 144, 144, 96, 0, - 0, 14, 8, 48, 8, 8, 14, 0, - 0, 8, 8, 8, 8, 8, 8, 0, - 0, 112, 16, 12, 16, 16, 112, 0, - 0, 0, 0, 0, 0, 0, 248, 0, - 252, 252, 252, 252, 252, 252, 252, 252, - 240, 240, 240, 240, 240, 240, 240, 240, - }; - - writeRecord(french_video_font, sizeof(french_video_font), GBVARS_FRENCHVIDEOFONT_INDEX , GBVARS_SIMON); -} - -static void addCharset_german_video_font() { - byte german_video_font[] = { - 0, 0, 0, 0, 0, 0, 0, 0, - 32, 112, 112, 32, 32, 0, 32, 0, - 48, 48, 96, 0, 0, 0, 0, 0, - 80, 0, 112, 8, 120, 136, 120, 0, - 80, 0, 112, 136, 136, 136, 112, 0, - 80, 0, 144, 144, 144, 144, 104, 0, - 0, 16, 40, 16, 42, 68, 58, 0, - 48, 48, 96, 0, 0, 0, 0, 0, - 0, 4, 8, 8, 8, 8, 4, 0, - 0, 32, 16, 16, 16, 16, 32, 0, - 0, 0, 20, 8, 62, 8, 20, 0, - 96, 144, 144, 160, 144, 144, 160, 128, - 0, 0, 0, 0, 0, 48, 48, 96, - 0, 0, 0, 240, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 48, 48, 0, - 80, 0, 112, 136, 248, 136, 136, 0, - 112, 136, 152, 168, 200, 136, 112, 0, - 32, 96, 32, 32, 32, 32, 112, 0, - 112, 136, 8, 48, 64, 136, 248, 0, - 112, 136, 8, 48, 8, 136, 112, 0, - 16, 48, 80, 144, 248, 16, 56, 0, - 248, 128, 240, 8, 8, 136, 112, 0, - 48, 64, 128, 240, 136, 136, 112, 0, - 248, 136, 8, 16, 32, 32, 32, 0, - 112, 136, 136, 112, 136, 136, 112, 0, - 112, 136, 136, 120, 8, 16, 96, 0, - 0, 0, 48, 48, 0, 48, 48, 0, - 136, 112, 136, 136, 136, 136, 112, 0, - 80, 0, 136, 136, 136, 136, 112, 0, - 80, 0, 144, 144, 144, 144, 104, 0, - 32, 64, 0, 112, 248, 128, 112, 0, - 112, 136, 8, 16, 32, 0, 32, 0, - 32, 80, 0, 192, 64, 64, 224, 0, - 112, 136, 136, 248, 136, 136, 136, 0, - 240, 72, 72, 112, 72, 72, 240, 0, - 48, 72, 128, 128, 128, 72, 48, 0, - 224, 80, 72, 72, 72, 80, 224, 0, - 248, 72, 64, 112, 64, 72, 248, 0, - 248, 72, 64, 112, 64, 64, 224, 0, - 48, 72, 128, 152, 136, 72, 56, 0, - 136, 136, 136, 248, 136, 136, 136, 0, - 248, 32, 32, 32, 32, 32, 248, 0, - 24, 8, 8, 8, 136, 136, 112, 0, - 200, 72, 80, 96, 80, 72, 200, 0, - 224, 64, 64, 64, 64, 72, 248, 0, - 136, 216, 168, 168, 136, 136, 136, 0, - 136, 200, 168, 152, 136, 136, 136, 0, - 112, 136, 136, 136, 136, 136, 112, 0, - 240, 72, 72, 112, 64, 64, 224, 0, - 112, 136, 136, 136, 136, 168, 112, 8, - 240, 72, 72, 112, 72, 72, 200, 0, - 112, 136, 128, 112, 8, 136, 112, 0, - 248, 168, 32, 32, 32, 32, 112, 0, - 136, 136, 136, 136, 136, 136, 120, 0, - 136, 136, 136, 80, 80, 32, 32, 0, - 136, 136, 136, 136, 168, 216, 136, 0, - 136, 136, 80, 32, 80, 136, 136, 0, - 136, 136, 136, 112, 32, 32, 112, 0, - 248, 136, 16, 32, 64, 136, 248, 0, - 0, 14, 8, 8, 8, 8, 14, 0, - 0, 128, 64, 32, 16, 8, 4, 0, - 0, 112, 16, 16, 16, 16, 112, 0, - 0, 48, 72, 64, 72, 48, 16, 48, - 0, 80, 0, 96, 32, 40, 48, 0, - 32, 16, 0, 152, 144, 144, 232, 0, - 0, 0, 112, 8, 120, 136, 120, 0, - 192, 64, 80, 104, 72, 72, 112, 0, - 0, 0, 112, 136, 128, 136, 112, 0, - 24, 16, 80, 176, 144, 144, 112, 0, - 0, 0, 112, 136, 248, 128, 112, 0, - 48, 72, 64, 224, 64, 64, 224, 0, - 0, 0, 104, 144, 144, 112, 136, 112, - 192, 64, 80, 104, 72, 72, 200, 0, - 64, 0, 192, 64, 64, 64, 224, 0, - 8, 0, 8, 8, 8, 8, 136, 112, - 192, 64, 72, 80, 96, 80, 200, 0, - 192, 64, 64, 64, 64, 64, 224, 0, - 0, 0, 144, 216, 168, 136, 136, 0, - 0, 0, 240, 136, 136, 136, 136, 0, - 0, 0, 112, 136, 136, 136, 112, 0, - 0, 0, 176, 72, 72, 112, 64, 224, - 0, 0, 104, 144, 144, 112, 16, 56, - 0, 0, 176, 72, 72, 64, 224, 0, - 0, 0, 120, 128, 112, 8, 240, 0, - 64, 64, 240, 64, 64, 72, 48, 0, - 0, 0, 144, 144, 144, 144, 104, 0, - 0, 0, 136, 136, 136, 80, 32, 0, - 0, 0, 136, 136, 168, 216, 144, 0, - 0, 0, 136, 80, 32, 80, 136, 0, - 0, 0, 136, 136, 136, 112, 32, 192, - 0, 0, 248, 144, 32, 72, 248, 0, - 32, 80, 0, 96, 144, 144, 96, 0, - 0, 14, 8, 48, 8, 8, 14, 0, - 0, 8, 8, 8, 8, 8, 8, 0, - 0, 112, 16, 12, 16, 16, 112, 0, - 0, 0, 0, 0, 0, 0, 248, 0, - 252, 252, 252, 252, 252, 252, 252, 252, - 240, 240, 240, 240, 240, 240, 240, 240, - }; - writeRecord(german_video_font, sizeof(german_video_font), GBVARS_GERMANVIDEOFONT_INDEX , GBVARS_SIMON); -} - -static void addCharset_hebrew_video_font() { - byte hebrew_video_font[] = { - 0, 0, 0, 0, 0, 0, 0, 0, - 32, 112, 112, 32, 32, 0, 32, 0, - 48, 48, 96, 0, 0, 0, 0, 0, - 0, 144, 0, 96, 144, 144, 104, 0, - 0, 144, 0, 96, 144, 144, 96, 0, - 0, 144, 0, 144, 144, 144, 96, 0, - 0, 16, 40, 16, 42, 68, 58, 0, - 48, 48, 96, 0, 0, 0, 0, 0, - 0, 4, 8, 8, 8, 8, 4, 0, - 0, 32, 16, 16, 16, 16, 32, 0, - 0, 0, 20, 8, 62, 8, 20, 0, - 0, 112, 136, 240, 136, 136, 240, 0, - 0, 0, 0, 0, 0, 48, 48, 96, - 0, 0, 0, 240, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 48, 48, 0, - 16, 32, 0, 120, 112, 64, 56, 0, - 112, 136, 152, 168, 200, 136, 112, 0, - 32, 96, 32, 32, 32, 32, 112, 0, - 112, 136, 8, 48, 64, 136, 248, 0, - 112, 136, 8, 48, 8, 136, 112, 0, - 16, 48, 80, 144, 248, 16, 56, 0, - 248, 128, 240, 8, 8, 136, 112, 0, - 48, 64, 128, 240, 136, 136, 112, 0, - 248, 136, 8, 16, 32, 32, 32, 0, - 112, 136, 136, 112, 136, 136, 112, 0, - 112, 136, 136, 120, 8, 16, 96, 0, - 0, 0, 48, 48, 0, 48, 48, 0, - 5, 5, 4, 6, 5, 3, 4, 5, - 6, 3, 5, 5, 4, 6, 5, 3, - 4, 6, 5, 6, 6, 6, 5, 5, - 5, 6, 5, 6, 6, 6, 6, 6, - 112, 136, 8, 16, 32, 0, 32, 0, - 0, 0, 144, 80, 160, 144, 144, 0, - 0, 0, 224, 32, 32, 32, 240, 0, - 0, 0, 224, 32, 96, 160, 160, 0, - 0, 0, 248, 16, 16, 16, 16, 0, - 0, 0, 240, 16, 16, 144, 144, 0, - 0, 0, 192, 64, 64, 64, 64, 0, - 0, 0, 224, 64, 32, 64, 64, 0, - 0, 0, 240, 144, 144, 144, 144, 0, - 0, 0, 184, 168, 136, 136, 112, 0, - 0, 0, 192, 64, 0, 0, 0, 0, - 0, 0, 240, 16, 16, 16, 16, 16, - 0, 0, 224, 16, 16, 16, 224, 0, - 128, 128, 224, 32, 32, 32, 192, 0, - 0, 0, 248, 72, 72, 72, 120, 0, - 0, 0, 176, 208, 144, 144, 176, 0, - 0, 0, 192, 64, 64, 64, 64, 64, - 0, 0, 96, 32, 32, 32, 224, 0, - 0, 0, 248, 72, 72, 72, 48, 0, - 0, 0, 80, 80, 80, 80, 224, 0, - 0, 0, 248, 72, 104, 8, 8, 8, - 0, 0, 248, 72, 104, 8, 248, 0, - 0, 0, 216, 72, 48, 16, 16, 16, - 0, 0, 144, 80, 32, 16, 240, 0, - 0, 0, 240, 16, 144, 160, 128, 128, - 0, 0, 240, 16, 16, 16, 16, 0, - 0, 0, 168, 168, 200, 136, 112, 0, - 0, 0, 240, 80, 80, 80, 208, 0, - 0, 14, 8, 8, 8, 8, 14, 0, - 0, 128, 64, 32, 16, 8, 4, 0, - 0, 112, 16, 16, 16, 16, 112, 0, - 0, 48, 72, 64, 72, 48, 16, 48, - 0, 80, 0, 96, 32, 40, 48, 0, - 32, 16, 0, 152, 144, 144, 232, 0, - 0, 0, 112, 8, 120, 136, 120, 0, - 192, 64, 80, 104, 72, 72, 112, 0, - 0, 0, 112, 136, 128, 136, 112, 0, - 24, 16, 80, 176, 144, 144, 112, 0, - 0, 0, 112, 136, 248, 128, 112, 0, - 48, 72, 64, 224, 64, 64, 224, 0, - 0, 0, 104, 144, 144, 112, 136, 112, - 192, 64, 80, 104, 72, 72, 200, 0, - 64, 0, 192, 64, 64, 64, 224, 0, - 8, 0, 8, 8, 8, 8, 136, 112, - 192, 64, 72, 80, 96, 80, 200, 0, - 192, 64, 64, 64, 64, 64, 224, 0, - 0, 0, 144, 216, 168, 136, 136, 0, - 0, 0, 240, 136, 136, 136, 136, 0, - 0, 0, 112, 136, 136, 136, 112, 0, - 0, 0, 176, 72, 72, 112, 64, 224, - 0, 0, 104, 144, 144, 112, 16, 56, - 0, 0, 176, 72, 72, 64, 224, 0, - 0, 0, 120, 128, 112, 8, 240, 0, - 64, 64, 240, 64, 64, 72, 48, 0, - 0, 0, 144, 144, 144, 144, 104, 0, - 0, 0, 136, 136, 136, 80, 32, 0, - 0, 0, 136, 136, 168, 216, 144, 0, - 0, 0, 136, 80, 32, 80, 136, 0, - 0, 0, 136, 136, 136, 112, 32, 192, - 0, 0, 248, 144, 32, 72, 248, 0, - 32, 80, 0, 96, 144, 144, 96, 0, - 0, 14, 8, 48, 8, 8, 14, 0, - 0, 8, 8, 8, 8, 8, 8, 0, - 0, 112, 16, 12, 16, 16, 112, 0, - 0, 0, 0, 0, 0, 0, 248, 0, - 252, 252, 252, 252, 252, 252, 252, 252, - 240, 240, 240, 240, 240, 240, 240, 240, - }; - writeRecord(hebrew_video_font, sizeof(hebrew_video_font), GBVARS_HEBREWVIDEOFONT_INDEX , GBVARS_SIMON); -} - -static void addCharset_italian_video_font() { - byte italian_video_font[] = { - 0, 0, 0, 0, 0, 0, 0, 0, - 32, 112, 112, 32, 32, 0, 32, 0, - 48, 48, 96, 0, 0, 0, 0, 0, - 80, 0, 112, 8, 120, 136, 120, 0, - 80, 0, 112, 136, 136, 136, 112, 0, - 32, 16, 0, 112, 136, 136, 112, 0, - 0, 16, 40, 16, 42, 68, 58, 0, - 48, 48, 96, 0, 0, 0, 0, 0, - 0, 4, 8, 8, 8, 8, 4, 0, - 0, 32, 16, 16, 16, 16, 32, 0, - 0, 0, 20, 8, 62, 8, 20, 0, - 32, 16, 0, 192, 64, 64, 224, 0, - 0, 0, 0, 0, 0, 48, 48, 96, - 0, 0, 0, 240, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 48, 48, 0, - 32, 64, 0, 112, 248, 128, 112, 0, - 112, 136, 152, 168, 200, 136, 112, 0, - 32, 96, 32, 32, 32, 32, 112, 0, - 112, 136, 8, 48, 64, 136, 248, 0, - 112, 136, 8, 48, 8, 136, 112, 0, - 16, 48, 80, 144, 248, 16, 56, 0, - 248, 128, 240, 8, 8, 136, 112, 0, - 48, 64, 128, 240, 136, 136, 112, 0, - 248, 136, 8, 16, 32, 32, 32, 0, - 112, 136, 136, 112, 136, 136, 112, 0, - 112, 136, 136, 120, 8, 16, 96, 0, - 0, 0, 48, 48, 0, 48, 48, 0, - 32, 16, 0, 112, 8, 248, 120, 0, - 32, 16, 0, 112, 136, 136, 112, 0, - 32, 16, 0, 112, 248, 128, 112, 0, - 32, 80, 0, 112, 248, 128, 112, 0, - 112, 136, 8, 16, 32, 0, 32, 0, - 32, 80, 0, 96, 32, 40, 48, 0, - 112, 136, 136, 248, 136, 136, 136, 0, - 240, 72, 72, 112, 72, 72, 240, 0, - 48, 72, 128, 128, 128, 72, 48, 0, - 224, 80, 72, 72, 72, 80, 224, 0, - 248, 72, 64, 112, 64, 72, 248, 0, - 248, 72, 64, 112, 64, 64, 224, 0, - 48, 72, 128, 152, 136, 72, 56, 0, - 136, 136, 136, 248, 136, 136, 136, 0, - 248, 32, 32, 32, 32, 32, 248, 0, - 24, 8, 8, 8, 136, 136, 112, 0, - 200, 72, 80, 96, 80, 72, 200, 0, - 224, 64, 64, 64, 64, 72, 248, 0, - 136, 216, 168, 168, 136, 136, 136, 0, - 136, 200, 168, 152, 136, 136, 136, 0, - 112, 136, 136, 136, 136, 136, 112, 0, - 240, 72, 72, 112, 64, 64, 224, 0, - 112, 136, 136, 136, 136, 168, 112, 8, - 240, 72, 72, 112, 72, 72, 200, 0, - 112, 136, 128, 112, 8, 136, 112, 0, - 248, 168, 32, 32, 32, 32, 112, 0, - 136, 136, 136, 136, 136, 136, 120, 0, - 136, 136, 136, 80, 80, 32, 32, 0, - 136, 136, 136, 136, 168, 216, 136, 0, - 136, 136, 80, 32, 80, 136, 136, 0, - 136, 136, 136, 112, 32, 32, 112, 0, - 248, 136, 16, 32, 64, 136, 248, 0, - 0, 14, 8, 8, 8, 8, 14, 0, - 0, 128, 64, 32, 16, 8, 4, 0, - 0, 112, 16, 16, 16, 16, 112, 0, - 0, 0, 112, 136, 128, 112, 32, 96, - 160, 0, 192, 64, 64, 64, 224, 0, - 32, 16, 0, 144, 144, 144, 104, 0, - 0, 0, 112, 8, 120, 136, 120, 0, - 192, 64, 80, 104, 72, 72, 112, 0, - 0, 0, 112, 136, 128, 136, 112, 0, - 24, 16, 80, 176, 144, 144, 112, 0, - 0, 0, 112, 136, 248, 128, 112, 0, - 48, 72, 64, 224, 64, 64, 224, 0, - 0, 0, 104, 144, 144, 112, 136, 112, - 192, 64, 80, 104, 72, 72, 200, 0, - 64, 0, 192, 64, 64, 64, 224, 0, - 8, 0, 8, 8, 8, 8, 136, 112, - 192, 64, 72, 80, 96, 80, 200, 0, - 192, 64, 64, 64, 64, 64, 224, 0, - 0, 0, 144, 216, 168, 136, 136, 0, - 0, 0, 240, 136, 136, 136, 136, 0, - 0, 0, 112, 136, 136, 136, 112, 0, - 0, 0, 176, 72, 72, 112, 64, 224, - 0, 0, 104, 144, 144, 112, 16, 56, - 0, 0, 176, 72, 72, 64, 224, 0, - 0, 0, 120, 128, 112, 8, 240, 0, - 64, 64, 240, 64, 64, 72, 48, 0, - 0, 0, 144, 144, 144, 144, 104, 0, - 0, 0, 136, 136, 136, 80, 32, 0, - 0, 0, 136, 136, 168, 216, 144, 0, - 0, 0, 136, 80, 32, 80, 136, 0, - 0, 0, 136, 136, 136, 112, 32, 192, - 0, 0, 248, 144, 32, 72, 248, 0, - 32, 80, 0, 96, 144, 144, 96, 0, - 0, 14, 8, 48, 8, 8, 14, 0, - 0, 8, 8, 8, 8, 8, 8, 0, - 0, 112, 16, 12, 16, 16, 112, 0, - 0, 0, 0, 0, 0, 0, 248, 0, - 252, 252, 252, 252, 252, 252, 252, 252, - 240, 240, 240, 240, 240, 240, 240, 240, - }; - writeRecord(italian_video_font, sizeof(italian_video_font), GBVARS_ITALIANVIDEOFONT_INDEX , GBVARS_SIMON); -} - -static void addCharset_spanish_video_font() { - byte spanish_video_font[] = { - 0, 0, 0, 0, 0, 0, 0, 0, - 32, 112, 112, 32, 32, 0, 32, 0, - 48, 48, 96, 0, 0, 0, 0, 0, - 80, 0, 112, 8, 120, 136, 120, 0, - 80, 0, 112, 136, 136, 136, 112, 0, - 80, 0, 144, 144, 144, 144, 104, 0, - 0, 16, 40, 16, 42, 68, 58, 0, - 48, 48, 96, 0, 0, 0, 0, 0, - 0, 4, 8, 8, 8, 8, 4, 0, - 0, 32, 16, 16, 16, 16, 32, 0, - 0, 0, 20, 8, 62, 8, 20, 0, - 96, 144, 144, 160, 144, 144, 160, 128, - 0, 0, 0, 0, 0, 48, 48, 96, - 0, 0, 0, 240, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 48, 48, 0, - 32, 64, 0, 112, 248, 128, 112, 0, - 112, 136, 152, 168, 200, 136, 112, 0, - 32, 96, 32, 32, 32, 32, 112, 0, - 112, 136, 8, 48, 64, 136, 248, 0, - 112, 136, 8, 48, 8, 136, 112, 0, - 16, 48, 80, 144, 248, 16, 56, 0, - 248, 128, 240, 8, 8, 136, 112, 0, - 48, 64, 128, 240, 136, 136, 112, 0, - 248, 136, 8, 16, 32, 32, 32, 0, - 112, 136, 136, 112, 136, 136, 112, 0, - 112, 136, 136, 120, 8, 16, 96, 0, - 0, 0, 48, 48, 0, 48, 48, 0, - 32, 64, 0, 112, 8, 248, 120, 0, - 32, 64, 0, 192, 64, 64, 224, 0, - 32, 64, 0, 112, 136, 136, 112, 0, - 32, 64, 0, 144, 144, 144, 104, 0, - 112, 136, 8, 16, 32, 0, 32, 0, - 80, 160, 0, 240, 136, 136, 136, 0, - 112, 136, 136, 248, 136, 136, 136, 0, - 240, 72, 72, 112, 72, 72, 240, 0, - 48, 72, 128, 128, 128, 72, 48, 0, - 224, 80, 72, 72, 72, 80, 224, 0, - 248, 72, 64, 112, 64, 72, 248, 0, - 248, 72, 64, 112, 64, 64, 224, 0, - 48, 72, 128, 152, 136, 72, 56, 0, - 136, 136, 136, 248, 136, 136, 136, 0, - 248, 32, 32, 32, 32, 32, 248, 0, - 24, 8, 8, 8, 136, 136, 112, 0, - 200, 72, 80, 96, 80, 72, 200, 0, - 224, 64, 64, 64, 64, 72, 248, 0, - 136, 216, 168, 168, 136, 136, 136, 0, - 136, 200, 168, 152, 136, 136, 136, 0, - 112, 136, 136, 136, 136, 136, 112, 0, - 240, 72, 72, 112, 64, 64, 224, 0, - 112, 136, 136, 136, 136, 168, 112, 8, - 240, 72, 72, 112, 72, 72, 200, 0, - 112, 136, 128, 112, 8, 136, 112, 0, - 248, 168, 32, 32, 32, 32, 112, 0, - 136, 136, 136, 136, 136, 136, 120, 0, - 136, 136, 136, 80, 80, 32, 32, 0, - 136, 136, 136, 136, 168, 216, 136, 0, - 136, 136, 80, 32, 80, 136, 136, 0, - 136, 136, 136, 112, 32, 32, 112, 0, - 248, 136, 16, 32, 64, 136, 248, 0, - 0, 14, 8, 8, 8, 8, 14, 0, - 0, 128, 64, 32, 16, 8, 4, 0, - 0, 112, 16, 16, 16, 16, 112, 0, - 32, 0, 32, 64, 128, 136, 112, 0, - 32, 0, 32, 32, 112, 112, 32, 0, - 80, 0, 144, 144, 144, 144, 104, 0, - 0, 0, 112, 8, 120, 136, 120, 0, - 192, 64, 80, 104, 72, 72, 112, 0, - 0, 0, 112, 136, 128, 136, 112, 0, - 24, 16, 80, 176, 144, 144, 112, 0, - 0, 0, 112, 136, 248, 128, 112, 0, - 48, 72, 64, 224, 64, 64, 224, 0, - 0, 0, 104, 144, 144, 112, 136, 112, - 192, 64, 80, 104, 72, 72, 200, 0, - 64, 0, 192, 64, 64, 64, 224, 0, - 8, 0, 8, 8, 8, 8, 136, 112, - 192, 64, 72, 80, 96, 80, 200, 0, - 192, 64, 64, 64, 64, 64, 224, 0, - 0, 0, 144, 216, 168, 136, 136, 0, - 0, 0, 240, 136, 136, 136, 136, 0, - 0, 0, 112, 136, 136, 136, 112, 0, - 0, 0, 176, 72, 72, 112, 64, 224, - 0, 0, 104, 144, 144, 112, 16, 56, - 0, 0, 176, 72, 72, 64, 224, 0, - 0, 0, 120, 128, 112, 8, 240, 0, - 64, 64, 240, 64, 64, 72, 48, 0, - 0, 0, 144, 144, 144, 144, 104, 0, - 0, 0, 136, 136, 136, 80, 32, 0, - 0, 0, 136, 136, 168, 216, 144, 0, - 0, 0, 136, 80, 32, 80, 136, 0, - 0, 0, 136, 136, 136, 112, 32, 192, - 0, 0, 248, 144, 32, 72, 248, 0, - 32, 80, 0, 96, 144, 144, 96, 0, - 0, 14, 8, 48, 8, 8, 14, 0, - 0, 8, 8, 8, 8, 8, 8, 0, - 0, 112, 16, 12, 16, 16, 112, 0, - 0, 0, 0, 0, 0, 0, 248, 0, - 252, 252, 252, 252, 252, 252, 252, 252, - 240, 240, 240, 240, 240, 240, 240, 240, - }; - writeRecord(spanish_video_font, sizeof(spanish_video_font), GBVARS_SPANISHVIDEOFONT_INDEX , GBVARS_SIMON); -} - -static void addCharset_video_font() { - byte video_font[] = { - 0, 0, 0, 0, 0, 0, 0, 0, - 32, 112, 112, 32, 32, 0, 32, 0, - 48, 48, 96, 0, 0, 0, 0, 0, - 0, 144, 0, 96, 144, 144, 104, 0, - 0, 144, 0, 96, 144, 144, 96, 0, - 0, 144, 0, 144, 144, 144, 96, 0, - 0, 16, 40, 16, 42, 68, 58, 0, - 48, 48, 96, 0, 0, 0, 0, 0, - 0, 4, 8, 8, 8, 8, 4, 0, - 0, 32, 16, 16, 16, 16, 32, 0, - 0, 0, 20, 8, 62, 8, 20, 0, - 0, 112, 136, 240, 136, 136, 240, 0, - 0, 0, 0, 0, 0, 48, 48, 96, - 0, 0, 0, 240, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 48, 48, 0, - 16, 32, 0, 120, 112, 64, 56, 0, - 112, 136, 152, 168, 200, 136, 112, 0, - 32, 96, 32, 32, 32, 32, 112, 0, - 112, 136, 8, 48, 64, 136, 248, 0, - 112, 136, 8, 48, 8, 136, 112, 0, - 16, 48, 80, 144, 248, 16, 56, 0, - 248, 128, 240, 8, 8, 136, 112, 0, - 48, 64, 128, 240, 136, 136, 112, 0, - 248, 136, 8, 16, 32, 32, 32, 0, - 112, 136, 136, 112, 136, 136, 112, 0, - 112, 136, 136, 120, 8, 16, 96, 0, - 0, 0, 48, 48, 0, 48, 48, 0, - 32, 16, 0, 112, 8, 248, 120, 0, - 32, 80, 0, 144, 144, 144, 104, 0, - 80, 0, 144, 144, 144, 144, 104, 0, - 32, 80, 0, 112, 248, 128, 112, 0, - 112, 136, 8, 16, 32, 0, 32, 0, - 32, 80, 0, 192, 64, 64, 224, 0, - 112, 136, 136, 248, 136, 136, 136, 0, - 240, 72, 72, 112, 72, 72, 240, 0, - 48, 72, 128, 128, 128, 72, 48, 0, - 224, 80, 72, 72, 72, 80, 224, 0, - 248, 72, 64, 112, 64, 72, 248, 0, - 248, 72, 64, 112, 64, 64, 224, 0, - 48, 72, 128, 152, 136, 72, 56, 0, - 136, 136, 136, 248, 136, 136, 136, 0, - 248, 32, 32, 32, 32, 32, 248, 0, - 24, 8, 8, 8, 136, 136, 112, 0, - 200, 72, 80, 96, 80, 72, 200, 0, - 224, 64, 64, 64, 64, 72, 248, 0, - 136, 216, 168, 168, 136, 136, 136, 0, - 136, 200, 168, 152, 136, 136, 136, 0, - 112, 136, 136, 136, 136, 136, 112, 0, - 240, 72, 72, 112, 64, 64, 224, 0, - 112, 136, 136, 136, 136, 168, 112, 8, - 240, 72, 72, 112, 72, 72, 200, 0, - 112, 136, 128, 112, 8, 136, 112, 0, - 248, 168, 32, 32, 32, 32, 112, 0, - 136, 136, 136, 136, 136, 136, 120, 0, - 136, 136, 136, 80, 80, 32, 32, 0, - 136, 136, 136, 136, 168, 216, 136, 0, - 136, 136, 80, 32, 80, 136, 136, 0, - 136, 136, 136, 112, 32, 32, 112, 0, - 248, 136, 16, 32, 64, 136, 248, 0, - 0, 14, 8, 8, 8, 8, 14, 0, - 0, 128, 64, 32, 16, 8, 4, 0, - 0, 112, 16, 16, 16, 16, 112, 0, - 0, 48, 72, 64, 72, 48, 16, 48, - 0, 80, 0, 96, 32, 40, 48, 0, - 32, 16, 0, 152, 144, 144, 232, 0, - 0, 0, 112, 8, 120, 136, 120, 0, - 192, 64, 80, 104, 72, 72, 112, 0, - 0, 0, 112, 136, 128, 136, 112, 0, - 24, 16, 80, 176, 144, 144, 112, 0, - 0, 0, 112, 136, 248, 128, 112, 0, - 48, 72, 64, 224, 64, 64, 224, 0, - 0, 0, 104, 144, 144, 112, 136, 112, - 192, 64, 80, 104, 72, 72, 200, 0, - 64, 0, 192, 64, 64, 64, 224, 0, - 8, 0, 8, 8, 8, 8, 136, 112, - 192, 64, 72, 80, 96, 80, 200, 0, - 192, 64, 64, 64, 64, 64, 224, 0, - 0, 0, 144, 216, 168, 136, 136, 0, - 0, 0, 240, 136, 136, 136, 136, 0, - 0, 0, 112, 136, 136, 136, 112, 0, - 0, 0, 176, 72, 72, 112, 64, 224, - 0, 0, 104, 144, 144, 112, 16, 56, - 0, 0, 176, 72, 72, 64, 224, 0, - 0, 0, 120, 128, 112, 8, 240, 0, - 64, 64, 240, 64, 64, 72, 48, 0, - 0, 0, 144, 144, 144, 144, 104, 0, - 0, 0, 136, 136, 136, 80, 32, 0, - 0, 0, 136, 136, 168, 216, 144, 0, - 0, 0, 136, 80, 32, 80, 136, 0, - 0, 0, 136, 136, 136, 112, 32, 192, - 0, 0, 248, 144, 32, 72, 248, 0, - 32, 80, 0, 96, 144, 144, 96, 0, - 0, 14, 8, 48, 8, 8, 14, 0, - 0, 8, 8, 8, 8, 8, 8, 0, - 0, 112, 16, 12, 16, 16, 112, 0, - 0, 0, 0, 0, 0, 0, 248, 0, - 252, 252, 252, 252, 252, 252, 252, 252, - 240, 240, 240, 240, 240, 240, 240, 240, - }; - writeRecord(video_font, sizeof(video_font), GBVARS_VIDEOFONT_INDEX , GBVARS_SIMON); -} -/////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////// - -void Simon_addCharset() { - addCharset_russian_video_font(); - addCharset_french_video_font(); - addCharset_german_video_font(); - addCharset_hebrew_video_font(); - addCharset_italian_video_font(); - addCharset_spanish_video_font(); - addCharset_video_font(); -} diff --git a/backends/platform/PalmOS/Src/builder/b_globals.c b/backends/platform/PalmOS/Src/builder/b_globals.c deleted file mode 100644 index ad0bd3a014..0000000000 --- a/backends/platform/PalmOS/Src/builder/b_globals.c +++ /dev/null @@ -1,85 +0,0 @@ -#include <PalmOS.h> -#include "b_globals.h" - - -//#define BUILD_COMMON -//#define BUILD_AGOS -#define BUILD_SCUMM -//#define BUILD_SKY -//#define BUILD_QUEEN -//#define BUILD_SWORD1 - -#ifdef BUILD_COMMON -# define BUILD_RES GBVARS_COMMON -# define BUILD_NAME "Common" -#else -# define BUILD_RES GBVARS_ENGINE -# define BUILD_NAME "Engine" -#endif - -DmOpenRef dbP[GBVARS_COUNT]; -/////////////////////////////////////////////////////////////////// - -void writeRecord(MemPtr ptr, UInt32 size, UInt16 index, UInt16 dbID) { - Err e; - - MemHandle recordH = DmNewRecord(dbP[dbID], &index, size); - MemPtr save = MemHandleLock(recordH); - e = DmWrite(save, 0, ptr, size); - MemHandleUnlock(recordH); - DmReleaseRecord (dbP[dbID], index, 0); -} -/////////////////////////////////////////////////////////////////// - -void buildAll() { - Err err; - LocalID olddb; - - olddb = DmFindDatabase(0, "Glbs::" BUILD_NAME); - if (olddb) { - DmDeleteDatabase(0,olddb); - FrmCustomAlert(1000,"delete old " BUILD_NAME " DB",0,0); - } - err = DmCreateDatabase (0, "Glbs::" BUILD_NAME, 'ScVM', 'GLBS', false); - olddb = DmFindDatabase(0, "Glbs::" BUILD_NAME); - dbP[BUILD_RES] = DmOpenDatabase(0, olddb, dmModeReadWrite); - -#if defined(BUILD_COMMON) - addNewGui(); - -#elif defined(BUILD_SCUMM) - addDimuseTables(); - // temp removed - // TODO ::scummvm use sizeof(OLD256_MIDI_HACK) so i need to fix it - // directly in the code or call MemHandleSize but it may slow down - // code execution - addAkos(); - addDimuseCodecs(); - addCodec47(); - addGfx(); - addDialogs(); - addCharset(); - addCostume(); - addPlayerV2(); - addScummTables(); - -#elif defined(BUILD_AGOS) - addAGOS(); - AGOS_addCharset(); - -#elif defined(BUILD_SKY) - Sky_addHufftext(); - -#elif defined(BUILD_QUEEN) - Queen_addTalk(); - Queen_addRestables(); - Queen_addGraphics(); - Queen_addDisplay(); - Queen_addMusicdata(); - -#elif defined(BUILD_SWORD1) - Sword1_addStaticres(); -#endif - - DmCloseDatabase(dbP[BUILD_RES]); -} diff --git a/backends/platform/PalmOS/Src/builder/b_globals.h b/backends/platform/PalmOS/Src/builder/b_globals.h deleted file mode 100644 index c1c35a5a4b..0000000000 --- a/backends/platform/PalmOS/Src/builder/b_globals.h +++ /dev/null @@ -1,37 +0,0 @@ -#include "enum_globals.h" - -typedef unsigned char byte; -typedef UInt32 uint; -typedef Int32 int32; -typedef UInt32 uint32; - - -void writeRecord(MemPtr ptr, UInt32 size, UInt16 index, UInt16 dbID); -void buildAll(); - -void addNewGui(); -void addGraphics(); -///////////////////////////////// -void addDimuseTables(); -void addAkos(); -void addDimuseCodecs(); -void addCodec47(); -void addGfx(); -void addDialogs(); -void addCharset(); -void addCostume(); -void addPlayerV2(); -void addScummTables(); -///////////////////////////////// -void addAGOS(); -void AGOS_addCharset(); -///////////////////////////////// -void Queen_addTalk(); -void Queen_addRestables(); -void Queen_addGraphics(); -void Queen_addDisplay(); -void Queen_addMusicdata(); -///////////////////////////////// -void Sky_addHufftext(); -///////////////////////////////// -void Sword1_addStaticres(); diff --git a/backends/platform/PalmOS/Src/builder/builder.c b/backends/platform/PalmOS/Src/builder/builder.c deleted file mode 100644 index 8b30707b81..0000000000 --- a/backends/platform/PalmOS/Src/builder/builder.c +++ /dev/null @@ -1,442 +0,0 @@ -#include <PalmOS.h> -#include "BuilderRsc.h" - - -/*********************************************************************** - * - * Entry Points - * - ***********************************************************************/ - -void buildAll(); -/*********************************************************************** - * - * Internal Structures - * - ***********************************************************************/ -typedef struct - { - UInt8 replaceme; - } StarterPreferenceType; - -typedef struct - { - UInt8 replaceme; - } StarterAppInfoType; - -typedef StarterAppInfoType* StarterAppInfoPtr; - - -/*********************************************************************** - * - * Global variables - * - ***********************************************************************/ -//static Boolean HideSecretRecords; - - -/*********************************************************************** - * - * Internal Constants - * - ***********************************************************************/ -#define appFileCreator 'STRT' // register your own at http://www.palmos.com/dev/creatorid/ -#define appVersionNum 0x01 -#define appPrefID 0x00 -#define appPrefVersionNum 0x01 - -// Define the minimum OS version we support. -#define ourMinVersion sysMakeROMVersion(3,5,0,sysROMStageRelease,0) -#define kPalmOS10Version sysMakeROMVersion(1,0,0,sysROMStageRelease,0) - - -/*********************************************************************** - * - * Internal Functions - * - ***********************************************************************/ - - -/*********************************************************************** - * - * FUNCTION: RomVersionCompatible - * - * DESCRIPTION: This routine checks that a ROM version is meet your - * minimum requirement. - * - * PARAMETERS: requiredVersion - minimum rom version required - * (see sysFtrNumROMVersion in SystemMgr.h - * for format) - * launchFlags - flags that indicate if the application - * UI is initialized. - * - * RETURNED: error code or zero if rom is compatible - * - * REVISION HISTORY: - * - * - ***********************************************************************/ -static Err RomVersionCompatible(UInt32 requiredVersion, UInt16 launchFlags) -{ - UInt32 romVersion; - - // See if we're on in minimum required version of the ROM or later. - FtrGet(sysFtrCreator, sysFtrNumROMVersion, &romVersion); - if (romVersion < requiredVersion) - { - if ((launchFlags & (sysAppLaunchFlagNewGlobals | sysAppLaunchFlagUIApp)) == - (sysAppLaunchFlagNewGlobals | sysAppLaunchFlagUIApp)) - { - FrmAlert (RomIncompatibleAlert); - - // Palm OS 1.0 will continuously relaunch this app unless we switch to - // another safe one. - if (romVersion <= kPalmOS10Version) - { - AppLaunchWithCommand(sysFileCDefaultApp, sysAppLaunchCmdNormalLaunch, NULL); - } - } - - return sysErrRomIncompatible; - } - - return errNone; -} - - -/*********************************************************************** - * - * FUNCTION: GetObjectPtr - * - * DESCRIPTION: This routine returns a pointer to an object in the current - * form. - * - * PARAMETERS: formId - id of the form to display - * - * RETURNED: void * - * - * REVISION HISTORY: - * - * - ***********************************************************************/ -static void * GetObjectPtr(UInt16 objectID) -{ - FormPtr frmP; - - frmP = FrmGetActiveForm(); - return FrmGetObjectPtr(frmP, FrmGetObjectIndex(frmP, objectID)); -} - - -/*********************************************************************** - * - * FUNCTION: MainFormInit - * - * DESCRIPTION: This routine initializes the MainForm form. - * - * PARAMETERS: frm - pointer to the MainForm form. - * - * RETURNED: nothing - * - * REVISION HISTORY: - * - * - ***********************************************************************/ -static void MainFormInit(FormPtr /*frmP*/) -{ -} - - -/*********************************************************************** - * - * FUNCTION: MainFormDoCommand - * - * DESCRIPTION: This routine performs the menu command specified. - * - * PARAMETERS: command - menu item id - * - * RETURNED: nothing - * - * REVISION HISTORY: - * - * - ***********************************************************************/ -static Boolean MainFormDoCommand(UInt16 command) -{ - Boolean handled = false; - FormPtr frmP; - - switch (command) - { - case MainOptionsAboutStarterApp: - MenuEraseStatus(0); // Clear the menu status from the display. - frmP = FrmInitForm (AboutForm); - FrmDoDialog (frmP); // Display the About Box. - FrmDeleteForm (frmP); - handled = true; - break; - - } - - return handled; -} - - -/*********************************************************************** - * - * FUNCTION: MainFormHandleEvent - * - * DESCRIPTION: This routine is the event handler for the - * "MainForm" of this application. - * - * PARAMETERS: eventP - a pointer to an EventType structure - * - * RETURNED: true if the event has handle and should not be passed - * to a higher level handler. - * - * REVISION HISTORY: - * - * - ***********************************************************************/ -static Boolean MainFormHandleEvent(EventPtr eventP) -{ - Boolean handled = false; - FormPtr frmP; - - switch (eventP->eType) - { - case menuEvent: - return MainFormDoCommand(eventP->data.menu.itemID); - - case frmOpenEvent: - frmP = FrmGetActiveForm(); - MainFormInit( frmP); - FrmDrawForm ( frmP); - handled = true; - break; - - case ctlSelectEvent: - switch (eventP->data.ctlSelect.controlID) - { - case MainBuildButton: - buildAll(); - break; - } - handled = true; - break; - - case frmUpdateEvent: - // To do any custom drawing here, first call FrmDrawForm(), then do your - // drawing, and then set handled to true. - break; - - default: - break; - - } - - return handled; -} - - -/*********************************************************************** - * - * FUNCTION: AppHandleEvent - * - * DESCRIPTION: This routine loads form resources and set the event - * handler for the form loaded. - * - * PARAMETERS: event - a pointer to an EventType structure - * - * RETURNED: true if the event has handle and should not be passed - * to a higher level handler. - * - * REVISION HISTORY: - * - * - ***********************************************************************/ -static Boolean AppHandleEvent(EventPtr eventP) -{ - UInt16 formId; - FormPtr frmP; - - if (eventP->eType == frmLoadEvent) - { - // Load the form resource. - formId = eventP->data.frmLoad.formID; - frmP = FrmInitForm(formId); - FrmSetActiveForm(frmP); - - // Set the event handler for the form. The handler of the currently - // active form is called by FrmHandleEvent each time is receives an - // event. - switch (formId) - { - case MainForm: - FrmSetEventHandler(frmP, MainFormHandleEvent); - break; - - default: -// ErrFatalDisplay("Invalid Form Load Event"); - break; - - } - return true; - } - - return false; -} - - -/*********************************************************************** - * - * FUNCTION: AppEventLoop - * - * DESCRIPTION: This routine is the event loop for the application. - * - * PARAMETERS: nothing - * - * RETURNED: nothing - * - * REVISION HISTORY: - * - * - ***********************************************************************/ -static void AppEventLoop(void) -{ - UInt16 error; - EventType event; - - do { - EvtGetEvent(&event, evtWaitForever); - - if (! SysHandleEvent(&event)) - if (! MenuHandleEvent(0, &event, &error)) - if (! AppHandleEvent(&event)) - FrmDispatchEvent(&event); - - } while (event.eType != appStopEvent); -} - - -/*********************************************************************** - * - * FUNCTION: AppStart - * - * DESCRIPTION: Get the current application's preferences. - * - * PARAMETERS: nothing - * - * RETURNED: Err value 0 if nothing went wrong - * - * REVISION HISTORY: - * - * - ***********************************************************************/ -static Err AppStart(void) -{ - StarterPreferenceType prefs; - UInt16 prefsSize; - - // Read the saved preferences / saved-state information. - prefsSize = sizeof(StarterPreferenceType); - if (PrefGetAppPreferences(appFileCreator, appPrefID, &prefs, &prefsSize, true) != - noPreferenceFound) - { - } - - return errNone; -} - - -/*********************************************************************** - * - * FUNCTION: AppStop - * - * DESCRIPTION: Save the current state of the application. - * - * PARAMETERS: nothing - * - * RETURNED: nothing - * - * REVISION HISTORY: - * - * - ***********************************************************************/ -static void AppStop(void) -{ - StarterPreferenceType prefs; - - // Write the saved preferences / saved-state information. This data - // will saved during a HotSync backup. - PrefSetAppPreferences (appFileCreator, appPrefID, appPrefVersionNum, - &prefs, sizeof (prefs), true); - - // Close all the open forms. - FrmCloseAllForms (); -} - - -/*********************************************************************** - * - * FUNCTION: StarterPalmMain - * - * DESCRIPTION: This is the main entry point for the application. - * - * PARAMETERS: cmd - word value specifying the launch code. - * cmdPB - pointer to a structure that is associated with the launch code. - * launchFlags - word value providing extra information about the launch. - * - * RETURNED: Result of launch - * - * REVISION HISTORY: - * - * - ***********************************************************************/ -static UInt32 StarterPalmMain(UInt16 cmd, MemPtr /*cmdPBP*/, UInt16 launchFlags) -{ - Err error; - - error = RomVersionCompatible (ourMinVersion, launchFlags); - if (error) return (error); - - switch (cmd) - { - case sysAppLaunchCmdNormalLaunch: - error = AppStart(); - if (error) - return error; - - FrmGotoForm(MainForm); - AppEventLoop(); - AppStop(); - break; - - default: - break; - - } - - return errNone; -} - - -/*********************************************************************** - * - * FUNCTION: PilotMain - * - * DESCRIPTION: This is the main entry point for the application. - * - * PARAMETERS: cmd - word value specifying the launch code. - * cmdPB - pointer to a structure that is associated with the launch code. - * launchFlags - word value providing extra information about the launch. - * RETURNED: Result of launch - * - * REVISION HISTORY: - * - * - ***********************************************************************/ -UInt32 PilotMain( UInt16 cmd, MemPtr cmdPBP, UInt16 launchFlags) -{ - return StarterPalmMain(cmd, cmdPBP, launchFlags); -} diff --git a/backends/platform/PalmOS/Src/builder/enum_globals.h b/backends/platform/PalmOS/Src/builder/enum_globals.h deleted file mode 100644 index 2844dfe7db..0000000000 --- a/backends/platform/PalmOS/Src/builder/enum_globals.h +++ /dev/null @@ -1,112 +0,0 @@ -#ifndef __ENUM_GLOBALS_H__ -#define __ENUM_GLOBALS_H__ - -// Common -enum { - GBVARS_GUIFONT_INDEX = 0 -}; - -// Scumm -enum { - GBVARS_DIGSTATEMUSICMAP_INDEX = 0, - GBVARS_DIGSTATEMUSICTABLE_INDEX, - GBVARS_DIGSEQMUSICTABLE_INDEX, - GBVARS_COMISTATEMUSICTABLE_INDEX, - GBVARS_COMISEQMUSICTABLE_INDEX, - GBVARS_FTSTATEMUSICTABLE_INDEX, - GBVARS_FTSEQMUSICTABLE_INDEX, - GBVARS_FTSEQNAMES_INDEX, - GBVARS_SMALLSCALETABLE_INDEX, - GBVARS_BIGSCALETABLE_INDEX, - GBVARS_IMCTABLE_INDEX, - GBVARS_CODEC47TABLE_INDEX, - GBVARS_TRANSITIONEFFECTS_INDEX, - GBVARS_STRINGMAPTABLEV7_INDEX, - GBVARS_STRINGMAPTABLEV6_INDEX, - GBVARS_STRINGMAPTABLEV5_INDEX, - GBVARS_GERMANCHARSETDATAV2_INDEX, - GBVARS_FRENCHCHARSETDATAV2_INDEX, - GBVARS_ENGLISHCHARSETDATAV2_INDEX, - GBVARS_ITALIANCHARSETDATAV2_INDEX, - GBVARS_SPANISHCHARSETDATAV2_INDEX, - GBVARS_NOTELENGTHS_INDEX, - GBVARS_HULLOFFSETS_INDEX, - GBVARS_HULLS_INDEX, - GBVARS_FREQMODLENGTHS_INDEX, - GBVARS_FREQMODOFFSETS_INDEX, - GBVARS_FREQMODTABLE_INDEX, - GBVARS_SPKFREQTABLE_INDEX, - GBVARS_PCJRFREQTABLE_INDEX, - - GBVARS_MD5TABLE_INDEX -//GBVARS_SMALLSCALETABLEAKOS_INDEX -}; -// AGOS -enum { - GBVARS_SIMON1SETTINGS_INDEX = 0, - GBVARS_SIMON1ACORNSETTINGS_INDEX, - GBVARS_SIMON1AMIGASETTINGS_INDEX, - GBVARS_SIMON1DEMOSETTINGS_INDEX, - GBVARS_SIMON2WINSETTINGS_INDEX, - GBVARS_SIMON2DOSSETTINGS_INDEX, - GBVARS_RUSSIANVIDEOFONT_INDEX, - GBVARS_FRENCHVIDEOFONT_INDEX, - GBVARS_GERMANVIDEOFONT_INDEX, - GBVARS_HEBREWVIDEOFONT_INDEX, - GBVARS_ITALIANVIDEOFONT_INDEX, - GBVARS_SPANISHVIDEOFONT_INDEX, - GBVARS_VIDEOFONT_INDEX, - GBVARS_SIMON1CURSOR_INDEX -// GBVARS_SIMON2CURSORS_INDEX -}; -// Queen -enum { - GBVARS_SPEECHPARAMETERS_INDEX = 0, - GBVARS_RESOURCETABLEPM10_INDEX, - GBVARS_GRAPHICSCARDATA_INDEX, - GBVARS_GRAPHICSFIGHT1DATA_INDEX, - GBVARS_GRAPHICSFIGHT2DATA_INDEX, - GBVARS_GRAPHICSFIGHT3DATA_INDEX, - GBVARS_DISPLAYFONTREGULAR_INDEX, - GBVARS_DISPLAYFONTHEBREW_INDEX, - GBVARS_DISPLAYPALJOECLOTHES_INDEX, - GBVARS_DISPLAYPALJOEDRESS_INDEX, - GBVARS_MUSICDATASONGDEMO_INDEX, - GBVARS_MUSICDATASONG_INDEX, - GBVARS_MUSICDATATUNEDEMO_INDEX, - GBVARS_MUSICDATATUNE_INDEX, - GBVARS_MUSICDATASFXNAME_INDEX, - GBVARS_MUSICDATAJUNGLELIST_INDEX -}; -// Sky -enum { - GBVARS_HUFFTREE_00109_INDEX = 0, - GBVARS_HUFFTREE_00267_INDEX, - GBVARS_HUFFTREE_00288_INDEX, - GBVARS_HUFFTREE_00303_INDEX, - GBVARS_HUFFTREE_00331_INDEX, - GBVARS_HUFFTREE_00348_INDEX, - GBVARS_HUFFTREE_00365_INDEX, - GBVARS_HUFFTREE_00368_INDEX, - GBVARS_HUFFTREE_00372_INDEX, -}; -// Sword1 -enum { - GBVARS_FXLIST_INDEX = 0 -}; - -enum { - GBVARS_COMMON = 0, - GBVARS_ENGINE = 1, - GBVARS_SCUMM = GBVARS_ENGINE, - GBVARS_AGOS = GBVARS_ENGINE, - GBVARS_SKY = GBVARS_ENGINE, - GBVARS_SWORD1 = GBVARS_ENGINE, -// GBVARS_SWORD2 = GBVARS_ENGINE, - GBVARS_QUEEN = GBVARS_ENGINE, - GBVARS_SAGA = GBVARS_ENGINE, - - GBVARS_COUNT -}; - -#endif diff --git a/backends/platform/PalmOS/Src/builder/queen/bq_display.c b/backends/platform/PalmOS/Src/builder/queen/bq_display.c deleted file mode 100644 index 9601729de7..0000000000 --- a/backends/platform/PalmOS/Src/builder/queen/bq_display.c +++ /dev/null @@ -1,297 +0,0 @@ -#include <PalmOS.h> -#include "b_globals.h" - -typedef UInt8 uint8; - -static void addDisplay_fontRegular() { - uint8 _fontRegular[] = { - 0xF8, 0xB0, 0xB0, 0x80, 0xB0, 0xB0, 0xC0, 0x00, 0xF8, 0xB0, 0xB0, 0x80, 0xB0, 0xB0, 0xC0, 0x00, - 0xF8, 0xB0, 0xB0, 0x80, 0xB0, 0xB0, 0xC0, 0x00, 0xF8, 0xB0, 0xB0, 0x80, 0xB0, 0xB0, 0xC0, 0x00, - 0xF8, 0xB0, 0xB0, 0x80, 0xB0, 0xB0, 0xC0, 0x00, 0xF8, 0xB0, 0xB0, 0x80, 0xB0, 0xB0, 0xC0, 0x00, - 0xF8, 0xB0, 0xB0, 0x80, 0xB0, 0xB0, 0xC0, 0x00, 0xF8, 0xB0, 0xB0, 0x80, 0xB0, 0xB0, 0xC0, 0x00, - 0xF8, 0xB0, 0xB0, 0x80, 0xB0, 0xB0, 0xC0, 0x00, 0xF8, 0xB0, 0xB0, 0x80, 0xB0, 0xB0, 0xC0, 0x00, - 0xF8, 0xB0, 0xB0, 0x80, 0xB0, 0xB0, 0xC0, 0x00, 0xF8, 0xB0, 0xB0, 0x80, 0xB0, 0xB0, 0xC0, 0x00, - 0xF8, 0xB0, 0xB0, 0x80, 0xB0, 0xB0, 0xC0, 0x00, 0xF8, 0xB0, 0xB0, 0x80, 0xB0, 0xB0, 0xC0, 0x00, - 0xF8, 0xB0, 0xB0, 0x80, 0xB0, 0xB0, 0xC0, 0x00, 0xF8, 0xB0, 0xB0, 0x80, 0xB0, 0xB0, 0xC0, 0x00, - 0xF8, 0xB0, 0xB0, 0x80, 0xB0, 0xB0, 0xC0, 0x00, 0xF8, 0xB0, 0xB0, 0x80, 0xB0, 0xB0, 0xC0, 0x00, - 0xF8, 0xB0, 0xB0, 0x80, 0xB0, 0xB0, 0xC0, 0x00, 0xF8, 0xB0, 0xB0, 0x80, 0xB0, 0xB0, 0xC0, 0x00, - 0xF8, 0xB0, 0xB0, 0x80, 0xB0, 0xB0, 0xC0, 0x00, 0xF8, 0xB0, 0xB0, 0x80, 0xB0, 0xB0, 0xC0, 0x00, - 0xF8, 0xB0, 0xB0, 0x80, 0xB0, 0xB0, 0xC0, 0x00, 0xF8, 0xB0, 0xB0, 0x80, 0xB0, 0xB0, 0xC0, 0x00, - 0xF8, 0xB0, 0xB0, 0x80, 0xB0, 0xB0, 0xC0, 0x00, 0xF8, 0xB0, 0xB0, 0x80, 0xB0, 0xB0, 0xC0, 0x00, - 0xF8, 0xB0, 0xB0, 0x80, 0xB0, 0xB0, 0xC0, 0x00, 0xF8, 0xB0, 0xB0, 0x80, 0xB0, 0xB0, 0xC0, 0x00, - 0xF8, 0xB0, 0xB0, 0x80, 0xB0, 0xB0, 0xC0, 0x00, 0xF8, 0xB0, 0xB0, 0x80, 0xB0, 0xB0, 0xC0, 0x00, - 0xF8, 0xB0, 0xB0, 0x80, 0xB0, 0xB0, 0xC0, 0x00, 0xF8, 0xB0, 0xB0, 0x80, 0xB0, 0xB0, 0xC0, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0xC0, 0xC0, 0xC0, 0x00, 0xC0, 0xC0, 0x00, - 0xD8, 0xD8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6C, 0x6C, 0xFE, 0x6C, 0xFE, 0x6C, 0x6C, 0x00, - 0x30, 0x7C, 0xC0, 0x78, 0x0C, 0xF8, 0x30, 0x00, 0x00, 0xC6, 0xCC, 0x18, 0x30, 0x66, 0xC6, 0x00, - 0x38, 0x6C, 0x68, 0x36, 0xDC, 0xCC, 0x76, 0x00, 0x60, 0x60, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x30, 0x60, 0xC0, 0xC0, 0xC0, 0x60, 0x30, 0x00, 0xC0, 0x60, 0x30, 0x30, 0x30, 0x60, 0xC0, 0x00, - 0x00, 0x6C, 0x38, 0xFE, 0x38, 0x6C, 0x00, 0x00, 0x00, 0x30, 0x30, 0xFC, 0x30, 0x30, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x60, 0xC0, 0x00, 0x00, 0x00, 0xFC, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0xC0, 0x00, 0x03, 0x06, 0x0C, 0x18, 0x30, 0x60, 0xC0, 0x00, - 0x78, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0x78, 0x00, 0x30, 0x70, 0xF0, 0x30, 0x30, 0x30, 0x30, 0x00, - 0x78, 0xCC, 0x0C, 0x78, 0xC0, 0xC0, 0xFC, 0x00, 0x78, 0xCC, 0x0C, 0x38, 0x0C, 0xCC, 0x78, 0x00, - 0x1C, 0x3C, 0x6C, 0xCC, 0xFC, 0x0C, 0x0C, 0x00, 0xFC, 0xC0, 0xF8, 0x0C, 0x0C, 0xCC, 0x78, 0x00, - 0x78, 0xCC, 0xC0, 0xF8, 0xCC, 0xCC, 0x78, 0x00, 0xFC, 0xCC, 0x0C, 0x18, 0x30, 0x30, 0x30, 0x00, - 0x78, 0xCC, 0xCC, 0x78, 0xCC, 0xCC, 0x78, 0x00, 0x78, 0xCC, 0xCC, 0x7C, 0x0C, 0xCC, 0x78, 0x00, - 0x00, 0xC0, 0xC0, 0x00, 0x00, 0xC0, 0xC0, 0x00, 0x00, 0x60, 0x60, 0x00, 0x00, 0x60, 0x60, 0xC0, - 0x18, 0x30, 0x60, 0xC0, 0x60, 0x30, 0x18, 0x00, 0x00, 0x00, 0xFC, 0x00, 0xFC, 0x00, 0x00, 0x00, - 0xC0, 0x60, 0x30, 0x18, 0x30, 0x60, 0xC0, 0x00, 0x78, 0xCC, 0x0C, 0x18, 0x30, 0x00, 0x30, 0x00, - 0x6C, 0xFE, 0xFE, 0xFE, 0x7C, 0x38, 0x10, 0x00, 0x38, 0x7C, 0xC6, 0xC6, 0xFE, 0xC6, 0xC6, 0x00, - 0xF8, 0xCC, 0xCC, 0xF8, 0xCC, 0xCC, 0xF8, 0x00, 0x78, 0xCC, 0xC0, 0xC0, 0xC0, 0xCC, 0x78, 0x00, - 0xF8, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xF8, 0x00, 0xFC, 0xC0, 0xC0, 0xF0, 0xC0, 0xC0, 0xFC, 0x00, - 0xFC, 0xC0, 0xC0, 0xF0, 0xC0, 0xC0, 0xC0, 0x00, 0x78, 0xCC, 0xC0, 0xDC, 0xCC, 0xCC, 0x7C, 0x00, - 0xCC, 0xCC, 0xCC, 0xFC, 0xCC, 0xCC, 0xCC, 0x00, 0xF0, 0x60, 0x60, 0x60, 0x60, 0x60, 0xF0, 0x00, - 0x0C, 0x0C, 0x0C, 0x0C, 0xCC, 0xCC, 0x78, 0x00, 0xC6, 0xCC, 0xD8, 0xF8, 0xD8, 0xCC, 0xC6, 0x00, - 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xFC, 0x00, 0x82, 0xC6, 0xEE, 0xFE, 0xD6, 0xC6, 0xC6, 0x00, - 0xC6, 0xE6, 0xF6, 0xDE, 0xCE, 0xC6, 0xC6, 0x00, 0x78, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0x78, 0x00, - 0xF8, 0xCC, 0xCC, 0xF8, 0xC0, 0xC0, 0xC0, 0x00, 0x78, 0xCC, 0xCC, 0xCC, 0xCC, 0xDC, 0x78, 0x0C, - 0xF8, 0xCC, 0xCC, 0xF8, 0xD8, 0xCC, 0xCC, 0x00, 0x78, 0xCC, 0xC0, 0x78, 0x0C, 0xCC, 0x78, 0x00, - 0xFC, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x00, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0x7C, 0x00, - 0xC6, 0xC6, 0x6C, 0x6C, 0x38, 0x38, 0x10, 0x00, 0xC6, 0xC6, 0xC6, 0xD6, 0xFE, 0xEE, 0xC6, 0x00, - 0xC6, 0x6C, 0x38, 0x10, 0x38, 0x6C, 0xC6, 0x00, 0xCC, 0xCC, 0xCC, 0x78, 0x30, 0x30, 0x30, 0x00, - 0xFC, 0x0C, 0x18, 0x30, 0x60, 0xC0, 0xFC, 0x00, 0xF0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xF0, 0x00, - 0xC0, 0x60, 0x30, 0x18, 0x0C, 0x06, 0x03, 0x00, 0xF0, 0x30, 0x30, 0x30, 0x30, 0x30, 0xF0, 0x00, - 0xE8, 0x4D, 0x4A, 0x48, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, - 0xC0, 0xC0, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x0C, 0x7C, 0xCC, 0x7C, 0x00, - 0xC0, 0xC0, 0xF8, 0xCC, 0xCC, 0xCC, 0xF8, 0x00, 0x00, 0x00, 0x78, 0xCC, 0xC0, 0xCC, 0x78, 0x00, - 0x0C, 0x0C, 0x7C, 0xCC, 0xCC, 0xCC, 0x7C, 0x00, 0x00, 0x00, 0x78, 0xCC, 0xFC, 0xC0, 0x78, 0x00, - 0x38, 0x6C, 0x60, 0xF8, 0x60, 0x60, 0x60, 0x00, 0x00, 0x00, 0x7C, 0xCC, 0xCC, 0x7C, 0x0C, 0x78, - 0xC0, 0xC0, 0xF8, 0xCC, 0xCC, 0xCC, 0xCC, 0x00, 0xC0, 0x00, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0x00, - 0x0C, 0x00, 0x0C, 0x0C, 0x0C, 0x0C, 0xCC, 0x78, 0xC0, 0xC0, 0xCC, 0xD8, 0xF0, 0xD8, 0xCC, 0x00, - 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0x00, 0x00, 0x00, 0xCC, 0xEE, 0xD6, 0xC6, 0xC6, 0x00, - 0x00, 0x00, 0xF8, 0xCC, 0xCC, 0xCC, 0xCC, 0x00, 0x00, 0x00, 0x78, 0xCC, 0xCC, 0xCC, 0x78, 0x00, - 0x00, 0x00, 0xF8, 0xCC, 0xCC, 0xF8, 0xC0, 0xC0, 0x00, 0x00, 0x7C, 0xCC, 0xCC, 0x7C, 0x0C, 0x0C, - 0x00, 0x00, 0xF8, 0xCC, 0xC0, 0xC0, 0xC0, 0x00, 0x00, 0x00, 0x7C, 0xC0, 0x78, 0x0C, 0x78, 0x00, - 0x30, 0x30, 0xFC, 0x30, 0x30, 0x30, 0x30, 0x00, 0x00, 0x00, 0xCC, 0xCC, 0xCC, 0xCC, 0x7C, 0x00, - 0x00, 0x00, 0xCC, 0xCC, 0xCC, 0x78, 0x30, 0x00, 0x00, 0x00, 0xC6, 0xD6, 0xD6, 0x6C, 0x6C, 0x00, - 0x00, 0x00, 0xCC, 0x78, 0x30, 0x78, 0xCC, 0x00, 0x00, 0x00, 0xCC, 0xCC, 0xCC, 0x78, 0x30, 0xE0, - 0x00, 0x00, 0xFC, 0x18, 0x30, 0x60, 0xFC, 0x00, 0x38, 0x60, 0x60, 0xC0, 0x60, 0x60, 0x38, 0x00, - 0xC0, 0xC0, 0xC0, 0x00, 0xC0, 0xC0, 0xC0, 0x00, 0xE0, 0x30, 0x30, 0x18, 0x30, 0x30, 0xE0, 0x00, - 0x38, 0x44, 0xBA, 0xAA, 0xBA, 0x44, 0x38, 0x00, 0x00, 0x98, 0x30, 0x60, 0xC8, 0x98, 0x30, 0x00, - 0x1E, 0x30, 0x60, 0x60, 0x30, 0x1E, 0x0C, 0x18, 0x00, 0x66, 0x00, 0x66, 0x66, 0x66, 0x3E, 0x00, - 0x0C, 0x18, 0x3C, 0x66, 0x7E, 0x60, 0x3C, 0x00, 0x18, 0x66, 0x3C, 0x06, 0x3E, 0x66, 0x3E, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x18, 0x3C, 0x06, 0x3E, 0x66, 0x3E, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1E, 0x30, 0x60, 0x60, 0x30, 0x1E, 0x0C, 0x18, - 0x18, 0x66, 0x3C, 0x66, 0x7E, 0x60, 0x3C, 0x00, 0x66, 0x00, 0x3C, 0x66, 0x7E, 0x60, 0x3C, 0x00, - 0x30, 0x18, 0x3C, 0x66, 0x7E, 0x60, 0x3C, 0x00, 0x00, 0x66, 0x00, 0x18, 0x18, 0x18, 0x18, 0x00, - 0x18, 0x66, 0x00, 0x18, 0x18, 0x18, 0x18, 0x00, 0x30, 0x18, 0x00, 0x18, 0x18, 0x18, 0x18, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x18, 0x30, 0xFC, 0xC0, 0xF0, 0xC0, 0xFC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x66, 0x00, 0x3C, 0x66, 0x66, 0x3C, 0x00, - 0x00, 0x66, 0x00, 0x3C, 0x66, 0x66, 0x3C, 0x00, 0x30, 0x18, 0x00, 0x3C, 0x66, 0x66, 0x3C, 0x00, - 0x18, 0x66, 0x00, 0x66, 0x66, 0x66, 0x3E, 0x00, 0x30, 0x18, 0x00, 0x66, 0x66, 0x66, 0x3E, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x18, 0x30, 0x78, 0x0C, 0x7C, 0xCC, 0x7C, 0x00, 0x0C, 0x18, 0x00, 0x18, 0x18, 0x18, 0x18, 0x00, - 0x18, 0x30, 0x00, 0x78, 0xCC, 0xCC, 0x78, 0x00, 0x18, 0x30, 0x00, 0xCC, 0xCC, 0xCC, 0x7C, 0x00, - 0x71, 0x8E, 0x00, 0x7C, 0x66, 0x66, 0x66, 0x00, 0x71, 0xCE, 0xE6, 0xF6, 0xDE, 0xCE, 0xC6, 0x00, - 0x18, 0x18, 0x18, 0x00, 0x18, 0x18, 0x18, 0x00, 0x3C, 0x60, 0x3C, 0x66, 0x3C, 0x06, 0x3C, 0x00, - 0x18, 0x00, 0x18, 0x30, 0x60, 0x66, 0x3C, 0x00, 0x3F, 0x40, 0x4E, 0x58, 0x4E, 0x40, 0x3F, 0x00, - 0x1C, 0xA4, 0xC4, 0xBC, 0x80, 0xFE, 0x00, 0x00, 0x00, 0x33, 0x66, 0xCC, 0x66, 0x33, 0x00, 0x00, - 0x3E, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0xC0, 0x00, 0xC0, 0xC0, 0xC0, 0xC0, 0x00, - 0x81, 0xB9, 0xA5, 0xB9, 0xA5, 0x81, 0x7E, 0x00, 0xFC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x78, 0xCC, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x30, 0xFC, 0x30, 0x30, 0x00, 0xFC, 0x00, - 0xF0, 0x18, 0x30, 0x60, 0xF8, 0x00, 0x00, 0x00, 0xF0, 0x18, 0x30, 0x18, 0xF0, 0x00, 0x00, 0x00, - 0x30, 0x60, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xCC, 0xCC, 0xCC, 0xCC, 0xFE, 0xC0, - 0x3E, 0x7A, 0x7A, 0x3A, 0x0A, 0x0A, 0x0A, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x60, 0x60, 0xE0, 0x60, 0x60, 0x60, 0x00, 0x00, 0x00, - 0x38, 0x44, 0x44, 0x38, 0x00, 0x7C, 0x00, 0x00, 0x00, 0xCC, 0x66, 0x33, 0x66, 0xCC, 0x00, 0x00, - 0x40, 0xC6, 0x4C, 0x58, 0x32, 0x66, 0xCF, 0x02, 0x40, 0xC6, 0x4C, 0x58, 0x3E, 0x62, 0xC4, 0x0E, - 0xC0, 0x23, 0x66, 0x2C, 0xD9, 0x33, 0x67, 0x01, 0x18, 0x00, 0x18, 0x30, 0x60, 0x66, 0x3C, 0x00, - 0x60, 0x30, 0x7C, 0xC6, 0xFE, 0xC6, 0xC6, 0x00, 0x0C, 0x18, 0x7C, 0xC6, 0xFE, 0xC6, 0xC6, 0x00, - 0x38, 0xC6, 0x7C, 0xC6, 0xFE, 0xC6, 0xC6, 0x00, 0x71, 0x8E, 0x7C, 0xC6, 0xFE, 0xC6, 0xC6, 0x00, - 0x6C, 0x00, 0x7C, 0xC6, 0xFE, 0xC6, 0xC6, 0x00, 0x38, 0x44, 0x7C, 0xC6, 0xFE, 0xC6, 0xC6, 0x00, - 0x1F, 0x3C, 0x3C, 0x6F, 0x7C, 0xCC, 0xCF, 0x00, 0x1E, 0x30, 0x60, 0x60, 0x30, 0x1E, 0x0C, 0x18, - 0x60, 0x30, 0xFC, 0xC0, 0xF0, 0xC0, 0xFC, 0x00, 0x18, 0x30, 0xFC, 0xC0, 0xF0, 0xC0, 0xFC, 0x00, - 0x30, 0xCC, 0xFC, 0xC0, 0xF0, 0xC0, 0xFC, 0x00, 0xCC, 0x00, 0xFC, 0xC0, 0xF0, 0xC0, 0xFC, 0x00, - 0x60, 0x30, 0x78, 0x30, 0x30, 0x30, 0x78, 0x00, 0x18, 0x30, 0x78, 0x30, 0x30, 0x30, 0x78, 0x00, - 0x30, 0xCC, 0x78, 0x30, 0x30, 0x30, 0x78, 0x00, 0xCC, 0x00, 0x78, 0x30, 0x30, 0x30, 0x78, 0x00, - 0x78, 0x6C, 0x66, 0xF6, 0x66, 0x6C, 0x78, 0x00, 0x71, 0xCE, 0xE6, 0xF6, 0xDE, 0xCE, 0xC6, 0x00, - 0x30, 0x18, 0x3C, 0x66, 0x66, 0x66, 0x3C, 0x00, 0x0C, 0x18, 0x3C, 0x66, 0x66, 0x66, 0x3C, 0x00, - 0x18, 0x66, 0x3C, 0x66, 0x66, 0x66, 0x3C, 0x00, 0x71, 0x8E, 0x3C, 0x66, 0x66, 0x66, 0x3C, 0x00, - 0xC3, 0x3C, 0x66, 0x66, 0x66, 0x66, 0x3C, 0x00, 0x00, 0xC6, 0x6C, 0x38, 0x6C, 0xC6, 0x00, 0x00, - 0x3F, 0x66, 0x6E, 0x7E, 0x76, 0x66, 0xFC, 0x00, 0x30, 0x18, 0x66, 0x66, 0x66, 0x66, 0x3E, 0x00, - 0x0C, 0x18, 0x66, 0x66, 0x66, 0x66, 0x3E, 0x00, 0x18, 0x24, 0x66, 0x66, 0x66, 0x66, 0x3E, 0x00, - 0x66, 0x00, 0x66, 0x66, 0x66, 0x66, 0x3E, 0x00, 0x06, 0x08, 0xC3, 0x66, 0x3C, 0x18, 0x18, 0x00, - 0x60, 0x60, 0x7E, 0x63, 0x7E, 0x60, 0x60, 0x00, 0x3C, 0x66, 0x66, 0x6C, 0x66, 0x66, 0x6C, 0x60, - 0x30, 0x18, 0x3C, 0x06, 0x3E, 0x66, 0x3E, 0x00, 0x0C, 0x18, 0x3C, 0x06, 0x3E, 0x66, 0x3E, 0x00, - 0x18, 0x66, 0x3C, 0x06, 0x3E, 0x66, 0x3E, 0x00, 0x71, 0x8E, 0x3C, 0x06, 0x3E, 0x66, 0x3E, 0x00, - 0x66, 0x00, 0x3C, 0x06, 0x3E, 0x66, 0x3E, 0x00, 0x18, 0x24, 0x3C, 0x06, 0x3E, 0x66, 0x3E, 0x00, - 0x00, 0x00, 0x7E, 0x1B, 0x7F, 0xD8, 0x77, 0x00, 0x00, 0x00, 0x3C, 0x60, 0x60, 0x60, 0x3C, 0x18, - 0x30, 0x18, 0x3C, 0x66, 0x7E, 0x60, 0x3C, 0x00, 0x0C, 0x18, 0x3C, 0x66, 0x7E, 0x60, 0x3C, 0x00, - 0x18, 0x66, 0x3C, 0x66, 0x7E, 0x60, 0x3C, 0x00, 0x66, 0x00, 0x3C, 0x66, 0x7E, 0x60, 0x3C, 0x00, - 0x30, 0x18, 0x00, 0x18, 0x18, 0x18, 0x18, 0x00, 0x0C, 0x18, 0x00, 0x18, 0x18, 0x18, 0x18, 0x00, - 0x18, 0x66, 0x00, 0x18, 0x18, 0x18, 0x18, 0x00, 0x00, 0x66, 0x00, 0x18, 0x18, 0x18, 0x18, 0x00, - 0x60, 0xFC, 0x18, 0x3C, 0x66, 0x66, 0x3C, 0x00, 0x71, 0x8E, 0x00, 0x7C, 0x66, 0x66, 0x66, 0x00, - 0x30, 0x18, 0x00, 0x3C, 0x66, 0x66, 0x3C, 0x00, 0x0C, 0x18, 0x00, 0x3C, 0x66, 0x66, 0x3C, 0x00, - 0x18, 0x66, 0x00, 0x3C, 0x66, 0x66, 0x3C, 0x00, 0x71, 0x8E, 0x00, 0x3C, 0x66, 0x66, 0x3C, 0x00, - 0x00, 0x66, 0x00, 0x3C, 0x66, 0x66, 0x3C, 0x00, 0x00, 0x18, 0x00, 0x7E, 0x00, 0x18, 0x00, 0x00, - 0x00, 0x02, 0x7C, 0xCE, 0xD6, 0xE6, 0x7C, 0x80, 0x30, 0x18, 0x00, 0x66, 0x66, 0x66, 0x3E, 0x00, - 0x0C, 0x18, 0x00, 0x66, 0x66, 0x66, 0x3E, 0x00, 0x18, 0x66, 0x00, 0x66, 0x66, 0x66, 0x3E, 0x00, - 0x00, 0x66, 0x00, 0x66, 0x66, 0x66, 0x3E, 0x00, 0x0C, 0x18, 0x00, 0x66, 0x66, 0x3C, 0x18, 0x30, - 0x60, 0x60, 0x7C, 0x66, 0x66, 0x7C, 0x60, 0x60, 0x00, 0x66, 0x00, 0x66, 0x66, 0x3C, 0x18, 0x30 - }; - writeRecord(_fontRegular, sizeof(_fontRegular), GBVARS_DISPLAYFONTREGULAR_INDEX , GBVARS_QUEEN); -} - -static void addDisplay_fontHebrew() { - uint8 _fontHebrew[] = { - 0xF8, 0xB0, 0xB0, 0x80, 0xB0, 0xB0, 0xC0, 0x00, 0xF8, 0xB0, 0xB0, 0x80, 0xB0, 0xB0, 0xC0, 0x00, - 0xF8, 0xB0, 0xB0, 0x80, 0xB0, 0xB0, 0xC0, 0x00, 0xF8, 0xB0, 0xB0, 0x80, 0xB0, 0xB0, 0xC0, 0x00, - 0xF8, 0xB0, 0xB0, 0x80, 0xB0, 0xB0, 0xC0, 0x00, 0xF8, 0xB0, 0xB0, 0x80, 0xB0, 0xB0, 0xC0, 0x00, - 0xF8, 0xB0, 0xB0, 0x80, 0xB0, 0xB0, 0xC0, 0x00, 0xF8, 0xB0, 0xB0, 0x80, 0xB0, 0xB0, 0xC0, 0x00, - 0xF8, 0xB0, 0xB0, 0x80, 0xB0, 0xB0, 0xC0, 0x00, 0xF8, 0xB0, 0xB0, 0x80, 0xB0, 0xB0, 0xC0, 0x00, - 0xF8, 0xB0, 0xB0, 0x80, 0xB0, 0xB0, 0xC0, 0x00, 0xF8, 0xB0, 0xB0, 0x80, 0xB0, 0xB0, 0xC0, 0x00, - 0xF8, 0xB0, 0xB0, 0x80, 0xB0, 0xB0, 0xC0, 0x00, 0xF8, 0xB0, 0xB0, 0x80, 0xB0, 0xB0, 0xC0, 0x00, - 0xF8, 0xB0, 0xB0, 0x80, 0xB0, 0xB0, 0xC0, 0x00, 0xF8, 0xB0, 0xB0, 0x80, 0xB0, 0xB0, 0xC0, 0x00, - 0xF8, 0xB0, 0xB0, 0x80, 0xB0, 0xB0, 0xC0, 0x00, 0xF8, 0xB0, 0xB0, 0x80, 0xB0, 0xB0, 0xC0, 0x00, - 0xF8, 0xB0, 0xB0, 0x80, 0xB0, 0xB0, 0xC0, 0x00, 0xF8, 0xB0, 0xB0, 0x80, 0xB0, 0xB0, 0xC0, 0x00, - 0xF8, 0xB0, 0xB0, 0x80, 0xB0, 0xB0, 0xC0, 0x00, 0xF8, 0xB0, 0xB0, 0x80, 0xB0, 0xB0, 0xC0, 0x00, - 0xF8, 0xB0, 0xB0, 0x80, 0xB0, 0xB0, 0xC0, 0x00, 0xF8, 0xB0, 0xB0, 0x80, 0xB0, 0xB0, 0xC0, 0x00, - 0xF8, 0xB0, 0xB0, 0x80, 0xB0, 0xB0, 0xC0, 0x00, 0xF8, 0xB0, 0xB0, 0x80, 0xB0, 0xB0, 0xC0, 0x00, - 0xF8, 0xB0, 0xB0, 0x80, 0xB0, 0xB0, 0xC0, 0x00, 0xF8, 0xB0, 0xB0, 0x80, 0xB0, 0xB0, 0xC0, 0x00, - 0xF8, 0xB0, 0xB0, 0x80, 0xB0, 0xB0, 0xC0, 0x00, 0xF8, 0xB0, 0xB0, 0x80, 0xB0, 0xB0, 0xC0, 0x00, - 0xF8, 0xB0, 0xB0, 0x80, 0xB0, 0xB0, 0xC0, 0x00, 0xF8, 0xB0, 0xB0, 0x80, 0xB0, 0xB0, 0xC0, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0xC0, 0xC0, 0xC0, 0x00, 0xC0, 0xC0, 0x00, - 0xD8, 0xD8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6C, 0x6C, 0xFE, 0x6C, 0xFE, 0x6C, 0x6C, 0x00, - 0x30, 0x7C, 0xC0, 0x78, 0x0C, 0xF8, 0x30, 0x00, 0x00, 0xC6, 0xCC, 0x18, 0x30, 0x66, 0xC6, 0x00, - 0x38, 0x6C, 0x68, 0x36, 0xDC, 0xCC, 0x76, 0x00, 0x60, 0x60, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x30, 0x60, 0xC0, 0xC0, 0xC0, 0x60, 0x30, 0x00, 0xC0, 0x60, 0x30, 0x30, 0x30, 0x60, 0xC0, 0x00, - 0x00, 0x6C, 0x38, 0xFE, 0x38, 0x6C, 0x00, 0x00, 0x00, 0x30, 0x30, 0xFC, 0x30, 0x30, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x60, 0xC0, 0x00, 0x00, 0x00, 0xFC, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0xC0, 0x00, 0x03, 0x06, 0x0C, 0x18, 0x30, 0x60, 0xC0, 0x00, - 0x78, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0x78, 0x00, 0x30, 0x70, 0xF0, 0x30, 0x30, 0x30, 0x30, 0x00, - 0x78, 0xCC, 0x0C, 0x78, 0xC0, 0xC0, 0xFC, 0x00, 0x78, 0xCC, 0x0C, 0x38, 0x0C, 0xCC, 0x78, 0x00, - 0x1C, 0x3C, 0x6C, 0xCC, 0xFC, 0x0C, 0x0C, 0x00, 0xFC, 0xC0, 0xF8, 0x0C, 0x0C, 0xCC, 0x78, 0x00, - 0x78, 0xCC, 0xC0, 0xF8, 0xCC, 0xCC, 0x78, 0x00, 0xFC, 0xCC, 0x0C, 0x18, 0x30, 0x30, 0x30, 0x00, - 0x78, 0xCC, 0xCC, 0x78, 0xCC, 0xCC, 0x78, 0x00, 0x78, 0xCC, 0xCC, 0x7C, 0x0C, 0xCC, 0x78, 0x00, - 0x00, 0xC0, 0xC0, 0x00, 0x00, 0xC0, 0xC0, 0x00, 0x00, 0x60, 0x60, 0x00, 0x00, 0x60, 0x60, 0xC0, - 0x18, 0x30, 0x60, 0xC0, 0x60, 0x30, 0x18, 0x00, 0x00, 0x00, 0xFC, 0x00, 0xFC, 0x00, 0x00, 0x00, - 0xC0, 0x60, 0x30, 0x18, 0x30, 0x60, 0xC0, 0x00, 0x78, 0xCC, 0x0C, 0x18, 0x30, 0x00, 0x30, 0x00, - 0x6C, 0xFE, 0xFE, 0xFE, 0x7C, 0x38, 0x10, 0x00, 0x38, 0x7C, 0xC6, 0xC6, 0xFE, 0xC6, 0xC6, 0x00, - 0xF8, 0xCC, 0xCC, 0xF8, 0xCC, 0xCC, 0xF8, 0x00, 0x78, 0xCC, 0xC0, 0xC0, 0xC0, 0xCC, 0x78, 0x00, - 0xF8, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xF8, 0x00, 0xFC, 0xC0, 0xC0, 0xF0, 0xC0, 0xC0, 0xFC, 0x00, - 0xFC, 0xC0, 0xC0, 0xF0, 0xC0, 0xC0, 0xC0, 0x00, 0x78, 0xCC, 0xC0, 0xDC, 0xCC, 0xCC, 0x7C, 0x00, - 0xCC, 0xCC, 0xCC, 0xFC, 0xCC, 0xCC, 0xCC, 0x00, 0xF0, 0x60, 0x60, 0x60, 0x60, 0x60, 0xF0, 0x00, - 0x0C, 0x0C, 0x0C, 0x0C, 0xCC, 0xCC, 0x78, 0x00, 0xC6, 0xCC, 0xD8, 0xF8, 0xD8, 0xCC, 0xC6, 0x00, - 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xFC, 0x00, 0x82, 0xC6, 0xEE, 0xFE, 0xD6, 0xC6, 0xC6, 0x00, - 0xC6, 0xE6, 0xF6, 0xDE, 0xCE, 0xC6, 0xC6, 0x00, 0x78, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0x78, 0x00, - 0xF8, 0xCC, 0xCC, 0xF8, 0xC0, 0xC0, 0xC0, 0x00, 0x78, 0xCC, 0xCC, 0xCC, 0xCC, 0xDC, 0x78, 0x0C, - 0xF8, 0xCC, 0xCC, 0xF8, 0xD8, 0xCC, 0xCC, 0x00, 0x78, 0xCC, 0xC0, 0x78, 0x0C, 0xCC, 0x78, 0x00, - 0xFC, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x00, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0x7C, 0x00, - 0xC6, 0xC6, 0x6C, 0x6C, 0x38, 0x38, 0x10, 0x00, 0xC6, 0xC6, 0xC6, 0xD6, 0xFE, 0xEE, 0xC6, 0x00, - 0xC6, 0x6C, 0x38, 0x10, 0x38, 0x6C, 0xC6, 0x00, 0xCC, 0xCC, 0xCC, 0x78, 0x30, 0x30, 0x30, 0x00, - 0xFC, 0x0C, 0x18, 0x30, 0x60, 0xC0, 0xFC, 0x00, 0xF0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xF0, 0x00, - 0xC0, 0x60, 0x30, 0x18, 0x0C, 0x06, 0x03, 0x00, 0xF0, 0x30, 0x30, 0x30, 0x30, 0x30, 0xF0, 0x00, - 0xE8, 0x4D, 0x4A, 0x48, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, - 0xC0, 0xC0, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x0C, 0x7C, 0xCC, 0x7C, 0x00, - 0xC0, 0xC0, 0xF8, 0xCC, 0xCC, 0xCC, 0xF8, 0x00, 0x00, 0x00, 0x78, 0xCC, 0xC0, 0xCC, 0x78, 0x00, - 0x0C, 0x0C, 0x7C, 0xCC, 0xCC, 0xCC, 0x7C, 0x00, 0x00, 0x00, 0x78, 0xCC, 0xFC, 0xC0, 0x78, 0x00, - 0x38, 0x6C, 0x60, 0xF8, 0x60, 0x60, 0x60, 0x00, 0x00, 0x00, 0x7C, 0xCC, 0xCC, 0x7C, 0x0C, 0x78, - 0xC0, 0xC0, 0xF8, 0xCC, 0xCC, 0xCC, 0xCC, 0x00, 0xC0, 0x00, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0x00, - 0x0C, 0x00, 0x0C, 0x0C, 0x0C, 0x0C, 0xCC, 0x78, 0xC0, 0xC0, 0xCC, 0xD8, 0xF0, 0xD8, 0xCC, 0x00, - 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0x00, 0x00, 0x00, 0xCC, 0xEE, 0xD6, 0xC6, 0xC6, 0x00, - 0x00, 0x00, 0xF8, 0xCC, 0xCC, 0xCC, 0xCC, 0x00, 0x00, 0x00, 0x78, 0xCC, 0xCC, 0xCC, 0x78, 0x00, - 0x00, 0x00, 0xF8, 0xCC, 0xCC, 0xF8, 0xC0, 0xC0, 0x00, 0x00, 0x7C, 0xCC, 0xCC, 0x7C, 0x0C, 0x0C, - 0x00, 0x00, 0xF8, 0xCC, 0xC0, 0xC0, 0xC0, 0x00, 0x00, 0x00, 0x7C, 0xC0, 0x78, 0x0C, 0x78, 0x00, - 0x30, 0x30, 0xFC, 0x30, 0x30, 0x30, 0x30, 0x00, 0x00, 0x00, 0xCC, 0xCC, 0xCC, 0xCC, 0x7C, 0x00, - 0x00, 0x00, 0xCC, 0xCC, 0xCC, 0x78, 0x30, 0x00, 0x00, 0x00, 0xC6, 0xD6, 0xD6, 0x6C, 0x6C, 0x00, - 0x00, 0x00, 0xCC, 0x78, 0x30, 0x78, 0xCC, 0x00, 0x00, 0x00, 0xCC, 0xCC, 0xCC, 0x78, 0x30, 0xE0, - 0x00, 0x00, 0xFC, 0x18, 0x30, 0x60, 0xFC, 0x00, 0x38, 0x60, 0x60, 0xC0, 0x60, 0x60, 0x38, 0x00, - 0xC0, 0xC0, 0xC0, 0x00, 0xC0, 0xC0, 0xC0, 0x00, 0xE0, 0x30, 0x30, 0x18, 0x30, 0x30, 0xE0, 0x00, - 0x38, 0x44, 0xBA, 0xAA, 0xBA, 0x44, 0x38, 0x00, 0x00, 0x98, 0x30, 0x60, 0xC8, 0x98, 0x30, 0x00, - 0xCC, 0x66, 0x76, 0xBC, 0x98, 0x8C, 0xE6, 0x00, 0xFC, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0xFE, 0x00, - 0x78, 0x18, 0x18, 0x18, 0x38, 0x78, 0xD8, 0x00, 0xFE, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x00, - 0xFE, 0x06, 0x06, 0xC6, 0xC6, 0xC6, 0xC6, 0x00, 0x78, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x00, - 0x7C, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x00, 0xFE, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x00, - 0xDC, 0x66, 0xE6, 0xC6, 0xC6, 0xC6, 0x7C, 0x00, 0xF0, 0x30, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xFE, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0xF8, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0xF8, 0x00, - 0xC0, 0xFE, 0x06, 0x06, 0x0C, 0x18, 0x18, 0x00, 0xFE, 0x66, 0x66, 0x66, 0x66, 0x66, 0x7E, 0x00, - 0xFC, 0x76, 0x66, 0x66, 0x66, 0x66, 0x6E, 0x00, 0x78, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, - 0x78, 0x18, 0x18, 0x18, 0x18, 0x18, 0x78, 0x00, 0xFE, 0x66, 0x66, 0x66, 0x66, 0x66, 0x3C, 0x00, - 0xEE, 0x66, 0x66, 0x66, 0x66, 0x6C, 0xF8, 0x00, 0xFE, 0xC6, 0xC6, 0xF6, 0x06, 0x06, 0x06, 0x06, - 0xFE, 0xC6, 0xC6, 0xFE, 0x06, 0x06, 0xFE, 0x00, 0xFE, 0x66, 0x6C, 0x78, 0x60, 0x60, 0x60, 0x60, - 0xEE, 0x66, 0x3C, 0x18, 0x0C, 0x06, 0xFE, 0x00, 0xFE, 0x06, 0x0E, 0xD8, 0xF0, 0xF0, 0xC0, 0xC0, - 0xFC, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x00, 0xEE, 0xCA, 0xCA, 0xCA, 0xCA, 0xCA, 0x7C, 0x00, - 0xFF, 0x67, 0x67, 0x67, 0x67, 0x67, 0xE7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0x00, - 0x00, 0x0C, 0x3E, 0x6C, 0x3E, 0x0C, 0x00, 0x00, 0x38, 0x6C, 0x60, 0xF0, 0x60, 0x60, 0xFC, 0x00, - 0x42, 0x3C, 0x66, 0x3C, 0x42, 0x00, 0x00, 0x00, 0xC3, 0x66, 0x3C, 0x18, 0x3C, 0x18, 0x18, 0x00, - 0x18, 0x18, 0x18, 0x00, 0x18, 0x18, 0x18, 0x00, 0x3C, 0x60, 0x3C, 0x66, 0x3C, 0x06, 0x3C, 0x00, - 0x66, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0x40, 0x4E, 0x58, 0x4E, 0x40, 0x3F, 0x00, - 0x1C, 0xA4, 0xC4, 0xBC, 0x80, 0xFE, 0x00, 0x00, 0x00, 0x33, 0x66, 0xCC, 0x66, 0x33, 0x00, 0x00, - 0x3E, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7E, 0x00, 0x00, 0x00, 0x00, - 0x81, 0xB9, 0xA5, 0xB9, 0xA5, 0x81, 0x7E, 0x00, 0xFC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x78, 0xCC, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x30, 0xFC, 0x30, 0x30, 0x00, 0xFC, 0x00, - 0xF0, 0x18, 0x30, 0x60, 0xF8, 0x00, 0x00, 0x00, 0xF0, 0x18, 0x30, 0x18, 0xF0, 0x00, 0x00, 0x00, - 0x30, 0x60, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xCC, 0xCC, 0xCC, 0xCC, 0xFE, 0xC0, - 0x3E, 0x7A, 0x7A, 0x3A, 0x0A, 0x0A, 0x0A, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x60, 0x60, 0xE0, 0x60, 0x60, 0x60, 0x00, 0x00, 0x00, - 0x38, 0x44, 0x44, 0x38, 0x00, 0x7C, 0x00, 0x00, 0x00, 0xCC, 0x66, 0x33, 0x66, 0xCC, 0x00, 0x00, - 0x40, 0xC6, 0x4C, 0x58, 0x32, 0x66, 0xCF, 0x02, 0x40, 0xC6, 0x4C, 0x58, 0x3E, 0x62, 0xC4, 0x0E, - 0xC0, 0x23, 0x66, 0x2C, 0xD9, 0x33, 0x67, 0x01, 0x18, 0x00, 0x18, 0x30, 0x60, 0x66, 0x3C, 0x00, - 0x60, 0x30, 0x7C, 0xC6, 0xFE, 0xC6, 0xC6, 0x00, 0x0C, 0x18, 0x7C, 0xC6, 0xFE, 0xC6, 0xC6, 0x00, - 0x38, 0xC6, 0x7C, 0xC6, 0xFE, 0xC6, 0xC6, 0x00, 0x71, 0x8E, 0x7C, 0xC6, 0xFE, 0xC6, 0xC6, 0x00, - 0x6C, 0x00, 0x7C, 0xC6, 0xFE, 0xC6, 0xC6, 0x00, 0x38, 0x44, 0x7C, 0xC6, 0xFE, 0xC6, 0xC6, 0x00, - 0x1F, 0x3C, 0x3C, 0x6F, 0x7C, 0xCC, 0xCF, 0x00, 0x1E, 0x30, 0x60, 0x60, 0x30, 0x1E, 0x0C, 0x18, - 0x60, 0x30, 0xFC, 0xC0, 0xF0, 0xC0, 0xFC, 0x00, 0x18, 0x30, 0xFC, 0xC0, 0xF0, 0xC0, 0xFC, 0x00, - 0x30, 0xCC, 0xFC, 0xC0, 0xF0, 0xC0, 0xFC, 0x00, 0xCC, 0x00, 0xFC, 0xC0, 0xF0, 0xC0, 0xFC, 0x00, - 0x60, 0x30, 0x78, 0x30, 0x30, 0x30, 0x78, 0x00, 0x18, 0x30, 0x78, 0x30, 0x30, 0x30, 0x78, 0x00, - 0x30, 0xCC, 0x78, 0x30, 0x30, 0x30, 0x78, 0x00, 0xCC, 0x00, 0x78, 0x30, 0x30, 0x30, 0x78, 0x00, - 0x78, 0x6C, 0x66, 0xF6, 0x66, 0x6C, 0x78, 0x00, 0x71, 0xCE, 0xE6, 0xF6, 0xDE, 0xCE, 0xC6, 0x00, - 0x30, 0x18, 0x3C, 0x66, 0x66, 0x66, 0x3C, 0x00, 0x0C, 0x18, 0x3C, 0x66, 0x66, 0x66, 0x3C, 0x00, - 0x18, 0x66, 0x3C, 0x66, 0x66, 0x66, 0x3C, 0x00, 0x71, 0x8E, 0x3C, 0x66, 0x66, 0x66, 0x3C, 0x00, - 0xC3, 0x3C, 0x66, 0x66, 0x66, 0x66, 0x3C, 0x00, 0x00, 0xC6, 0x6C, 0x38, 0x6C, 0xC6, 0x00, 0x00, - 0x3F, 0x66, 0x6E, 0x7E, 0x76, 0x66, 0xFC, 0x00, 0x30, 0x18, 0x66, 0x66, 0x66, 0x66, 0x3E, 0x00, - 0x0C, 0x18, 0x66, 0x66, 0x66, 0x66, 0x3E, 0x00, 0x18, 0x24, 0x66, 0x66, 0x66, 0x66, 0x3E, 0x00, - 0x66, 0x00, 0x66, 0x66, 0x66, 0x66, 0x3E, 0x00, 0x06, 0x08, 0xC3, 0x66, 0x3C, 0x18, 0x18, 0x00, - 0x60, 0x60, 0x7E, 0x63, 0x7E, 0x60, 0x60, 0x00, 0x3C, 0x66, 0x66, 0x6C, 0x66, 0x66, 0x6C, 0x60, - 0x30, 0x18, 0x3C, 0x06, 0x3E, 0x66, 0x3E, 0x00, 0x0C, 0x18, 0x3C, 0x06, 0x3E, 0x66, 0x3E, 0x00, - 0x18, 0x66, 0x3C, 0x06, 0x3E, 0x66, 0x3E, 0x00, 0x71, 0x8E, 0x3C, 0x06, 0x3E, 0x66, 0x3E, 0x00, - 0x66, 0x00, 0x3C, 0x06, 0x3E, 0x66, 0x3E, 0x00, 0x18, 0x24, 0x3C, 0x06, 0x3E, 0x66, 0x3E, 0x00, - 0x00, 0x00, 0x7E, 0x1B, 0x7F, 0xD8, 0x77, 0x00, 0x00, 0x00, 0x3C, 0x60, 0x60, 0x60, 0x3C, 0x18, - 0x30, 0x18, 0x3C, 0x66, 0x7E, 0x60, 0x3C, 0x00, 0x0C, 0x18, 0x3C, 0x66, 0x7E, 0x60, 0x3C, 0x00, - 0x18, 0x66, 0x3C, 0x66, 0x7E, 0x60, 0x3C, 0x00, 0x66, 0x00, 0x3C, 0x66, 0x7E, 0x60, 0x3C, 0x00, - 0x30, 0x18, 0x00, 0x18, 0x18, 0x18, 0x18, 0x00, 0x0C, 0x18, 0x00, 0x18, 0x18, 0x18, 0x18, 0x00, - 0x18, 0x66, 0x00, 0x18, 0x18, 0x18, 0x18, 0x00, 0x00, 0x66, 0x00, 0x18, 0x18, 0x18, 0x18, 0x00, - 0x60, 0xFC, 0x18, 0x3C, 0x66, 0x66, 0x3C, 0x00, 0x71, 0x8E, 0x00, 0x7C, 0x66, 0x66, 0x66, 0x00, - 0x30, 0x18, 0x00, 0x3C, 0x66, 0x66, 0x3C, 0x00, 0x0C, 0x18, 0x00, 0x3C, 0x66, 0x66, 0x3C, 0x00, - 0x18, 0x66, 0x00, 0x3C, 0x66, 0x66, 0x3C, 0x00, 0x71, 0x8E, 0x00, 0x3C, 0x66, 0x66, 0x3C, 0x00, - 0x00, 0x66, 0x00, 0x3C, 0x66, 0x66, 0x3C, 0x00, 0x00, 0x18, 0x00, 0x7E, 0x00, 0x18, 0x00, 0x00, - 0x00, 0x02, 0x7C, 0xCE, 0xD6, 0xE6, 0x7C, 0x80, 0x30, 0x18, 0x00, 0x66, 0x66, 0x66, 0x3E, 0x00, - 0x0C, 0x18, 0x00, 0x66, 0x66, 0x66, 0x3E, 0x00, 0x18, 0x66, 0x00, 0x66, 0x66, 0x66, 0x3E, 0x00, - 0x00, 0x66, 0x00, 0x66, 0x66, 0x66, 0x3E, 0x00, 0x0C, 0x18, 0x00, 0x66, 0x66, 0x3C, 0x18, 0x30, - 0x60, 0x60, 0x7C, 0x66, 0x66, 0x7C, 0x60, 0x60, 0x00, 0x66, 0x00, 0x66, 0x66, 0x3C, 0x18, 0x30 - }; - writeRecord(_fontHebrew, sizeof(_fontHebrew), GBVARS_DISPLAYFONTHEBREW_INDEX , GBVARS_QUEEN); -} - -static void addDisplay_palJoeClothes() { - uint8 _palJoeClothes[] = { - 0x00, 0x00, 0x00, 0x60, 0x60, 0x60, 0x87, 0x87, 0x87, 0xB0, 0xB0, 0xB0, 0xDA, 0xDA, 0xDA, 0x43, - 0x34, 0x20, 0x77, 0x33, 0x1F, 0xA3, 0x43, 0x27, 0x80, 0x45, 0x45, 0x9E, 0x5D, 0x5B, 0xB9, 0x78, - 0x75, 0xDF, 0x97, 0x91, 0x17, 0x27, 0x63, 0x1F, 0x3F, 0x83, 0x27, 0x5B, 0xA7, 0x98, 0xD4, 0xFF - }; - writeRecord(_palJoeClothes, sizeof(_palJoeClothes), GBVARS_DISPLAYPALJOECLOTHES_INDEX , GBVARS_QUEEN); -} - -static void addDisplay_palJoeDress() { - uint8 _palJoeDress[] = { - 0x00, 0x00, 0x00, 0x50, 0x50, 0x50, 0x70, 0x70, 0x70, 0x90, 0x90, 0x90, 0xC6, 0xC6, 0xC6, 0xFF, - 0xFF, 0xFF, 0x30, 0x30, 0x90, 0x47, 0x49, 0xD0, 0x40, 0x24, 0x00, 0x79, 0x34, 0x0B, 0xB2, 0x3D, - 0x22, 0xED, 0x42, 0x42, 0x80, 0x45, 0x45, 0xA3, 0x5F, 0x5F, 0xC8, 0x7C, 0x7C, 0xEC, 0x9C, 0x9C - }; - writeRecord(_palJoeDress, sizeof(_palJoeDress), GBVARS_DISPLAYPALJOEDRESS_INDEX , GBVARS_QUEEN); -} - -void Queen_addDisplay() { - addDisplay_fontRegular(); - addDisplay_fontHebrew(); - addDisplay_palJoeClothes(); - addDisplay_palJoeDress(); -}
\ No newline at end of file diff --git a/backends/platform/PalmOS/Src/builder/queen/bq_graphics.c b/backends/platform/PalmOS/Src/builder/queen/bq_graphics.c deleted file mode 100644 index 910e9b61fb..0000000000 --- a/backends/platform/PalmOS/Src/builder/queen/bq_graphics.c +++ /dev/null @@ -1,302 +0,0 @@ -#include <PalmOS.h> -#include "b_globals.h" - -typedef Int16 int16; - -typedef struct { - int16 x, y; - int16 frame; -} BamDataObj; - -typedef struct { - BamDataObj obj1; // truck / Frank - BamDataObj obj2; // Rico / robot - BamDataObj fx; - int16 sfx; -} BamDataBlock; - -static void addGraphics_carData() { - BamDataBlock _carData[] = { - { { 310, 105, 1 }, { 314, 106, 17 }, { 366, 101, 1 }, 0 }, - { { 303, 105, 1 }, { 307, 106, 17 }, { 214, 0, 10 }, 0 }, - { { 297, 104, 1 }, { 301, 105, 17 }, { 214, 0, 10 }, 0 }, - { { 294, 103, 1 }, { 298, 104, 17 }, { 214, 0, 10 }, 0 }, - { { 291, 102, 1 }, { 295, 103, 18 }, { 214, 0, 10 }, 0 }, - { { 287, 101, 1 }, { 291, 102, 18 }, { 266, 51, 10 }, 2 }, - { { 283, 100, 1 }, { 287, 101, 19 }, { 279, 47, 11 }, 0 }, - { { 279, 99, 1 }, { 283, 100, 20 }, { 294, 46, 12 }, 0 }, - { { 274, 98, 1 }, { 278, 99, 20 }, { 305, 44, 13 }, 0 }, - { { 269, 98, 1 }, { 273, 99, 20 }, { 320, 42, 14 }, 0 }, - { { 264, 98, 1 }, { 268, 99, 17 }, { 214, 0, 10 }, 0 }, - { { 261, 98, 1 }, { 265, 99, 17 }, { 214, 0, 10 }, 0 }, - { { 259, 98, 1 }, { 263, 99, 17 }, { 214, 0, 10 }, 0 }, - { { 258, 98, 1 }, { 262, 99, 17 }, { 214, 0, 10 }, 0 }, - { { 257, 98, 2 }, { 260, 99, 17 }, { 214, 0, 10 }, 0 }, - { { 255, 99, 3 }, { 258, 100, 17 }, { 214, 0, 10 }, 0 }, - { { 258, 99, 4 }, { 257, 100, 17 }, { 214, 0, 10 }, 0 }, - { { 264, 102, 4 }, { 263, 103, 17 }, { 214, 0, 10 }, 0 }, - { { 272, 105, 5 }, { 274, 106, 17 }, { 214, 0, 10 }, 0 }, - { { 276, 107, 5 }, { 277, 108, 17 }, { 214, 0, 10 }, 0 }, - { { 283, 108, 5 }, { 284, 109, 17 }, { 214, 0, 10 }, 0 }, - { { 288, 109, 5 }, { 288, 110, 17 }, { 214, 0, 10 }, 0 }, - { { 293, 110, 5 }, { 293, 111, 18 }, { 266, 59, 10 }, 2 }, - { { 298, 110, 5 }, { 299, 111, 18 }, { 277, 56, 11 }, 0 }, - { { 303, 110, 5 }, { 304, 111, 19 }, { 285, 55, 12 }, 0 }, - { { 308, 110, 4 }, { 307, 111, 20 }, { 296, 54, 13 }, 0 }, - { { 309, 110, 3 }, { 312, 111, 20 }, { 304, 53, 14 }, 0 }, - { { 310, 110, 3 }, { 313, 111, 20 }, { 214, 0, 10 }, 0 }, - { { 311, 110, 3 }, { 314, 111, 17 }, { 214, 0, 10 }, 0 }, - { { 309, 110, 2 }, { 312, 111, 17 }, { 214, 0, 10 }, 0 }, - { { 304, 111, 2 }, { 307, 112, 17 }, { 214, 0, 10 }, 0 }, - { { 300, 110, 2 }, { 303, 111, 17 }, { 214, 0, 10 }, 0 }, - { { 296, 109, 2 }, { 299, 110, 17 }, { 214, 0, 10 }, 0 }, - { { 292, 108, 1 }, { 296, 109, 17 }, { 214, 0, 10 }, 0 }, - { { 285, 107, 2 }, { 289, 108, 17 }, { 214, 0, 10 }, 0 }, - { { 282, 107, 3 }, { 285, 108, 17 }, { 214, 0, 10 }, 0 }, - { { 278, 107, 4 }, { 277, 108, 18 }, { 214, 0, 10 }, 0 }, - { { 279, 108, 4 }, { 278, 109, 18 }, { 252, 57, 10 }, 2 }, - { { 281, 108, 5 }, { 283, 109, 18 }, { 265, 55, 11 }, 0 }, - { { 284, 109, 5 }, { 285, 110, 19 }, { 277, 55, 12 }, 0 }, - { { 287, 110, 5 }, { 288, 111, 20 }, { 288, 54, 13 }, 0 }, - { { 289, 111, 5 }, { 290, 112, 20 }, { 299, 54, 14 }, 0 }, - { { 291, 112, 4 }, { 290, 113, 20 }, { 214, 0, 10 }, 0 }, - { { 293, 113, 3 }, { 295, 114, 17 }, { 214, 0, 10 }, 0 }, - { { 296, 114, 2 }, { 299, 115, 17 }, { 214, 0, 10 }, 0 }, - { { 295, 115, 2 }, { 298, 116, 17 }, { 214, 0, 10 }, 0 }, - { { 293, 116, 1 }, { 297, 117, 17 }, { 214, 0, 10 }, 0 }, - { { 289, 116, 1 }, { 292, 117, 17 }, { 214, 0, 10 }, 0 }, - { { 285, 115, 1 }, { 289, 116, 17 }, { 214, 0, 10 }, 0 }, - { { 281, 114, 1 }, { 284, 115, 17 }, { 214, 0, 10 }, 0 }, - { { 277, 113, 1 }, { 280, 114, 17 }, { 214, 0, 10 }, 0 }, - { { 274, 112, 1 }, { 277, 113, 17 }, { 214, 0, 10 }, 0 }, - { { 271, 111, 1 }, { 274, 112, 17 }, { 214, 0, 10 }, 0 }, - { { 267, 110, 1 }, { 270, 111, 17 }, { 214, 0, 10 }, 0 }, - { { 263, 109, 1 }, { 266, 110, 17 }, { 214, 0, 10 }, 0 }, - { { 260, 108, 1 }, { 263, 109, 17 }, { 214, 0, 10 }, 0 }, - { { 254, 108, 2 }, { 256, 109, 17 }, { 214, 0, 10 }, 0 }, - { { 252, 107, 3 }, { 254, 108, 17 }, { 214, 0, 10 }, 0 }, - { { 253, 108, 3 }, { 255, 109, 17 }, { 214, 0, 10 }, 0 }, - { { 255, 109, 3 }, { 257, 110, 18 }, { 231, 59, 10 }, 2 }, - { { 258, 111, 3 }, { 260, 112, 18 }, { 242, 57, 11 }, 0 }, - { { 263, 112, 4 }, { 262, 113, 19 }, { 256, 57, 12 }, 0 }, - { { 270, 111, 4 }, { 269, 112, 20 }, { 267, 57, 13 }, 0 }, - { { 274, 112, 5 }, { 276, 113, 20 }, { 281, 56, 14 }, 0 }, - { { 280, 111, 6 }, { 282, 112, 19 }, { 214, 0, 10 }, 0 }, - { { 284, 109, 6 }, { 285, 110, 17 }, { 214, 0, 10 }, 0 }, - { { 289, 108, 6 }, { 291, 109, 17 }, { 214, 0, 10 }, 0 }, - { { 294, 107, 6 }, { 296, 108, 17 }, { 214, 0, 10 }, 0 }, - { { 294, 107, 5 }, { 296, 108, 18 }, { 272, 57, 10 }, 2 }, - { { 295, 107, 5 }, { 297, 108, 18 }, { 282, 57, 11 }, 0 }, - { { 296, 108, 5 }, { 298, 109, 19 }, { 295, 57, 12 }, 0 }, - { { 300, 108, 4 }, { 299, 109, 20 }, { 303, 57, 13 }, 0 }, - { { 303, 108, 3 }, { 306, 109, 20 }, { 313, 57, 14 }, 0 }, - { { 307, 109, 2 }, { 311, 110, 17 }, { 214, 0, 10 }, 0 }, - { { 310, 110, 1 }, { 314, 111, 17 }, { 214, 0, 10 }, 99 } - }; - writeRecord(_carData, sizeof(_carData), GBVARS_GRAPHICSCARDATA_INDEX , GBVARS_QUEEN); -} - -static void addGraphics_fight1Data() { - BamDataBlock _fight1Data[] = { - { { 75, 96, 1 }, { 187, 96, -23 }, { 58, 37, 46 }, 0 }, - { { 75, 96, 2 }, { 187, 96, -23 }, { 58, 37, 46 }, 0 }, - { { 75, 96, 3 }, { 187, 96, -23 }, { 58, 37, 46 }, 0 }, - { { 75, 96, 4 }, { 187, 96, -23 }, { 58, 37, 46 }, 0 }, - { { 75, 96, 1 }, { 187, 96, -23 }, { 58, 37, 46 }, 0 }, - { { 75, 96, 2 }, { 187, 96, -23 }, { 58, 37, 46 }, 0 }, - { { 75, 96, 3 }, { 187, 96, -23 }, { 58, 37, 46 }, 0 }, - { { 75, 96, 4 }, { 187, 96, -24 }, { 58, 37, 46 }, 0 }, - { { 79, 96, 1 }, { 187, 96, -24 }, { 58, 37, 46 }, 0 }, - { { 85, 96, 2 }, { 187, 96, -24 }, { 58, 37, 46 }, 0 }, - { { 94, 96, 3 }, { 187, 96, -24 }, { 58, 37, 46 }, 0 }, - { { 100, 96, 4 }, { 187, 96, -24 }, { 58, 37, 46 }, 0 }, - { { 113, 96, 1 }, { 187, 96, -25 }, { 58, 37, 46 }, 0 }, - { { 121, 96, 1 }, { 187, 96, -25 }, { 58, 37, 46 }, 0 }, - { { 136, 96, 16 }, { 187, 96, -26 }, { 58, 37, 46 }, 0 }, - { { 151, 93, 6 }, { 187, 96, -27 }, { 58, 37, 46 }, 0 }, - { { 159, 83, 16 }, { 187, 96, -28 }, { 58, 37, 46 }, 0 }, - { { 170, 73, 16 }, { 187, 96, -29 }, { 182, 96, 48 }, 3 }, - { { 176, 69, 13 }, { 187, 96, -31 }, { 182, 94, 49 }, 1 }, - { { 168, 66, 13 }, { 187, 98, -32 }, { 182, 92, 50 }, 0 }, - { { 155, 75, 13 }, { 187, 96, -32 }, { 182, 88, 51 }, 3 }, - { { 145, 86, 13 }, { 187, 98, -32 }, { 182, 85, 52 }, 0 }, - { { 127, 104, 13 }, { 187, 98, -32 }, { 182, 25, 52 }, 1 }, - { { 122, 108, 13 }, { 187, 98, -32 }, { 182, 25, 52 }, 1 }, - { { 120, 104, 14 }, { 187, 96, -34 }, { 107, 145, 42 }, 2 }, - { { 111, 103, 13 }, { 187, 96, -23 }, { 107, 144, 43 }, 0 }, - { { 102, 105, 13 }, { 187, 96, -23 }, { 107, 142, 43 }, 0 }, - { { 97, 107, 13 }, { 187, 96, -23 }, { 107, 139, 44 }, 0 }, - { { 92, 101, 14 }, { 187, 96, -23 }, { 107, 34, 47 }, 3 }, - { { 90, 105, 14 }, { 187, 96, -23 }, { 107, 34, 47 }, 0 }, - { { 88, 104, 14 }, { 187, 96, -23 }, { 107, 34, 47 }, 0 }, - { { 87, 105, 14 }, { 187, 96, -23 }, { 107, 34, 47 }, 0 }, - { { 86, 105, 14 }, { 187, 96, -23 }, { 107, 34, 47 }, 0 }, - { { 86, 105, 14 }, { 187, 96, -23 }, { 107, 34, 47 }, 0 }, - { { 86, 105, 15 }, { 187, 96, -23 }, { 0, 0, 0 }, 0 }, - { { 85, 98, 16 }, { 187, 96, -23 }, { 0, 0, 0 }, 0 }, - { { 92, 96, 1 }, { 187, 96, -23 }, { 0, 0, 0 }, 0 }, - { { 92, 96, 1 }, { 187, 96, -23 }, { 0, 0, 0 }, 0 }, - { { 89, 96, 4 }, { 187, 96, -23 }, { 0, 0, 0 }, 0 }, - { { 86, 96, 3 }, { 187, 96, -23 }, { 0, 0, 0 }, 0 }, - { { 83, 96, 2 }, { 187, 96, -23 }, { 0, 0, 0 }, 0 }, - { { 81, 96, 1 }, { 187, 96, -23 }, { 0, 0, 0 }, 0 }, - { { 78, 96, 4 }, { 187, 96, -23 }, { 0, 0, 0 }, 0 }, - { { 75, 96, 3 }, { 187, 96, -23 }, { 0, 0, 0 }, 0 }, - { { 75, 96, 1 }, { 187, 96, -23 }, { 0, 0, 0 }, 0 }, - { { 75, 96, 1 }, { 187, 96, -23 }, { 0, 0, 0 }, 99 } - }; - writeRecord(_fight1Data, sizeof(_fight1Data), GBVARS_GRAPHICSFIGHT1DATA_INDEX , GBVARS_QUEEN); -} - -static void addGraphics_fight2Data() { - BamDataBlock _fight2Data[] = { - { { 75, 96, 1 }, { 187, 96, -23 }, { 150, 45, 35 }, 0 }, - { { 78, 96, 2 }, { 187, 96, -23 }, { 150, 45, 35 }, 0 }, - { { 81, 96, 3 }, { 189, 96, -18 }, { 150, 45, 35 }, 0 }, - { { 84, 96, 4 }, { 183, 96, -19 }, { 150, 45, 35 }, 0 }, - { { 87, 96, 1 }, { 181, 96, -20 }, { 150, 45, 35 }, 0 }, - { { 90, 96, 2 }, { 177, 96, -21 }, { 150, 45, 35 }, 0 }, - { { 93, 96, 3 }, { 171, 96, -22 }, { 150, 45, 35 }, 0 }, - { { 96, 96, 4 }, { 169, 96, -17 }, { 150, 45, 35 }, 0 }, - { { 99, 96, 1 }, { 165, 96, -18 }, { 150, 45, 35 }, 0 }, - { { 102, 96, 2 }, { 159, 96, -19 }, { 150, 45, 35 }, 0 }, - { { 105, 96, 3 }, { 157, 96, -20 }, { 150, 45, 35 }, 0 }, - { { 108, 96, 4 }, { 153, 96, -21 }, { 150, 45, 35 }, 0 }, - { { 111, 96, 1 }, { 147, 96, -22 }, { 150, 45, 35 }, 0 }, - { { 114, 96, 2 }, { 147, 96, -23 }, { 150, 45, 35 }, 0 }, - { { 117, 96, 3 }, { 147, 96, -23 }, { 150, 45, 35 }, 0 }, - { { 120, 96, 4 }, { 147, 96, -24 }, { 150, 45, 35 }, 0 }, - { { 123, 96, 1 }, { 147, 96, -25 }, { 150, 45, 35 }, 0 }, - { { 125, 96, 2 }, { 147, 96, -25 }, { 150, 45, 35 }, 0 }, - { { 127, 96, 12 }, { 147, 96, -69 }, { 122, 94, 36 }, 3 }, - { { 127, 95, 11 }, { 147, 96, -70 }, { 122, 94, 41 }, 0 }, - { { 127, 96, 12 }, { 147, 96, -71 }, { 122, 100, 36 }, 3 }, - { { 127, 97, 11 }, { 147, 96, -69 }, { 122, 100, 41 }, 0 }, - { { 127, 96, 12 }, { 147, 96, -70 }, { 127, 103, 36 }, 3 }, - { { 127, 95, 11 }, { 147, 96, -71 }, { 127, 103, 41 }, 0 }, - { { 127, 94, 12 }, { 147, 96, -69 }, { 123, 94, 36 }, 3 }, - { { 127, 95, 11 }, { 147, 96, -70 }, { 123, 94, 41 }, 0 }, - { { 127, 96, 12 }, { 147, 96, -71 }, { 120, 99, 36 }, 3 }, - { { 127, 96, 12 }, { 147, 96, -71 }, { 115, 98, 41 }, 0 }, - { { 117, 93, 11 }, { 147, 96, -25 }, { 115, 134, 42 }, 0 }, - { { 110, 92, 11 }, { 147, 96, -25 }, { 114, 133, 42 }, 0 }, - { { 102, 93, 11 }, { 147, 96, -25 }, { 114, 131, 43 }, 0 }, - { { 92, 93, 11 }, { 147, 96, -25 }, { 114, 130, 43 }, 0 }, - { { 82, 94, 11 }, { 147, 96, -25 }, { 114, 128, 44 }, 0 }, - { { 76, 95, 11 }, { 147, 96, -25 }, { 114, 127, 44 }, 0 }, - { { 70, 96, 11 }, { 147, 96, -25 }, { 114, 126, 45 }, 0 }, - { { 75, 96, 5 }, { 147, 96, -25 }, { 114, 125, 46 }, 1 }, - { { 75, 96, 6 }, { 147, 96, -25 }, { 114, 43, 46 }, 0 }, - { { 75, 96, 6 }, { 147, 96, -25 }, { 114, 43, 46 }, 0 }, - { { 75, 96, 5 }, { 147, 96, -25 }, { 114, 43, 46 }, 0 }, - { { 75, 96, 7 }, { 147, 96, -25 }, { 114, 43, 46 }, 0 }, - { { 75, 96, 68 }, { 147, 96, -25 }, { 114, 43, 46 }, 0 }, - { { 75, 96, 68 }, { 147, 96, -25 }, { 89, 104, 36 }, 2 }, - { { 75, 96, 68 }, { 147, 96, -25 }, { 94, 103, 62 }, 0 }, - { { 75, 96, 68 }, { 147, 96, -25 }, { 122, 103, 63 }, 0 }, - { { 75, 96, 68 }, { 147, 96, -25 }, { 141, 103, 64 }, 0 }, - { { 75, 96, 68 }, { 147, 96, -30 }, { 150, 103, 65 }, 3 }, - { { 75, 96, 68 }, { 156, 96, -30 }, { 160, 103, 66 }, 0 }, - { { 75, 96, 7 }, { 164, 96, -30 }, { 169, 103, 67 }, 0 }, - { { 75, 96, 5 }, { 169, 96, -30 }, { 177, 103, 48 }, 3 }, - { { 75, 96, 5 }, { 173, 96, -30 }, { 185, 103, 49 }, 0 }, - { { 75, 96, 6 }, { 178, 96, -30 }, { 198, 103, 50 }, 0 }, - { { 75, 96, 6 }, { 181, 96, -30 }, { 207, 103, 51 }, 1 }, - { { 75, 96, 5 }, { 184, 96, -30 }, { 221, 103, 52 }, 0 }, - { { 75, 96, 5 }, { 186, 96, -30 }, { 224, 53, 53 }, 0 }, - { { 75, 96, 5 }, { 187, 96, -23 }, { 224, 53, 53 }, 99 } - }; - writeRecord(_fight2Data, sizeof(_fight2Data), GBVARS_GRAPHICSFIGHT2DATA_INDEX , GBVARS_QUEEN); -} - -static void addGraphics_fight3Data() { - BamDataBlock _fight3Data[] = { - { { 75, 96, 1 }, { 187, 96, -23 }, { 150, 45, 35 }, 0 }, - { { 77, 96, 2 }, { 187, 96, -22 }, { 150, 45, 35 }, 0 }, - { { 80, 96, 3 }, { 185, 96, -17 }, { 150, 45, 35 }, 0 }, - { { 83, 96, 4 }, { 181, 96, -18 }, { 150, 45, 35 }, 0 }, - { { 86, 96, 1 }, { 175, 96, -19 }, { 150, 45, 35 }, 0 }, - { { 88, 96, 2 }, { 173, 96, -20 }, { 150, 45, 35 }, 0 }, - { { 91, 96, 3 }, { 169, 96, -21 }, { 150, 45, 35 }, 0 }, - { { 94, 96, 4 }, { 163, 96, -22 }, { 150, 45, 35 }, 0 }, - { { 97, 96, 1 }, { 161, 96, -17 }, { 150, 45, 35 }, 0 }, - { { 99, 96, 2 }, { 157, 96, -18 }, { 150, 45, 35 }, 0 }, - { { 102, 96, 3 }, { 151, 96, -19 }, { 150, 45, 35 }, 0 }, - { { 105, 96, 4 }, { 149, 96, -20 }, { 150, 45, 35 }, 0 }, - { { 108, 96, 1 }, { 145, 96, -21 }, { 150, 45, 35 }, 0 }, - { { 110, 96, 2 }, { 145, 96, -25 }, { 150, 45, 35 }, 0 }, - { { 113, 96, 3 }, { 145, 96, -26 }, { 132, 96, 36 }, 2 }, - { { 117, 96, 7 }, { 145, 96, -27 }, { 122, 97, 36 }, 0 }, - { { 117, 96, 7 }, { 145, 96, -28 }, { 117, 97, 37 }, 0 }, - { { 116, 96, 12 }, { 145, 96, -24 }, { 110, 96, 38 }, 3 }, - { { 109, 96, 12 }, { 145, 96, -24 }, { 103, 95, 39 }, 0 }, - { { 105, 96, 12 }, { 145, 96, -24 }, { 95, 90, 40 }, 1 }, - { { 96, 96, 11 }, { 145, 96, -24 }, { 86, 80, 41 }, 0 }, - { { 92, 96, 11 }, { 145, 96, -24 }, { 86, 80, 41 }, 0 }, - { { 93, 96, 5 }, { 145, 96, -24 }, { 86, 38, 41 }, 0 }, - { { 91, 96, 5 }, { 145, 96, -24 }, { 86, 38, 41 }, 0 }, - { { 89, 96, 5 }, { 145, 96, -24 }, { 86, 38, 41 }, 0 }, - { { 88, 96, 5 }, { 145, 96, -24 }, { 86, 38, 41 }, 0 }, - { { 87, 96, 6 }, { 145, 96, -24 }, { 86, 38, 41 }, 0 }, - { { 87, 96, 6 }, { 145, 96, -23 }, { 86, 38, 41 }, 0 }, - { { 87, 96, 6 }, { 145, 96, -23 }, { 86, 38, 41 }, 0 }, - { { 87, 96, 5 }, { 145, 96, -23 }, { 86, 38, 41 }, 0 }, - { { 87, 96, 5 }, { 145, 96, -23 }, { 86, 38, 41 }, 0 }, - { { 87, 96, 6 }, { 145, 96, -23 }, { 86, 38, 41 }, 0 }, - { { 87, 96, 6 }, { 145, 96, -23 }, { 86, 38, 41 }, 0 }, - { { 87, 96, 5 }, { 145, 96, -23 }, { 86, 38, 41 }, 0 }, - { { 87, 96, 5 }, { 145, 96, -23 }, { 86, 38, 41 }, 0 }, - { { 87, 96, 6 }, { 145, 96, -23 }, { 86, 38, 41 }, 0 }, - { { 87, 96, 6 }, { 145, 96, -26 }, { 86, 38, 41 }, 0 }, - { { 87, 96, 6 }, { 145, 96, -27 }, { 132, 97, 36 }, 2 }, - { { 87, 96, 5 }, { 145, 96, -28 }, { 118, 97, 36 }, 0 }, - { { 87, 96, 7 }, { 145, 96, -24 }, { 107, 97, 36 }, 0 }, - { { 87, 96, 8 }, { 145, 96, -24 }, { 101, 97, 36 }, 0 }, - { { 87, 96, 9 }, { 145, 96, -23 }, { 102, 97, 66 }, 3 }, - { { 87, 96, 10 }, { 145, 96, -23 }, { 120, 97, 67 }, 0 }, - { { 87, 96, 10 }, { 145, 96, -30 }, { 139, 97, 67 }, 1 }, - { { 87, 96, 7 }, { 146, 96, -30 }, { 144, 97, 62 }, 2 }, - { { 86, 96, 4 }, { 160, 96, -30 }, { 144, 97, 48 }, 1 }, - { { 83, 96, 3 }, { 170, 96, -31 }, { 154, 93, 49 }, 0 }, - { { 80, 96, 2 }, { 174, 96, -31 }, { 161, 89, 50 }, 0 }, - { { 78, 96, 1 }, { 178, 99, -31 }, { 169, 85, 51 }, 0 }, - { { 75, 96, 4 }, { 183, 104, -31 }, { 175, 79, 52 }, 0 }, - { { 75, 96, 1 }, { 185, 99, -32 }, { 180, 144, 42 }, 3 }, - { { 75, 96, 1 }, { 185, 106, -31 }, { 181, 141, 42 }, 0 }, - { { 75, 96, 5 }, { 185, 104, -31 }, { 181, 138, 43 }, 0 }, - { { 75, 96, 5 }, { 188, 106, -31 }, { 182, 135, 43 }, 0 }, - { { 75, 96, 6 }, { 191, 99, -32 }, { 183, 131, 44 }, 3 }, - { { 75, 96, 6 }, { 191, 99, -32 }, { 183, 127, 45 }, 0 }, - { { 75, 96, 5 }, { 191, 99, -32 }, { 184, 121, 46 }, 0 }, - { { 75, 96, 5 }, { 191, 99, -32 }, { 183, 115, 46 }, 0 }, - { { 75, 96, 6 }, { 191, 99, -32 }, { 183, 41, 47 }, 0 }, - { { 75, 96, 6 }, { 191, 99, -32 }, { 183, 41, 47 }, 0 }, - { { 75, 96, 6 }, { 191, 99, -32 }, { 183, 41, 47 }, 0 }, - { { 75, 96, 5 }, { 191, 99, -32 }, { 183, 41, 47 }, 0 }, - { { 75, 96, 5 }, { 191, 99, -32 }, { 183, 41, 47 }, 0 }, - { { 75, 96, 5 }, { 191, 99, -32 }, { 183, 41, 47 }, 0 }, - { { 75, 96, 5 }, { 191, 99, -32 }, { 183, 41, 47 }, 0 }, - { { 75, 96, 5 }, { 191, 99, -32 }, { 183, 41, 47 }, 0 }, - { { 75, 96, 6 }, { 191, 99, -32 }, { 183, 41, 47 }, 0 }, - { { 75, 96, 6 }, { 191, 99, -32 }, { 183, 41, 47 }, 0 }, - { { 75, 96, 5 }, { 195, 98, -33 }, { 183, 41, 47 }, 0 }, - { { 75, 96, 6 }, { 191, 96, -34 }, { 183, 41, 47 }, 0 }, - { { 75, 96, 6 }, { 193, 96, -25 }, { 183, 41, 47 }, 0 }, - { { 75, 96, 5 }, { 193, 96, -24 }, { 183, 41, 47 }, 0 }, - { { 75, 96, 5 }, { 193, 96, -24 }, { 183, 41, 47 }, 0 }, - { { 75, 96, 5 }, { 193, 96, -24 }, { 183, 41, 47 }, 0 }, - { { 75, 96, 6 }, { 191, 96, -18 }, { 183, 41, 47 }, 0 }, - { { 75, 96, 6 }, { 190, 96, -19 }, { 183, 41, 47 }, 0 }, - { { 75, 96, 6 }, { 187, 96, -20 }, { 183, 41, 47 }, 0 }, - { { 75, 96, 1 }, { 187, 96, -23 }, { 183, 41, 47 }, 0 }, - { { 75, 96, 1 }, { 187, 96, -23 }, { 183, 41, 47 }, 99 } - }; - writeRecord(_fight3Data, sizeof(_fight3Data), GBVARS_GRAPHICSFIGHT3DATA_INDEX , GBVARS_QUEEN); -} - -void Queen_addGraphics() { - addGraphics_carData(); - addGraphics_fight1Data(); - addGraphics_fight2Data(); - addGraphics_fight3Data(); -} diff --git a/backends/platform/PalmOS/Src/builder/queen/bq_musicdata.c b/backends/platform/PalmOS/Src/builder/queen/bq_musicdata.c deleted file mode 100644 index 0c6df08403..0000000000 --- a/backends/platform/PalmOS/Src/builder/queen/bq_musicdata.c +++ /dev/null @@ -1,1939 +0,0 @@ -#include <PalmOS.h> -#include "b_globals.h" - -typedef Int16 int16; - -typedef struct { - int16 tuneList[5]; - int16 volume; - int16 tempo; - int16 reverb; - int16 override; - int16 ignore; -} songData; - -typedef struct { - int16 tuneNum[9]; - int16 sfx[2]; - int16 mode; - int16 delay; -} tuneData; - -static void addMusicdata_songDemo() { - songData _songDemo[] = { - /* 1 - Hotel Gangsters */ - { { 1, 0 }, 128, 128, 128, 1, 0 }, - - /* 2 - Hotel General */ - { { 2, 0 }, 128, 128, 128, 1, 0 }, - - /* 3 - Jungle */ - { { 3, 4, 5, 6, 0 }, 128, 128, 128, 1, 0 }, - - /* 4 - Waterfall On */ - { { 7, 0 }, 128, 128, 128, 0, 0 }, - - /* 5 - Vnormal */ - { { 8, 0 }, 128, 128, 128, 2, 0 }, - - /* 6 - Trader Bob */ - { { 9, 0 }, 120, 128, 128, 1, 0 }, - - /* 7 - Jetty Music */ - { { 10, 0 }, 128, 128, 128, 1, 0 }, - - /* 8 - Ferry Music */ - { { 11, 0 }, 128, 128, 128, 1, 0 }, - - /* 9 - Temple Upstairs */ - { { 12, 0 }, 128, 128, 128, 1, 0 }, - - /* 10 - Temple Downstairs */ - { { 13, 0 }, 128, 128, 128, 1, 0 }, - - /* 11 - Temple Maze */ - { { 14, 0 }, 128, 128, 128, 1, 0 }, - - /* 12 - Temple Skull */ - { { 15, 0 }, 128, 128, 128, 1, 0 }, - - /* 13 - Johns Theme (Love Story) */ - { { 16, 0 }, 128, 128, 128, 1, 0 }, - - /* 14 - Vmedium */ - { { 17, 0 }, 128, 128, 0, 2, 0 }, - - /* 15 - Vsoft */ - { { 18, 0 }, 128, 128, 0, 2, 0 }, - - /* 16 - Floda Upstairs */ - { { 19, 0 }, 128, 128, 0, 1, 0 }, - - /* 17 - Floda General */ - { { 20, 0 }, 128, 128, 128, 1, 0 }, - - /* 18 - Klunks Room */ - { { 21, 0 }, 110, 128, 128, 1, 0 }, - - /* 19 - Hotel Lola */ - { { 22, 0 }, 120, 18128, 128, 1, 0 }, - - /* 20 - Hotel Escape 1 */ - { { 23, 0 }, 128, 18128, 128, 1, 0 }, - - /* 21 - Amazon Fortress */ - { { 24, 0 }, 128, 128, 128, 1, 0 }, - - /* 22 - Waterfall Off */ - { { 25, 0 }, 128, 128, 128, 0, 0 }, - - /* 23 - Wave Torch */ - { { 26, 0 }, 128, 128, 128, 0, 1 }, - - /* 24 - Zombies Rez Out */ - { { 27, 0 }, 128, 128, 128, 0, 1 }, - - /* 25 - Open Door (standard) */ - { { 28, 0 }, 128, 128, 128, 0, 1 }, - - /* 26 - Close Door (standard) */ - { { 29, 0 }, 128, 128, 128, 0, 1 }, - - /* 27 - Cloth Unrolls */ - { { 30, 0 }, 128, 128, 128, 0, 1 }, - - /* 28 - Snake Slithers Off */ - { { 31, 0 }, 128, 128, 128, 0, 1 }, - - /* 29 - Hotel Fanfare 2 */ - { { 32, 0 }, 128, 128, 128, 1, 1 }, - - /* 30 - Floda Secret */ - { { 33, 0 }, 120, 128, 128, 1, 0 }, - - /* 31 - Temple Fanfare 1 */ - { { 34, 0 }, 128, 128, 128, 1, 1 }, - }; - - writeRecord(_songDemo, sizeof(_songDemo), GBVARS_MUSICDATASONGDEMO_INDEX , GBVARS_QUEEN); -} - -static void addMusicdata_song() { - songData _song[] = { - /* 1 - Hotel Gangsters */ - { { 1, 0 }, 128, 180, 0, 1, 0 }, - - /* 2 - Hotel General */ - { { 2, 0 }, 128, 180, 0, 1, 0 }, - - /* 3 - Jungle */ - { { 3, 4, 5, 6, 0 }, 128, 0, 0, 1, 0 }, - - /* 4 - Waterfall On */ - { { 7, 0 }, 128, 0, 0, 0, 0 }, - - /* 5 - Vnormal */ - { { 8, 0 }, 128, 0, 0, 2, 0 }, - - /* 6 - Trader Bob */ - { { 9, 0 }, 120, 0, 0, 1, 0 }, - - /* 7 - Jetty Music */ - { { 10, 0 }, 128, 0, 0, 1, 0 }, - - /* 8 - Ferry Music */ - { { 11, 0 }, 128, 0, 0, 1, 0 }, - - /* 9 - Temple Upstairs */ - { { 12, 0 }, 128, 0, 0, 1, 0 }, - - /* 10 - Temple Downstairs */ - { { 13, 0 }, 128, 0, 0, 1, 0 }, - - /* 11 - Temple Maze */ - { { 14, 0 }, 128, 0, 0, 1, 0 }, - - /* 12 - Temple Skull */ - { { 15, 0 }, 128, 0, 0, 1, 0 }, - - /* 13 - Johns Theme (Love Story) */ - { { 16, 0 }, 128, 0, 0, 1, 0 }, - - /* 14 - Vmedium */ - { { 17, 0 }, 120, 0, 0, 2, 0 }, - - /* 15 - Vsoft */ - { { 18, 0 }, 110, 0, 0, 2, 0 }, - - /* 16 - Floda Upstairs */ - { { 19, 0 }, 110, 0, 0, 1, 0 }, - - /* 17 - Floda General */ - { { 20, 0 }, 128, 0, 0, 1, 0 }, - - /* 18 - Klunks Room */ - { { 21, 0 }, 128, 0, 0, 1, 0 }, - - /* 19 - Hotel Lola */ - { { 22, 0 }, 120, 180, 0, 1, 0 }, - - /* 20 - Hotel Escape 1 */ - { { 23, 0 }, 128, 180, 0, 1, 0 }, - - /* 21 - Amazon Fortress */ - { { 24, 0 }, 128, 0, 0, 1, 0 }, - - /* 22 - Waterfall Off */ - { { 25, 0 }, 128, 0, 0, 0, 0 }, - - /* 23 - Wave Torch */ - { { 26, 0 }, 128, 0, 0, 0, 1 }, - - /* 24 - Zombies Rez Out */ - { { 27, 0 }, 128, 0, 0, 0, 1 }, - - /* 25 - Open Door (standard) */ - { { 28, 0 }, 128, 0, 0, 0, 1 }, - - /* 26 - Close Door (standard) */ - { { 29, 0 }, 128, 0, 0, 0, 1 }, - - /* 27 - Cloth Unrolls */ - { { 30, 0 }, 128, 0, 0, 0, 1 }, - - /* 28 - Snake Slithers Off */ - { { 31, 0 }, 128, 0, 0, 0, 1 }, - - /* 29 - Hotel Fanfare 2 */ - { { 32, 0 }, 128, 0, 0, 1, 1 }, - - /* 30 - Floda Secret */ - { { 33, 0 }, 128, 0, 0, 1, 0 }, - - /* 31 - Temple Fanfare 1 */ - { { 34, 0 }, 128, 0, 0, 1, 1 }, - - /* 32 - Commander Rocket 1 */ - { { 35, 0 }, 128, 0, 0, 1, 0 }, - - /* 33 - Hotel Escape 2 */ - { { 36, 0 }, 128, 180, 0, 1, 0 }, - - /* 34 - Back of Truck */ - { { 37, 0 }, 128, 180, 0, 1, 0 }, - - /* 35 - Hotel Fanfare 1 */ - { { 38, 0 }, 128, 0, 0, 1, 1 }, - - /* 36 - Truck Fanfare */ - { { 39, 0 }, 128, 0, 0, 1, 1 }, - - /* 37 - Airport */ - { { 40, 0 }, 128, 0, 0, 1, 0 }, - - /* 38 - Plane Leaves */ - { { 41, 0 }, 128, 0, 0, 1, 1 }, - - /* 39 - Arrive Hotel */ - { { 42, 0 }, 128, 0, 0, 1, 0 }, - - /* 40 - Jungle Fanfare */ - { { 43, 0 }, 128, 0, 0, 1, 1 }, - - /* 41 - General Fanfare */ - { { 44, 0 }, 128, 0, 0, 1, 1 }, - - /* 42 - Johns Room */ - { { 45, 0 }, 128, 0, 0, 1, 0 }, - - /* 43 - Floda Lab */ - { { 46, 0 }, 128, 0, 0, 1, 0 }, - - /* 44 - Azura's Theme */ - { { 47, 0 }, 128, 0, 0, 1, 0 }, - - /* 45 - Use Record */ - { { 48, 0 }, 128, 0, 0, 1, 1 }, - - /* 46 - Franks Theme */ - { { 49, 0 }, 128, 0, 0, 1, 0 }, - - /* 47 - Anderson Doubts */ - { { 50, 0 }, 128, 0, 0, 1, 0 }, - - /* 48 - Bud and Lou Theme */ - { { 51, 0 }, 128, 0, 0, 1, 1 }, - - /* 49 - Gorilla Theme */ - { { 52, 0 }, 128, 0, 0, 1, 1 }, - - /* 50 - Missionaries Theme */ - { { 53, 0 }, 128, 0, 0, 1, 1 }, - - /* 51 - Sloth Theme */ - { { 54, 0 }, 128, 0, 0, 1, 1 }, - - /* 52 - Amazon Dungeon */ - { { 55, 0 }, 128, 0, 0, 1, 0 }, - - /* 53 - Throne Room */ - { { 56, 0 }, 128, 0, 0, 1, 0 }, - - /* 54 - Temple Puzzle */ - { { 57, 0 }, 128, 0, 0, 1, 0 }, - - /* 55 - Temple Fountain Room */ - { { 58, 0 }, 128, 0, 0, 1, 0 }, - - /* 56 - Light Switch */ - { { 59, 0 }, 128, 0, 0, 0, 1 }, - - /* 57 - Hydraulic Open */ - { { 60, 0 }, 128, 0, 0, 0, 1 }, - - /* 58 - Hydraulic Close */ - { { 61, 0 }, 128, 0, 0, 0, 1 }, - - /* 59 - Close Door (metal) */ - { { 62, 0 }, 128, 0, 0, 0, 1 }, - - /* 60 - Small Hatch Close */ - { { 63, 0 }, 128, 0, 0, 0, 1 }, - - /* 61 - Scissors Snip */ - { { 64, 0 }, 128, 0, 0, 0, 1 }, - - /* 62 - Pick up Sticky */ - { { 65, 0 }, 128, 0, 0, 0, 1 }, - - /* 63 - Oracle Rezzes In */ - { { 66, 0 }, 128, 0, 0, 0, 1 }, - - /* 64 - Sparkle SFX */ - { { 67, 0 }, 128, 0, 0, 0, 1 }, - - /* 65 - Splorch! */ - { { 68, 0 }, 128, 0, 0, 0, 1 }, - - /* 66 - Pour Liquid */ - { { 69, 0 }, 128, 0, 0, 0, 1 }, - - /* 67 - End Credit Medley */ - { { 70, 0 }, 128, 0, 0, 1, 0 }, - - /* 68 - Dino Ray */ - { { 71, 0 }, 128, 0, 0, 0, 1 }, - - /* 69 - Squish! */ - { { 72, 0 }, 128, 0, 0, 0, 1 }, - - /* 70 - Robot Laser */ - { { 73, 0 }, 128, 0, 0, 0, 1 }, - - /* 71 - Thud wood light */ - { { 74, 0 }, 128, 0, 0, 0, 1 }, - - /* 72 - Thud wood deep */ - { { 75, 0 }, 128, 0, 0, 0, 1 }, - - /* 73 - Thud metallic */ - { { 76, 0 }, 128, 0, 0, 0, 1 }, - - /* 74 - Cut Coconut */ - { { 77, 0 }, 128, 0, 0, 0, 1 }, - - /* 75 - Thud Stone */ - { { 78, 0 }, 128, 0, 0, 0, 1 }, - - /* 76 - Cloth Slide 1 */ - { { 79, 0 }, 128, 0, 0, 0, 1 }, - - /* 77 - Open Chest */ - { { 80, 0 }, 128, 0, 0, 0, 1 }, - - /* 78 - Close Chest */ - { { 81, 0 }, 128, 0, 0, 0, 1 }, - - /* 79 - Open Drawer */ - { { 82, 0 }, 128, 0, 0, 0, 1 }, - - /* 80 - Truck door closes */ - { { 83, 0 }, 128, 0, 0, 0, 1 }, - - /* 81 - Truck Starts */ - { { 84, 0 }, 128, 0, 0, 0, 1 }, - - /* 82 - Truck Drives Off */ - { { 85, 0 }, 128, 0, 0, 0, 1 }, - - /* 83 - Fish Splash */ - { { 86, 0 }, 128, 0, 0, 0, 1 }, - - /* 84 - Close Drawer/Push Ladder */ - { { 87, 0 }, 128, 0, 0, 0, 1 }, - - /* 85 - Agression Enhancer */ - { { 88, 0 }, 128, 0, 0, 0, 1 }, - - /* 86 - Stone Door Grind 1 */ - { { 89, 0 }, 128, 0, 0, 0, 1 }, - - /* 87 - Prequel 1 */ - { { 90, 0 }, 128, 0, 0, 1, 0 }, - - /* 88 - Intro Credits */ - { { 91, 0 }, 128, 0, 0, 1, 0 }, - - /* 89 - Valley 1 */ - { { 92, 0 }, 128, 0, 0, 1, 0 }, - - /* 90 - Valley 3 */ - { { 93, 0 }, 128, 0, 0, 1, 0 }, - - /* 91 - Fight Music */ - { { 94, 0 }, 128, 0, 0, 1, 0 }, - - /* 92 - Confrontation 1 */ - { { 95, 0 }, 128, 0, 0, 1, 0 }, - - /* 93 - Confrontation 2 */ - { { 96, 0 }, 128, 0, 0, 1, 0 }, - - /* 94 - Plane Hatch Open */ - { { 97, 0 }, 128, 128, 128, 0, 1 }, - - /* 95 - Plane Hatch Close */ - { { 98, 0 }, 128, 128, 128, 0, 1 }, - - /* 96 - Tie Vines */ - { { 99, 0 }, 128, 128, 128, 0, 1 }, - - /* 97 - Pterodactyl */ - { { 100, 0 }, 128, 128, 128, 0, 1 }, - - /* 98 - Beef Jerky Splash */ - { { 101, 0 }, 128, 128, 128, 0, 1 }, - - /* 99 - Piranha Burp */ - { { 102, 0 }, 128, 128, 128, 0, 1 }, - - /* 100 - Falling Vine */ - { { 103, 0 }, 128, 128, 128, 0, 1 }, - - /* 101 - Stone Door Grind 2 */ - { { 104, 0 }, 128, 128, 128, 0, 1 }, - - /* 102 - Stone Grind (light) */ - { { 105, 0 }, 128, 128, 128, 0, 1 }, - - /* 103 - Ape Takes Off Mask */ - { { 106, 0 }, 128, 128, 128, 0, 1 }, - - /* 104 - Bark Breaks */ - { { 107, 0 }, 128, 128, 128, 0, 1 }, - - /* 105 - Stone Click */ - { { 108, 0 }, 128, 128, 128, 0, 1 }, - - /* 106 - Sproing! */ - { { 109, 0 }, 128, 128, 128, 0, 1 }, - - /* 107 - Cash Register */ - { { 110, 0 }, 128, 128, 128, 0, 1 }, - - /* 108 - Squeaky Toy */ - { { 111, 0 }, 128, 128, 128, 0, 1 }, - - /* 109 - Falling Chains */ - { { 112, 0 }, 128, 128, 128, 0, 1 }, - - /* 110 - Open Locker Door */ - { { 113, 0 }, 128, 128, 128, 0, 1 }, - - /* 111 - Close Locker Door */ - { { 114, 0 }, 128, 128, 128, 0, 1 }, - - /* 112 - Rub Pencil */ - { { 115, 0 }, 128, 128, 128, 0, 1 }, - - /* 113 - Open Safe */ - { { 116, 0 }, 128, 128, 128, 0, 1 }, - - /* 114 - Close Safe */ - { { 117, 0 }, 128, 128, 128, 0, 1 }, - - /* 115 - Push Chair */ - { { 118, 0 }, 128, 128, 128, 0, 1 }, - - /* 116 - Snake Hiss */ - { { 119, 0 }, 128, 128, 128, 0, 1 }, - - /* 117 - Oracle Rezzes Out */ - { { 120, 0 }, 128, 128, 128, 0, 1 }, - - /* 118 - Wall Crumbles */ - { { 121, 0 }, 128, 128, 128, 0, 1 }, - - /* 119 - Crypt Crumbles */ - { { 122, 0 }, 128, 128, 128, 0, 1 }, - - /* 120 - Joe Sucked Up */ - { { 123, 0 }, 128, 128, 128, 0, 1 }, - - /* 121 - Rocket Pack Zoom */ - { { 124, 0 }, 128, 128, 128, 0, 1 }, - - /* 122 - Piranha Splash */ - { { 125, 0 }, 128, 128, 128, 0, 1 }, - - /* 123 - Snap Branch */ - { { 126, 0 }, 128, 128, 128, 0, 1 }, - - /* 124 - Dino Horn */ - { { 127, 0 }, 128, 128, 128, 0, 1 }, - - /* 125 - Tyre Screech */ - { { 128, 0 }, 128, 128, 128, 0, 1 }, - - /* 126 - Oil Splat */ - { { 129, 0 }, 128, 128, 128, 0, 1 }, - - /* 127 - Punch */ - { { 130, 0 }, 128, 128, 128, 0, 1 }, - - /* 128 - Body Hits Ground */ - { { 131, 0 }, 128, 128, 128, 0, 1 }, - - /* 129 - Chicken */ - { { 132, 0 }, 128, 128, 128, 0, 1 }, - - /* 130 - Open Sarcophagus */ - { { 133, 0 }, 128, 128, 128, 0, 1 }, - - /* 131 - Close Sarcophagus */ - { { 134, 0 }, 128, 128, 128, 0, 1 }, - - /* 132 - Creaking Stick */ - { { 135, 0 }, 128, 128, 128, 0, 1 }, - - /* 133 - Pick Hits Stone */ - { { 136, 0 }, 128, 128, 128, 0, 1 }, - - /* 134 - Stalactite Crumbles */ - { { 137, 0 }, 128, 128, 128, 0, 1 }, - - /* 135 - Tic-Toc */ - { { 138, 0 }, 128, 128, 128, 0, 1 }, - - /* 136 - Stone Grind (heavy) */ - { { 139, 0 }, 128, 128, 128, 0, 1 }, - - /* 137 - Explosion */ - { { 140, 0 }, 128, 128, 128, 0, 1 }, - - /* 138 - Cloth Slide 2 */ - { { 141, 0 }, 128, 128, 128, 0, 1 }, - - /* 139 - Temple Laser */ - { { 142, 0 }, 128, 128, 128, 0, 1 }, - - /* 140 - Dino Transformation */ - { { 143, 0 }, 128, 128, 128, 0, 1 }, - - /* 141 - Experimental Laser */ - { { 144, 0 }, 128, 128, 128, 0, 1 }, - - /* 142 - Stone Grind (medium) */ - { { 145, 0 }, 128, 128, 128, 0, 1 }, - - /* 143 - Weeping God Grind */ - { { 146, 0 }, 128, 128, 128, 0, 1 }, - - /* 144 - Alien Hum */ - { { 147, 0 }, 128, 128, 128, 0, 1 }, - - /* 145 - Alien Puzzle */ - { { 148, 0 }, 128, 128, 128, 0, 1 }, - - /* 146 - Vacuum On */ - { { 149, 0 }, 128, 128, 128, 0, 1 }, - - /* 147 - Vacuum Off */ - { { 150, 0 }, 128, 128, 128, 0, 1 }, - - /* 148 - Elevator Starts */ - { { 151, 0 }, 128, 128, 128, 0, 1 }, - - /* 149 - Mummy Crumbles */ - { { 152, 0 }, 128, 128, 128, 0, 1 }, - - /* 150 - Temple Green Circle */ - { { 153, 0 }, 128, 128, 128, 0, 1 }, - - /* 151 - Rattle Bars */ - { { 154, 0 }, 128, 128, 128, 0, 1 }, - - /* 152 - Door Dissolves */ - { { 155, 0 }, 128, 128, 128, 0, 1 }, - - /* 153 - Altar Slides */ - { { 156, 0 }, 128, 128, 128, 0, 1 }, - - /* 154 - Light Torch */ - { { 157, 0 }, 128, 128, 128, 0, 1 }, - - /* 155 - Stamp Sound */ - { { 158, 0 }, 128, 128, 128, 0, 1 }, - - /* 156 - Plaster Loud */ - { { 159, 0 }, 128, 128, 128, 0, 1 }, - - /* 157 - Sparky Bathtub */ - { { 160, 0 }, 128, 128, 128, 0, 1 }, - - /* 158 - Ape Rezzes Out */ - { { 161, 0 }, 128, 128, 128, 0, 1 }, - - /* 159 - Song 159 */ - { { 162, 0 }, 128, 128, 128, 1, 0 }, - - /* 160 - Song 160 */ - { { 163, 0 }, 128, 128, 128, 1, 0 }, - - /* 161 - Song 161 */ - { { 164, 0 }, 128, 128, 128, 1, 0 }, - - /* 162 - Piranhas Swim */ - { { 165, 0 }, 128, 128, 128, 0, 1 }, - - /* 163 - Prison/Dungeon Door */ - { { 166, 0 }, 128, 128, 128, 0, 1 }, - - /* 164 - Fight Explosion */ - { { 167, 0 }, 128, 128, 128, 0, 1 }, - - /* 165 - Press Button */ - { { 168, 0 }, 128, 128, 128, 2, 1 }, - - /* 166 - Pull Lever */ - { { 169, 0 }, 128, 128, 128, 0, 1 }, - - /* 167 - Wrong Code */ - { { 170, 0 }, 128, 128, 128, 0, 1 }, - - /* 168 - Correct Code */ - { { 171, 0 }, 128, 128, 128, 0, 1 }, - - /* 169 - Sizzle */ - { { 172, 0 }, 128, 128, 128, 0, 1 }, - - /* 170 - Money In Slot */ - { { 173, 0 }, 128, 128, 128, 0, 1 }, - - /* 171 - Lightning Crack */ - { { 174, 0 }, 128, 128, 128, 0, 1 }, - - /* 172 - Machine Gun Fire */ - { { 175, 0 }, 128, 128, 128, 0, 1 }, - - /* 173 - Cage Descends */ - { { 176, 0 }, 128, 128, 128, 0, 1 }, - - /* 174 - Chair Activates */ - { { 177, 0 }, 128, 128, 128, 0, 1 }, - - /* 175 - Robot Powers On */ - { { 178, 0 }, 128, 128, 128, 0, 1 }, - - /* 176 - Grow Big */ - { { 179, 0 }, 128, 128, 128, 0, 1 }, - - /* 177 - Eat Food */ - { { 180, 0 }, 128, 128, 128, 0, 1 }, - - /* 178 - Head Shrink */ - { { 181, 0 }, 128, 128, 128, 0, 1 }, - - /* 179 - Grinding Gears */ - { { 182, 0 }, 128, 128, 128, 0, 1 }, - - /* 180 - Chair Splash */ - { { 183, 0 }, 128, 128, 128, 0, 1 }, - - /* 181 - Deflect Laser */ - { { 184, 0 }, 128, 128, 128, 0, 1 }, - - /* 182 - Zap Frank */ - { { 185, 0 }, 128, 128, 128, 0, 1 }, - - /* 183 - Frank Transforms */ - { { 186, 0 }, 128, 128, 128, 0, 1 }, - - /* 184 - Alarm Clock */ - { { 187, 0 }, 128, 128, 128, 0, 1 }, - - /* 185 - Slide Chute */ - { { 188, 0 }, 128, 128, 128, 0, 1 }, - - /* 186 - Puff */ - { { 189, 0 }, 128, 128, 128, 0, 1 }, - - /* 187 - Bite */ - { { 190, 0 }, 128, 128, 128, 0, 0 }, - - /* 188 - Stone Door Grind 2 */ - { { 191, 0 }, 128, 128, 128, 0, 1 }, - - /* 189 - Prequel 2 */ - { { 192, 0 }, 128, 128, 128, 1, 0 }, - - /* 190 - Prequel 3 */ - { { 193, 0 }, 128, 128, 128, 1, 0 }, - - /* 191 - Prequel 4 */ - { { 194, 0 }, 128, 128, 128, 1, 0 }, - - /* 192 - Stop Music */ - { { 195, 0 }, 128, 128, 128, 1, 0 }, - - /* 193 - Plane Flyby */ - { { 196, 0 }, 128, 128, 128, 0, 1 }, - - /* 194 - Commander Rocket 2 */ - { { 197, 0 }, 128, 128, 128, 1, 0 }, - - /* 195 - Commander Rocket 3 */ - { { 198, 0 }, 128, 128, 128, 1, 0 }, - - /* 196 - Rescue */ - { { 199, 0 }, 128, 128, 128, 1, 0 }, - - /* 197 - Slow Fanfare */ - { { 200, 0 }, 128, 128, 128, 1, 0 }, - - /* 198 - Plane Crash */ - { { 201, 0 }, 128, 128, 128, 1, 0 }, - - /* 199 - Plane Engine 1 */ - { { 202, 0 }, 128, 128, 128, 0, 1 }, - - /* 200 - Plane Engine 2 */ - { { 203, 0 }, 128, 128, 128, 0, 1 }, - - /* 201 - Boat In */ - { { 204, 0 }, 128, 128, 128, 0, 1 }, - - /* 202 - Boat Out */ - { { 205, 0 }, 128, 128, 128, 0, 1 }, - - /* 203 - Final Fanfare! */ - { { 206, 0 }, 128, 128, 128, 1, 0 }, - - /* 204 - Frank Destroyed */ - { { 207, 0 }, 128, 128, 128, 1, 0 }, - - /* 205 - Jaspar Eats */ - { { 208, 0 }, 128, 128, 128, 0, 1 }, - - /* 206 - Compy Scream 1 */ - { { 209, 0 }, 128, 128, 128, 0, 1 }, - - /* 207 - Compy Scream 2 */ - { { 210, 0 }, 128, 128, 128, 0, 1 }, - - /* 208 - Punch Klunk Fanfare */ - { { 211, 0 }, 128, 128, 128, 1, 0 }, - - /* 209 - Talk Frank */ - { { 212, 0 }, 128, 128, 128, 1, 0 } - }; - - writeRecord(_song, sizeof(_song), GBVARS_MUSICDATASONG_INDEX , GBVARS_QUEEN); -} - -static void addMusicdata_tuneDemo() { - tuneData _tuneDemo[] = { - /* 1 - Hotel Gangsters */ - { { 32, 0 }, { 0, 0 }, 1, 0 }, - - /* 2 - Hotel General */ - { { 26, 0 }, { 0, 0 }, 1, 0 }, - - /* 3 - Jungle */ - { { 15, 0 }, { 0, 0 }, 1, 0 }, - - /* 4 - Jungle */ - { { 17, 0 }, { 0, 0 }, 1, 0 }, - - /* 5 - Jungle */ - { { 18, 0 }, { 0, 0 }, 1, 0 }, - - /* 6 - Jungle */ - { { 7, 8, 9, 10, 11, 12, 13, 14, 0 }, { 0, 0 }, 0, 0 }, - - /* 7 - Waterfall On */ - { { 3, 0 }, { 0, 0 }, 1, 0 }, - - /* 8 - Vnormal */ - { { 1, 0 }, { 0, 0 }, 1, 0 }, - - /* 9 - Trader Bob */ - { { 1, 0 }, { 0, 0 }, 1, 0 }, - - /* 10 - Jetty Music */ - { { 37, 0 }, { 0, 0 }, 1, 0 }, - - /* 11 - Ferry Music */ - { { 38, 0 }, { 0, 0 }, 1, 0 }, - - /* 12 - Temple Upstairs */ - { { 30, 0 }, { 0, 0 }, 1, 0 }, - - /* 13 - Temple Downstairs */ - { { 34, 0 }, { 0, 0 }, 1, 0 }, - - /* 14 - Temple Maze */ - { { 35, 0 }, { 0, 0 }, 1, 0 }, - - /* 15 - Temple Skull */ - { { 36, 0 }, { 0, 0 }, 1, 0 }, - - /* 16 - Johns Theme (Love Story) */ - { { 43, 0 }, { 0, 0 }, 1, 0 }, - - /* 17 - Vmedium */ - { { 28, 0 }, { 0, 0 }, 1, 0 }, - - /* 18 - Vsoft */ - { { 28, 0 }, { 0, 0 }, 1, 0 }, - - /* 19 - Floda Upstairs */ - { { 28, 0 }, { 0, 0 }, 1, 0 }, - - /* 20 - Floda General */ - { { 29, 0 }, { 0, 0 }, 1, 0 }, - - /* 21 - Klunks Room */ - { { 39, 0 }, { 0, 0 }, 1, 0 }, - - /* 22 - Hotel Lola */ - { { 31, 0 }, { 0, 0 }, 1, 0 }, - - /* 23 - Hotel Escape 1 */ - { { 33, 0 }, { 0, 0 }, 1, 0 }, - - /* 24 - Amazon Fortress */ - { { 40, 0 }, { 0, 0 }, 1, 0 }, - - /* 25 - Waterfall Off */ - { { -3, 0 }, { 0, 0 }, 1, 0 }, - - /* 26 - Wave Torch */ - { { 22, 0 }, { 121, 0 }, 2, 0 }, - - /* 27 - Zombies Rez Out */ - { { 25, 0 }, { 20, 0 }, 2, 0 }, - - /* 28 - Open Door (standard) */ - { { 20, 0 }, { 1, 0 }, 2, 0 }, - - /* 29 - Close Door (standard) */ - { { 21, 0 }, { 2, 0 }, 2, 0 }, - - /* 30 - Cloth Unrolls */ - { { 23, 0 }, { 51, 0 }, 2, 0 }, - - /* 31 - Snake Slithers Off */ - { { 24, 0 }, { 122, 0 }, 2, 0 }, - - /* 32 - Hotel Fanfare 2 */ - { { 69, 1003, 0 }, { 0, 0 }, 2, 0 }, - - /* 33 - Floda Secret */ - { { 28, 0 }, { 0, 0 }, 1, 0 }, - - /* 34 - Temple Fanfare 1 */ - { { 60, 162, 0 }, { 0, 0 }, 2, 0 }, - - /* 35 - Commander Rocket 1 */ - { { 46, 0 }, { 0, 0 }, 1, 0 }, - }; - writeRecord(_tuneDemo, sizeof(_tuneDemo), GBVARS_MUSICDATATUNEDEMO_INDEX , GBVARS_QUEEN); -} - -static void addMusicdata_tune() { - tuneData _tune[] = { - /* 1 - Hotel Gangsters */ - { { 32, 0 }, { 0, 0 }, 1, 0 }, - - /* 2 - Hotel General */ - { { 41, 0 }, { 0, 0 }, 1, 0 }, - - /* 3 - Jungle */ - { { 15, 16, 0 }, { 0, 0 }, 1, 0 }, - - /* 4 - Jungle */ - { { 17, 0 }, { 0, 0 }, 1, 0 }, - - /* 5 - Jungle */ - { { 18, 0 }, { 0, 0 }, 1, 0 }, - - /* 6 - Jungle */ - { { 7, 8, 9, 10, 11, 12, 13, 14, 0 }, { 0, 0 }, 0, -10 }, - - /* 7 - Waterfall On */ - { { 3, 0 }, { 0, 0 }, 1, 0 }, - - /* 8 - Vnormal */ - { { 23, 0 }, { 0, 0 }, 1, 0 }, - - /* 9 - Trader Bob */ - { { 23, 0 }, { 0, 0 }, 1, 0 }, - - /* 10 - Jetty Music */ - { { 37, 0 }, { 0, 0 }, 1, 0 }, - - /* 11 - Ferry Music */ - { { 38, 0 }, { 0, 0 }, 1, 0 }, - - /* 12 - Temple Upstairs */ - { { 30, 0 }, { 0, 0 }, 1, 0 }, - - /* 13 - Temple Downstairs */ - { { 34, 36, 56, 0 }, { 0, 0 }, 0, 0 }, - - /* 14 - Temple Maze */ - { { 87, 35, 0 }, { 0, 0 }, 1, 0 }, - - /* 15 - Temple Skull */ - { { 76, 0 }, { 0, 0 }, 1, 0 }, - - /* 16 - Johns Theme (Love Story) */ - { { 44, 0 }, { 0, 0 }, 1, 0 }, - - /* 17 - Vmedium */ - { { 28, 0 }, { 0, 0 }, 1, 0 }, - - /* 18 - Vsoft */ - { { 28, 0 }, { 0, 0 }, 1, 0 }, - - /* 19 - Floda Upstairs */ - { { 28, 39, 0 }, { 0, 0 }, 0, 0 }, - - /* 20 - Floda General */ - { { 89, 63, 64, 65, 0 }, { 0, 0 }, 0, 0 }, - - /* 21 - Klunks Room */ - { { 43, 0 }, { 0, 0 }, 1, 0 }, - - /* 22 - Hotel Lola */ - { { 31, 0 }, { 0, 0 }, 1, 0 }, - - /* 23 - Hotel Escape 1 */ - { { 52, 0 }, { 0, 0 }, 1, 0 }, - - /* 24 - Amazon Fortress */ - { { 40, 0 }, { 0, 0 }, 1, 0 }, - - /* 25 - Waterfall Off */ - { {-3, 0 }, { 0, 0 }, 1, 0 }, - - /* 26 - Wave Torch */ - { { 0, 0 }, { 121, 0 }, 2, 0 }, - - /* 27 - Zombies Rez Out */ - { { 0, 0 }, { 20, 0 }, 2, 0 }, - - /* 28 - Open Door (standard) */ - { { 0, 0 }, { 1, 0 }, 2, 0 }, - - /* 29 - Close Door (standard) */ - { { 0, 0 }, { 2, 0 }, 2, 0 }, - - /* 30 - Cloth Unrolls */ - { { 0, 0 }, { 51, 0 }, 2, 0 }, - - /* 31 - Snake Slithers Off */ - { { 0, 0 }, { 122, 0 }, 2, 0 }, - - /* 32 - Hotel Fanfare 2 */ - { { 69, 2000, 0 }, { 0, 0 }, 2, 0 }, - - /* 33 - Floda Secret */ - { { 29, 42, 0 }, { 0, 0 }, 1, 0 }, - - /* 34 - Temple Fanfare 1 */ - { { 70, 2000, 0 }, { 0, 0 }, 2, 0 }, - - /* 35 - Commander Rocket 1 */ - { { 45, 0 }, { 0, 0 }, 2, 0 }, - - /* 36 - Hotel Escape 2 */ - { { 52, 0 }, { 0, 0 }, 1, 0 }, - - /* 37 - Back of Truck */ - { { 51, 48, 33, 54, 52, 0 }, { 0, 0 }, 1, 0 }, - - /* 38 - Hotel Fanfare 1 */ - { { 67, 2000, 0 }, { 0, 0 }, 2, 0 }, - - /* 39 - Truck Fanfare */ - { { 67, 177, 0 }, { 0, 0 }, 2, 0 }, - - /* 40 - Airport */ - { { 81, 0 }, { 0, 0 }, 1, 0 }, - - /* 41 - Plane Leaves */ - { { 68, 1198, 0 }, { 0, 0 }, 2, 0 }, - - /* 42 - Arrive Hotel */ - { { 26, 0 }, { 0, 0 }, 1, 0 }, - - /* 43 - Jungle Fanfare */ - { { 68, 2000, 0 }, { 0, 0 }, 2, 0 }, - - /* 44 - General Fanfare */ - { { 57, 2000, 0 }, { 0, 0 }, 2, 0 }, - - /* 45 - Johns Room */ - { { 90, 0 }, { 0, 0 }, 1, 0 }, - - /* 46 - Floda Lab */ - { { 92, 0 }, { 0, 0 }, 1, 0 }, - - /* 47 - Azura's Theme */ - { { 80, 0 }, { 0, 0 }, 1, 0 }, - - /* 48 - Use Record */ - { { 91, 2000, 0 }, { 0, 0 }, 2, 0 }, - - /* 49 - Franks Theme */ - { { 77, 0 }, { 0, 0 }, 1, 0 }, - - /* 50 - Anderson Doubts */ - { { 75, 0 }, { 0, 0 }, 1, 0 }, - - /* 51 - Bud and Lou Theme */ - { { 94, 1003, 0 }, { 0, 0 }, 1, 0 }, - - /* 52 - Gorilla Theme */ - { { 97, 1003, 0 }, { 0, 0 }, 1, 0 }, - - /* 53 - Missionaries Theme */ - { { 98, 1003, 0 }, { 0, 0 }, 1, 0 }, - - /* 54 - Sloth Theme */ - { { 100, 1003, 0 }, { 0, 0 }, 1, 0 }, - - /* 55 - Amazon Dungeon */ - { { 96, 0 }, { 0, 0 }, 1, 0 }, - - /* 56 - Throne Room */ - { { 78, 0 }, { 0, 0 }, 1, 0 }, - - /* 57 - Temple Puzzle */ - { { 88, 0 }, { 0, 0 }, 1, 0 }, - - /* 58 - Temple Fountain Room */ - { { 55, 0 }, { 0, 0 }, 1, 0 }, - - /* 59 - Light Switch */ - { { 0, 0 }, { 4, 0 }, 2, 0 }, - - /* 60 - Hydraulic Open */ - { { 0, 0 }, { 7, 0 }, 2, 0 }, - - /* 61 - Hydraulic Close */ - { { 0, 0 }, { 8, 0 }, 2, 0 }, - - /* 62 - Close Door (metal) */ - { { 0, 0 }, { 9, 0 }, 2, 0 }, - - /* 63 - Small Hatch Close */ - { { 0, 0 }, { 10, 0 }, 2, 0 }, - - /* 64 - Scissors Snip */ - { { 0, 0 }, { 5, 0 }, 2, 0 }, - - /* 65 - Pick up Sticky */ - { { 0, 0 }, { 6, 0 }, 2, 0 }, - - /* 66 - Oracle Rezzes In */ - { { 0, 0 }, { 11, 0 }, 2, 0 }, - - /* 67 - Sparkle SFX */ - { { 0, 0 }, { 12, 0 }, 2, 0 }, - - /* 68 - Splorch! */ - { { 0, 0 }, { 13, 0 }, 2, 0 }, - - /* 69 - Pour Liquid */ - { { 0, 0 }, { 3, 0 }, 2, 0 }, - - /* 70 - End Credit Medley */ - { { 95, 0 }, { 0, 0 }, 1, 0 }, - - /* 71 - Dino Ray */ - { { 0, 0 }, { 14, 0 }, 2, 0 }, - - /* 72 - Squish! */ - { { 0, 0 }, { 15, 0 }, 2, 0 }, - - /* 73 - Robot Laser */ - { { 0, 0 }, { 16, 0 }, 2, 0 }, - - /* 74 - Thud wood light */ - { { 0, 0 }, { 17, 0 }, 2, 0 }, - - /* 75 - Thud wood deep */ - { { 0, 0 }, { 18, 0 }, 2, 0 }, - - /* 76 - Thud metallic */ - { { 0, 0 }, { 19, 0 }, 2, 0 }, - - /* 77 - Cut Coconut */ - { { 0, 0 }, { 22, 0 }, 2, 0 }, - - /* 78 - Thud Stone */ - { { 0, 0 }, { 23, 0 }, 2, 0 }, - - /* 79 - Cloth Slide 1 */ - { { 0, 0 }, { 24, 0 }, 2, 0 }, - - /* 80 - Open Chest */ - { { 0, 0 }, { 25, 0 }, 2, 0 }, - - /* 81 - Close Chest */ - { { 0, 0 }, { 26, 0 }, 2, 0 }, - - /* 82 - Open Drawer */ - { { 0, 0 }, { 27, 0 }, 2, 0 }, - - /* 83 - Truck door closes */ - { { 0, 0 }, { 28, 0 }, 2, 0 }, - - /* 84 - Truck Starts */ - { { 0, 0 }, { 29, 0 }, 2, 0 }, - - /* 85 - Truck Drives Off */ - { { 0, 0 }, { 30, 0 }, 2, 0 }, - - /* 86 - Fish Splash */ - { { 0, 0 }, { 31, 0 }, 2, 0 }, - - /* 87 - Close Drawer/Push Ladder */ - { { 0, 0 }, { 33, 0 }, 2, 0 }, - - /* 88 - Agression Enhancer */ - { { 0, 0 }, { 32, 0 }, 2, 0 }, - - /* 89 - Stone Door Grind 1 */ - { { 0, 0 }, { 78, 0 }, 2, 0 }, - - /* 90 - Prequel 1 */ - { { 20, 0 }, { 0, 0 }, 1, 0 }, - - /* 91 - Intro Credits */ - { { 21, 0 }, { 0, 0 }, 2, 0 }, - - /* 92 - Valley 1 */ - { { 71, 0 }, { 0, 0 }, 1, 0 }, - - /* 93 - Valley 3 */ - { { 73, 0 }, { 0, 0 }, 1, 0 }, - - /* 94 - Fight Music */ - { { 72, 0 }, { 0, 0 }, 1, 0 }, - - /* 95 - Confrontation 1 */ - { { 93, 0 }, { 0, 0 }, 1, 0 }, - - /* 96 - Confrontation 2 */ - { { 74, 0 }, { 0, 0 }, 1, 0 }, - - /* 97 - Plane Hatch Open */ - { { 0, 0 }, { 35, 0 }, 2, 0 }, - - /* 98 - Plane Hatch Close */ - { { 0, 0 }, { 36, 0 }, 2, 0 }, - - /* 99 - Tie Vines */ - { { 0, 0 }, { 37, 0 }, 2, 0 }, - - /* 100 - Pterodactyl */ - { { 0, 0 }, { 38, 0 }, 2, 0 }, - - /* 101 - Beef Jerky Splash */ - { { 0, 0 }, { 39, 0 }, 2, 0 }, - - /* 102 - Piranha Burp */ - { { 0, 0 }, { 40, 0 }, 2, 0 }, - - /* 103 - Falling Vine */ - { { 0, 0 }, { 41, 0 }, 2, 0 }, - - /* 104 - Stone Door Grind 2 */ - { { 0, 0 }, { 79, 0 }, 2, 0 }, - - /* 105 - Stone Grind (light) */ - { { 0, 0 }, { 82, 0 }, 2, 0 }, - - /* 106 - Ape Takes Off Mask */ - { { 0, 0 }, { 44, 0 }, 2, 0 }, - - /* 107 - Bark Breaks */ - { { 0, 0 }, { 45, 0 }, 2, 0 }, - - /* 108 - Stone Click */ - { { 0, 0 }, { 46, 0 }, 2, 0 }, - - /* 109 - Sproing! */ - { { 0, 0 }, { 42, 0 }, 2, 0 }, - - /* 110 - Cash Register */ - { { 0, 0 }, { 48, 0 }, 2, 0 }, - - /* 111 - Squeaky Toy */ - { { 0, 0 }, { 49, 0 }, 2, 0 }, - - /* 112 - Falling Chains */ - { { 0, 0 }, { 50, 0 }, 2, 0 }, - - /* 113 - Open Locker Door */ - { { 0, 0 }, { 52, 0 }, 2, 0 }, - - /* 114 - Close Locker Door */ - { { 0, 0 }, { 53, 0 }, 2, 0 }, - - /* 115 - Rub Pencil */ - { { 0, 0 }, { 54, 0 }, 2, 0 }, - - /* 116 - Open Safe */ - { { 0, 0 }, { 55, 0 }, 2, 0 }, - - /* 117 - Close Safe */ - { { 0, 0 }, { 56, 0 }, 2, 0 }, - - /* 118 - Push Chair */ - { { 0, 0 }, { 57, 0 }, 2, 0 }, - - /* 119 - Snake Hiss */ - { { 0, 0 }, { 58, 0 }, 2, 0 }, - - /* 120 - Oracle Rezzes Out */ - { { 0, 0 }, { 59, 0 }, 2, 0 }, - - /* 121 - Wall Crumbles */ - { { 0, 0 }, { 60, 0 }, 2, 0 }, - - /* 122 - Crypt Crumbles */ - { { 0, 0 }, { 61, 0 }, 2, 0 }, - - /* 123 - Joe Sucked Up */ - { { 0, 0 }, { 63, 0 }, 2, 0 }, - - /* 124 - Rocket Pack Zoom */ - { { 0, 0 }, { 47, 0 }, 2, 0 }, - - /* 125 - Piranha Splash */ - { { 0, 0 }, { 83, 0 }, 2, 0 }, - - /* 126 - Snap Branch */ - { { 0, 0 }, { 66, 0 }, 2, 0 }, - - /* 127 - Dino Horn */ - { { 0, 0 }, { 67, 0 }, 2, 0 }, - - /* 128 - Tyre Screech */ - { { 0, 0 }, { 68, 0 }, 2, 0 }, - - /* 129 - Oil Splat */ - { { 0, 0 }, { 70, 0 }, 2, 0 }, - - /* 130 - Punch */ - { { 0, 0 }, { 71, 0 }, 2, 0 }, - - /* 131 - Body Hits Ground */ - { { 0, 0 }, { 72, 0 }, 2, 0 }, - - /* 132 - Chicken */ - { { 0, 0 }, { 69, 0 }, 2, 0 }, - - /* 133 - Open Sarcophagus */ - { { 0, 0 }, { 21, 0 }, 2, 0 }, - - /* 134 - Close Sarcophagus */ - { { 0, 0 }, { 21, 0 }, 2, 0 }, - - /* 135 - Creaking Stick */ - { { 0, 0 }, { 62, 0 }, 2, 0 }, - - /* 136 - Pick Hits Stone */ - { { 0, 0 }, { 73, 0 }, 2, 0 }, - - /* 137 - Stalactite Crumbles */ - { { 0, 0 }, { 74, 0 }, 2, 0 }, - - /* 138 - Tic-Toc */ - { { 0, 0 }, { 76, 0 }, 2, 0 }, - - /* 139 - Stone Grind (heavy) */ - { { 0, 0 }, { 81, 0 }, 2, 0 }, - - /* 140 - Explosion */ - { { 0, 0 }, { 77, 0 }, 2, 0 }, - - /* 141 - Cloth Slide 2 */ - { { 0, 0 }, { 84, 0 }, 2, 0 }, - - /* 142 - Temple Laser */ - { { 0, 0 }, { 85, 0 }, 2, 0 }, - - /* 143 - Dino Transformation */ - { { 0, 0 }, { 86, 0 }, 2, 0 }, - - /* 144 - Experimental Laser */ - { { 0, 0 }, { 87, 0 }, 2, 0 }, - - /* 145 - Stone Grind (medium) */ - { { 0, 0 }, { 88, 0 }, 2, 0 }, - - /* 146 - Weeping God Grind */ - { { 0, 0 }, { 89, 0 }, 2, 0 }, - - /* 147 - Alien Hum */ - { { 0, 0 }, { 90, 0 }, 2, 0 }, - - /* 148 - Alien Puzzle */ - { { 0, 0 }, { 91, 0 }, 2, 0 }, - - /* 149 - Vacuum On */ - { { 0, 0 }, { 92, 0 }, 2, 0 }, - - /* 150 - Vacuum Off */ - { { 0, 0 }, { 93, 0 }, 2, 0 }, - - /* 151 - Elevator Starts */ - { { 0, 0 }, { 94, 0 }, 2, 0 }, - - /* 152 - Mummy Crumbles */ - { { 0, 0 }, { 95, 0 }, 2, 0 }, - - /* 153 - Temple Green Circle */ - { { 0, 0 }, { 96, 0 }, 2, 0 }, - - /* 154 - Rattle Bars */ - { { 0, 0 }, { 97, 0 }, 2, 0 }, - - /* 155 - Door Dissolves */ - { { 0, 0 }, { 98, 0 }, 2, 0 }, - - /* 156 - Altar Slides */ - { { 0, 0 }, { 99, 0 }, 2, 0 }, - - /* 157 - Light Torch */ - { { 0, 0 }, { 100, 0 }, 2, 0 }, - - /* 158 - Stamp Sound */ - { { 0, 0 }, { 34, 0 }, 2, 0 }, - - /* 159 - Plaster Loud */ - { { 0, 0 }, { 102, 0 }, 2, 0 }, - - /* 160 - Sparky Bathtub */ - { { 0, 0 }, { 103, 0 }, 2, 0 }, - - /* 161 - Ape Rezzes Out */ - { { 0, 0 }, { 104, 0 }, 2, 0 }, - - /* 162 - Song 159 */ - { { 0, 0 }, { 0, 0 }, 2, 0 }, - - /* 163 - Song 160 */ - { { 0, 0 }, { 0, 0 }, 2, 0 }, - - /* 164 - Song 161 */ - { { 0, 0 }, { 0, 0 }, 2, 0 }, - - /* 165 - Piranhas Swim */ - { { 0, 0 }, { 105, 0 }, 2, 0 }, - - /* 166 - Prison/Dungeon Door */ - { { 0, 0 }, { 43, 0 }, 2, 0 }, - - /* 167 - Fight Explosion */ - { { 0, 0 }, { 80, 0 }, 2, 0 }, - - /* 168 - Press Button */ - { { 0, 0 }, { 65, 0 }, 2, 0 }, - - /* 169 - Pull Lever */ - { { 0, 0 }, { 107, 0 }, 2, 0 }, - - /* 170 - Wrong Code */ - { { 0, 0 }, { 108, 0 }, 2, 0 }, - - /* 171 - Correct Code */ - { { 0, 0 }, { 109, 0 }, 2, 0 }, - - /* 172 - Sizzle */ - { { 0, 0 }, { 110, 0 }, 2, 0 }, - - /* 173 - Money In Slot */ - { { 0, 0 }, { 111, 0 }, 2, 0 }, - - /* 174 - Lightning Crack */ - { { 0, 0 }, { 112, 0 }, 2, 0 }, - - /* 175 - Machine Gun Fire */ - { { 0, 0 }, { 113, 0 }, 2, 0 }, - - /* 176 - Cage Descends */ - { { 0, 0 }, { 114, 0 }, 2, 0 }, - - /* 177 - Chair Activates */ - { { 0, 0 }, { 115, 0 }, 2, 0 }, - - /* 178 - Robot Powers On */ - { { 0, 0 }, { 116, 0 }, 2, 0 }, - - /* 179 - Grow Big */ - { { 0, 0 }, { 117, 0 }, 2, 0 }, - - /* 180 - Eat Food */ - { { 0, 0 }, { 118, 0 }, 2, 0 }, - - /* 181 - Head Shrink */ - { { 0, 0 }, { 119, 0 }, 2, 0 }, - - /* 182 - Grinding Gears */ - { { 0, 0 }, { 120, 0 }, 2, 0 }, - - /* 183 - Chair Splash */ - { { 0, 0 }, { 123, 0 }, 2, 0 }, - - /* 184 - Deflect Laser */ - { { 0, 0 }, { 124, 0 }, 2, 0 }, - - /* 185 - Zap Frank */ - { { 0, 0 }, { 125, 0 }, 2, 0 }, - - /* 186 - Frank Transforms */ - { { 0, 0 }, { 126, 0 }, 2, 0 }, - - /* 187 - Alarm Clock */ - { { 0, 0 }, { 127, 0 }, 2, 0 }, - - /* 188 - Slide Chute */ - { { 0, 0 }, { 64, 0 }, 2, 0 }, - - /* 189 - Puff */ - { { 0, 0 }, { 128, 0 }, 2, 0 }, - - /* 190 - Bite */ - { { 0, 0 }, { 129, 0 }, 2, 0 }, - - /* 191 - Stone Door Grind 2 */ - { { 0, 0 }, { 79, 0 }, 2, 0 }, - - /* 192 - Prequel 2 */ - { { 22, 0 }, { 0, 0 }, 1, 0 }, - - /* 193 - Prequel 3 */ - { { 24, 0 }, { 0, 0 }, 1, 0 }, - - /* 194 - Prequel 4 */ - { { 25, 0 }, { 0, 0 }, 1, 0 }, - - /* 195 - Stop Music */ - { { 1, 0 }, { 0, 0 }, 1, 0 }, - - /* 196 - Plane Flyby */ - { { 0, 0 }, { 101, 0 }, 2, 0 }, - - /* 197 - Commander Rocket 2 */ - { { 46, 0 }, { 0, 0 }, 1, 0 }, - - /* 198 - Commander Rocket 3 */ - { { 47, 0 }, { 0, 0 }, 1, 0 }, - - /* 199 - Rescue */ - { { 99, 0 }, { 0, 0 }, 1, 0 }, - - /* 200 - Slow Fanfare */ - { { 0, 0 }, { 0, 0 }, 1, 0 }, - - /* 201 - Plane Crash */ - { { 93, 0 }, { 0, 0 }, 1, 0 }, - - /* 202 - Plane Engine 1 */ - { { 0, 0 }, { 130, 0 }, 2, 0 }, - - /* 203 - Plane Engine 2 */ - { { 0, 0 }, { 131, 0 }, 2, 0 }, - - /* 204 - Boat In */ - { { 0, 0 }, { 132, 0 }, 2, 0 }, - - /* 205 - Boat Out */ - { { 0, 0 }, { 133, 0 }, 2, 0 }, - - /* 206 - Final Fanfare! */ - { { 21, 95, 21, 0 }, { 0, 0 }, 1, 0 }, - - /* 207 - Frank Destroyed */ - { { 25, 1044, 0 }, { 0, 0 }, 1, 0 }, - - - /* 208 - Jaspar Eats */ - { { 0, 0 }, { 134, 0 }, 2, 0 }, - - /* 209 - Compy Scream 1 */ - { { 0, 0 }, { 135, 0 }, 2, 0 }, - - /* 210 - Compy Scream 2 */ - { { 0, 0 }, { 136, 0 }, 2, 0 }, - - /* 211 - Punch Klunk Fanfare */ - { { 69, 1017, 0 }, { 0, 0 }, 1, 0 }, - - /* 212 - Talk Frank */ - { { 77, 1017, 0 }, { 0, 0 }, 1, 0 } - }; - writeRecord(_tune, sizeof(_tune), GBVARS_MUSICDATATUNE_INDEX , GBVARS_QUEEN); -} - -static void addMusicdata_sfxName() { - const char *_sfxName[] = { - /* 1 - Door Open (standard) */ - "116Bssss", - - /* 2 - Door Close (standard) */ - "105assss", - - /* 3 - Pour Liquid */ - "133sssss", - - /* 4 - Light Switch */ - "27ssssss", - - /* 5 - Scissor Snip */ - "15ssssss", - - /* 6 - Pick up Sticky */ - "79ssssss", - - /* 7 - Hydraulic Doors Open */ - "96ssssss", - - /* 8 - Hydraulic Doors Close */ - "97ssssss", - - /* 9 - Metallic Door Slams */ - "105sssss", - - /* 10 - Small Hatch Close */ - "106sssss", - - /* 11 - Oracle Rezzes In */ - "132sssss", - - /* 12 - Polish Sparkle */ - "132Cssss", - - /* 13 - Splorch! */ - "137Bssss", - - /* 14 - Dino Ray Gun */ - "138sssss", - - /* 15 - Squish! */ - "137Assss", - - /* 16 - Robot Laser */ - "61ssssss", - - /* 17 - Thud wood light */ - "109sssss", - - /* 18 - Thud wood deep */ - "110sssss", - - /* 19 - Thud metallic */ - "111sssss", - - /* 20 - Zombies Rez Out */ - "77ssssss", - - /* 21 - Sarc Door Closes */ - "58ssssss", - - /* 22 - Thud breadboard fruit/Coconut */ - "131Assss", - - /* 23 - Thud stone */ - "75ssssss", - - /* 24 - Cloth Slide 1 */ - "135sssss", - - /* 25 - Open Chest */ - "112sssss", - - /* 26 - Close Chest */ - "121sssss", - - /* 27 - Open Drawer */ - "120sssss", - - /* 28 - Truck door closes */ - "122sssss", - - /* 29 - Truck Starts */ - "123Assss", - - /* 30 - Truck Drives Off */ - "123Bssss", - - /* 31 - Fish Splash */ - "18ssssss", - - /* 32 - Agression Enhancer */ - "138Bssss", - - /* 33 - Close Drawer/Push Ladder */ - "113sssss", - - /* 34 - *Stamp Sound */ - "40ssssss", - - /* 35 - plane hatch open */ - "3sssssss", - - /* 36 - plane hatch close */ - "4sssssss", - - /* 37 - tie vines */ - "11ssssss", - - /* 38 - Pterodactyl */ - "10ssssss", - - /* 39 - Beef Jerky Splash */ - "6sssssss", - - /* 40 - Piranha Burp */ - "7sssssss", - - /* 41 - Falling Vine */ - "13ssssss", - - /* 42 - Sproing! */ - "29ssssss", - - /* 43 - Prison/Dungeon Door */ - "33ssssss", - - /* 44 - Ape takes off mask */ - "24ssssss", - - /* 45 - Bark breaks */ - "25ssssss", - - /* 46 - Stone Click */ - "136sssss", - - /* 47 - Rocket Pack Zoom */ - "1006ssss", - - /* 48 - Cash Register */ - "36ssssss", - - /* 49 - Squeaky Toy */ - "37ssssss", - - /* 50 - Falling Chains */ - "38ssssss", - - /* 51 - Cloth Unravels */ - "64ssssss", - - /* 52 - Open Locker Door */ - "48ssssss", - - /* 53 - Close Locker Door */ - "49ssssss", - - /* 54 - Rub Pencil on Pad */ - "50ssssss", - - /* 55 - Open Safe */ - "51ssssss", - - /* 56 - Close Safe */ - "52ssssss", - - /* 57 - Push Chair */ - "59ssssss", - - /* 58 - Snake Hiss */ - "83ssssss", - - /* 59 - Oracle Rezzes Out */ - "70ssssss", - - /* 60 - Wall Crumbles */ - "73Asssss", - - /* 61 - Crypt Crumbles */ - "76ssssss", - - /* 62 - Creaking Stick */ - "74Asssss", - - /* 63 - Joe Sucked Up */ - "80ssssss", - - /* 64 - Slide Chute */ - "114assss", - - /* 65 - Press Button */ - "1007ssss", - - /* 66 - Snap Branch */ - "101sssss", - - /* 67 - Dino Horn */ - "103sssss", - - /* 68 - Tyre Screech */ - "125sssss", - - /* 69 - Chicken */ - "126sssss", - - /* 70 - Oil Splat */ - "127sssss", - - /* 71 - Punch */ - "128sssss", - - /* 72 - Body Hits Ground */ - "129sssss", - - /* 73 - Pick Hits Stone */ - "71ssssss", - - /* 74 - Stalactite Crumbles */ - "119sssss", - - /* 75 - *Drip */ - "93ssssss", - - /* 76 - Tic-Toc */ - "42Bsssss", - - /* 77 - Explosion */ - "88ssssss", - - /* 78 - Stone Door Grind 1 */ - "1001ssss", - - /* 79 - Stone Door Grind 2 */ - "1002ssss", - - /* 80 - *Fight Explosion */ - "1000ssss", - - /* 81 - Stone Grind (heavy) */ - "1003ssss", - - /* 82 - Stone Grind (light) */ - "89ssssss", - - /* 83 - Piranha Splash */ - "5sssssss", - - /* 84 - Cloth Slide 2 */ - "1005ssss", - - /* 85 - Temple Laser */ - "87ssssss", - - /* 86 - Dino Transformation */ - "55Bsssss", - - /* 87 - Experimental Laser */ - "55ssssss", - - /* 88 - Stone Grind (medium) */ - "134sssss", - - /* 89 - Weeping God Grind */ - "94ssssss", - - /* 90 - Alien Hum */ - "95ssssss", - - /* 91 - Alien Puzzle */ - "103Assss", - - /* 92 - Vacuum On */ - "21ssssss", - - /* 93 - Vacuum Off */ - "21Csssss", - - /* 94 - Elevator Starts */ - "44ssssss", - - /* 95 - Mummy Crumbles */ - "68ssssss", - - /* 96 - Temple Green Circle */ - "60Bsssss", - - /* 97 - Rattle Bars */ - "115sssss", - - /* 98 - Door Dissolves */ - "56ssssss", - - /* 99 - Altar Slides */ - "85ssssss", - - /* 100 - Light Torch */ - "81ssssss", - - /* 101 - Plane Flyby */ - "1027ssss", - - /* 102 - Plaster Loud */ - "41Bsssss", - - /* 103 - Sparky Bathtub */ - "73ssssss", - - /* 104 - Ape Rezzes Out */ - "14ssssss", - - /* 105 - Piranhas Swim */ - "17ssssss", - - /* 106 - *Gun Shot */ - "1004ssss", - - /* 107 - Pull Lever */ - "1008ssss", - - /* 108 - Wrong Code */ - "1009ssss", - - /* 109 - Correct Code */ - "1010ssss", - - /* 110 - Sizzle */ - "1011ssss", - - /* 111 - Money In Slot */ - "1012ssss", - - /* 112 - Lightning */ - "1013ssss", - - /* 113 - Machine Gun Fire */ - "1014ssss", - - /* 114 - Cage Descends */ - "1015ssss", - - /* 115 - Temple Chair Activates */ - "1016ssss", - - /* 116 - Robot Powers On */ - "1017ssss", - - /* 117 - Grow Big */ - "1018ssss", - - /* 118 - Eat Food */ - "1019ssss", - - /* 119 - Head Shrink */ - "1020ssss", - - /* 120 - Grinding Gears */ - "84ssssss", - - /* 121 - Wave Torch */ - "1021ssss", - - /* 122 - Snake Slithers Off */ - "1022ssss", - - /* 123 - Chair Splash */ - "26ssssss", - - /* 124 - Deflect Laser */ - "60ssssss", - - /* 125 - Zap Frank */ - "1023ssss", - - /* 126 - Frank Transforms */ - "1024ssss", - - /* 127 - Alarm Clock */ - "1025ssss", - - /* 128 - Puff */ - "35ssssss", - - /* 129 - Bite */ - "1026ssss", - - /* 130 - Plane Engine 1 */ - "1028ssss", - - /* 131 - Plane Engine 2 */ - "1029ssss", - - /* 132 - Boat In */ - "1030ssss", - - /* 133 - Boat Out */ - "1031ssss", - - /* 134 - Jaspar Eats */ - "1032ssss", - - /* 135 - Compy Scream 1 */ - "1033ssss", - - /* 136 - Compy Scream 2 */ - "1034ssss" - }; - - const char *first = _sfxName[0]; - const char *last = _sfxName[135]; - - UInt32 size = ((last - first) + 10); - - writeRecord((void *)first, size, GBVARS_MUSICDATASFXNAME_INDEX , GBVARS_QUEEN); -} - -static void addMusicdata_jungleList() { - int16 _jungleList[] = { 15, 16, 17, 18, 7, 8, 9, 10, 11, 12, 13, 14, 0 }; - - writeRecord(_jungleList, sizeof(_jungleList), GBVARS_MUSICDATAJUNGLELIST_INDEX , GBVARS_QUEEN); -} - -void Queen_addMusicdata() { - - addMusicdata_songDemo(); - addMusicdata_song(); - addMusicdata_tuneDemo(); - addMusicdata_tune(); - addMusicdata_sfxName(); - addMusicdata_jungleList(); -} diff --git a/backends/platform/PalmOS/Src/builder/queen/bq_restables.c b/backends/platform/PalmOS/Src/builder/queen/bq_restables.c deleted file mode 100644 index 29fd7fb370..0000000000 --- a/backends/platform/PalmOS/Src/builder/queen/bq_restables.c +++ /dev/null @@ -1,1096 +0,0 @@ -#include <PalmOS.h> -#include "b_globals.h" - -typedef struct { - char filename[13]; - UInt8 inBundle; - UInt32 offset; - UInt32 size; -} ResourceEntry; - -static void addRestables_resourceTablePEM10() { - ResourceEntry _resourceTablePEM10[] = { - { "1000SSSS.SB", 1, 0x00000000, 0x000027fe }, - { "1001SSSS.SB", 1, 0x000027fe, 0x00007af8 }, - { "1002SSSS.SB", 1, 0x0000a2f6, 0x000049e2 }, - { "1003SSSS.SB", 1, 0x0000ecd8, 0x00001d42 }, - { "1004SSSS.SB", 1, 0x00010a1a, 0x00001a1c }, - { "1005SSSS.SB", 1, 0x00012436, 0x00001a8a }, - { "1006SSSS.SB", 1, 0x00013ec0, 0x00009d41 }, - { "1007SSSS.SB", 1, 0x0001dc01, 0x00001372 }, - { "1008SSSS.SB", 1, 0x0001ef73, 0x00002e4a }, - { "1009SSSS.SB", 1, 0x00021dbd, 0x0000220c }, - { "1010SSSS.SB", 1, 0x00023fc9, 0x00003b1e }, - { "1011SSSS.SB", 1, 0x00027ae7, 0x00000dd8 }, - { "1012SSSS.SB", 1, 0x000288bf, 0x0000444c }, - { "1013SSSS.SB", 1, 0x0002cd0b, 0x00007e66 }, - { "1014SSSS.SB", 1, 0x00034b71, 0x00006e14 }, - { "1015SSSS.SB", 1, 0x0003b985, 0x0000760c }, - { "1016SSSS.SB", 1, 0x00042f91, 0x00004f8b }, - { "1017SSSS.SB", 1, 0x00047f1c, 0x00004848 }, - { "1018SSSS.SB", 1, 0x0004c764, 0x00007e94 }, - { "1019SSSS.SB", 1, 0x000545f8, 0x00003a70 }, - { "101SSSSS.SB", 1, 0x00058068, 0x0000191a }, - { "1020SSSS.SB", 1, 0x00059982, 0x00004d90 }, - { "1021SSSS.SB", 1, 0x0005e712, 0x00003dcc }, - { "1023SSSS.SB", 1, 0x000624de, 0x00003d7f }, - { "1024SSSS.SB", 1, 0x0006625d, 0x00004f8a }, - { "1025SSSS.SB", 1, 0x0006b1e7, 0x00006488 }, - { "1026SSSS.SB", 1, 0x0007166f, 0x00002022 }, - { "1027SSSS.SB", 1, 0x00073691, 0x00009e76 }, - { "1028SSSS.SB", 1, 0x0007d507, 0x0001b37c }, - { "1029SSSS.SB", 1, 0x00098883, 0x0000ce2c }, - { "1030SSSS.SB", 1, 0x000a56af, 0x0001e6e4 }, - { "1031SSSS.SB", 1, 0x000c3d93, 0x00011532 }, - { "1032SSSS.SB", 1, 0x000d52c5, 0x000034d4 }, - { "1033SSSS.SB", 1, 0x000d8799, 0x00002de6 }, - { "1034SSSS.SB", 1, 0x000db57f, 0x000099a1 }, - { "103ASSSS.SB", 1, 0x000e4f20, 0x00005040 }, - { "103SSSSS.SB", 1, 0x000e9f60, 0x00006a94 }, - { "105ASSSS.SB", 1, 0x000f09f4, 0x00001d04 }, - { "105SSSSS.SB", 1, 0x000f26f8, 0x000024de }, - { "106SSSSS.SB", 1, 0x000f4bd6, 0x00000ac4 }, - { "109SSSSS.SB", 1, 0x000f569a, 0x00000d96 }, - { "10SSSSSS.SB", 1, 0x000f6430, 0x000013f6 }, - { "110SSSSS.SB", 1, 0x000f7826, 0x00000c96 }, - { "111SSSSS.SB", 1, 0x000f84bc, 0x00000f72 }, - { "112SSSSS.SB", 1, 0x000f942e, 0x00000f1a }, - { "113SSSSS.SB", 1, 0x000fa348, 0x00003f5e }, - { "114ASSSS.SB", 1, 0x000fe2a6, 0x00001e54 }, - { "115SSSSS.SB", 1, 0x001000fa, 0x00002580 }, - { "116BSSSS.SB", 1, 0x0010267a, 0x00002350 }, - { "119SSSSS.SB", 1, 0x001049ca, 0x00003808 }, - { "11SSSSSS.SB", 1, 0x001081d2, 0x0000157e }, - { "120SSSSS.SB", 1, 0x00109750, 0x00002be4 }, - { "121SSSSS.SB", 1, 0x0010c334, 0x00001340 }, - { "122SSSSS.SB", 1, 0x0010d674, 0x0000173e }, - { "123ASSSS.SB", 1, 0x0010edb2, 0x00009e9d }, - { "123BSSSS.SB", 1, 0x00118c4f, 0x0000f613 }, - { "125SSSSS.SB", 1, 0x00128262, 0x0000e628 }, - { "126SSSSS.SB", 1, 0x0013688a, 0x0000372e }, - { "127SSSSS.SB", 1, 0x00139fb8, 0x0000ff1e }, - { "128SSSSS.SB", 1, 0x00149ed6, 0x00000e34 }, - { "129SSSSS.SB", 1, 0x0014ad0a, 0x00000b02 }, - { "130SSSSS.SB", 1, 0x0014b80c, 0x00000a10 }, - { "131ASSSS.SB", 1, 0x0014c21c, 0x000022d4 }, - { "132CSSSS.SB", 1, 0x0014e4f0, 0x000094c3 }, - { "132SSSSS.SB", 1, 0x001579b3, 0x00006183 }, - { "133SSSSS.SB", 1, 0x0015db36, 0x00006a13 }, - { "134SSSSS.SB", 1, 0x00164549, 0x00004ea3 }, - { "135SSSSS.SB", 1, 0x001693ec, 0x000017c8 }, - { "136SSSSS.SB", 1, 0x0016abb4, 0x000004a0 }, - { "137ASSSS.SB", 1, 0x0016b054, 0x00001826 }, - { "137BSSSS.SB", 1, 0x0016c87a, 0x00001d46 }, - { "138BSSSS.SB", 1, 0x0016e5c0, 0x000065f9 }, - { "138SSSSS.SB", 1, 0x00174bb9, 0x000053c3 }, - { "13SSSSSS.SB", 1, 0x00179f7c, 0x00001f32 }, - { "14SSSSSS.SB", 1, 0x0017beae, 0x00004921 }, - { "15SSSSSS.SB", 1, 0x001807cf, 0x000007aa }, - { "17SSSSSS.SB", 1, 0x00180f79, 0x00005080 }, - { "18SSSSSS.SB", 1, 0x00185ff9, 0x000015e2 }, - { "21CSSSSS.SB", 1, 0x001875db, 0x000048ec }, - { "21SSSSSS.SB", 1, 0x0018bec7, 0x0000bb40 }, - { "24SSSSSS.SB", 1, 0x00197a07, 0x000023fc }, - { "25SSSSSS.SB", 1, 0x00199e03, 0x000016d8 }, - { "26SSSSSS.SB", 1, 0x0019b4db, 0x000049dd }, - { "27SSSSSS.SB", 1, 0x0019feb8, 0x000010a0 }, - { "29SSSSSS.SB", 1, 0x001a0f58, 0x00004e50 }, - { "33SSSSSS.SB", 1, 0x001a5da8, 0x00005218 }, - { "35SSSSSS.SB", 1, 0x001aafc0, 0x00002c6c }, - { "36SSSSSS.SB", 1, 0x001adc2c, 0x000031d2 }, - { "37SSSSSS.SB", 1, 0x001b0dfe, 0x0000197a }, - { "38SSSSSS.SB", 1, 0x001b2778, 0x00002162 }, - { "3SSSSSSS.SB", 1, 0x001b48da, 0x00000d04 }, - { "40SSSSSS.SB", 1, 0x001b55de, 0x00000268 }, - { "41BSSSSS.SB", 1, 0x001b5846, 0x000005fe }, - { "42BSSSSS.SB", 1, 0x001b5e44, 0x00000308 }, - { "44SSSSSS.SB", 1, 0x001b614c, 0x000052c0 }, - { "48SSSSSS.SB", 1, 0x001bb40c, 0x000010a8 }, - { "49SSSSSS.SB", 1, 0x001bc4b4, 0x00001dd4 }, - { "4SSSSSSS.SB", 1, 0x001be288, 0x000009d2 }, - { "50SSSSSS.SB", 1, 0x001bec5a, 0x00003f8a }, - { "51SSSSSS.SB", 1, 0x001c2be4, 0x000015da }, - { "52SSSSSS.SB", 1, 0x001c41be, 0x0000125a }, - { "55BSSSSS.SB", 1, 0x001c5418, 0x00003d7f }, - { "55SSSSSS.SB", 1, 0x001c9197, 0x00004508 }, - { "56SSSSSS.SB", 1, 0x001cd69f, 0x0000520b }, - { "58SSSSSS.SB", 1, 0x001d28aa, 0x00003399 }, - { "59SSSSSS.SB", 1, 0x001d5c43, 0x000032b8 }, - { "5SSSSSSS.SB", 1, 0x001d8efb, 0x00004ae9 }, - { "60BSSSSS.SB", 1, 0x001dd9e4, 0x000050f2 }, - { "60SSSSSS.SB", 1, 0x001e2ad6, 0x00003c57 }, - { "61SSSSSS.SB", 1, 0x001e672d, 0x0000513d }, - { "64SSSSSS.SB", 1, 0x001eb86a, 0x00005a98 }, - { "68SSSSSS.SB", 1, 0x001f1302, 0x00003e85 }, - { "6SSSSSSS.SB", 1, 0x001f5187, 0x00001650 }, - { "70SSSSSS.SB", 1, 0x001f67d7, 0x00009645 }, - { "71SSSSSS.SB", 1, 0x001ffe1c, 0x00000fa3 }, - { "73ASSSSS.SB", 1, 0x00200dbf, 0x00008812 }, - { "73SSSSSS.SB", 1, 0x002095d1, 0x00006706 }, - { "74ASSSSS.SB", 1, 0x0020fcd7, 0x000029b2 }, - { "75SSSSSS.SB", 1, 0x00212689, 0x00000920 }, - { "76SSSSSS.SB", 1, 0x00212fa9, 0x00004ef8 }, - { "77SSSSSS.SB", 1, 0x00217ea1, 0x00003358 }, - { "79SSSSSS.SB", 1, 0x0021b1f9, 0x000016a8 }, - { "7SSSSSSS.SB", 1, 0x0021c8a1, 0x000010d4 }, - { "80SSSSSS.SB", 1, 0x0021d975, 0x0000441e }, - { "81SSSSSS.SB", 1, 0x00221d93, 0x0000517f }, - { "83SSSSSS.SB", 1, 0x00226f12, 0x000043e3 }, - { "84SSSSSS.SB", 1, 0x0022b2f5, 0x00003baa }, - { "85SSSSSS.SB", 1, 0x0022ee9f, 0x00004470 }, - { "87SSSSSS.SB", 1, 0x0023330f, 0x00005113 }, - { "88SSSSSS.SB", 1, 0x00238422, 0x00005275 }, - { "89SSSSSS.SB", 1, 0x0023d697, 0x00001a69 }, - { "93SSSSSS.SB", 1, 0x0023f100, 0x00000470 }, - { "94SSSSSS.SB", 1, 0x0023f570, 0x000051e4 }, - { "95SSSSSS.SB", 1, 0x00244754, 0x0000343b }, - { "96SSSSSS.SB", 1, 0x00247b8f, 0x00005110 }, - { "97SSSSSS.SB", 1, 0x0024cc9f, 0x00004972 }, - { "AMAZON.ACT", 1, 0x00251611, 0x0000a97a }, - { "AND1.DOG", 1, 0x0025bf8b, 0x000009ca }, - { "ANDERSON.ACT", 1, 0x0025c955, 0x00007c0a }, - { "ANDSON2.ACT", 1, 0x0026455f, 0x00007c0a }, - { "ANDSON_E.ACT", 1, 0x0026c169, 0x00003c42 }, - { "APE.ACT", 1, 0x0026fdab, 0x000084cd }, - { "APE.DOG", 1, 0x00278278, 0x000011d4 }, - { "APE2.DOG", 1, 0x0027944c, 0x000008da }, - { "APE3.DOG", 1, 0x00279d26, 0x00000788 }, - { "AQ.RL", 1, 0x0027a4ae, 0x00063f3a }, - { "AQ8.RL", 1, 0x002de3e8, 0x000167f8 }, - { "AQB2.MUS", 1, 0x002f4be0, 0x00039972 }, - { "AQBANK.MUS", 1, 0x0032e552, 0x0004fe89 }, - { "AQBANK.RL", 1, 0x0037e3db, 0x000059e9 }, - { "AZURA_E.ACT", 1, 0x00383dc4, 0x0000425a }, - { "AZURA_H.ACT", 1, 0x0038801e, 0x00008a7a }, - { "AZURA_H.BBK", 1, 0x00390a98, 0x0001a712 }, - { "AZURA_H.PCX", 1, 0x003ab1aa, 0x0000accb }, - { "B1.BBK", 1, 0x003b5e75, 0x000051fb }, - { "B1.LUM", 1, 0x003bb070, 0x00000018 }, - { "B1.MSK", 1, 0x003bb088, 0x00001f40 }, - { "B1.PCX", 1, 0x003bcfc8, 0x000162a8 }, - { "B2.BBK", 1, 0x003d3270, 0x000034b1 }, - { "B2.LUM", 1, 0x003d6721, 0x00000018 }, - { "B2.MSK", 1, 0x003d6739, 0x00001f40 }, - { "B2.PCX", 1, 0x003d8679, 0x0000a521 }, - { "BAT.SAM", 1, 0x003e2b9a, 0x00009d9a }, - { "BEETLE.ACT", 1, 0x003ec934, 0x00001e42 }, - { "BIGAM.ACT", 1, 0x003ee776, 0x00002d12 }, - { "BLANK000.SB", 1, 0x003f1488, 0x00000076 }, - { "BLUEP.CUT", 1, 0x003f14fe, 0x00000148 }, - { "BOB1.DOG", 1, 0x003f1646, 0x000010bc }, - { "BOB2.DOG", 1, 0x003f2702, 0x00000e5a }, - { "BOB3.DOG", 1, 0x003f355c, 0x00000df8 }, - { "BOB4.DOG", 1, 0x003f4354, 0x00000dea }, - { "BOB5.DOG", 1, 0x003f513e, 0x00000bf0 }, - { "BUD.ACT", 1, 0x003f5d2e, 0x00006582 }, - { "BUD1.DOG", 1, 0x003fc2b0, 0x0000129c }, - { "BUD2.DOG", 1, 0x003fd54c, 0x00000c0e }, - { "C1.BBK", 1, 0x003fe15a, 0x000026fd }, - { "C1.LUM", 1, 0x00400857, 0x00000018 }, - { "C1.MSK", 1, 0x0040086f, 0x00001f40 }, - { "C1.PCX", 1, 0x004027af, 0x00004888 }, - { "C10.BBK", 1, 0x00407037, 0x0003949f }, - { "C10.PCX", 1, 0x004404d6, 0x0000e6fd }, - { "C100A.CUT", 1, 0x0044ebd3, 0x000003be }, - { "C100B.CUT", 1, 0x0044ef91, 0x00000346 }, - { "C100C.CUT", 1, 0x0044f2d7, 0x0000019a }, - { "C100D.CUT", 1, 0x0044f471, 0x00000774 }, - { "C101A.CUT", 1, 0x0044fbe5, 0x0000021a }, - { "C101B.CUT", 1, 0x0044fdff, 0x000000e6 }, - { "C101C.CUT", 1, 0x0044fee5, 0x00000200 }, - { "C101D.CUT", 1, 0x004500e5, 0x00000144 }, - { "C101E.CUT", 1, 0x00450229, 0x00000144 }, - { "C102A.CUT", 1, 0x0045036d, 0x0000040e }, - { "C102B.CUT", 1, 0x0045077b, 0x0000040e }, - { "C102C.CUT", 1, 0x00450b89, 0x0000047e }, - { "C102D.CUT", 1, 0x00451007, 0x000003b8 }, - { "C102E.CUT", 1, 0x004513bf, 0x0000037e }, - { "C103A.CUT", 1, 0x0045173d, 0x000000b4 }, - { "C103B.CUT", 1, 0x004517f1, 0x00000104 }, - { "C103C.CUT", 1, 0x004518f5, 0x00000090 }, - { "C103D.CUT", 1, 0x00451985, 0x00000070 }, - { "C103E.CUT", 1, 0x004519f5, 0x000000da }, - { "C103F.CUT", 1, 0x00451acf, 0x0000084a }, - { "C103G.CUT", 1, 0x00452319, 0x0000068e }, - { "C103H.CUT", 1, 0x004529a7, 0x000003be }, - { "C103I.CUT", 1, 0x00452d65, 0x000001f2 }, - { "C103J.CUT", 1, 0x00452f57, 0x0000041c }, - { "C103K.CUT", 1, 0x00453373, 0x0000016a }, - { "C103L.CUT", 1, 0x004534dd, 0x00000458 }, - { "C11.BBK", 1, 0x00453935, 0x0000bf94 }, - { "C11.PCX", 1, 0x0045f8c9, 0x0000c01a }, - { "C11A.CUT", 1, 0x0046b8e3, 0x00000346 }, - { "C12A.CUT", 1, 0x0046bc29, 0x000004d0 }, - { "C13A.CUT", 1, 0x0046c0f9, 0x00000164 }, - { "C13B.CUT", 1, 0x0046c25d, 0x0000016c }, - { "C13C.CUT", 1, 0x0046c3c9, 0x000001fa }, - { "C13D.CUT", 1, 0x0046c5c3, 0x00000174 }, - { "C13E.CUT", 1, 0x0046c737, 0x000001d0 }, - { "C13F.CUT", 1, 0x0046c907, 0x000002d6 }, - { "C13G.CUT", 1, 0x0046cbdd, 0x00000152 }, - { "C13H.CUT", 1, 0x0046cd2f, 0x00000116 }, - { "C13I.CUT", 1, 0x0046ce45, 0x00000080 }, - { "C13J.CUT", 1, 0x0046cec5, 0x00000272 }, - { "C13K.CUT", 1, 0x0046d137, 0x00000192 }, - { "C13L.CUT", 1, 0x0046d2c9, 0x000001dc }, - { "C13M.CUT", 1, 0x0046d4a5, 0x00000468 }, - { "C13N.CUT", 1, 0x0046d90d, 0x0000015e }, - { "C14A.CUT", 1, 0x0046da6b, 0x000002fe }, - { "C14B.CUT", 1, 0x0046dd69, 0x00000126 }, - { "C14C.CUT", 1, 0x0046de8f, 0x00000150 }, - { "C14D.CUT", 1, 0x0046dfdf, 0x00000108 }, - { "C15A.CUT", 1, 0x0046e0e7, 0x00000264 }, - { "C15B.CUT", 1, 0x0046e34b, 0x00000136 }, - { "C15C.CUT", 1, 0x0046e481, 0x00000380 }, - { "C15D.CUT", 1, 0x0046e801, 0x000002d2 }, - { "C15E.CUT", 1, 0x0046ead3, 0x000000f4 }, - { "C16A.CUT", 1, 0x0046ebc7, 0x000005d6 }, - { "C16B.CUT", 1, 0x0046f19d, 0x0000057e }, - { "C17A.CUT", 1, 0x0046f71b, 0x00000156 }, - { "C18A.CUT", 1, 0x0046f871, 0x00000a60 }, - { "C18B.CUT", 1, 0x004702d1, 0x000012b8 }, - { "C18C.CUT", 1, 0x00471589, 0x00001202 }, - { "C18D.CUT", 1, 0x0047278b, 0x000009fa }, - { "C18E.CUT", 1, 0x00473185, 0x000009e4 }, - { "C19A.CUT", 1, 0x00473b69, 0x00001076 }, - { "C19B.CUT", 1, 0x00474bdf, 0x0000015c }, - { "C1A.CUT", 1, 0x00474d3b, 0x0000034e }, - { "C2.BBK", 1, 0x00475089, 0x00005908 }, - { "C2.LUM", 1, 0x0047a991, 0x00000018 }, - { "C2.MSK", 1, 0x0047a9a9, 0x00001f40 }, - { "C2.PCX", 1, 0x0047c8e9, 0x00007f3a }, - { "C2.SAM", 1, 0x00484823, 0x000147ac }, - { "C20A.CUT", 1, 0x00498fcf, 0x00000500 }, - { "C20B.CUT", 1, 0x004994cf, 0x00000168 }, - { "C20C.CUT", 1, 0x00499637, 0x00000170 }, - { "C20D.CUT", 1, 0x004997a7, 0x00000388 }, - { "C20E.CUT", 1, 0x00499b2f, 0x00000394 }, - { "C20F.CUT", 1, 0x00499ec3, 0x0000073a }, - { "C20G.CUT", 1, 0x0049a5fd, 0x0000029c }, - { "C21A.CUT", 1, 0x0049a899, 0x000000da }, - { "C21B.CUT", 1, 0x0049a973, 0x000000ee }, - { "C21C.CUT", 1, 0x0049aa61, 0x0000025e }, - { "C21D.CUT", 1, 0x0049acbf, 0x000002ec }, - { "C21E.CUT", 1, 0x0049afab, 0x00000602 }, - { "C21F.CUT", 1, 0x0049b5ad, 0x000003e2 }, - { "C21G.CUT", 1, 0x0049b98f, 0x00000136 }, - { "C21H.CUT", 1, 0x0049bac5, 0x00000172 }, - { "C21I.CUT", 1, 0x0049bc37, 0x0000024c }, - { "C21J.CUT", 1, 0x0049be83, 0x00000122 }, - { "C21K.CUT", 1, 0x0049bfa5, 0x00000584 }, - { "C21L.CUT", 1, 0x0049c529, 0x00000522 }, - { "C21M.CUT", 1, 0x0049ca4b, 0x000001ea }, - { "C21N.CUT", 1, 0x0049cc35, 0x00000610 }, - { "C21O.CUT", 1, 0x0049d245, 0x000000f4 }, - { "C21P.CUT", 1, 0x0049d339, 0x00000150 }, - { "C21Q.CUT", 1, 0x0049d489, 0x000002ec }, - { "C21R.CUT", 1, 0x0049d775, 0x00000106 }, - { "C21S.CUT", 1, 0x0049d87b, 0x0000012a }, - { "C21T.CUT", 1, 0x0049d9a5, 0x0000015e }, - { "C21U.CUT", 1, 0x0049db03, 0x000000c6 }, - { "C22A.CUT", 1, 0x0049dbc9, 0x00000156 }, - { "C22B.CUT", 1, 0x0049dd1f, 0x000000fc }, - { "C22C.CUT", 1, 0x0049de1b, 0x00000166 }, - { "C24A.CUT", 1, 0x0049df81, 0x000000ec }, - { "C24B.CUT", 1, 0x0049e06d, 0x000005ca }, - { "C25A.CUT", 1, 0x0049e637, 0x000002d0 }, - { "C25B.CUT", 1, 0x0049e907, 0x000002e4 }, - { "C25C.CUT", 1, 0x0049ebeb, 0x0000023e }, - { "C25D.CUT", 1, 0x0049ee29, 0x00000182 }, - { "C25E.CUT", 1, 0x0049efab, 0x00000126 }, - { "C25F.CUT", 1, 0x0049f0d1, 0x0000017c }, - { "C25G.CUT", 1, 0x0049f24d, 0x000001e2 }, - { "C25H.CUT", 1, 0x0049f42f, 0x00000218 }, - { "C25I.CUT", 1, 0x0049f647, 0x000001da }, - { "C26A.CUT", 1, 0x0049f821, 0x0000030e }, - { "C26B.CUT", 1, 0x0049fb2f, 0x000000be }, - { "C26C.CUT", 1, 0x0049fbed, 0x000001a4 }, - { "C2A.CUT", 1, 0x0049fd91, 0x000008d0 }, - { "C2B.CUT", 1, 0x004a0661, 0x000004b8 }, - { "C2C.CUT", 1, 0x004a0b19, 0x0000023e }, - { "C3.BBK", 1, 0x004a0d57, 0x00006875 }, - { "C3.LUM", 1, 0x004a75cc, 0x00000018 }, - { "C3.MSK", 1, 0x004a75e4, 0x00001f40 }, - { "C3.PCX", 1, 0x004a9524, 0x0000c40c }, - { "C3.SAM", 1, 0x004b5930, 0x00011c72 }, - { "C30A.CUT", 1, 0x004c75a2, 0x00000254 }, - { "C30B.CUT", 1, 0x004c77f6, 0x000003c4 }, - { "C30C.CUT", 1, 0x004c7bba, 0x00000722 }, - { "C30D.CUT", 1, 0x004c82dc, 0x00000206 }, - { "C30E.CUT", 1, 0x004c84e2, 0x00000976 }, - { "C30F.CUT", 1, 0x004c8e58, 0x0000010e }, - { "C30G.CUT", 1, 0x004c8f66, 0x000001e6 }, - { "C30H.CUT", 1, 0x004c914c, 0x0000014c }, - { "C31A.CUT", 1, 0x004c9298, 0x0000020c }, - { "C31B.CUT", 1, 0x004c94a4, 0x00000596 }, - { "C31C.CUT", 1, 0x004c9a3a, 0x000000e2 }, - { "C31D.CUT", 1, 0x004c9b1c, 0x000004e4 }, - { "C31E.CUT", 1, 0x004ca000, 0x000000ee }, - { "C31F.CUT", 1, 0x004ca0ee, 0x0000010e }, - { "C32A.CUT", 1, 0x004ca1fc, 0x000000ac }, - { "C32B.CUT", 1, 0x004ca2a8, 0x0000010c }, - { "C32C.CUT", 1, 0x004ca3b4, 0x000000e8 }, - { "C35A.CUT", 1, 0x004ca49c, 0x0000042a }, - { "C35B.CUT", 1, 0x004ca8c6, 0x000001c0 }, - { "C36A.CUT", 1, 0x004caa86, 0x0000078c }, - { "C39A.CUT", 1, 0x004cb212, 0x00000ed4 }, - { "C3A.CUT", 1, 0x004cc0e6, 0x00000610 }, - { "C3B.CUT", 1, 0x004cc6f6, 0x000000a0 }, - { "C3C.CUT", 1, 0x004cc796, 0x000005d8 }, - { "C3D.CUT", 1, 0x004ccd6e, 0x00000344 }, - { "C3E.CUT", 1, 0x004cd0b2, 0x0000013a }, - { "C3F.CUT", 1, 0x004cd1ec, 0x000000e0 }, - { "C3G.CUT", 1, 0x004cd2cc, 0x00000102 }, - { "C3H.CUT", 1, 0x004cd3ce, 0x00000120 }, - { "C4.BBK", 1, 0x004cd4ee, 0x00009420 }, - { "C4.LUM", 1, 0x004d690e, 0x00000018 }, - { "C4.MSK", 1, 0x004d6926, 0x00001f40 }, - { "C4.PCX", 1, 0x004d8866, 0x00009487 }, - { "C4.SAM", 1, 0x004e1ced, 0x00002754 }, - { "C40A.CUT", 1, 0x004e4441, 0x0000094a }, - { "C40B.CUT", 1, 0x004e4d8b, 0x000002c2 }, - { "C41A.CUT", 1, 0x004e504d, 0x00000b84 }, - { "C41B.CUT", 1, 0x004e5bd1, 0x00001ba0 }, - { "C41C.CUT", 1, 0x004e7771, 0x00000170 }, - { "C41D.CUT", 1, 0x004e78e1, 0x0000025c }, - { "C41E.CUT", 1, 0x004e7b3d, 0x000001b8 }, - { "C41F.CUT", 1, 0x004e7cf5, 0x0000009c }, - { "C41G.CUT", 1, 0x004e7d91, 0x000000fe }, - { "C41H.CUT", 1, 0x004e7e8f, 0x000000ba }, - { "C42A.CUT", 1, 0x004e7f49, 0x000003ce }, - { "C42B.CUT", 1, 0x004e8317, 0x00000802 }, - { "C42C.CUT", 1, 0x004e8b19, 0x000001ae }, - { "C42D.CUT", 1, 0x004e8cc7, 0x0000010e }, - { "C42E.CUT", 1, 0x004e8dd5, 0x00000106 }, - { "C42F.CUT", 1, 0x004e8edb, 0x00000166 }, - { "C44A.CUT", 1, 0x004e9041, 0x000004f8 }, - { "C44B.CUT", 1, 0x004e9539, 0x0000079e }, - { "C44C.CUT", 1, 0x004e9cd7, 0x0000030a }, - { "C45A.CUT", 1, 0x004e9fe1, 0x000000f8 }, - { "C45B.CUT", 1, 0x004ea0d9, 0x000000f8 }, - { "C45C.CUT", 1, 0x004ea1d1, 0x000000f8 }, - { "C45D.CUT", 1, 0x004ea2c9, 0x000000f8 }, - { "C45E.CUT", 1, 0x004ea3c1, 0x00000186 }, - { "C46A.CUT", 1, 0x004ea547, 0x000000f8 }, - { "C46B.CUT", 1, 0x004ea63f, 0x000000f8 }, - { "C46C.CUT", 1, 0x004ea737, 0x000000f8 }, - { "C46D.CUT", 1, 0x004ea82f, 0x000000f8 }, - { "C47A.CUT", 1, 0x004ea927, 0x00000640 }, - { "C48A.CUT", 1, 0x004eaf67, 0x00000656 }, - { "C48C.CUT", 1, 0x004eb5bd, 0x00000516 }, - { "C49B.CUT", 1, 0x004ebad3, 0x00000398 }, - { "C49C.CUT", 1, 0x004ebe6b, 0x00000132 }, - { "C49D.CUT", 1, 0x004ebf9d, 0x000004e4 }, - { "C4A.CUT", 1, 0x004ec481, 0x00000094 }, - { "C4B.CUT", 1, 0x004ec515, 0x000003f4 }, - { "C5.BBK", 1, 0x004ec909, 0x00004171 }, - { "C5.LUM", 1, 0x004f0a7a, 0x00000018 }, - { "C5.MSK", 1, 0x004f0a92, 0x00001f40 }, - { "C5.PCX", 1, 0x004f29d2, 0x000099f2 }, - { "C5.SAM", 1, 0x004fc3c4, 0x00003016 }, - { "C50A.CUT", 1, 0x004ff3da, 0x000004f2 }, - { "C50B.CUT", 1, 0x004ff8cc, 0x000001f8 }, - { "C50C.CUT", 1, 0x004ffac4, 0x0000086e }, - { "C50D.CUT", 1, 0x00500332, 0x000000e2 }, - { "C50E.CUT", 1, 0x00500414, 0x00000618 }, - { "C50F.CUT", 1, 0x00500a2c, 0x000003b8 }, - { "C50G.CUT", 1, 0x00500de4, 0x000008da }, - { "C50H.CUT", 1, 0x005016be, 0x000000ba }, - { "C50I.CUT", 1, 0x00501778, 0x000009d4 }, - { "C50J.CUT", 1, 0x0050214c, 0x000000f2 }, - { "C51A.CUT", 1, 0x0050223e, 0x0000080e }, - { "C51B.CUT", 1, 0x00502a4c, 0x000001d8 }, - { "C51C.CUT", 1, 0x00502c24, 0x000001d8 }, - { "C51D.CUT", 1, 0x00502dfc, 0x000000ec }, - { "C53A.CUT", 1, 0x00502ee8, 0x00000566 }, - { "C53B.CUT", 1, 0x0050344e, 0x0000018a }, - { "C54A.CUT", 1, 0x005035d8, 0x0000028c }, - { "C55A.CUT", 1, 0x00503864, 0x000006c8 }, - { "C56A.CUT", 1, 0x00503f2c, 0x000003ba }, - { "C56B.CUT", 1, 0x005042e6, 0x00000678 }, - { "C58A.CUT", 1, 0x0050495e, 0x000001cc }, - { "C59A.CUT", 1, 0x00504b2a, 0x0000014a }, - { "C5A.CUT", 1, 0x00504c74, 0x0000040c }, - { "C5C.CUT", 1, 0x00505080, 0x0000050c }, - { "C6.BBK", 1, 0x0050558c, 0x0000711b }, - { "C6.LUM", 1, 0x0050c6a7, 0x00000018 }, - { "C6.MSK", 1, 0x0050c6bf, 0x00001f40 }, - { "C6.PCX", 1, 0x0050e5ff, 0x0000c6c0 }, - { "C6.SAM", 1, 0x0051acbf, 0x00004a87 }, - { "C60A.CUT", 1, 0x0051f746, 0x00000170 }, - { "C61A.CUT", 1, 0x0051f8b6, 0x00000170 }, - { "C62A.CUT", 1, 0x0051fa26, 0x00000dde }, - { "C62B.CUT", 1, 0x00520804, 0x00000268 }, - { "C62C.CUT", 1, 0x00520a6c, 0x00000164 }, - { "C62D.CUT", 1, 0x00520bd0, 0x000002a2 }, - { "C63A.CUT", 1, 0x00520e72, 0x000002d0 }, - { "C63B.CUT", 1, 0x00521142, 0x0000098e }, - { "C63C.CUT", 1, 0x00521ad0, 0x000005d8 }, - { "C63D.CUT", 1, 0x005220a8, 0x00000194 }, - { "C63E.CUT", 1, 0x0052223c, 0x00000336 }, - { "C63F.CUT", 1, 0x00522572, 0x0000041a }, - { "C63G.CUT", 1, 0x0052298c, 0x00000170 }, - { "C63H.CUT", 1, 0x00522afc, 0x0000039a }, - { "C63I.CUT", 1, 0x00522e96, 0x000003ac }, - { "C63J.CUT", 1, 0x00523242, 0x000002f0 }, - { "C63K.CUT", 1, 0x00523532, 0x00000634 }, - { "C64A.CUT", 1, 0x00523b66, 0x00000128 }, - { "C66A.CUT", 1, 0x00523c8e, 0x000002e8 }, - { "C67A.CUT", 1, 0x00523f76, 0x000005b6 }, - { "C67B.CUT", 1, 0x0052452c, 0x0000054c }, - { "C69A.CUT", 1, 0x00524a78, 0x00000700 }, - { "C69B.CUT", 1, 0x00525178, 0x00000670 }, - { "C69C.CUT", 1, 0x005257e8, 0x00000688 }, - { "C69D.CUT", 1, 0x00525e70, 0x000006ac }, - { "C69E.CUT", 1, 0x0052651c, 0x000009cc }, - { "C69F.CUT", 1, 0x00526ee8, 0x00000aa2 }, - { "C69G.CUT", 1, 0x0052798a, 0x000019ac }, - { "C69H.CUT", 1, 0x00529336, 0x0000075a }, - { "C69I.CUT", 1, 0x00529a90, 0x000003f0 }, - { "C69J.CUT", 1, 0x00529e80, 0x0000008a }, - { "C69K.CUT", 1, 0x00529f0a, 0x000005c8 }, - { "C69L.CUT", 1, 0x0052a4d2, 0x0000062a }, - { "C69M.CUT", 1, 0x0052aafc, 0x000005ba }, - { "C69N.CUT", 1, 0x0052b0b6, 0x0000012c }, - { "C69O.CUT", 1, 0x0052b1e2, 0x000001e4 }, - { "C69Z.CUT", 1, 0x0052b3c6, 0x000017a4 }, - { "C6A.CUT", 1, 0x0052cb6a, 0x00000220 }, - { "C6B.CUT", 1, 0x0052cd8a, 0x000000da }, - { "C6C.CUT", 1, 0x0052ce64, 0x00000138 }, - { "C7.BBK", 1, 0x0052cf9c, 0x00013c13 }, - { "C7.PCX", 1, 0x00540baf, 0x0000a75d }, - { "C70A.CUT", 1, 0x0054b30c, 0x000002b8 }, - { "C70B.CUT", 1, 0x0054b5c4, 0x00000384 }, - { "C70B.SAM", 1, 0x0054b948, 0x00009a4e }, - { "C70C.CUT", 1, 0x00555396, 0x00000292 }, - { "C70D.CUT", 1, 0x00555628, 0x00000952 }, - { "C70E.CUT", 1, 0x00555f7a, 0x0000038c }, - { "C70F.CUT", 1, 0x00556306, 0x0000034c }, - { "C70F.SAM", 1, 0x00556652, 0x000076bf }, - { "C70G.CUT", 1, 0x0055dd11, 0x00000348 }, - { "C70G.SAM", 1, 0x0055e059, 0x00008d7d }, - { "C70H.CUT", 1, 0x00566dd6, 0x00000322 }, - { "C70I.CUT", 1, 0x005670f8, 0x000003d8 }, - { "C70J.CUT", 1, 0x005674d0, 0x00000184 }, - { "C70K.CUT", 1, 0x00567654, 0x000002c0 }, - { "C70L.CUT", 1, 0x00567914, 0x000002c0 }, - { "C70M.CUT", 1, 0x00567bd4, 0x000002ba }, - { "C70N.CUT", 1, 0x00567e8e, 0x000002ba }, - { "C71A.CUT", 1, 0x00568148, 0x00000094 }, - { "C71B.CUT", 1, 0x005681dc, 0x00000094 }, - { "C71C.CUT", 1, 0x00568270, 0x000000b2 }, - { "C72A.CUT", 1, 0x00568322, 0x00000730 }, - { "C72B.CUT", 1, 0x00568a52, 0x00000632 }, - { "C72C.CUT", 1, 0x00569084, 0x0000007c }, - { "C73A.CUT", 1, 0x00569100, 0x0000038a }, - { "C73B.CUT", 1, 0x0056948a, 0x000002b8 }, - { "C73C.CUT", 1, 0x00569742, 0x00000192 }, - { "C73D.CUT", 1, 0x005698d4, 0x000000c8 }, - { "C73E.CUT", 1, 0x0056999c, 0x00000330 }, - { "C73F.CUT", 1, 0x00569ccc, 0x00000344 }, - { "C73G.CUT", 1, 0x0056a010, 0x00000210 }, - { "C74A.CUT", 1, 0x0056a220, 0x0000075e }, - { "C74B.CUT", 1, 0x0056a97e, 0x0000018c }, - { "C74C.CUT", 1, 0x0056ab0a, 0x000001dc }, - { "C74D.CUT", 1, 0x0056ace6, 0x0000018c }, - { "C74F.CUT", 1, 0x0056ae72, 0x000000e0 }, - { "C75B.CUT", 1, 0x0056af52, 0x00000d00 }, - { "C76A.CUT", 1, 0x0056bc52, 0x00000072 }, - { "C76B.CUT", 1, 0x0056bcc4, 0x00000f28 }, - { "C8.BBK", 1, 0x0056cbec, 0x0000b5ce }, - { "C8.PCX", 1, 0x005781ba, 0x0000c31f }, - { "C8A.CUT", 1, 0x005844d9, 0x000007e4 }, - { "C8B.CUT", 1, 0x00584cbd, 0x000002a8 }, - { "C9.BBK", 1, 0x00584f65, 0x0000f68b }, - { "C9.PCX", 1, 0x005945f0, 0x0000a787 }, - { "C97A.CUT", 1, 0x0059ed77, 0x0000017e }, - { "C97B.CUT", 1, 0x0059eef5, 0x0000013c }, - { "C99D.CUT", 1, 0x0059f031, 0x00000094 }, - { "C99E.CUT", 1, 0x0059f0c5, 0x000002e6 }, - { "C99F.CUT", 1, 0x0059f3ab, 0x000002e6 }, - { "C9A.CUT", 1, 0x0059f691, 0x000001fa }, - { "C9B.CUT", 1, 0x0059f88b, 0x000000f8 }, - { "C9C.CUT", 1, 0x0059f983, 0x00000136 }, - { "C9D.CUT", 1, 0x0059fab9, 0x000000a0 }, - { "CDCLO.CUT", 1, 0x0059fb59, 0x000001f6 }, - { "CDINT.CUT", 1, 0x0059fd4f, 0x000017fe }, - { "CDINT061.SB", 1, 0x005a154d, 0x0000334c }, - { "CDINT063.SB", 1, 0x005a4899, 0x0000798b }, - { "CDINT072.SB", 1, 0x005ac224, 0x00005f03 }, - { "CDINT081.SB", 1, 0x005b2127, 0x000062b3 }, - { "CDINT091.SB", 1, 0x005b83da, 0x00008a0e }, - { "CDINT102.SB", 1, 0x005c0de8, 0x0000673a }, - { "CDINT111.SB", 1, 0x005c7522, 0x00008453 }, - { "CDINT141.SB", 1, 0x005cf975, 0x000031be }, - { "CDINT151.SB", 1, 0x005d2b33, 0x00002a7c }, - { "CDINT191.SB", 1, 0x005d55af, 0x00001fc8 }, - { "CDINT201.SB", 1, 0x005d7577, 0x00002cd8 }, - { "CDINT212.SB", 1, 0x005da24f, 0x00004b03 }, - { "CDINT231.SB", 1, 0x005ded52, 0x00008dc0 }, - { "CDINT241.SB", 1, 0x005e7b12, 0x000032cf }, - { "CDINT281.SB", 1, 0x005eade1, 0x000053a6 }, - { "CDINT291.SB", 1, 0x005f0187, 0x00002138 }, - { "CDINT301.SB", 1, 0x005f22bf, 0x00003dae }, - { "CDINT321.SB", 1, 0x005f606d, 0x00007e92 }, - { "CDINT351.SB", 1, 0x005fdeff, 0x00002000 }, - { "CDINT361.SB", 1, 0x005ffeff, 0x00005a8b }, - { "CDINT381.SB", 1, 0x0060598a, 0x00003882 }, - { "CDINT442.SB", 1, 0x0060920c, 0x0000471b }, - { "CDINT451.SB", 1, 0x0060d927, 0x00005929 }, - { "CDINT452.SB", 1, 0x00613250, 0x00007915 }, - { "CDINT461.SB", 1, 0x0061ab65, 0x00001c6a }, - { "CDINT463.SB", 1, 0x0061c7cf, 0x000030ae }, - { "CDINT464.SB", 1, 0x0061f87d, 0x0000c980 }, - { "CDINT471.SB", 1, 0x0062c1fd, 0x00003593 }, - { "CDINT481.SB", 1, 0x0062f790, 0x00004e60 }, - { "CDINT492.SB", 1, 0x006345f0, 0x00004594 }, - { "CDRES.CUT", 1, 0x00638b84, 0x000001f6 }, - { "CHANGE.SAM", 1, 0x00638d7a, 0x00005ef2 }, - { "CHEF.ACT", 1, 0x0063ec6c, 0x00005362 }, - { "CHEF.DOG", 1, 0x00643fce, 0x00000af0 }, - { "CHIEF1.DOG", 1, 0x00644abe, 0x000009ca }, - { "CHIEF2.DOG", 1, 0x00645488, 0x0000121e }, - { "CHIEF3.DOG", 1, 0x006466a6, 0x00000be4 }, - { "CHIEF4.DOG", 1, 0x0064728a, 0x000002c4 }, - { "CHORN.CUT", 1, 0x0064754e, 0x0000034a }, - { "CINTR.CUT", 1, 0x00647898, 0x00001768 }, - { "CLOGO.CUT", 1, 0x00649000, 0x000000aa }, - { "CMASK.CUT", 1, 0x006490aa, 0x00000386 }, - { "COCON.CUT", 1, 0x00649430, 0x000003d8 }, - { "COCONUT.SAM", 1, 0x00649808, 0x0000a047 }, - { "COMIC.CUT", 1, 0x0065384f, 0x0000094e }, - { "COMPY.ACT", 1, 0x0065419d, 0x00005533 }, - { "CONTROL.BBK", 1, 0x006596d0, 0x00000e0e }, - { "COPY.BBK", 1, 0x0065a4de, 0x00000002 }, - { "COPY.CUT", 1, 0x0065a4e0, 0x00000086 }, - { "COPY.LBM", 1, 0x0065a566, 0x000053ca }, - { "COPY.PCX", 1, 0x0065f930, 0x0000646f }, - { "CRAP.PCX", 1, 0x00665d9f, 0x0000724c }, - { "CRED.CUT", 1, 0x0066cfeb, 0x000003ae }, - { "CREDIT1.CRD", 1, 0x0066d399, 0x00000604 }, - { "CREDIT2.CRD", 1, 0x0066d99d, 0x000010d3 }, - { "CROWBAR.SAM", 1, 0x0066ea70, 0x00009aca }, - { "CUDRS.CUT", 1, 0x0067853a, 0x000001f6 }, - { "D1.BBK", 1, 0x00678730, 0x000061b7 }, - { "D1.LUM", 1, 0x0067e8e7, 0x00000018 }, - { "D1.MSK", 1, 0x0067e8ff, 0x00001f40 }, - { "D1.PCX", 1, 0x0068083f, 0x0000a331 }, - { "D1C.SAM", 1, 0x0068ab70, 0x0000ddd7 }, - { "D2.BBK", 1, 0x00698947, 0x00004630 }, - { "D2.LUM", 1, 0x0069cf77, 0x00000018 }, - { "D2.MSK", 1, 0x0069cf8f, 0x00001f40 }, - { "D2.PCX", 1, 0x0069eecf, 0x00008dc3 }, - { "D3.BBK", 1, 0x006a7c92, 0x00004b34 }, - { "D3.LUM", 1, 0x006ac7c6, 0x00000018 }, - { "D3.MSK", 1, 0x006ac7de, 0x00001f40 }, - { "D3.PCX", 1, 0x006ae71e, 0x0000a662 }, - { "D3.SAM", 1, 0x006b8d80, 0x0000c55a }, - { "D4.BBK", 1, 0x006c52da, 0x00013e0d }, - { "D4.LUM", 1, 0x006d90e7, 0x00000018 }, - { "D4.MSK", 1, 0x006d90ff, 0x00001f40 }, - { "D4.PCX", 1, 0x006db03f, 0x0000a69b }, - { "D5.BBK", 1, 0x006e56da, 0x000088a1 }, - { "D5.PCX", 1, 0x006edf7b, 0x00007bc5 }, - { "D5.SAM", 1, 0x006f5b40, 0x00002ee7 }, - { "D5B.SAM", 1, 0x006f8a27, 0x0001128e }, - { "D6.BBK", 1, 0x00709cb5, 0x0000a480 }, - { "D6.LUM", 1, 0x00714135, 0x00000018 }, - { "D6.MSK", 1, 0x0071414d, 0x00001f40 }, - { "D6.PCX", 1, 0x0071608d, 0x000099a6 }, - { "D9.BBK", 1, 0x0071fa33, 0x00008461 }, - { "D9.PCX", 1, 0x00727e94, 0x0000b551 }, - { "DATA", 1, 0x007333e5, 0x00001434 }, - { "DEATH.ACT", 1, 0x00734819, 0x0000d83a }, - { "DEATH1.DOG", 1, 0x00742053, 0x000017ca }, - { "DEATH2.DOG", 1, 0x0074381d, 0x0000081e }, - { "DEINO.ACT", 1, 0x0074403b, 0x0000e199 }, - { "DFRANK.ACT", 1, 0x007521d4, 0x000052e2 }, - { "DISK1.SAM", 1, 0x007574b6, 0x000033da }, - { "DOG.ACT", 1, 0x0075a890, 0x00002a62 }, - { "DOG.DOG", 1, 0x0075d2f2, 0x0000023a }, - { "E1.BBK", 1, 0x0075d52c, 0x0001765b }, - { "E1.PCX", 1, 0x00774b87, 0x0000dcc7 }, - { "E2.BBK", 1, 0x0078284e, 0x0000cefc }, - { "E2.PCX", 1, 0x0078f74a, 0x0000f5f2 }, - { "E3.BBK", 1, 0x0079ed3c, 0x00011042 }, - { "E3.PCX", 1, 0x007afd7e, 0x0000a4d0 }, - { "EQDATA.LHA", 1, 0x007ba24e, 0x00031a7a }, - { "F1.BBK", 1, 0x007ebcc8, 0x00004716 }, - { "F1.LUM", 1, 0x007f03de, 0x00000018 }, - { "F1.MSK", 1, 0x007f03f6, 0x00001f40 }, - { "F1.PCX", 1, 0x007f2336, 0x0000991d }, - { "F1.SAM", 1, 0x007fbc53, 0x0000fd04 }, - { "F1B.PCX", 1, 0x0080b957, 0x00005739 }, - { "F2.BBK", 1, 0x00811090, 0x00006a18 }, - { "F2.LUM", 1, 0x00817aa8, 0x00000018 }, - { "F2.MSK", 1, 0x00817ac0, 0x00001f40 }, - { "F2.PCX", 1, 0x00819a00, 0x00009f28 }, - { "F2B.PCX", 1, 0x00823928, 0x00004abb }, - { "F3.BBK", 1, 0x008283e3, 0x00002c59 }, - { "F3.LUM", 1, 0x0082b03c, 0x00000018 }, - { "F3.MSK", 1, 0x0082b054, 0x00001f40 }, - { "F3.PCX", 1, 0x0082cf94, 0x0000aa0c }, - { "F3.SAM", 1, 0x008379a0, 0x0000a940 }, - { "F4.BBK", 1, 0x008422e0, 0x0000b561 }, - { "F4.LUM", 1, 0x0084d841, 0x00000018 }, - { "F4.MSK", 1, 0x0084d859, 0x00001f40 }, - { "F4.PCX", 1, 0x0084f799, 0x00014df0 }, - { "F4B.PCX", 1, 0x00864589, 0x000117d8 }, - { "F4S.PCX", 1, 0x00875d61, 0x0000833e }, - { "FALL.SAM", 1, 0x0087e09f, 0x0000cbda }, - { "FAYE.ACT", 1, 0x0088ac79, 0x00013fda }, - { "FAYE2.DOG", 1, 0x0089ec53, 0x0000098e }, - { "FAYE3.DOG", 1, 0x0089f5e1, 0x000005d8 }, - { "FAYE4.DOG", 1, 0x0089fbb9, 0x00000c40 }, - { "FAYE5.CUT", 1, 0x008a07f9, 0x0000007a }, - { "FAYE5.DOG", 1, 0x008a0873, 0x000009ce }, - { "FAYE6.DOG", 1, 0x008a1241, 0x00000466 }, - { "FAYE_E.ACT", 1, 0x008a16a7, 0x00002d4a }, - { "FAYE_H.ACT", 1, 0x008a43f1, 0x0000807a }, - { "FAYE_H.BBK", 1, 0x008ac46b, 0x0000e9fb }, - { "FAYE_H.PCX", 1, 0x008bae66, 0x000096b5 }, - { "FRANK.ACT", 1, 0x008c451b, 0x00008342 }, - { "FRANK.DOG", 1, 0x008cc85d, 0x00000e48 }, - { "FRANK_H.ACT", 1, 0x008cd6a5, 0x0000ad60 }, - { "FRANK_H.BBK", 1, 0x008d8405, 0x00016369 }, - { "FRANK_H.PCX", 1, 0x008ee76e, 0x00008dd6 }, - { "GET_GEM.SAM", 1, 0x008f7544, 0x000099d2 }, - { "GET_HORN.BBK", 1, 0x00900f16, 0x000045d8 }, - { "GET_HORN.SAM", 1, 0x009054ee, 0x00005dde }, - { "GM.CUT", 1, 0x0090b2cc, 0x0000009c }, - { "GOONS.ACT", 1, 0x0090b368, 0x0000728a }, - { "GUARDS.ACT", 1, 0x009125f2, 0x0000504a }, - { "HENRY.ACT", 1, 0x0091763c, 0x0000b102 }, - { "HENRY.DOG", 1, 0x0092273e, 0x00001280 }, - { "HENRY2.DOG", 1, 0x009239be, 0x00000b24 }, - { "HORN.SAM", 1, 0x009244e2, 0x000067b2 }, - { "HUGH.ACT", 1, 0x0092ac94, 0x0000e8da }, - { "I1.SAM", 1, 0x0093956e, 0x0000cbf2 }, - { "IAN.ACT", 1, 0x00946160, 0x0000a542 }, - { "IAN1.DOG", 1, 0x009506a2, 0x00000518 }, - { "IAN2.DOG", 1, 0x00950bba, 0x00000a9a }, - { "J1.BBK", 1, 0x00951654, 0x000025fc }, - { "J1.LUM", 1, 0x00953c50, 0x00000018 }, - { "J1.MSK", 1, 0x00953c68, 0x00001f40 }, - { "J1.PCX", 1, 0x00955ba8, 0x00008d84 }, - { "J1.SAM", 1, 0x0095e92c, 0x00008442 }, - { "J2.BBK", 1, 0x00966d6e, 0x00000e97 }, - { "J2.LUM", 1, 0x00967c05, 0x00000018 }, - { "J2.MSK", 1, 0x00967c1d, 0x00001f40 }, - { "J2.PCX", 1, 0x00969b5d, 0x0000c33c }, - { "J2.SAM", 1, 0x00975e99, 0x0000a1e3 }, - { "J3.BBK", 1, 0x0098007c, 0x00003289 }, - { "J3.LUM", 1, 0x00983305, 0x00000018 }, - { "J3.MSK", 1, 0x0098331d, 0x00001f40 }, - { "J3.PCX", 1, 0x0098525d, 0x000094b4 }, - { "J4.BBK", 1, 0x0098e711, 0x00006e28 }, - { "J4.LUM", 1, 0x00995539, 0x00000018 }, - { "J4.MSK", 1, 0x00995551, 0x00001f40 }, - { "J4.PCX", 1, 0x00997491, 0x00008e90 }, - { "J5.BBK", 1, 0x009a0321, 0x00004521 }, - { "J5.LUM", 1, 0x009a4842, 0x00000018 }, - { "J5.MSK", 1, 0x009a485a, 0x00001f40 }, - { "J5.PCX", 1, 0x009a679a, 0x00009b37 }, - { "J5.SAM", 1, 0x009b02d1, 0x000042f2 }, - { "J6.BBK", 1, 0x009b45c3, 0x000043d7 }, - { "J6.LUM", 1, 0x009b899a, 0x00000018 }, - { "J6.MSK", 1, 0x009b89b2, 0x00001f40 }, - { "J6.PCX", 1, 0x009ba8f2, 0x0000a5c5 }, - { "J7.BBK", 1, 0x009c4eb7, 0x00003234 }, - { "J7.LUM", 1, 0x009c80eb, 0x00000018 }, - { "J7.MSK", 1, 0x009c8103, 0x00001f40 }, - { "J7.PCX", 1, 0x009ca043, 0x0000cd63 }, - { "J7.SAM", 1, 0x009d6da6, 0x000083aa }, - { "J8.BBK", 1, 0x009df150, 0x0000320d }, - { "J8.LUM", 1, 0x009e235d, 0x00000018 }, - { "J8.MSK", 1, 0x009e2375, 0x00001f40 }, - { "J8.PCX", 1, 0x009e42b5, 0x0000c0e2 }, - { "J8.SAM", 1, 0x009f0397, 0x0000024e }, - { "JASPAR.ACT", 1, 0x009f05e5, 0x00004fb2 }, - { "JIM1.DOG", 1, 0x009f5597, 0x00001276 }, - { "JIM2.DOG", 1, 0x009f680d, 0x00001282 }, - { "JIM3.DOG", 1, 0x009f7a8f, 0x00000df6 }, - { "JIMTAM.ACT", 1, 0x009f8885, 0x0000a08a }, - { "JOE.BBK", 1, 0x00a0290f, 0x00014b8a }, - { "JOE1.BBK", 1, 0x00a17499, 0x00012a5a }, - { "JOED_A.BBK", 1, 0x00a29ef3, 0x00009b8a }, - { "JOED_B.BBK", 1, 0x00a33a7d, 0x0000a50a }, - { "JOEU_A.BBK", 1, 0x00a3df87, 0x00009b8a }, - { "JOEU_B.BBK", 1, 0x00a47b11, 0x0000a50a }, - { "JOE_A.BBK", 1, 0x00a5201b, 0x00009b8a }, - { "JOE_B.BBK", 1, 0x00a5bba5, 0x0000dc5a }, - { "JOE_E.ACT", 1, 0x00a697ff, 0x0000388a }, - { "JOE_H.ACT", 1, 0x00a6d089, 0x0000dace }, - { "JOHN.ACT", 1, 0x00a7ab57, 0x00006312 }, - { "JOHN1.DOG", 1, 0x00a80e69, 0x0000067c }, - { "JOURNAL.BBK", 1, 0x00a814e5, 0x0000a318 }, - { "JOURNAL.PCX", 1, 0x00a8b7fd, 0x00009c70 }, - { "KISS1.SAM", 1, 0x00a9546d, 0x0000f722 }, - { "KLUNK.ACT", 1, 0x00aa4b8f, 0x00007c30 }, - { "KLUNK1.DOG", 1, 0x00aac7bf, 0x00000e6a }, - { "KLUNK2.DOG", 1, 0x00aad629, 0x00000ed0 }, - { "KLUNK2.SAM", 1, 0x00aae4f9, 0x0001737c }, - { "L1.BBK", 1, 0x00ac5875, 0x00000002 }, - { "L1.PCX", 1, 0x00ac5877, 0x000043f7 }, - { "L2.BBK", 1, 0x00ac9c6e, 0x00000002 }, - { "L2.PCX", 1, 0x00ac9c70, 0x0000ba60 }, - { "LARIS.ACT", 1, 0x00ad56d0, 0x0000355a }, - { "LARIS.DOG", 1, 0x00ad8c2a, 0x00000f32 }, - { "LARIS3.DOG", 1, 0x00ad9b5c, 0x0000079a }, - { "LITTLEP.ACT", 1, 0x00ada2f6, 0x000002e2 }, - { "LOLA.ACT", 1, 0x00ada5d8, 0x0001342d }, - { "LOLA1.DOG", 1, 0x00aeda05, 0x00000ad6 }, - { "LOU.ACT", 1, 0x00aee4db, 0x00005552 }, - { "LOU1.DOG", 1, 0x00af3a2d, 0x000010ac }, - { "LOU2.DOG", 1, 0x00af4ad9, 0x00000bae }, - { "M1.BBK", 1, 0x00af5687, 0x00006d5c }, - { "M1.PCX", 1, 0x00afc3e3, 0x000193ce }, - { "M2.BBK", 1, 0x00b157b1, 0x00001a4a }, - { "M2.PCX", 1, 0x00b171fb, 0x0000a9d3 }, - { "M2.SAM", 1, 0x00b21bce, 0x0001433c }, - { "MAN1.DOG", 1, 0x00b35f0a, 0x0000101e }, - { "MAN2.DOG", 1, 0x00b36f28, 0x000007a4 }, - { "MASK.SAM", 1, 0x00b376cc, 0x000081ea }, - { "N1.BBK", 1, 0x00b3f8b6, 0x00002d74 }, - { "N1.LUM", 1, 0x00b4262a, 0x00000018 }, - { "N1.MSK", 1, 0x00b42642, 0x00001f40 }, - { "N1.PCX", 1, 0x00b44582, 0x0000cbe7 }, - { "N10.BBK", 1, 0x00b51169, 0x00000002 }, - { "N10.PCX", 1, 0x00b5116b, 0x0000a28d }, - { "N10.SAM", 1, 0x00b5b3f8, 0x000147f8 }, - { "N11.BBK", 1, 0x00b6fbf0, 0x00000d48 }, - { "N11.PCX", 1, 0x00b70938, 0x00008e85 }, - { "N12.BBK", 1, 0x00b797bd, 0x000049aa }, - { "N12.LUM", 1, 0x00b7e167, 0x00000018 }, - { "N12.MSK", 1, 0x00b7e17f, 0x00001f40 }, - { "N12.PCX", 1, 0x00b800bf, 0x000074ea }, - { "N13.BBK", 1, 0x00b875a9, 0x000046b7 }, - { "N13.LUM", 1, 0x00b8bc60, 0x00000018 }, - { "N13.MSK", 1, 0x00b8bc78, 0x00001f40 }, - { "N13.PCX", 1, 0x00b8dbb8, 0x00008640 }, - { "N13.SAM", 1, 0x00b961f8, 0x00025a26 }, - { "N13B.SAM", 1, 0x00bbbc1e, 0x0000250a }, - { "N14.BBK", 1, 0x00bbe128, 0x000073ec }, - { "N14.PCX", 1, 0x00bc5514, 0x0000b3f3 }, - { "N14.SAM", 1, 0x00bd0907, 0x0002550a }, - { "N14B.PCX", 1, 0x00bf5e11, 0x0000b933 }, - { "N15.BBK", 1, 0x00c01744, 0x00000002 }, - { "N15.PCX", 1, 0x00c01746, 0x0000ae43 }, - { "N16.BBK", 1, 0x00c0c589, 0x000014c0 }, - { "N16.LUM", 1, 0x00c0da49, 0x00000018 }, - { "N16.MSK", 1, 0x00c0da61, 0x00001f40 }, - { "N16.PCX", 1, 0x00c0f9a1, 0x0000e038 }, - { "N2.BBK", 1, 0x00c1d9d9, 0x00007377 }, - { "N2.LUM", 1, 0x00c24d50, 0x00000018 }, - { "N2.MSK", 1, 0x00c24d68, 0x00001f40 }, - { "N2.PCX", 1, 0x00c26ca8, 0x00007d65 }, - { "N3.BBK", 1, 0x00c2ea0d, 0x00004fe2 }, - { "N3.LUM", 1, 0x00c339ef, 0x00000018 }, - { "N3.MSK", 1, 0x00c33a07, 0x00001f40 }, - { "N3.PCX", 1, 0x00c35947, 0x0000a6de }, - { "N4.BBK", 1, 0x00c40025, 0x0000acc0 }, - { "N4.LUM", 1, 0x00c4ace5, 0x00000018 }, - { "N4.MSK", 1, 0x00c4acfd, 0x00001f40 }, - { "N4.PCX", 1, 0x00c4cc3d, 0x00006e0b }, - { "N5.BBK", 1, 0x00c53a48, 0x0000202a }, - { "N5.LUM", 1, 0x00c55a72, 0x00000018 }, - { "N5.MSK", 1, 0x00c55a8a, 0x00001f40 }, - { "N5.PCX", 1, 0x00c579ca, 0x000092f0 }, - { "N6.BBK", 1, 0x00c60cba, 0x00001d97 }, - { "N6.LUM", 1, 0x00c62a51, 0x00000018 }, - { "N6.MSK", 1, 0x00c62a69, 0x00001f40 }, - { "N6.PCX", 1, 0x00c649a9, 0x000086e2 }, - { "N7.BBK", 1, 0x00c6d08b, 0x000025f8 }, - { "N7.LUM", 1, 0x00c6f683, 0x00000018 }, - { "N7.MSK", 1, 0x00c6f69b, 0x00001f40 }, - { "N7.PCX", 1, 0x00c715db, 0x00008e79 }, - { "N8.BBK", 1, 0x00c7a454, 0x00007bb7 }, - { "N8.LUM", 1, 0x00c8200b, 0x00000018 }, - { "N8.MSK", 1, 0x00c82023, 0x00001f40 }, - { "N8.PCX", 1, 0x00c83f63, 0x0000be5f }, - { "N9.BBK", 1, 0x00c8fdc2, 0x0000c9bf }, - { "N9.LUM", 1, 0x00c9c781, 0x00000018 }, - { "N9.MSK", 1, 0x00c9c799, 0x00001f40 }, - { "N9.PCX", 1, 0x00c9e6d9, 0x0000aa4b }, - { "N9.SAM", 1, 0x00ca9124, 0x0000e902 }, - { "NAOMI.DOG", 1, 0x00cb7a26, 0x000013b6 }, - { "NAOMI2.DOG", 1, 0x00cb8ddc, 0x00000a40 }, - { "OBJECTS.BBK", 1, 0x00cb981c, 0x00019322 }, - { "ORACLE.ACT", 1, 0x00cd2b3e, 0x00004042 }, - { "ORACLE1.DOG", 1, 0x00cd6b80, 0x00001088 }, - { "ORACLE2.DOG", 1, 0x00cd7c08, 0x000003c0 }, - { "ORACLE3.DOG", 1, 0x00cd7fc8, 0x00000806 }, - { "PANEL.PCX", 1, 0x00cd87ce, 0x00002279 }, - { "PRIN1.CUT", 1, 0x00cdaa47, 0x0000007a }, - { "PRIN1.DOG", 1, 0x00cdaac1, 0x00000aea }, - { "PRIN2.DOG", 1, 0x00cdb5ab, 0x0000055a }, - { "PRIN4.DOG", 1, 0x00cdbb05, 0x00000720 }, - { "PRINCESS.ACT", 1, 0x00cdc225, 0x0000d732 }, - { "PRISON.ACT", 1, 0x00ce9957, 0x00006f22 }, - { "PUNCH.SAM", 1, 0x00cf0879, 0x00007e9a }, - { "PUSH.SAM", 1, 0x00cf8713, 0x00009308 }, - { "PYGMY.ACT", 1, 0x00d01a1b, 0x00010a63 }, - { "QUEEN.JAS", 1, 0x00d1247e, 0x0001371a }, - { "QUEEN2.JAS", 1, 0x00d25b98, 0x00008c00 }, - { "R1.BBK", 1, 0x00d2e798, 0x00001a4a }, - { "R1.PCX", 1, 0x00d301e2, 0x000065c0 }, - { "R2.BBK", 1, 0x00d367a2, 0x00001a4a }, - { "R2.PCX", 1, 0x00d381ec, 0x00005f32 }, - { "R3.BBK", 1, 0x00d3e11e, 0x00001a4a }, - { "R3.PCX", 1, 0x00d3fb68, 0x000061a1 }, - { "R4.BBK", 1, 0x00d45d09, 0x00001a4a }, - { "R4.PCX", 1, 0x00d47753, 0x00009ec3 }, - { "RASH.SAM", 1, 0x00d51616, 0x0000431a }, - { "RENEGADE.BBK", 1, 0x00d55930, 0x0000117a }, - { "RENEGADE.PCX", 1, 0x00d56aaa, 0x0000296d }, - { "RITA.ACT", 1, 0x00d59417, 0x000020ea }, - { "RITA_H.ACT", 1, 0x00d5b501, 0x00015cdb }, - { "ROCKET.SAM", 1, 0x00d711dc, 0x00027e20 }, - { "SEC.ACT", 1, 0x00d98ffc, 0x00006e6a }, - { "SEC1.DOG", 1, 0x00d9fe66, 0x00001672 }, - { "SEC2.DOG", 1, 0x00da14d8, 0x00000944 }, - { "SHEET.SAM", 1, 0x00da1e1c, 0x0000ad00 }, - { "SHIELD.SAM", 1, 0x00dacb1c, 0x00002afb }, - { "SHOWER.ACT", 1, 0x00daf617, 0x0000762a }, - { "SHOWERAM.DOG", 1, 0x00db6c41, 0x000005fc }, - { "SKULL.ACT", 1, 0x00db723d, 0x00001973 }, - { "SPARKY.ACT", 1, 0x00db8bb0, 0x0000f912 }, - { "SPARKY1.DOG", 1, 0x00dc84c2, 0x00000986 }, - { "SPARKY2.DOG", 1, 0x00dc8e48, 0x00000402 }, - { "SPARKY3.DOG", 1, 0x00dc924a, 0x0000126e }, - { "SPARKY4.DOG", 1, 0x00dca4b8, 0x0000043a }, - { "SPARKY5.DOG", 1, 0x00dca8f2, 0x0000091c }, - { "SPARKY6.DOG", 1, 0x00dcb20e, 0x000007b6 }, - { "SPARKY7.DOG", 1, 0x00dcb9c4, 0x0000095e }, - { "SPARKY8.DOG", 1, 0x00dcc322, 0x0000072a }, - { "SPARKY_H.ACT", 1, 0x00dcca4c, 0x0000280a }, - { "T1.BBK", 1, 0x00dcf256, 0x0000f492 }, - { "T1.LUM", 1, 0x00dde6e8, 0x00000018 }, - { "T1.MSK", 1, 0x00dde700, 0x00001f40 }, - { "T1.PCX", 1, 0x00de0640, 0x0000aa3d }, - { "T1.SAM", 1, 0x00deb07d, 0x0000711a }, - { "T10.BBK", 1, 0x00df2197, 0x0000a957 }, - { "T10.LUM", 1, 0x00dfcaee, 0x00000018 }, - { "T10.MSK", 1, 0x00dfcb06, 0x00001f40 }, - { "T10.PCX", 1, 0x00dfea46, 0x0001198a }, - { "T10.SAM", 1, 0x00e103d0, 0x0000bc49 }, - { "T11.BBK", 1, 0x00e1c019, 0x00001e84 }, - { "T11.LUM", 1, 0x00e1de9d, 0x00000018 }, - { "T11.MSK", 1, 0x00e1deb5, 0x00001f40 }, - { "T11.PCX", 1, 0x00e1fdf5, 0x00008e7e }, - { "T12.BBK", 1, 0x00e28c73, 0x000059b5 }, - { "T12.LUM", 1, 0x00e2e628, 0x00000018 }, - { "T12.MSK", 1, 0x00e2e640, 0x00001f40 }, - { "T12.PCX", 1, 0x00e30580, 0x00007b3c }, - { "T12.SAM", 1, 0x00e380bc, 0x0000fe4b }, - { "T13.BBK", 1, 0x00e47f07, 0x000043b4 }, - { "T13.LUM", 1, 0x00e4c2bb, 0x00000018 }, - { "T13.MSK", 1, 0x00e4c2d3, 0x00001f40 }, - { "T13.PCX", 1, 0x00e4e213, 0x00007591 }, - { "T14.BBK", 1, 0x00e557a4, 0x0000468b }, - { "T14.LUM", 1, 0x00e59e2f, 0x00000018 }, - { "T14.MSK", 1, 0x00e59e47, 0x00001f40 }, - { "T14.PCX", 1, 0x00e5bd87, 0x00007df5 }, - { "T14.SAM", 1, 0x00e63b7c, 0x00016db3 }, - { "T15.BBK", 1, 0x00e7a92f, 0x000096e6 }, - { "T15.LUM", 1, 0x00e84015, 0x00000018 }, - { "T15.MSK", 1, 0x00e8402d, 0x00001f40 }, - { "T15.PCX", 1, 0x00e85f6d, 0x00008b28 }, - { "T15.SAM", 1, 0x00e8ea95, 0x0000a7d0 }, - { "T15B.SAM", 1, 0x00e99265, 0x000164d7 }, - { "T16.BBK", 1, 0x00eaf73c, 0x000027ff }, - { "T16.LUM", 1, 0x00eb1f3b, 0x00000018 }, - { "T16.MSK", 1, 0x00eb1f53, 0x00001f40 }, - { "T16.PCX", 1, 0x00eb3e93, 0x00009110 }, - { "T17.BBK", 1, 0x00ebcfa3, 0x000056df }, - { "T17.LUM", 1, 0x00ec2682, 0x00000018 }, - { "T17.MSK", 1, 0x00ec269a, 0x00001f40 }, - { "T17.PCX", 1, 0x00ec45da, 0x00007db6 }, - { "T18.BBK", 1, 0x00ecc390, 0x00006174 }, - { "T18.LUM", 1, 0x00ed2504, 0x00000018 }, - { "T18.MSK", 1, 0x00ed251c, 0x00001f40 }, - { "T18.PCX", 1, 0x00ed445c, 0x000087d6 }, - { "T19.BBK", 1, 0x00edcc32, 0x0000aec8 }, - { "T19.LUM", 1, 0x00ee7afa, 0x00000018 }, - { "T19.MSK", 1, 0x00ee7b12, 0x00001f40 }, - { "T19.PCX", 1, 0x00ee9a52, 0x0000768e }, - { "T19.SAM", 1, 0x00ef10e0, 0x000167ea }, - { "T1B.SAM", 1, 0x00f078ca, 0x0002fa9f }, - { "T2.BBK", 1, 0x00f37369, 0x00004dea }, - { "T2.LUM", 1, 0x00f3c153, 0x00000018 }, - { "T2.MSK", 1, 0x00f3c16b, 0x00001f40 }, - { "T2.PCX", 1, 0x00f3e0ab, 0x00011404 }, - { "T2.SAM", 1, 0x00f4f4af, 0x0000aa32 }, - { "T20.BBK", 1, 0x00f59ee1, 0x0000611c }, - { "T20.LUM", 1, 0x00f5fffd, 0x00000018 }, - { "T20.MSK", 1, 0x00f60015, 0x00001f40 }, - { "T20.PCX", 1, 0x00f61f55, 0x0000852a }, - { "T20.SAM", 1, 0x00f6a47f, 0x00007f9c }, - { "T20B.SAM", 1, 0x00f7241b, 0x0000a2bc }, - { "T21.BBK", 1, 0x00f7c6d7, 0x00000002 }, - { "T21.PCX", 1, 0x00f7c6d9, 0x0000b7b0 }, - { "T22.BBK", 1, 0x00f87e89, 0x00000002 }, - { "T22.PCX", 1, 0x00f87e8b, 0x0000a982 }, - { "T23.BBK", 1, 0x00f9280d, 0x00005bca }, - { "T23.LUM", 1, 0x00f983d7, 0x00000018 }, - { "T23.MSK", 1, 0x00f983ef, 0x00001f40 }, - { "T23.PCX", 1, 0x00f9a32f, 0x00008200 }, - { "T24.BBK", 1, 0x00fa252f, 0x0000aaf1 }, - { "T24.LUM", 1, 0x00fad020, 0x00000018 }, - { "T24.MSK", 1, 0x00fad038, 0x00001f40 }, - { "T24.PCX", 1, 0x00faef78, 0x00006f7e }, - { "T25.BBK", 1, 0x00fb5ef6, 0x0000a631 }, - { "T25.LUM", 1, 0x00fc0527, 0x00000018 }, - { "T25.MSK", 1, 0x00fc053f, 0x00001f40 }, - { "T25.PCX", 1, 0x00fc247f, 0x00008881 }, - { "T25.SAM", 1, 0x00fcad00, 0x000091ac }, - { "T26.BBK", 1, 0x00fd3eac, 0x00014578 }, - { "T26.LUM", 1, 0x00fe8424, 0x00000018 }, - { "T26.MSK", 1, 0x00fe843c, 0x00001f40 }, - { "T26.PCX", 1, 0x00fea37c, 0x00012570 }, - { "T26A.SAM", 1, 0x00ffc8ec, 0x000126a6 }, - { "T27.BBK", 1, 0x0100ef92, 0x0000a73e }, - { "T27.LUM", 1, 0x010196d0, 0x00000018 }, - { "T27.MSK", 1, 0x010196e8, 0x00001f40 }, - { "T27.PCX", 1, 0x0101b628, 0x000085fa }, - { "T28.BBK", 1, 0x01023c22, 0x00000002 }, - { "T28.PCX", 1, 0x01023c24, 0x000017d2 }, - { "T2B.SAM", 1, 0x010253f6, 0x00021df6 }, - { "T3.BBK", 1, 0x010471ec, 0x00004b24 }, - { "T3.LUM", 1, 0x0104bd10, 0x00000018 }, - { "T3.MSK", 1, 0x0104bd28, 0x00001f40 }, - { "T3.PCX", 1, 0x0104dc68, 0x0000724c }, - { "T3.SAM", 1, 0x01054eb4, 0x00006042 }, - { "T4.BBK", 1, 0x0105aef6, 0x00002dca }, - { "T4.MSK", 1, 0x0105dcc0, 0x00001f40 }, - { "T4.PCX", 1, 0x0105fc00, 0x00007566 }, - { "T5.BBK", 1, 0x01067166, 0x00001ac0 }, - { "T5.LUM", 1, 0x01068c26, 0x00000018 }, - { "T5.MSK", 1, 0x01068c3e, 0x00001f40 }, - { "T5.PCX", 1, 0x0106ab7e, 0x00009509 }, - { "T5.SAM", 1, 0x01074087, 0x000049aa }, - { "T5B.SAM", 1, 0x01078a31, 0x00022018 }, - { "T5C.SAM", 1, 0x0109aa49, 0x00011612 }, - { "T6.BBK", 1, 0x010ac05b, 0x00007db0 }, - { "T6.LUM", 1, 0x010b3e0b, 0x00000018 }, - { "T6.MSK", 1, 0x010b3e23, 0x00001f40 }, - { "T6.PCX", 1, 0x010b5d63, 0x000096b4 }, - { "T6.SAM", 1, 0x010bf417, 0x0000f04d }, - { "T6A.SAM", 1, 0x010ce464, 0x000199ee }, - { "T6B.PCX", 1, 0x010e7e52, 0x0000ad10 }, - { "T6B.SAM", 1, 0x010f2b62, 0x00010cba }, - { "T6C.SAM", 1, 0x0110381c, 0x00015041 }, - { "T7.BBK", 1, 0x0111885d, 0x0000c781 }, - { "T7.PCX", 1, 0x01124fde, 0x00006da0 }, - { "T7.SAM", 1, 0x0112bd7e, 0x000172ea }, - { "T8.BBK", 1, 0x01143068, 0x00002762 }, - { "T8.LUM", 1, 0x011457ca, 0x00000018 }, - { "T8.MSK", 1, 0x011457e2, 0x00001f40 }, - { "T8.PCX", 1, 0x01147722, 0x0000831b }, - { "T8.SAM", 1, 0x0114fa3d, 0x00012c01 }, - { "T9.BBK", 1, 0x0116263e, 0x000029f3 }, - { "T9.LUM", 1, 0x01165031, 0x00000018 }, - { "T9.MSK", 1, 0x01165049, 0x00001f40 }, - { "T9.PCX", 1, 0x01166f89, 0x0000735b }, - { "T9.SAM", 1, 0x0116e2e4, 0x0000d9e6 }, - { "TABLET.BBK", 1, 0x0117bcca, 0x00013902 }, - { "TABLET.PCX", 1, 0x0118f5cc, 0x0000af16 }, - { "TALLPYG.DOG", 1, 0x0119a4e2, 0x0000034a }, - { "TAM1.DOG", 1, 0x0119a82c, 0x00001e8a }, - { "TAM2.DOG", 1, 0x0119c6b6, 0x0000076c }, - { "TAM3.DOG", 1, 0x0119ce22, 0x000007c2 }, - { "TAM4.DOG", 1, 0x0119d5e4, 0x0000083c }, - { "TEMPLE.ACT", 1, 0x0119de20, 0x00005052 }, - { "TMPD.ACT", 1, 0x011a2e72, 0x0000b00c }, - { "TRADER.ACT", 1, 0x011ade7e, 0x0001424a }, - { "V1.BBK", 1, 0x011c20c8, 0x00006724 }, - { "V1.PCX", 1, 0x011c87ec, 0x000091ea }, - { "V1.SAM", 1, 0x011d19d6, 0x000061e5 }, - { "V10.BBK", 1, 0x011d7bbb, 0x000094e8 }, - { "V10.PCX", 1, 0x011e10a3, 0x0000946c }, - { "V11.BBK", 1, 0x011ea50f, 0x0000e122 }, - { "V11.PCX", 1, 0x011f8631, 0x0000946c }, - { "V2.BBK", 1, 0x01201a9d, 0x00007dfb }, - { "V2.LUM", 1, 0x01209898, 0x00000018 }, - { "V2.MSK", 1, 0x012098b0, 0x00001f40 }, - { "V2.PCX", 1, 0x0120b7f0, 0x0000876c }, - { "V3.BBK", 1, 0x01213f5c, 0x0000d716 }, - { "V3.LUM", 1, 0x01221672, 0x00000018 }, - { "V3.MSK", 1, 0x0122168a, 0x00001f40 }, - { "V3.PCX", 1, 0x012235ca, 0x00005efa }, - { "V4.BBK", 1, 0x012294c4, 0x0000571a }, - { "V4.PCX", 1, 0x0122ebde, 0x00010cd4 }, - { "V5.BBK", 1, 0x0123f8b2, 0x0001c43f }, - { "V5.MSK", 1, 0x0125bcf1, 0x00001f40 }, - { "V5.PCX", 1, 0x0125dc31, 0x00009148 }, - { "V5.SAM", 1, 0x01266d79, 0x0003953d }, - { "V5B.SAM", 1, 0x012a02b6, 0x0000ce6f }, - { "V5C.SAM", 1, 0x012ad125, 0x0000f142 }, - { "V5D.SAM", 1, 0x012bc267, 0x00000f50 }, - { "V5E.SAM", 1, 0x012bd1b7, 0x00009352 }, - { "V5X.SAM", 1, 0x012c6509, 0x0001d7c2 }, - { "V6.BBK", 1, 0x012e3ccb, 0x0000d716 }, - { "V6.LUM", 1, 0x012f13e1, 0x00000018 }, - { "V6.MSK", 1, 0x012f13f9, 0x00001f40 }, - { "V6.PCX", 1, 0x012f3339, 0x000074ce }, - { "V7.BBK", 1, 0x012fa807, 0x000177cd }, - { "V7.PCX", 1, 0x01311fd4, 0x0000a3b4 }, - { "V8.BBK", 1, 0x0131c388, 0x00006724 }, - { "V8.PCX", 1, 0x01322aac, 0x0000a8d0 }, - { "VACUUM.SAM", 1, 0x0132d37c, 0x00009516 }, - { "WATER.ACT", 1, 0x01336892, 0x00001c02 }, - { "WEDGE.ACT", 1, 0x01338494, 0x0000390e }, - { "WEDGE.DOG", 1, 0x0133bda2, 0x000002c4 }, - { "WEENIE.SAM", 1, 0x0133c066, 0x0000b4d2 }, - { "WITCH1.DOG", 1, 0x01347538, 0x000012e4 }, - { "WITCH2.DOG", 1, 0x0134881c, 0x0000088e }, - { "WITCH3.DOG", 1, 0x013490aa, 0x00000df8 }, - { "WITCH4.DOG", 1, 0x01349ea2, 0x000002b2 }, - { "X1.BBK", 1, 0x0134a154, 0x00010e5d }, - { "X1.PCX", 1, 0x0135afb1, 0x0000cc4b }, - { "X10.BBK", 1, 0x01367bfc, 0x00009907 }, - { "X10.PCX", 1, 0x01371503, 0x0000a1b3 }, - { "X10_JOE.ACT", 1, 0x0137b6b6, 0x0000943a }, - { "X10_RITA.ACT", 1, 0x01384af0, 0x000076d9 }, - { "X11.BBK", 1, 0x0138c1c9, 0x00016966 }, - { "X11.PCX", 1, 0x013a2b2f, 0x0000c160 }, - { "X11_JOE.ACT", 1, 0x013aec8f, 0x0000872e }, - { "X11_RITA.ACT", 1, 0x013b73bd, 0x0000a6f2 }, - { "X2.BBK", 1, 0x013c1aaf, 0x0000df2b }, - { "X2.PCX", 1, 0x013cf9da, 0x00013ed5 }, - { "X2_JOE.ACT", 1, 0x013e38af, 0x00008042 }, - { "X2_RITA.ACT", 1, 0x013eb8f1, 0x0000df02 }, - { "X3.BBK", 1, 0x013f97f3, 0x00000002 }, - { "X3.PCX", 1, 0x013f97f5, 0x0000d165 }, - { "X3_RITA.ACT", 1, 0x0140695a, 0x0000a0fa }, - { "X4.BBK", 1, 0x01410a54, 0x00004b53 }, - { "X4.PCX", 1, 0x014155a7, 0x0000b51b }, - { "X4A.SAM", 1, 0x01420ac2, 0x0001b456 }, - { "X4B.SAM", 1, 0x0143bf18, 0x0002a1b4 }, - { "X4_JOE.ACT", 1, 0x014660cc, 0x000088a5 }, - { "X4_RITA.ACT", 1, 0x0146e971, 0x0000398a }, - { "X5.BBK", 1, 0x014722fb, 0x000075a0 }, - { "X5.PCX", 1, 0x0147989b, 0x0000adeb }, - { "X5_SPARK.ACT", 1, 0x01484686, 0x00006e5a }, - { "X6.BBK", 1, 0x0148b4e0, 0x0001889e }, - { "X6.PCX", 1, 0x014a3d7e, 0x0000be75 }, - { "X6_HUGH.ACT", 1, 0x014afbf3, 0x0000c25a }, - { "X7.BBK", 1, 0x014bbe4d, 0x00002ada }, - { "X7.PCX", 1, 0x014be927, 0x00009456 }, - { "X7A.SAM", 1, 0x014c7d7d, 0x0001b7cb }, - { "X7B.SAM", 1, 0x014e3548, 0x0003b107 }, - { "X8.BBK", 1, 0x0151e64f, 0x00032a14 }, - { "X8.PCX", 1, 0x01551063, 0x00013d4f }, - { "X9.BBK", 1, 0x01564db2, 0x00028337 }, - { "X9.PCX", 1, 0x0158d0e9, 0x0000a31c }, - { "ZOMBIE.ACT", 1, 0x01597405, 0x000078ea }, - { "ZOMBIE1.DOG", 1, 0x0159ecef, 0x00000f6a }, - { "ZOMBIE2.DOG", 1, 0x0159fc59, 0x00000c40 } -}; - - writeRecord(_resourceTablePEM10, sizeof(_resourceTablePEM10), GBVARS_RESOURCETABLEPM10_INDEX , GBVARS_QUEEN); -} - -void Queen_addRestables() { - addRestables_resourceTablePEM10(); -}
\ No newline at end of file diff --git a/backends/platform/PalmOS/Src/builder/queen/bq_talk.c b/backends/platform/PalmOS/Src/builder/queen/bq_talk.c deleted file mode 100644 index 4798a3bbe0..0000000000 --- a/backends/platform/PalmOS/Src/builder/queen/bq_talk.c +++ /dev/null @@ -1,518 +0,0 @@ -#include <PalmOS.h> -#include "b_globals.h" - -typedef struct { - const char name[11]; // Nstr - signed char state,faceDirection; // S,F - signed char body,bf,rf,af; - const char animation[80]; // SANIMstr - signed char ff; -} SpeechParameters; - -UInt8 *ptr; - -static UInt32 resize(void *p, UInt32 more) { - UInt32 old = MemPtrSize(p); - UInt8 *np = MemPtrNew(old + more); - MemMove(np, ptr, old); - MemPtrFree(ptr); - ptr = np; - - return old; -} - -#define DO_AddFunc(XX) \ - static UInt32 addTalk_speechParameters_part##XX() { \ - SpeechParameters _speechParameters_part[] = { - -#define DO_EndFunc \ - }; \ - UInt32 size = sizeof(_speechParameters_part); \ - UInt32 old = resize(ptr, size); \ - MemMove(ptr + old, _speechParameters_part, size); \ - return MemPtrSize(ptr); \ - } - -DO_AddFunc(1) - { "JOE",0,1,1,10,2,3,"",0}, - { "JOE",0,3,3,28,2,3,"",0}, - { "JOE",0,4,5,38,1,0,"",0}, - - { "JOE",1,1,1,45,-1,0,"",0}, - { "JOE",1,3,3,28,2,3,"",0}, - { "JOE",1,4,5,38,1,0,"",0}, - - { "JOE",2,1,1,46,-1,0,"",0}, - { "JOE",2,3,3,28,2,3,"",0}, - { "JOE",2,4,5,38,1,0,"",0}, - - { "JOE",3,1,1,47,-1,0,"",0}, - { "JOE",3,3,3,28,2,3,"",0}, - { "JOE",3,4,5,38,1,0,"",0}, - - { "JOE",4,1,1,50,-1,0,"",0}, - { "JOE",4,3,3,28,2,3,"",0}, - { "JOE",4,4,5,38,1,0,"",0}, - - { "JOE",5,1,2,0,0,0,"",0}, - { "JOE",5,3,4,0,0,0,"",0}, - { "JOE",5,4,6,0,0,0,"",0}, - - { "JOE",6,1,1,48,0,1,"",0}, - { "JOE",6,3,3,28,2,3,"",0}, - { "JOE",6,4,5,38,1,0,"",0}, - - { "JOE",7,1,1,51,0,1,"",0}, - { "JOE",7,3,3,28,2,3,"",0}, - { "JOE",7,4,5,38,1,0,"",0}, - - { "JOE",8,1,1,26,0,0,"",0}, - { "JOE",8,3,3,28,2,3,"",0}, - { "JOE",8,4,5,38,1,0,"",0}, - - { "JOE",9,1,1,29,0,0,"",0}, - { "JOE",9,3,3,28,0,0,"",0}, - { "JOE",9,4,5,38,0,0,"",0}, - - { "JOE",10,1,1,12,0,0,"T046,010,010,010,012,012,012,012,012,012,012,012,012,012,012,012,012,012,010,000",0}, - { "JOE",10,3,3,18,0,0,"",0}, - { "JOE",10,4,5,44,0,0,"",0}, - - { "JOE",11,1,1,53,-1,0,"",0}, - { "JOE",11,3,3,28,2,3,"",0}, - { "JOE",11,4,5,38,1,0,"",0}, - - { "JOE",12,1,1,10,2,3,"",0}, - { "JOE",12,3,3,28,2,0,"",0}, - { "JOE",12,4,5,38,1,0,"",0}, - - { "JOE",13,1,1,10,2,3,"T012,013,019,019,019,019,019,019,019,019,019,019,013,010,000",0}, - { "JOE",13,3,3,28,2,3,"",0}, - { "JOE",13,4,5,38,1,0,"",0}, - - { "JOE",14,1,1,16,2,3,"",16}, - { "JOE",14,3,3,28,2,3,"",0}, - { "JOE",14,4,5,38,1,0,"",0}, - - { "JOE",15,1,1,58,-1,0,"",0}, - { "JOE",15,3,3,28,2,3,"",0}, - { "JOE",15,4,5,38,1,0,"",0}, - - { "JOE",16,1,1,59,-1,0,"",0}, - { "JOE",16,3,3,28,2,3,"",0}, - { "JOE",16,4,5,38,1,0,"",0}, - - { "JOE",17,1,1,56,-1,0,"",0}, - { "JOE",17,3,3,28,2,3,"",0}, - { "JOE",17,4,5,38,1,0,"",0}, - - { "JOE",18,1,56,16,2,3,"T056,057,057,057,056,056,000",0}, - { "JOE",18,3,3,28,2,3,"",0}, - { "JOE",18,4,5,38,1,0,"",0}, - - { "JOE",19,1,54,16,2,3,"T054,055,057,056,000",0}, - { "JOE",19,3,3,28,2,3,"",0}, - { "JOE",19,4,5,38,1,0,"",0}, - - { "JOE",20,1,56,16,2,3,"T056,057,055,054,001,000",0}, - { "JOE",20,3,3,28,2,3,"",0}, - { "JOE",20,4,5,38,1,0,"",0}, - { "JOE",21,1,1,60,-1,0,"",0}, - { "JOE",21,3,3,28,2,3,"",0}, - { "JOE",21,4,61,38,1,0,"",0}, - - { "JOE",22,1,1,16,2,3,"T063,060,000",0}, - { "JOE",22,3,3,28,2,3,"",0}, - { "JOE",22,4,5,38,1,0,"",0}, - - { "JOE",23,1,1,16,2,3,"T060,063,001,000",0}, - { "JOE",23,3,3,28,2,3,"",0}, - { "JOE",23,4,5,38,1,0,"",0}, - - { "JOE",24,1,1,47,-2,0,"",0}, - { "JOE",24,3,3,28,2,3,"",0}, - { "JOE",24,4,5,38,1,0,"",0}, - - { "RICO",0,0,1,7,1,3,"",7}, - { "RICO",1,0,1,5,-1,0,"",7}, - { "RICO",2,0,1,9,0,3,"",7}, - { "RICO",3,0,1,4,-1,0,"",7}, - - { "EDDY",0,0,14,18,1,3,"",18}, - { "EDDY",1,0,14,0,0,0,"T016,017,017,016,016,017,017,016,016,017,017,000",18}, - - { "MIKE",0,0,1,2,2,3,"",2}, - - { "LOLA",0,0,30,33,2,3,"",33}, - { "LOLA",1,0,9,10,2,3,"",33}, - { "LOLA",2,0,30,33,2,3,"",33}, - { "LOLA",3,0,32,33,2,3,"",33}, - { "LOLA",4,0,8,0,0,0,"",33}, - { "LOLA",5,0,31,0,0,0,"",0}, - { "LOLA",6,0,31,0,0,0,"047,048,049,050,000",33}, -DO_EndFunc -DO_AddFunc(2) - { "LOLA_SHOWER",0,0,7,10,2,3,"",10}, - { "LOLA_SHOWER",1,0,9,10,2,3,"",10}, - { "LOLA_SHOWER",2,0,30,33,2,3,"",10}, - { "LOLA_SHOWER",3,0,32,33,2,3,"",10}, - { "LOLA_SHOWER",4,0,8,0,0,0,"",0}, - { "LOLA_SHOWER",5,0,61,0,0,0,"",0}, - { "LOLA_SHOWER",6,0,64,10,2,3,"",0}, - { "LOLA_SHOWER",7,0,31,0,0,0,"062,063,064,000",0}, - - { "SECRETARY",0,0,1,12,2,3,"",12}, - { "SECRETARY",1,0,1,12,2,0,"",12}, - { "SECRETARY",2,0,1,12,2,0,"",12}, - - { "SPARKY",0,0,21,23,2,3,"",23}, - { "SPARKY",1,0,21,22,0,0,"",0}, - { "SPARKY",2,0,21,22,0,0,"021,042,043,000",0}, - { "SPARKY",3,0,21,22,0,0,"043,042,021,000",0}, - { "SPARKY",4,0,43,43,1,0,"",0}, - { "SPARKY",14,0,21,29,5,0,"",29}, - - { "SPARKY-F",0,0,45,23,5,0,"",23}, - { "SPARKY-F",1,0,45,47,0,0,"",0}, - { "SPARKY-F",2,0,45,23,5,0,"045,046,046,045,000",23}, - { "SPARKY-F",14,0,45,29,5,0,"",29}, - - { "FAYE",0,0,19,35,2,3,"",35}, - { "FAYE",1,0,19,41,2,3,"",35}, - { "FAYE",2,0,19,28,-1,0,"",35}, - { "FAYE",3,0,19,20,0,0,"",0}, - { "FAYE",4,0,19,27,-1,0,"",35}, - { "FAYE",5,0,19,29,-1,0,"",35}, - { "FAYE",6,0,59,35,2,3,"",35}, - { "FAYE",7,0,19,30,-1,0,"",35}, - { "FAYE",8,0,19,31,-1,0,"",35}, - - { "BOB",0,0,27,34,2,3,"",34}, - { "BOB",1,0,27,28,-1,0,"",34}, - { "BOB",2,0,30,0,0,0,"",0}, - { "BOB",3,0,31,0,0,0,"",0}, - { "BOB",4,0,27,61,-1,0,"",34}, - { "BOB",5,0,27,42,1,0,"",42}, - - { "PYGMY",0,0,20,21,2,6,"",0}, - { "PYGMY",1,0,20,21,2,6,"020,068,068,068,068,068,068,068,068,020,000",0}, - { "PYGMY",2,0,20,21,2,6,"T028,029,030,031,031,031,031,030,029,028,035,000",0}, - { "PYGMY",3,0,20,21,2,6,"T035,036,037,038,037,038,037,038,036,035,000",0}, - { "PYGMY",4,0,20,21,2,6,"T032,033,032,033,032,033,035,000",0}, - { "PYGMY",5,0,20,21,2,6,"T023,022,021,022,023,024,025,026,027,026,025,024,023,000",0}, - { "PYGMY",6,0,20,21,2,6,"T034,034,034,035,000",0}, - - { "WITCH",0,0,39,40,2,6,"",40}, - { "WITCH",1,0,39,40,2,6,"073,074,000",40}, - { "WITCH",2,0,39,40,2,6,"074,073,000",40}, - { "WITCH",3,0,39,40,2,6,"T047,048,049,050,051,000",40}, - { "WITCH",4,0,39,40,2,6,"T052,053,054,055,056,057,058,057,056,056,056,055,054,053,052,000",40}, - { "WITCH",5,0,39,40,2,6,"069,070,071,072,073,074,000",40}, - { "WITCH",6,0,39,40,2,6,"074,073,072,071,070,069,070,000",40}, - { "WITCH",7,0,39,51,-1,0,"",40}, - { "WITCH",8,0,39,40,2,6,"T051,050,049,048,047,000",40}, - - { "CHIEF",0,0,1,7,1,7,"",3}, - { "CHIEF",1,0,1,2,2,6,"062,063,064,065,066,000",0}, - { "CHIEF",2,0,1,2,2,6,"066,065,064,063,062,000",0}, - { "CHIEF",3,0,1,17,-1,0,"",3}, - { "CHIEF",4,0,1,18,-1,0,"",3}, - { "CHIEF",5,0,1,19,-1,0,"",3}, - - { "NAOMI",0,0,1,2,2,3,"",2}, - { "NAOMI",1,0,1,2,2,6,"048,049,050,051,052,053,054,055,000",0}, - { "NAOMI",2,0,1,2,2,6,"055,054,053,052,051,050,049,048,000",0}, - { "NAOMI",3,0,1,13,-1,0,"",2}, - { "NAOMI",4,0,1,14,-1,0,"",2}, - { "NAOMI",5,0,1,10,-1,0,"",2}, - { "NAOMI",6,0,1,12,-1,0,"",2}, - { "NAOMI",7,0,1,12,-1,0,"T008,008,008,002,000",2}, - - { "WEDGEWOOD",0,0,8,1,2,0,"",8}, - { "WEDGEWOOD",1,0,1,1,3,0,"",1}, - - { "BUD",0,0,1,2,3,2,"",2}, - { "BUD",1,0,1,2,4,2,"T017,018,000",2}, - { "BUD",2,0,1,21,-1,0,"",2}, - { "BUD",3,0,1,14,-1,0,"",2}, - { "BUD",4,0,1,15,-1,0,"",2}, - { "BUD",5,0,1,20,-1,0,"",2}, - { "BUD",6,0,1,16,-1,0,"",2}, - { "BUD",7,0,1,19,-1,0,"",2}, - { "BUD",8,0,1,17,-1,0,"",2}, - { "BUD",9,0,1,14,-1,0,"T014,008,008,003,003,008,008,003,003,010,010,012,012,000",2}, - - { "LOU",0,0,1,2,2,3,"",2}, - { "LOU",1,0,1,2,4,2,"013,014,015,016,017,018,000",2}, - { "LOU",2,0,1,2,4,2,"018,017,016,015,014,013,000",2}, - - { "JIMMY",0,0,16,17,2,3,"",17}, - { "JIMMY",1,0,16,25,-1,0,"",17}, - { "JIMMY",2,0,16,26,-1,0,"",17}, - { "JIMMY",3,0,16,27,-1,0,"",17}, - { "JIMMY",4,0,16,28,-1,0,"",17}, - { "JIMMY",5,0,16,29,-1,0,"",17}, - - { "TAMMY",0,0,1,2,2,3,"",2}, - { "TAMMY",1,0,1,2,2,3,"T008,008,009,009,008,008,009,009,008,008,009,009,002,000",2}, - { "TAMMY",2,0,1,2,2,3,"T002,010,010,010,002,000",2}, - { "TAMMY",3,0,1,2,2,3,"T011,011,011,011,011,002,000",2}, - { "TAMMY",4,0,1,2,2,3,"T013,014,015,013,014,015,013,009,001,000",2}, - - { "SKULL",0,0,9,9,4,0,"",0}, - { "SKULL",1,0,1,9,4,0,"001,002,003,004,005,006,007,008,009,000",0}, - { "SKULL",2,0,1,9,4,0,"009,008,007,006,005,004,003,002,001,000",0}, -DO_EndFunc -DO_AddFunc(3) - { "APE",0,0,1,6,7,0,"",6}, - { "APE",1,0,1,6,7,0,"002,001,000",6}, - { "APE",2,0,1,6,7,0,"002,003,001,000",6}, - { "APE",3,0,1,6,7,0,"004,005,004,005,004,001,000",6}, - { "APE",4,0,1,6,7,0,"001,003,005,004,005,004,001,000",6}, - - { "APE1",0,0,15,16,7,0,"",16}, - { "APE2",0,0,14,6,7,0,"",6}, - - { "SHOWERAM",0,0,1,2,3,0,"",2}, - { "SHOWERAM",1,0,1,2,3,0,"026,027,028,029,001,000",2}, - { "SHOWERAM",2,0,1,2,3,0,"001,029,028,027,026,000",2}, - - { "PRINCESS1",0,0,19,23,2,3,"",23}, - { "PRINCESS1",1,0,19,41,-1,0,"",23}, - { "PRINCESS1",2,0,19,42,-1,0,"",23}, - { "PRINCESS1",3,0,19,45,-1,0,"",23}, - { "PRINCESS1",4,0,19,40,-1,0,"",23}, - { "PRINCESS1",5,0,19,45,2,3,"T40,043,044,045,000",45}, - { "PRINCESS1",6,0,19,45,-1,0,"T041,038,000",38}, - { "PRINCESS1",7,0,22,0,0,0,"",0}, - { "PRINCESS1",8,0,19,45,2,3,"T045,044,043,040,039,000",39}, - - { "PRINCESS2",0,0,46,23,2,3,"",23}, - { "PRINCESS2",1,0,46,29,2,3,"",29}, - { "PRINCESS2",2,0,46,29,2,3,"T029,036,035,000",35}, - - { "GUARDS",0,0,7,7,0,0,"",7}, - - { "AMGUARD",0,0,19,22,2,3,"",22}, - - { "MAN1",0,0,2,3,2,3,"",3}, - { "MAN2",0,0,9,10,1,2,"",10}, - - { "DOG",0,0,6,6,1,0,"",0}, - { "DOG",1,0,6,6,1,0,"010,009,008,000",0}, - { "DOG",2,0,6,6,1,0,"008,009,010,000",0}, - - { "CHEF",0,0,5,6,2,3,"",6}, - - { "HENRY",0,0,7,9,2,3,"",9}, - { "HENRY",1,0,7,21,-1,0,"",9}, - { "HENRY",2,0,7,19,-1,0,"",9}, - { "HENRY",3,0,7,20,-1,0,"",9}, - { "HENRY",4,0,8,9,2,3,"",9}, - { "HENRY",5,0,23,9,-1,0,"",9}, - { "HENRY",6,0,7,9,2,3,"T019,015,017,017,017,017,017,017,017,015,009,000",9}, - { "HENRY",7,0,7,9,2,3,"T018,010,000",10}, - { "HENRY",8,0,7,9,2,3,"T018,016,000",16}, - { "HENRY",9,0,7,9,2,3,"T018,011,000",11}, - { "HENRY",10,0,29,33,1,1,"",33}, - { "HENRY",11,0,7,30,2,0,"",9}, - { "HENRY",12,0,7,9,2,3,"025,026,000",26}, - { "HENRY",13,0,7,9,2,3,"027,028,027,028,000",28}, - { "HENRY",14,0,7,9,2,3,"026,025,007,000",9}, - - { "JOHAN",0,0,1,15,2,3,"",15}, - { "JOHAN",1,0,1,0,0,0,"T006,007,008,000",15}, - { "JOHAN",2,0,1,15,2,3,"T002,003,004,005,004,005,004,005,004,005,004,005,004,003,002,000",15}, - { "JOHAN",3,0,1,8,-1,0,"",15}, - { "JOHAN",4,0,1,0,0,0,"T008,007,006,001,000",15}, - - { "KLUNK",0,0,1,2,2,3,"",2}, - { "KLUNK",1,0,1,2,2,3,"019,020,021,022,001,000",2}, - { "KLUNK",2,0,1,2,2,3,"001,022,021,020,019,016,517,000",2}, - { "KLUNK",3,0,1,2,2,3,"T010,011,010,011,010,011,009,000",2}, - - { "FRANK",0,0,13,14,2,3,"",14}, - { "FRANK",1,0,13,20,0,1,"",14}, - { "FRANK",2,0,13,14,2,3,"025,026,027,027,027,026,026,026,027,027,026,026,027,025,013,000",14}, - { "FRANK",3,0,28,14,2,3,"",14}, - - { "DEATH",0,0,1,2,2,3,"",2}, - { "DEATH",1,0,1,2,2,3,"013,014,015,016,017,001,000",0}, - { "DEATH",2,0,1,2,2,3,"001,017,016,015,014,013,000",0}, - { "DEATH",3,0,1,2,2,3,"T018,019,020,021,021,022,022,020,021,022,020,021,022,023,024,524,000",2}, - { "DEATH",4,0,1,2,2,3,"T025,026,027,028,028,028,028,028,028,028,028,028,029,035,000",2}, - { "DEATH",5,0,1,2,2,3,"T030,031,032,033,033,033,033,033,033,033,033,033,034,035,000",2}, - { "DEATH",6,0,1,2,2,3,"T023,022,020,019,018,001,000",2}, - - { "JASPAR",0,0,1,1,22,0,"026,027,028,029,028,029,028,029,030,023,000",0}, - { "JASPAR",1,0,1,1,22,0,"023,026,000",0}, - - { "ORACLE",0,0,1,5,3,0,"",0}, - - { "ZOMBIE",0,0,1,5,2,3,"",5}, - { "ZOMBIE",1,0,1,12,-1,0,"",5}, - { "ZOMBIE",2,0,1,13,-1,0,"",5}, - { "ZOMBIE",3,0,1,1,5,5,"",5}, - - { "ZOMBIE2",0,0,14,14,0,0,"",0}, - { "ZOMBIE3",0,0,18,18,0,0,"",0}, - - { "ANDERSON",0,0,7,8,2,3,"",8}, - { "ANDERSON",1,0,7,8,1,0,"",8}, - { "ANDERSON",2,0,7,16,-1,0,"",8}, - { "ANDERSON",3,0,7,18,-1,0,"",8}, - { "ANDERSON",4,0,7,19,-1,0,"",8}, - { "ANDERSON",5,0,7,20,-1,0,"",8}, - { "ANDERSON",6,0,7,21,1,0,"",8}, - - { "COMPY",0,0,12,12,-1,0,"",0}, - { "COMPY",1,0,10,10,10,0,"010,011,012,012,013,014,014,000",0}, - { "COMPY",2,0,10,10,10,0,"014,013,012,000",0}, - - { "DEINO",0,0,13,13,-1,0,"",0}, - { "DEINO",1,0,9,9,9,0,"009,010,000",0}, - - { "TMPD",0,0,19,22,2,3,"",22}, - - { "IAN",0,0,7,9,2,3,"",9}, - { "IAN",1,0,8,25,3,0,"",25}, - { "IAN",2,0,7,21,-1,0,"",9}, - { "IAN",3,0,7,22,1,0,"",9}, - { "IAN",4,0,7,22,-1,0,"",9}, - { "IAN",5,0,7,24,-1,0,"",9}, - { "IAN",6,0,7,9,2,3,"034,034,034,035,035,036,036,035,035,036,035,036,035,000",9}, - { "IAN",7,0,7,31,-1,0,"",9}, -DO_EndFunc -DO_AddFunc(4) - { "FAYE-H",0,0,1,1,4,1,"",1}, - { "FAYE-H",1,0,1,1,4,1,"007,000",7}, - { "FAYE-H",2,0,1,1,4,1,"009,010,011,009,001,000",1}, - { "FAYE-H",3,0,1,1,4,1,"E012,013,000",1}, - { "FAYE-H",4,0,1,1,4,1,"E015,000",1}, - { "FAYE-H",5,0,1,1,4,1,"E014,000",1}, - - { "AZURA-H",0,0,1,1,4,1,"",1}, - { "AZURA-H",1,0,1,1,4,1,"007,000",7}, - { "AZURA-H",2,0,1,1,4,1,"009,010,011,009,001,000",1}, - { "AZURA-H",3,0,1,1,4,1,"E012,013,000",1}, - { "AZURA-H",4,0,1,1,4,1,"E015,000",1}, - { "AZURA-H",5,0,1,1,4,1,"E014,000",1}, - - { "FRANK-H",0,0,1,1,4,1,"",1}, - { "FRANK-H",1,0,1,1,4,1,"E009,000",1}, - { "FRANK-H",2,0,1,1,4,1,"E007,000",1}, - { "FRANK-H",3,0,1,1,4,1,"010,011,012,013,014,015,010,000",1}, - - { "JOE-E",0,0,1,2,4,1,"",2}, - { "JOE-E",6,0,1,2,4,1,"008,009,008,002,000",2}, - - { "AZURA-E",0,0,1,1,5,1,"",1}, - { "AZURA-E",1,0,1,1,5,1,"009,010,009,008,000",1}, - - { "FAYE-E",0,0,1,4,4,1,"",1}, - { "FAYE-E",1,0,1,4,4,1,"002,003,002,001,000",1}, - - { "ANDSON-E",0,0,1,3,4,1,"",1}, - { "ANDSON-E",1,0,1,3,4,1,"002,001,000",1}, - - { "JOE-H",0,0,1,1,4,4,"",1}, - { "JOE-H",1,0,1,1,2,3,"012,013,014,000",14}, - { "JOE-H",2,0,1,1,2,3,"010,011,000",11}, - { "JOE-H",3,0,1,1,2,3,"014,013,012,001,000",1}, - { "JOE-H",4,0,1,13,1,0,"",13}, - - { "RITA-H",0,0,7,1,2,3,"",1}, - { "RITA-H",1,0,7,0,0,0,"009,010,011,012,013,000",13}, - { "RITA-H",2,0,7,0,0,0,"014,015,016,000",16}, - { "RITA-H",3,0,7,0,0,0,"013,012,011,010,000",10}, - { "RITA-H",4,0,7,0,0,0,"009,007,008,007,009,000",9}, - { "RITA-H",5,0,7,0,0,0,"016,015,014,000",14}, - - { "RITA",0,0,1,4,2,3,"",4}, - { "RITA",1,0,2,4,2,3,"",4}, - - { "SPARKY-H",0,0,1,1,2,3,"",1}, - - { "HUGH",0,0,1,1,2,3,"",1}, - { "HUGH",1,0,7,7,2,3,"",7}, - - { "X2_JOE",0,0,1,1,2,3,"",1}, - { "X2_JOE",1,0,1,1,2,3,"001,007,008,008,007,001,000",1}, - - { "X2_RITA",0,0,1,1,2,3,"",1}, - { "X2_RITA",1,0,1,1,2,3,"001,007,008,008,007,001,000",1}, - - { "X3_RITA",0,0,1,1,4,1,"",1}, - { "X3_RITA",1,0,1,1,4,1,"007,000",7}, - { "X3_RITA",2,0,1,1,4,1,"009,010,011,009,001,000",1}, - { "X3_RITA",3,0,1,1,4,1,"E012,013,000",1}, - { "X3_RITA",4,0,1,1,4,1,"E015,000",1}, - { "X3_RITA",5,0,1,1,4,1,"E014,000",1}, - - { "X4_JOE",0,0,1,1,3,4,"",1}, - { "X4_JOE",1,0,1,13,2,3,"",13}, - { "X4_JOE",2,0,1,1,3,4,"009,010,011,012,013,000",13}, - { "X4_JOE",3,0,1,1,3,4,"012,011,010,009,000",9}, - { "X4_JOE",4,0,1,1,3,4,"001,019,000",19}, - - { "X4_RITA",0,0,1,1,0,1,"",1}, - { "X4_RITA",1,0,1,7,0,1,"",7}, - { "X4_RITA",2,0,1,1,3,4,"004,005,006,006,006,006,007,000",7}, - { "X4_RITA",3,0,1,1,3,4,"005,004,001,000",1}, - { "X4_RITA",4,0,1,1,3,4,"001,003,000",3}, - - { "X5_SPARKY",0,0,1,1,2,3,"",1}, - { "X5_SPARKY",1,0,1,1,2,3,"001,010,011,011,001,000",1}, - { "X5_SPARKY",2,0,1,1,2,3,"001,007,008,009,000",9}, - - { "X6_HUGH",0,0,1,1,2,3,"",1}, - { "X6_HUGH",1,0,1,1,2,3,"007,007,007,007,,001,000",1}, - { "X6_HUGH",2,0,1,1,2,3,"008,008,008,008,008,009,009,008,008,008,009,008,000",8}, - - { "X10_JOE",0,0,1,2,2,3,"",2}, - { "X10_JOE",1,0,1,8,2,3,"",8}, - { "X10_JOE",2,0,1,2,2,3,"014,014,014,015,015,014,014,015,015,000",2}, - - { "X10_RITA",0,0,1,2,2,3,"",2}, - - { "X11_JOE",0,0,1,2,0,1,"",2}, - - { "X11_RITA",0,0,1,2,0,1,"",2}, - { "X11_RITA",1,0,1,2,1,0,"003,004,000",4}, - - { "JOHN", 0, 0, 1, 2, 2, 3, "", 1 }, - { "JOHN", 1, 0, 1, 15, -1, 0, "", 1 }, - { "JOHN", 2, 0, 1, 16, -1, 0, "", 1 }, - { "JOHN", 3, 0, 1, 17, -1, 0, "", 1 }, - - { "STEVE", 0, 0, 8, 2, 2, 3, "", 2 }, - { "STEVE", 1, 0, 8, 16, -1, 0, "", 2 }, - { "STEVE", 2, 0, 9, 18, -1, 0, "T016,017,017,016,008,000", 2 }, - { "STEVE", 3, 0, 8, 18, -1, 0, "", 2 }, - - { "TONY", 0, 0, 1, 2, 2, 3, "", 1 }, - { "TONY", 1, 0, 1, 12, -1, 0, "", 1 }, - - { "*",0,0,0,0,0,0,"",0} -DO_EndFunc - -static void addTalk_speechParameters() { - UInt32 remove, size; - - remove = 10; - ptr = MemPtrNew(remove); - - size = addTalk_speechParameters_part1(); - size = addTalk_speechParameters_part2(); - size = addTalk_speechParameters_part3(); - size = addTalk_speechParameters_part4(); - - size = MemPtrSize(ptr) - remove; - - writeRecord(ptr + remove, size, GBVARS_SPEECHPARAMETERS_INDEX , GBVARS_QUEEN); - MemPtrFree(ptr); -} - -void Queen_addTalk() { - addTalk_speechParameters(); -}
\ No newline at end of file diff --git a/backends/platform/PalmOS/Src/builder/scumm/bl_akos.c b/backends/platform/PalmOS/Src/builder/scumm/bl_akos.c deleted file mode 100644 index e5f7c2721f..0000000000 --- a/backends/platform/PalmOS/Src/builder/scumm/bl_akos.c +++ /dev/null @@ -1,117 +0,0 @@ -#include <PalmOS.h> -#include "b_globals.h" - -static void addAkos_bigScaleTable() { -byte bigCostumeScaleTable[768] = { - 0x00, 0x80, 0x40, 0xC0, 0x20, 0xA0, 0x60, 0xE0, - 0x10, 0x90, 0x50, 0xD0, 0x30, 0xB0, 0x70, 0xF0, - 0x08, 0x88, 0x48, 0xC8, 0x28, 0xA8, 0x68, 0xE8, - 0x18, 0x98, 0x58, 0xD8, 0x38, 0xB8, 0x78, 0xF8, - 0x04, 0x84, 0x44, 0xC4, 0x24, 0xA4, 0x64, 0xE4, - 0x14, 0x94, 0x54, 0xD4, 0x34, 0xB4, 0x74, 0xF4, - 0x0C, 0x8C, 0x4C, 0xCC, 0x2C, 0xAC, 0x6C, 0xEC, - 0x1C, 0x9C, 0x5C, 0xDC, 0x3C, 0xBC, 0x7C, 0xFC, - 0x02, 0x82, 0x42, 0xC2, 0x22, 0xA2, 0x62, 0xE2, - 0x12, 0x92, 0x52, 0xD2, 0x32, 0xB2, 0x72, 0xF2, - 0x0A, 0x8A, 0x4A, 0xCA, 0x2A, 0xAA, 0x6A, 0xEA, - 0x1A, 0x9A, 0x5A, 0xDA, 0x3A, 0xBA, 0x7A, 0xFA, - 0x06, 0x86, 0x46, 0xC6, 0x26, 0xA6, 0x66, 0xE6, - 0x16, 0x96, 0x56, 0xD6, 0x36, 0xB6, 0x76, 0xF6, - 0x0E, 0x8E, 0x4E, 0xCE, 0x2E, 0xAE, 0x6E, 0xEE, - 0x1E, 0x9E, 0x5E, 0xDE, 0x3E, 0xBE, 0x7E, 0xFE, - 0x01, 0x81, 0x41, 0xC1, 0x21, 0xA1, 0x61, 0xE1, - 0x11, 0x91, 0x51, 0xD1, 0x31, 0xB1, 0x71, 0xF1, - 0x09, 0x89, 0x49, 0xC9, 0x29, 0xA9, 0x69, 0xE9, - 0x19, 0x99, 0x59, 0xD9, 0x39, 0xB9, 0x79, 0xF9, - 0x05, 0x85, 0x45, 0xC5, 0x25, 0xA5, 0x65, 0xE5, - 0x15, 0x95, 0x55, 0xD5, 0x35, 0xB5, 0x75, 0xF5, - 0x0D, 0x8D, 0x4D, 0xCD, 0x2D, 0xAD, 0x6D, 0xED, - 0x1D, 0x9D, 0x5D, 0xDD, 0x3D, 0xBD, 0x7D, 0xFD, - 0x03, 0x83, 0x43, 0xC3, 0x23, 0xA3, 0x63, 0xE3, - 0x13, 0x93, 0x53, 0xD3, 0x33, 0xB3, 0x73, 0xF3, - 0x0B, 0x8B, 0x4B, 0xCB, 0x2B, 0xAB, 0x6B, 0xEB, - 0x1B, 0x9B, 0x5B, 0xDB, 0x3B, 0xBB, 0x7B, 0xFB, - 0x07, 0x87, 0x47, 0xC7, 0x27, 0xA7, 0x67, 0xE7, - 0x17, 0x97, 0x57, 0xD7, 0x37, 0xB7, 0x77, 0xF7, - 0x0F, 0x8F, 0x4F, 0xCF, 0x2F, 0xAF, 0x6F, 0xEF, - 0x1F, 0x9F, 0x5F, 0xDF, 0x3F, 0xBF, 0x7F, 0xFE, - - 0x00, 0x80, 0x40, 0xC0, 0x20, 0xA0, 0x60, 0xE0, - 0x10, 0x90, 0x50, 0xD0, 0x30, 0xB0, 0x70, 0xF0, - 0x08, 0x88, 0x48, 0xC8, 0x28, 0xA8, 0x68, 0xE8, - 0x18, 0x98, 0x58, 0xD8, 0x38, 0xB8, 0x78, 0xF8, - 0x04, 0x84, 0x44, 0xC4, 0x24, 0xA4, 0x64, 0xE4, - 0x14, 0x94, 0x54, 0xD4, 0x34, 0xB4, 0x74, 0xF4, - 0x0C, 0x8C, 0x4C, 0xCC, 0x2C, 0xAC, 0x6C, 0xEC, - 0x1C, 0x9C, 0x5C, 0xDC, 0x3C, 0xBC, 0x7C, 0xFC, - 0x02, 0x82, 0x42, 0xC2, 0x22, 0xA2, 0x62, 0xE2, - 0x12, 0x92, 0x52, 0xD2, 0x32, 0xB2, 0x72, 0xF2, - 0x0A, 0x8A, 0x4A, 0xCA, 0x2A, 0xAA, 0x6A, 0xEA, - 0x1A, 0x9A, 0x5A, 0xDA, 0x3A, 0xBA, 0x7A, 0xFA, - 0x06, 0x86, 0x46, 0xC6, 0x26, 0xA6, 0x66, 0xE6, - 0x16, 0x96, 0x56, 0xD6, 0x36, 0xB6, 0x76, 0xF6, - 0x0E, 0x8E, 0x4E, 0xCE, 0x2E, 0xAE, 0x6E, 0xEE, - 0x1E, 0x9E, 0x5E, 0xDE, 0x3E, 0xBE, 0x7E, 0xFE, - 0x01, 0x81, 0x41, 0xC1, 0x21, 0xA1, 0x61, 0xE1, - 0x11, 0x91, 0x51, 0xD1, 0x31, 0xB1, 0x71, 0xF1, - 0x09, 0x89, 0x49, 0xC9, 0x29, 0xA9, 0x69, 0xE9, - 0x19, 0x99, 0x59, 0xD9, 0x39, 0xB9, 0x79, 0xF9, - 0x05, 0x85, 0x45, 0xC5, 0x25, 0xA5, 0x65, 0xE5, - 0x15, 0x95, 0x55, 0xD5, 0x35, 0xB5, 0x75, 0xF5, - 0x0D, 0x8D, 0x4D, 0xCD, 0x2D, 0xAD, 0x6D, 0xED, - 0x1D, 0x9D, 0x5D, 0xDD, 0x3D, 0xBD, 0x7D, 0xFD, - 0x03, 0x83, 0x43, 0xC3, 0x23, 0xA3, 0x63, 0xE3, - 0x13, 0x93, 0x53, 0xD3, 0x33, 0xB3, 0x73, 0xF3, - 0x0B, 0x8B, 0x4B, 0xCB, 0x2B, 0xAB, 0x6B, 0xEB, - 0x1B, 0x9B, 0x5B, 0xDB, 0x3B, 0xBB, 0x7B, 0xFB, - 0x07, 0x87, 0x47, 0xC7, 0x27, 0xA7, 0x67, 0xE7, - 0x17, 0x97, 0x57, 0xD7, 0x37, 0xB7, 0x77, 0xF7, - 0x0F, 0x8F, 0x4F, 0xCF, 0x2F, 0xAF, 0x6F, 0xEF, - 0x1F, 0x9F, 0x5F, 0xDF, 0x3F, 0xBF, 0x7F, 0xFE, - - 0x00, 0x80, 0x40, 0xC0, 0x20, 0xA0, 0x60, 0xE0, - 0x10, 0x90, 0x50, 0xD0, 0x30, 0xB0, 0x70, 0xF0, - 0x08, 0x88, 0x48, 0xC8, 0x28, 0xA8, 0x68, 0xE8, - 0x18, 0x98, 0x58, 0xD8, 0x38, 0xB8, 0x78, 0xF8, - 0x04, 0x84, 0x44, 0xC4, 0x24, 0xA4, 0x64, 0xE4, - 0x14, 0x94, 0x54, 0xD4, 0x34, 0xB4, 0x74, 0xF4, - 0x0C, 0x8C, 0x4C, 0xCC, 0x2C, 0xAC, 0x6C, 0xEC, - 0x1C, 0x9C, 0x5C, 0xDC, 0x3C, 0xBC, 0x7C, 0xFC, - 0x02, 0x82, 0x42, 0xC2, 0x22, 0xA2, 0x62, 0xE2, - 0x12, 0x92, 0x52, 0xD2, 0x32, 0xB2, 0x72, 0xF2, - 0x0A, 0x8A, 0x4A, 0xCA, 0x2A, 0xAA, 0x6A, 0xEA, - 0x1A, 0x9A, 0x5A, 0xDA, 0x3A, 0xBA, 0x7A, 0xFA, - 0x06, 0x86, 0x46, 0xC6, 0x26, 0xA6, 0x66, 0xE6, - 0x16, 0x96, 0x56, 0xD6, 0x36, 0xB6, 0x76, 0xF6, - 0x0E, 0x8E, 0x4E, 0xCE, 0x2E, 0xAE, 0x6E, 0xEE, - 0x1E, 0x9E, 0x5E, 0xDE, 0x3E, 0xBE, 0x7E, 0xFE, - 0x01, 0x81, 0x41, 0xC1, 0x21, 0xA1, 0x61, 0xE1, - 0x11, 0x91, 0x51, 0xD1, 0x31, 0xB1, 0x71, 0xF1, - 0x09, 0x89, 0x49, 0xC9, 0x29, 0xA9, 0x69, 0xE9, - 0x19, 0x99, 0x59, 0xD9, 0x39, 0xB9, 0x79, 0xF9, - 0x05, 0x85, 0x45, 0xC5, 0x25, 0xA5, 0x65, 0xE5, - 0x15, 0x95, 0x55, 0xD5, 0x35, 0xB5, 0x75, 0xF5, - 0x0D, 0x8D, 0x4D, 0xCD, 0x2D, 0xAD, 0x6D, 0xED, - 0x1D, 0x9D, 0x5D, 0xDD, 0x3D, 0xBD, 0x7D, 0xFD, - 0x03, 0x83, 0x43, 0xC3, 0x23, 0xA3, 0x63, 0xE3, - 0x13, 0x93, 0x53, 0xD3, 0x33, 0xB3, 0x73, 0xF3, - 0x0B, 0x8B, 0x4B, 0xCB, 0x2B, 0xAB, 0x6B, 0xEB, - 0x1B, 0x9B, 0x5B, 0xDB, 0x3B, 0xBB, 0x7B, 0xFB, - 0x07, 0x87, 0x47, 0xC7, 0x27, 0xA7, 0x67, 0xE7, - 0x17, 0x97, 0x57, 0xD7, 0x37, 0xB7, 0x77, 0xF7, - 0x0F, 0x8F, 0x4F, 0xCF, 0x2F, 0xAF, 0x6F, 0xEF, - 0x1F, 0x9F, 0x5F, 0xDF, 0x3F, 0xBF, 0x7F, 0xFF, -}; - writeRecord(bigCostumeScaleTable, sizeof(bigCostumeScaleTable), GBVARS_BIGSCALETABLE_INDEX , GBVARS_SCUMM); -} - - -/////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////// - -void addAkos() { - addAkos_bigScaleTable(); - -}
\ No newline at end of file diff --git a/backends/platform/PalmOS/Src/builder/scumm/bl_charset.c b/backends/platform/PalmOS/Src/builder/scumm/bl_charset.c deleted file mode 100644 index 1fe8d561af..0000000000 --- a/backends/platform/PalmOS/Src/builder/scumm/bl_charset.c +++ /dev/null @@ -1,689 +0,0 @@ -#include <PalmOS.h> -#include "b_globals.h" - -static void addCharset_germanCharsetDataV2() { - byte germanCharsetDataV2[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x01, 0x03, 0x06, 0x0c, 0x18, 0x3e, 0x03, 0x00, - 0x80, 0xc0, 0x60, 0x30, 0x18, 0x7c, 0xc0, 0x00, - 0x00, 0x03, 0x3e, 0x18, 0x0c, 0x06, 0x03, 0x01, - 0x00, 0xc0, 0x7c, 0x18, 0x30, 0x60, 0xc0, 0x80, - 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, - 0x03, 0x03, 0x03, 0x07, 0x07, 0x0f, 0x1f, 0x7f, - 0xe0, 0x80, 0x00, 0x00, 0x00, 0x00, 0x80, 0xe0, - 0x07, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x07, - 0x00, 0x00, 0x00, 0x01, 0x03, 0x06, 0x0c, 0x18, - 0x00, 0x00, 0x00, 0x80, 0xc0, 0x60, 0x30, 0x18, - 0x18, 0x30, 0x60, 0xc0, 0x80, 0x00, 0x00, 0x00, - 0x18, 0x0c, 0x06, 0x03, 0x01, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x1f, 0x1f, 0x18, 0x18, 0x18, - 0x00, 0x00, 0x00, 0xf8, 0xf8, 0x18, 0x18, 0x18, - 0x18, 0x18, 0x18, 0xf8, 0xf8, 0x00, 0x00, 0x00, - 0x18, 0x18, 0x18, 0x1f, 0x1f, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x03, 0x07, 0x0c, 0x18, 0x18, - 0x00, 0x00, 0x00, 0xc0, 0xe0, 0x30, 0x18, 0x18, - 0x18, 0x18, 0x30, 0xe0, 0xc0, 0x00, 0x00, 0x00, - 0x18, 0x18, 0x0c, 0x07, 0x03, 0x00, 0x00, 0x00, - 0x18, 0x18, 0x18, 0x1f, 0x1f, 0x18, 0x18, 0x18, - 0x18, 0x18, 0x18, 0xf8, 0xf8, 0x18, 0x18, 0x18, - 0x18, 0x18, 0x18, 0xff, 0xff, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0xff, 0xff, 0x18, 0x18, 0x18, - 0x18, 0x18, 0x18, 0xff, 0xff, 0x18, 0x18, 0x18, - 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, - 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, - 0x18, 0x3c, 0x66, 0xc3, 0xc3, 0x66, 0x3c, 0x18, - 0x18, 0x3c, 0x7e, 0xff, 0xff, 0x7e, 0x3c, 0x18, - 0x18, 0x66, 0xc3, 0xdb, 0xdb, 0xc3, 0x66, 0x18, - 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x18, 0x18, 0x18, 0x18, 0x00, 0x00, 0x18, 0x00, - 0x66, 0x66, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x66, 0x66, 0xff, 0x66, 0xff, 0x66, 0x66, 0x00, - 0x18, 0x3e, 0x60, 0x3c, 0x06, 0x7c, 0x18, 0x00, - 0x62, 0x66, 0x0c, 0x18, 0x30, 0x66, 0x46, 0x00, - 0x3c, 0x66, 0x3c, 0x38, 0x67, 0x66, 0x3f, 0x00, - 0x30, 0x18, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x0c, 0x18, 0x30, 0x30, 0x30, 0x18, 0x0c, 0x00, - 0x30, 0x18, 0x0c, 0x0c, 0x0c, 0x18, 0x30, 0x00, - 0x00, 0x66, 0x3c, 0xff, 0x3c, 0x66, 0x00, 0x00, - 0x00, 0x18, 0x18, 0x7e, 0x18, 0x18, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x30, - 0x00, 0x00, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, - 0x00, 0x03, 0x06, 0x0c, 0x18, 0x30, 0x60, 0x00, - 0x3c, 0x66, 0x66, 0x66, 0x66, 0x66, 0x3c, 0x00, - 0x18, 0x18, 0x38, 0x18, 0x18, 0x18, 0x7e, 0x00, - 0x3c, 0x66, 0x06, 0x0c, 0x30, 0x60, 0x7e, 0x00, - 0x3c, 0x66, 0x06, 0x1c, 0x06, 0x66, 0x3c, 0x00, - 0x06, 0x0e, 0x1e, 0x66, 0x7f, 0x06, 0x06, 0x00, - 0x7e, 0x60, 0x7c, 0x06, 0x06, 0x66, 0x3c, 0x00, - 0x3c, 0x66, 0x60, 0x7c, 0x66, 0x66, 0x3c, 0x00, - 0x7e, 0x66, 0x0c, 0x18, 0x18, 0x18, 0x18, 0x00, - 0x3c, 0x66, 0x66, 0x3c, 0x66, 0x66, 0x3c, 0x00, - 0x3c, 0x66, 0x66, 0x3e, 0x06, 0x66, 0x3c, 0x00, - 0x00, 0x00, 0x18, 0x00, 0x00, 0x18, 0x00, 0x00, - 0x00, 0x00, 0x18, 0x00, 0x00, 0x18, 0x18, 0x30, - 0x0e, 0x18, 0x30, 0x60, 0x30, 0x18, 0x0e, 0x00, - 0x7c, 0x82, 0xba, 0xa2, 0xa2, 0xba, 0x82, 0x7c, - 0x70, 0x18, 0x0c, 0x06, 0x0c, 0x18, 0x70, 0x00, - 0x3c, 0x66, 0x06, 0x0c, 0x18, 0x00, 0x18, 0x00, - 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, - 0x18, 0x3c, 0x66, 0x7e, 0x66, 0x66, 0x66, 0x00, - 0x7c, 0x66, 0x66, 0x7c, 0x66, 0x66, 0x7c, 0x00, - 0x3c, 0x66, 0x60, 0x60, 0x60, 0x66, 0x3c, 0x00, - 0x78, 0x6c, 0x66, 0x66, 0x66, 0x6c, 0x78, 0x00, - 0x7e, 0x60, 0x60, 0x78, 0x60, 0x60, 0x7e, 0x00, - 0x7e, 0x60, 0x60, 0x78, 0x60, 0x60, 0x60, 0x00, - 0x3c, 0x66, 0x60, 0x6e, 0x66, 0x66, 0x3c, 0x00, - 0x66, 0x66, 0x66, 0x7e, 0x66, 0x66, 0x66, 0x00, - 0x3c, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, - 0x1e, 0x0c, 0x0c, 0x0c, 0x0c, 0x6c, 0x38, 0x00, - 0x66, 0x6c, 0x78, 0x70, 0x78, 0x6c, 0x66, 0x00, - 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x7e, 0x00, - 0x63, 0x77, 0x7f, 0x6b, 0x63, 0x63, 0x63, 0x00, - 0x66, 0x76, 0x7e, 0x7e, 0x6e, 0x66, 0x66, 0x00, - 0x3c, 0x66, 0x66, 0x66, 0x66, 0x66, 0x3c, 0x00, - 0x7c, 0x66, 0x66, 0x7c, 0x60, 0x60, 0x60, 0x00, - 0x3c, 0x66, 0x66, 0x66, 0x66, 0x3c, 0x0e, 0x00, - 0x7c, 0x66, 0x66, 0x7c, 0x78, 0x6c, 0x66, 0x00, - 0x3c, 0x66, 0x60, 0x3c, 0x06, 0x66, 0x3c, 0x00, - 0x7e, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x00, - 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x3c, 0x00, - 0x66, 0x66, 0x66, 0x66, 0x66, 0x3c, 0x18, 0x00, - 0x63, 0x63, 0x63, 0x6b, 0x7f, 0x77, 0x63, 0x00, - 0x66, 0x66, 0x3c, 0x18, 0x3c, 0x66, 0x66, 0x00, - 0x66, 0x66, 0x66, 0x3c, 0x18, 0x18, 0x18, 0x00, - 0x7e, 0x06, 0x0c, 0x18, 0x30, 0x60, 0x7e, 0x00, - 0x66, 0x00, 0x66, 0x66, 0x66, 0x66, 0x3e, 0x00, - 0x66, 0x00, 0x3c, 0x06, 0x3e, 0x66, 0x3e, 0x00, - 0x66, 0x00, 0x66, 0x66, 0x66, 0x66, 0x3c, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0xdb, 0xdb, 0x00, - 0x00, 0x10, 0x30, 0x7f, 0x7f, 0x30, 0x10, 0x00, - 0x66, 0x66, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x3c, 0x06, 0x3e, 0x66, 0x3e, 0x00, - 0x00, 0x60, 0x60, 0x7c, 0x66, 0x66, 0x7c, 0x00, - 0x00, 0x00, 0x3c, 0x60, 0x60, 0x60, 0x3c, 0x00, - 0x00, 0x06, 0x06, 0x3e, 0x66, 0x66, 0x3e, 0x00, - 0x00, 0x00, 0x3c, 0x66, 0x7e, 0x60, 0x3c, 0x00, - 0x00, 0x0e, 0x18, 0x3e, 0x18, 0x18, 0x18, 0x00, - 0x00, 0x00, 0x3e, 0x66, 0x66, 0x3e, 0x06, 0x7c, - 0x00, 0x60, 0x60, 0x7c, 0x66, 0x66, 0x66, 0x00, - 0x00, 0x18, 0x00, 0x38, 0x18, 0x18, 0x3c, 0x00, - 0x00, 0x06, 0x00, 0x06, 0x06, 0x06, 0x06, 0x3c, - 0x00, 0x60, 0x60, 0x6c, 0x78, 0x6c, 0x66, 0x00, - 0x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, - 0x00, 0x00, 0x66, 0x7f, 0x7f, 0x6b, 0x63, 0x00, - 0x00, 0x00, 0x7c, 0x66, 0x66, 0x66, 0x66, 0x00, - 0x00, 0x00, 0x3c, 0x66, 0x66, 0x66, 0x3c, 0x00, - 0x00, 0x00, 0x7c, 0x66, 0x66, 0x7c, 0x60, 0x60, - 0x00, 0x00, 0x3e, 0x66, 0x66, 0x3e, 0x06, 0x06, - 0x00, 0x00, 0x7c, 0x66, 0x60, 0x60, 0x60, 0x00, - 0x00, 0x00, 0x3e, 0x60, 0x3c, 0x06, 0x7c, 0x00, - 0x00, 0x18, 0x7e, 0x18, 0x18, 0x18, 0x0e, 0x00, - 0x00, 0x00, 0x66, 0x66, 0x66, 0x66, 0x3e, 0x00, - 0x00, 0x00, 0x66, 0x66, 0x66, 0x3c, 0x18, 0x00, - 0x00, 0x00, 0x63, 0x6b, 0x7f, 0x3e, 0x36, 0x00, - 0x00, 0x00, 0x66, 0x3c, 0x18, 0x3c, 0x66, 0x00, - 0x00, 0x00, 0x66, 0x66, 0x66, 0x3e, 0x0c, 0x78, - 0x00, 0x00, 0x7e, 0x0c, 0x18, 0x30, 0x7e, 0x00, - 0x66, 0x00, 0x3c, 0x66, 0x66, 0x66, 0x3c, 0x00, - 0x66, 0x18, 0x3c, 0x66, 0x7e, 0x66, 0x66, 0x00, - 0x42, 0x3c, 0x66, 0x66, 0x66, 0x66, 0x3c, 0x00, - 0x1c, 0x36, 0x36, 0x7c, 0x66, 0x66, 0x7c, 0x40, - 0x08, 0x0c, 0x0e, 0xff, 0xff, 0x0e, 0x0c, 0x08, - }; - - writeRecord(germanCharsetDataV2, sizeof(germanCharsetDataV2), GBVARS_GERMANCHARSETDATAV2_INDEX , GBVARS_SCUMM); -} - -static void addCharset_frenchCharsetDataV2() { - byte frenchCharsetDataV2[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x01, 0x03, 0x06, 0x0c, 0x18, 0x3e, 0x03, 0x00, - 0x80, 0xc0, 0x60, 0x30, 0x18, 0x7c, 0xc0, 0x00, - 0x00, 0x03, 0x3e, 0x18, 0x0c, 0x06, 0x03, 0x01, - 0x00, 0xc0, 0x7c, 0x18, 0x30, 0x60, 0xc0, 0x80, - 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, - 0x03, 0x03, 0x03, 0x07, 0x07, 0x0f, 0x1f, 0x7f, - 0xe0, 0x80, 0x00, 0x00, 0x00, 0x00, 0x80, 0xe0, - 0x07, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x07, - 0x00, 0x00, 0x00, 0x01, 0x03, 0x06, 0x0c, 0x18, - 0x00, 0x00, 0x00, 0x80, 0xc0, 0x60, 0x30, 0x18, - 0x18, 0x30, 0x60, 0xc0, 0x80, 0x00, 0x00, 0x00, - 0x18, 0x0c, 0x06, 0x03, 0x01, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x1f, 0x1f, 0x18, 0x18, 0x18, - 0x00, 0x00, 0x00, 0xf8, 0xf8, 0x18, 0x18, 0x18, - 0x18, 0x18, 0x18, 0xf8, 0xf8, 0x00, 0x00, 0x00, - 0x18, 0x18, 0x18, 0x1f, 0x1f, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x03, 0x07, 0x0c, 0x18, 0x18, - 0x00, 0x00, 0x00, 0xc0, 0xe0, 0x30, 0x18, 0x18, - 0x18, 0x18, 0x30, 0xe0, 0xc0, 0x00, 0x00, 0x00, - 0x18, 0x18, 0x0c, 0x07, 0x03, 0x00, 0x00, 0x00, - 0x18, 0x18, 0x18, 0x1f, 0x1f, 0x18, 0x18, 0x18, - 0x18, 0x18, 0x18, 0xf8, 0xf8, 0x18, 0x18, 0x18, - 0x18, 0x18, 0x18, 0xff, 0xff, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0xff, 0xff, 0x18, 0x18, 0x18, - 0x18, 0x18, 0x18, 0xff, 0xff, 0x18, 0x18, 0x18, - 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, - 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, - 0x18, 0x3c, 0x66, 0xc3, 0xc3, 0x66, 0x3c, 0x18, - 0x18, 0x3c, 0x7e, 0xff, 0xff, 0x7e, 0x3c, 0x18, - 0x18, 0x66, 0xc3, 0xdb, 0xdb, 0xc3, 0x66, 0x18, - 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x18, 0x18, 0x18, 0x18, 0x00, 0x00, 0x18, 0x00, - 0x66, 0x66, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x66, 0x66, 0xff, 0x66, 0xff, 0x66, 0x66, 0x00, - 0x18, 0x3e, 0x60, 0x3c, 0x06, 0x7c, 0x18, 0x00, - 0x62, 0x66, 0x0c, 0x18, 0x30, 0x66, 0x46, 0x00, - 0x3c, 0x66, 0x3c, 0x38, 0x67, 0x66, 0x3f, 0x00, - 0x30, 0x18, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x0c, 0x18, 0x30, 0x30, 0x30, 0x18, 0x0c, 0x00, - 0x30, 0x18, 0x0c, 0x0c, 0x0c, 0x18, 0x30, 0x00, - 0x00, 0x66, 0x3c, 0xff, 0x3c, 0x66, 0x00, 0x00, - 0x00, 0x18, 0x18, 0x7e, 0x18, 0x18, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x30, - 0x00, 0x00, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, - 0x00, 0x03, 0x06, 0x0c, 0x18, 0x30, 0x60, 0x00, - 0x3c, 0x66, 0x66, 0x66, 0x66, 0x66, 0x3c, 0x00, - 0x18, 0x18, 0x38, 0x18, 0x18, 0x18, 0x7e, 0x00, - 0x3c, 0x66, 0x06, 0x0c, 0x30, 0x60, 0x7e, 0x00, - 0x3c, 0x66, 0x06, 0x1c, 0x06, 0x66, 0x3c, 0x00, - 0x06, 0x0e, 0x1e, 0x66, 0x7f, 0x06, 0x06, 0x00, - 0x7e, 0x60, 0x7c, 0x06, 0x06, 0x66, 0x3c, 0x00, - 0x3c, 0x66, 0x60, 0x7c, 0x66, 0x66, 0x3c, 0x00, - 0x7e, 0x66, 0x0c, 0x18, 0x18, 0x18, 0x18, 0x00, - 0x3c, 0x66, 0x66, 0x3c, 0x66, 0x66, 0x3c, 0x00, - 0x3c, 0x66, 0x66, 0x3e, 0x06, 0x66, 0x3c, 0x00, - 0x00, 0x00, 0x18, 0x00, 0x00, 0x18, 0x00, 0x00, - 0x00, 0x00, 0x18, 0x00, 0x00, 0x18, 0x18, 0x30, - 0x10, 0x08, 0x3c, 0x06, 0x3e, 0x66, 0x3e, 0x00, - 0x18, 0x24, 0x3c, 0x06, 0x3e, 0x66, 0x3e, 0x00, - 0x00, 0x00, 0x3c, 0x60, 0x60, 0x3c, 0x18, 0x38, - 0x3c, 0x66, 0x06, 0x0c, 0x18, 0x00, 0x18, 0x00, - 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, - 0x18, 0x3c, 0x66, 0x7e, 0x66, 0x66, 0x66, 0x00, - 0x7c, 0x66, 0x66, 0x7c, 0x66, 0x66, 0x7c, 0x00, - 0x3c, 0x66, 0x60, 0x60, 0x60, 0x66, 0x3c, 0x00, - 0x78, 0x6c, 0x66, 0x66, 0x66, 0x6c, 0x78, 0x00, - 0x7e, 0x60, 0x60, 0x78, 0x60, 0x60, 0x7e, 0x00, - 0x7e, 0x60, 0x60, 0x78, 0x60, 0x60, 0x60, 0x00, - 0x3c, 0x66, 0x60, 0x6e, 0x66, 0x66, 0x3c, 0x00, - 0x66, 0x66, 0x66, 0x7e, 0x66, 0x66, 0x66, 0x00, - 0x3c, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, - 0x1e, 0x0c, 0x0c, 0x0c, 0x0c, 0x6c, 0x38, 0x00, - 0x66, 0x6c, 0x78, 0x70, 0x78, 0x6c, 0x66, 0x00, - 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x7e, 0x00, - 0x63, 0x77, 0x7f, 0x6b, 0x63, 0x63, 0x63, 0x00, - 0x66, 0x76, 0x7e, 0x7e, 0x6e, 0x66, 0x66, 0x00, - 0x3c, 0x66, 0x66, 0x66, 0x66, 0x66, 0x3c, 0x00, - 0x7c, 0x66, 0x66, 0x7c, 0x60, 0x60, 0x60, 0x00, - 0x3c, 0x66, 0x66, 0x66, 0x66, 0x3c, 0x0e, 0x00, - 0x7c, 0x66, 0x66, 0x7c, 0x78, 0x6c, 0x66, 0x00, - 0x3c, 0x66, 0x60, 0x3c, 0x06, 0x66, 0x3c, 0x00, - 0x7e, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x00, - 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x3c, 0x00, - 0x66, 0x66, 0x66, 0x66, 0x66, 0x3c, 0x18, 0x00, - 0x63, 0x63, 0x63, 0x6b, 0x7f, 0x77, 0x63, 0x00, - 0x66, 0x66, 0x3c, 0x18, 0x3c, 0x66, 0x66, 0x00, - 0x66, 0x66, 0x66, 0x3c, 0x18, 0x18, 0x18, 0x00, - 0x7e, 0x06, 0x0c, 0x18, 0x30, 0x60, 0x7e, 0x00, - 0x08, 0x10, 0x3c, 0x66, 0x7e, 0x60, 0x3c, 0x00, - 0x10, 0x08, 0x3c, 0x66, 0x7e, 0x60, 0x3c, 0x00, - 0x18, 0x24, 0x3c, 0x66, 0x7e, 0x60, 0x3c, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0xdb, 0xdb, 0x00, - 0x00, 0x6c, 0x00, 0x38, 0x18, 0x18, 0x3c, 0x00, - 0x66, 0x66, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x3c, 0x06, 0x3e, 0x66, 0x3e, 0x00, - 0x00, 0x60, 0x60, 0x7c, 0x66, 0x66, 0x7c, 0x00, - 0x00, 0x00, 0x3c, 0x60, 0x60, 0x60, 0x3c, 0x00, - 0x00, 0x06, 0x06, 0x3e, 0x66, 0x66, 0x3e, 0x00, - 0x00, 0x00, 0x3c, 0x66, 0x7e, 0x60, 0x3c, 0x00, - 0x00, 0x0e, 0x18, 0x3e, 0x18, 0x18, 0x18, 0x00, - 0x00, 0x00, 0x3e, 0x66, 0x66, 0x3e, 0x06, 0x7c, - 0x00, 0x60, 0x60, 0x7c, 0x66, 0x66, 0x66, 0x00, - 0x00, 0x18, 0x00, 0x38, 0x18, 0x18, 0x3c, 0x00, - 0x00, 0x06, 0x00, 0x06, 0x06, 0x06, 0x06, 0x3c, - 0x00, 0x60, 0x60, 0x6c, 0x78, 0x6c, 0x66, 0x00, - 0x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, - 0x00, 0x00, 0x66, 0x7f, 0x7f, 0x6b, 0x63, 0x00, - 0x00, 0x00, 0x7c, 0x66, 0x66, 0x66, 0x66, 0x00, - 0x00, 0x00, 0x3c, 0x66, 0x66, 0x66, 0x3c, 0x00, - 0x00, 0x00, 0x7c, 0x66, 0x66, 0x7c, 0x60, 0x60, - 0x00, 0x00, 0x3e, 0x66, 0x66, 0x3e, 0x06, 0x06, - 0x00, 0x00, 0x7c, 0x66, 0x60, 0x60, 0x60, 0x00, - 0x00, 0x00, 0x3e, 0x60, 0x3c, 0x06, 0x7c, 0x00, - 0x00, 0x18, 0x7e, 0x18, 0x18, 0x18, 0x0e, 0x00, - 0x00, 0x00, 0x66, 0x66, 0x66, 0x66, 0x3e, 0x00, - 0x00, 0x00, 0x66, 0x66, 0x66, 0x3c, 0x18, 0x00, - 0x00, 0x00, 0x63, 0x6b, 0x7f, 0x3e, 0x36, 0x00, - 0x00, 0x00, 0x66, 0x3c, 0x18, 0x3c, 0x66, 0x00, - 0x00, 0x00, 0x66, 0x66, 0x66, 0x3e, 0x0c, 0x78, - 0x00, 0x00, 0x7e, 0x0c, 0x18, 0x30, 0x7e, 0x00, - 0x18, 0x24, 0x00, 0x38, 0x18, 0x18, 0x3c, 0x00, - 0x18, 0x24, 0x00, 0x3c, 0x66, 0x66, 0x3c, 0x00, - 0x10, 0x08, 0x00, 0x66, 0x66, 0x66, 0x3e, 0x00, - 0x18, 0x24, 0x00, 0x66, 0x66, 0x66, 0x3e, 0x00, - 0x08, 0x0c, 0x0e, 0xff, 0xff, 0x0e, 0x0c, 0x08, - }; - - writeRecord(frenchCharsetDataV2, sizeof(frenchCharsetDataV2), GBVARS_FRENCHCHARSETDATAV2_INDEX , GBVARS_SCUMM); -} - -static void addCharset_englishCharsetDataV2() { - byte englishCharsetDataV2[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x01, 0x03, 0x06, 0x0C, 0x18, 0x3E, 0x03, 0x00, - 0x80, 0xC0, 0x60, 0x30, 0x18, 0x7C, 0xC0, 0x00, - 0x00, 0x03, 0x3E, 0x18, 0x0C, 0x06, 0x03, 0x01, - 0x00, 0xC0, 0x7C, 0x18, 0x30, 0x60, 0xC0, 0x80, - 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, - 0x03, 0x03, 0x03, 0x07, 0x07, 0x0F, 0x1F, 0x7F, - 0xE0, 0x80, 0x00, 0x00, 0x00, 0x00, 0x80, 0xE0, - 0x07, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x07, - 0x00, 0x00, 0x00, 0x01, 0x03, 0x06, 0x0C, 0x18, - 0x00, 0x00, 0x00, 0x80, 0xC0, 0x60, 0x30, 0x18, - 0x18, 0x30, 0x60, 0xC0, 0x80, 0x00, 0x00, 0x00, - 0x18, 0x0C, 0x06, 0x03, 0x01, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x1F, 0x1F, 0x18, 0x18, 0x18, - 0x00, 0x00, 0x00, 0xF8, 0xF8, 0x18, 0x18, 0x18, - 0x18, 0x18, 0x18, 0xF8, 0xF8, 0x00, 0x00, 0x00, - 0x18, 0x18, 0x18, 0x1F, 0x1F, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x03, 0x07, 0x0C, 0x18, 0x18, - 0x00, 0x00, 0x00, 0xC0, 0xE0, 0x30, 0x18, 0x18, - 0x18, 0x18, 0x30, 0xE0, 0xC0, 0x00, 0x00, 0x00, - 0x18, 0x18, 0x0C, 0x07, 0x03, 0x00, 0x00, 0x00, - 0x18, 0x18, 0x18, 0x1F, 0x1F, 0x18, 0x18, 0x18, - 0x18, 0x18, 0x18, 0xF8, 0xF8, 0x18, 0x18, 0x18, - 0x18, 0x18, 0x18, 0xFF, 0xFF, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x18, 0x18, 0x18, - 0x18, 0x18, 0x18, 0xFF, 0xFF, 0x18, 0x18, 0x18, - 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, - 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x00, - 0x18, 0x3C, 0x66, 0xC3, 0xC3, 0x66, 0x3C, 0x18, - 0x18, 0x3C, 0x7E, 0xFF, 0xFF, 0x7E, 0x3C, 0x18, - 0x18, 0x66, 0xC3, 0xDB, 0xDB, 0xC3, 0x66, 0x18, - 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x18, 0x18, 0x18, 0x18, 0x00, 0x00, 0x18, 0x00, - 0x66, 0x66, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x66, 0x66, 0xFF, 0x66, 0xFF, 0x66, 0x66, 0x00, - 0x18, 0x3E, 0x58, 0x3C, 0x1A, 0x7C, 0x18, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x49, 0x49, 0x00, - 0x3C, 0x66, 0x3C, 0x38, 0x67, 0x66, 0x3F, 0x00, - 0x06, 0x0C, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x0C, 0x18, 0x30, 0x30, 0x30, 0x18, 0x0C, 0x00, - 0x30, 0x18, 0x0C, 0x0C, 0x0C, 0x18, 0x30, 0x00, - 0x00, 0x66, 0x3C, 0xFF, 0x3C, 0x66, 0x00, 0x00, - 0x00, 0x18, 0x18, 0x7E, 0x18, 0x18, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x30, - 0x00, 0x00, 0x00, 0x7E, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, - 0x00, 0x03, 0x06, 0x0C, 0x18, 0x30, 0x60, 0x00, - 0x3C, 0x66, 0x66, 0x66, 0x66, 0x66, 0x3C, 0x00, - 0x18, 0x18, 0x38, 0x18, 0x18, 0x18, 0x7E, 0x00, - 0x3C, 0x66, 0x06, 0x0C, 0x30, 0x60, 0x7E, 0x00, - 0x3C, 0x66, 0x06, 0x1C, 0x06, 0x66, 0x3C, 0x00, - 0x06, 0x0E, 0x1E, 0x66, 0x7F, 0x06, 0x06, 0x00, - 0x7E, 0x60, 0x7C, 0x06, 0x06, 0x66, 0x3C, 0x00, - 0x3C, 0x66, 0x60, 0x7C, 0x66, 0x66, 0x3C, 0x00, - 0x7E, 0x66, 0x0C, 0x18, 0x18, 0x18, 0x18, 0x00, - 0x3C, 0x66, 0x66, 0x3C, 0x66, 0x66, 0x3C, 0x00, - 0x3C, 0x66, 0x66, 0x3E, 0x06, 0x66, 0x3C, 0x00, - 0x00, 0x00, 0x18, 0x00, 0x00, 0x18, 0x00, 0x00, - 0x00, 0x00, 0x18, 0x00, 0x00, 0x18, 0x18, 0x30, - 0x0E, 0x18, 0x30, 0x60, 0x30, 0x18, 0x0E, 0x00, - 0x7C, 0x82, 0xBA, 0xA2, 0xBA, 0x82, 0x7C, 0x00, - 0x70, 0x18, 0x0C, 0x06, 0x0C, 0x18, 0x70, 0x00, - 0x3C, 0x66, 0x06, 0x0C, 0x18, 0x00, 0x18, 0x00, - 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x00, - 0x18, 0x3C, 0x66, 0x7E, 0x66, 0x66, 0x66, 0x00, - 0x7C, 0x66, 0x66, 0x7C, 0x66, 0x66, 0x7C, 0x00, - 0x3C, 0x66, 0x60, 0x60, 0x60, 0x66, 0x3C, 0x00, - 0x78, 0x6C, 0x66, 0x66, 0x66, 0x6C, 0x78, 0x00, - 0x7E, 0x60, 0x60, 0x78, 0x60, 0x60, 0x7E, 0x00, - 0x7E, 0x60, 0x60, 0x78, 0x60, 0x60, 0x60, 0x00, - 0x3C, 0x66, 0x60, 0x6E, 0x66, 0x66, 0x3C, 0x00, - 0x66, 0x66, 0x66, 0x7E, 0x66, 0x66, 0x66, 0x00, - 0x3C, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3C, 0x00, - 0x1E, 0x0C, 0x0C, 0x0C, 0x0C, 0x6C, 0x38, 0x00, - 0x66, 0x6C, 0x78, 0x70, 0x78, 0x6C, 0x66, 0x00, - 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x7E, 0x00, - 0x63, 0x77, 0x7F, 0x6B, 0x63, 0x63, 0x63, 0x00, - 0x66, 0x76, 0x7E, 0x7E, 0x6E, 0x66, 0x66, 0x00, - 0x3C, 0x66, 0x66, 0x66, 0x66, 0x66, 0x3C, 0x00, - 0x7C, 0x66, 0x66, 0x7C, 0x60, 0x60, 0x60, 0x00, - 0x3C, 0x66, 0x66, 0x66, 0x66, 0x3C, 0x0E, 0x00, - 0x7C, 0x66, 0x66, 0x7C, 0x78, 0x6C, 0x66, 0x00, - 0x3C, 0x66, 0x60, 0x3C, 0x06, 0x66, 0x3C, 0x00, - 0x7E, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x00, - 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x3C, 0x00, - 0x66, 0x66, 0x66, 0x66, 0x66, 0x3C, 0x18, 0x00, - 0x63, 0x63, 0x63, 0x6B, 0x7F, 0x77, 0x63, 0x00, - 0x66, 0x66, 0x3C, 0x18, 0x3C, 0x66, 0x66, 0x00, - 0x66, 0x66, 0x66, 0x3C, 0x18, 0x18, 0x18, 0x00, - 0x7E, 0x06, 0x0C, 0x18, 0x30, 0x60, 0x7E, 0x00, - 0x3C, 0x30, 0x30, 0x30, 0x30, 0x30, 0x3C, 0x00, - 0x0C, 0x12, 0x30, 0x7C, 0x30, 0x62, 0xFC, 0x00, - 0x3C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x3C, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0xDB, 0xDB, 0x00, - 0x00, 0x10, 0x30, 0x7F, 0x7F, 0x30, 0x10, 0x00, - 0x66, 0x66, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x3C, 0x06, 0x3E, 0x66, 0x3E, 0x00, - 0x00, 0x60, 0x60, 0x7C, 0x66, 0x66, 0x7C, 0x00, - 0x00, 0x00, 0x3C, 0x60, 0x60, 0x60, 0x3C, 0x00, - 0x00, 0x06, 0x06, 0x3E, 0x66, 0x66, 0x3E, 0x00, - 0x00, 0x00, 0x3C, 0x66, 0x7E, 0x60, 0x3C, 0x00, - 0x00, 0x0E, 0x18, 0x3E, 0x18, 0x18, 0x18, 0x00, - 0x00, 0x00, 0x3E, 0x66, 0x66, 0x3E, 0x06, 0x7C, - 0x00, 0x60, 0x60, 0x7C, 0x66, 0x66, 0x66, 0x00, - 0x00, 0x18, 0x00, 0x38, 0x18, 0x18, 0x3C, 0x00, - 0x00, 0x06, 0x00, 0x06, 0x06, 0x06, 0x06, 0x3C, - 0x00, 0x60, 0x60, 0x6C, 0x78, 0x6C, 0x66, 0x00, - 0x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x3C, 0x00, - 0x00, 0x00, 0x66, 0x7F, 0x7F, 0x6B, 0x63, 0x00, - 0x00, 0x00, 0x7C, 0x66, 0x66, 0x66, 0x66, 0x00, - 0x00, 0x00, 0x3C, 0x66, 0x66, 0x66, 0x3C, 0x00, - 0x00, 0x00, 0x7C, 0x66, 0x66, 0x7C, 0x60, 0x60, - 0x00, 0x00, 0x3E, 0x66, 0x66, 0x3E, 0x06, 0x06, - 0x00, 0x00, 0x7C, 0x66, 0x60, 0x60, 0x60, 0x00, - 0x00, 0x00, 0x3E, 0x60, 0x3C, 0x06, 0x7C, 0x00, - 0x00, 0x18, 0x7E, 0x18, 0x18, 0x18, 0x0E, 0x00, - 0x00, 0x00, 0x66, 0x66, 0x66, 0x66, 0x3E, 0x00, - 0x00, 0x00, 0x66, 0x66, 0x66, 0x3C, 0x18, 0x00, - 0x00, 0x00, 0x63, 0x6B, 0x7F, 0x3E, 0x36, 0x00, - 0x00, 0x00, 0x66, 0x3C, 0x18, 0x3C, 0x66, 0x00, - 0x00, 0x00, 0x66, 0x66, 0x66, 0x3E, 0x0C, 0x78, - 0x00, 0x00, 0x7E, 0x0C, 0x18, 0x30, 0x7E, 0x00, - 0x01, 0x03, 0x06, 0x6C, 0x78, 0x70, 0x60, 0x00, - 0x18, 0x3C, 0x7E, 0xFF, 0x18, 0x18, 0x18, 0x18, - 0x18, 0x18, 0x18, 0x18, 0xFF, 0x7E, 0x3C, 0x18, - 0x10, 0x30, 0x70, 0xFF, 0xFF, 0x70, 0x30, 0x10, - 0x08, 0x0C, 0x0E, 0xFF, 0xFF, 0x0E, 0x0C, 0x08, - }; - - writeRecord(englishCharsetDataV2, sizeof(englishCharsetDataV2), GBVARS_ENGLISHCHARSETDATAV2_INDEX , GBVARS_SCUMM); -} - -static void addCharset_italianCharsetDataV2() { - byte italianCharsetDataV2[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x01, 0x03, 0x06, 0x0c, 0x18, 0x3e, 0x03, 0x00, - 0x80, 0xc0, 0x60, 0x30, 0x18, 0x7c, 0xc0, 0x00, - 0x00, 0x03, 0x3e, 0x18, 0x0c, 0x06, 0x03, 0x01, - 0x00, 0xc0, 0x7c, 0x18, 0x30, 0x60, 0xc0, 0x80, - 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, - 0x03, 0x03, 0x03, 0x07, 0x07, 0x0f, 0x1f, 0x7f, - 0xe0, 0x80, 0x00, 0x00, 0x00, 0x00, 0x80, 0xe0, - 0x07, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x07, - 0x00, 0x00, 0x00, 0x01, 0x03, 0x06, 0x0c, 0x18, - 0x00, 0x00, 0x00, 0x80, 0xc0, 0x60, 0x30, 0x18, - 0x18, 0x30, 0x60, 0xc0, 0x80, 0x00, 0x00, 0x00, - 0x18, 0x0c, 0x06, 0x03, 0x01, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x1f, 0x1f, 0x18, 0x18, 0x18, - 0x00, 0x00, 0x00, 0xf8, 0xf8, 0x18, 0x18, 0x18, - 0x18, 0x18, 0x18, 0xf8, 0xf8, 0x00, 0x00, 0x00, - 0x18, 0x18, 0x18, 0x1f, 0x1f, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x03, 0x07, 0x0c, 0x18, 0x18, - 0x00, 0x00, 0x00, 0xc0, 0xe0, 0x30, 0x18, 0x18, - 0x18, 0x18, 0x30, 0xe0, 0xc0, 0x00, 0x00, 0x00, - 0x18, 0x18, 0x0c, 0x07, 0x03, 0x00, 0x00, 0x00, - 0x18, 0x18, 0x18, 0x1f, 0x1f, 0x18, 0x18, 0x18, - 0x18, 0x18, 0x18, 0xf8, 0xf8, 0x18, 0x18, 0x18, - 0x18, 0x18, 0x18, 0xff, 0xff, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0xff, 0xff, 0x18, 0x18, 0x18, - 0x18, 0x18, 0x18, 0xff, 0xff, 0x18, 0x18, 0x18, - 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, - 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, - 0x18, 0x3c, 0x66, 0xc3, 0xc3, 0x66, 0x3c, 0x18, - 0x18, 0x3c, 0x7e, 0xff, 0xff, 0x7e, 0x3c, 0x18, - 0x18, 0x66, 0xc3, 0xdb, 0xdb, 0xc3, 0x66, 0x18, - 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x18, 0x18, 0x18, 0x18, 0x00, 0x00, 0x18, 0x00, - 0x66, 0x66, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x66, 0x66, 0xff, 0x66, 0xff, 0x66, 0x66, 0x00, - 0x18, 0x3e, 0x60, 0x3c, 0x06, 0x7c, 0x18, 0x00, - 0x62, 0x66, 0x0c, 0x18, 0x30, 0x66, 0x46, 0x00, - 0x3c, 0x66, 0x3c, 0x38, 0x67, 0x66, 0x3f, 0x00, - 0x30, 0x18, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x0c, 0x18, 0x30, 0x30, 0x30, 0x18, 0x0c, 0x00, - 0x30, 0x18, 0x0c, 0x0c, 0x0c, 0x18, 0x30, 0x00, - 0x00, 0x66, 0x3c, 0xff, 0x3c, 0x66, 0x00, 0x00, - 0x00, 0x18, 0x18, 0x7e, 0x18, 0x18, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x30, - 0x00, 0x00, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, - 0x00, 0x03, 0x06, 0x0c, 0x18, 0x30, 0x60, 0x00, - 0x3c, 0x66, 0x66, 0x66, 0x66, 0x66, 0x3c, 0x00, - 0x18, 0x18, 0x38, 0x18, 0x18, 0x18, 0x7e, 0x00, - 0x3c, 0x66, 0x06, 0x0c, 0x30, 0x60, 0x7e, 0x00, - 0x3c, 0x66, 0x06, 0x1c, 0x06, 0x66, 0x3c, 0x00, - 0x06, 0x0e, 0x1e, 0x66, 0x7f, 0x06, 0x06, 0x00, - 0x7e, 0x60, 0x7c, 0x06, 0x06, 0x66, 0x3c, 0x00, - 0x3c, 0x66, 0x60, 0x7c, 0x66, 0x66, 0x3c, 0x00, - 0x7e, 0x66, 0x0c, 0x18, 0x18, 0x18, 0x18, 0x00, - 0x3c, 0x66, 0x66, 0x3c, 0x66, 0x66, 0x3c, 0x00, - 0x3c, 0x66, 0x66, 0x3e, 0x06, 0x66, 0x3c, 0x00, - 0x00, 0x00, 0x18, 0x00, 0x00, 0x18, 0x00, 0x00, - 0x00, 0x00, 0x18, 0x00, 0x00, 0x18, 0x18, 0x30, - 0x10, 0x08, 0x3c, 0x06, 0x3e, 0x66, 0x3e, 0x00, - 0x18, 0x24, 0x3c, 0x06, 0x3e, 0x66, 0x3e, 0x00, - 0x00, 0x00, 0x3c, 0x60, 0x60, 0x3c, 0x18, 0x38, - 0x3c, 0x66, 0x06, 0x0c, 0x18, 0x00, 0x18, 0x00, - 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, - 0x18, 0x3c, 0x66, 0x7e, 0x66, 0x66, 0x66, 0x00, - 0x7c, 0x66, 0x66, 0x7c, 0x66, 0x66, 0x7c, 0x00, - 0x3c, 0x66, 0x60, 0x60, 0x60, 0x66, 0x3c, 0x00, - 0x78, 0x6c, 0x66, 0x66, 0x66, 0x6c, 0x78, 0x00, - 0x7e, 0x60, 0x60, 0x78, 0x60, 0x60, 0x7e, 0x00, - 0x7e, 0x60, 0x60, 0x78, 0x60, 0x60, 0x60, 0x00, - 0x3c, 0x66, 0x60, 0x6e, 0x66, 0x66, 0x3c, 0x00, - 0x66, 0x66, 0x66, 0x7e, 0x66, 0x66, 0x66, 0x00, - 0x3c, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, - 0x1e, 0x0c, 0x0c, 0x0c, 0x0c, 0x6c, 0x38, 0x00, - 0x66, 0x6c, 0x78, 0x70, 0x78, 0x6c, 0x66, 0x00, - 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x7e, 0x00, - 0x63, 0x77, 0x7f, 0x6b, 0x63, 0x63, 0x63, 0x00, - 0x66, 0x76, 0x7e, 0x7e, 0x6e, 0x66, 0x66, 0x00, - 0x3c, 0x66, 0x66, 0x66, 0x66, 0x66, 0x3c, 0x00, - 0x7c, 0x66, 0x66, 0x7c, 0x60, 0x60, 0x60, 0x00, - 0x3c, 0x66, 0x66, 0x66, 0x66, 0x3c, 0x0e, 0x00, - 0x7c, 0x66, 0x66, 0x7c, 0x78, 0x6c, 0x66, 0x00, - 0x3c, 0x66, 0x60, 0x3c, 0x06, 0x66, 0x3c, 0x00, - 0x7e, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x00, - 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x3c, 0x00, - 0x66, 0x66, 0x66, 0x66, 0x66, 0x3c, 0x18, 0x00, - 0x63, 0x63, 0x63, 0x6b, 0x7f, 0x77, 0x63, 0x00, - 0x66, 0x66, 0x3c, 0x18, 0x3c, 0x66, 0x66, 0x00, - 0x66, 0x66, 0x66, 0x3c, 0x18, 0x18, 0x18, 0x00, - 0x7e, 0x06, 0x0c, 0x18, 0x30, 0x60, 0x7e, 0x00, - 0x08, 0x10, 0x3c, 0x66, 0x7e, 0x60, 0x3c, 0x00, - 0x10, 0x08, 0x3c, 0x66, 0x7e, 0x60, 0x3c, 0x00, - 0x18, 0x24, 0x3c, 0x66, 0x7e, 0x60, 0x3c, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0xdb, 0xdb, 0x00, - 0x00, 0x6c, 0x00, 0x38, 0x18, 0x18, 0x3c, 0x00, - 0x66, 0x66, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x3c, 0x06, 0x3e, 0x66, 0x3e, 0x00, - 0x00, 0x60, 0x60, 0x7c, 0x66, 0x66, 0x7c, 0x00, - 0x00, 0x00, 0x3c, 0x60, 0x60, 0x60, 0x3c, 0x00, - 0x00, 0x06, 0x06, 0x3e, 0x66, 0x66, 0x3e, 0x00, - 0x00, 0x00, 0x3c, 0x66, 0x7e, 0x60, 0x3c, 0x00, - 0x00, 0x0e, 0x18, 0x3e, 0x18, 0x18, 0x18, 0x00, - 0x00, 0x00, 0x3e, 0x66, 0x66, 0x3e, 0x06, 0x7c, - 0x00, 0x60, 0x60, 0x7c, 0x66, 0x66, 0x66, 0x00, - 0x00, 0x18, 0x00, 0x38, 0x18, 0x18, 0x3c, 0x00, - 0x00, 0x06, 0x00, 0x06, 0x06, 0x06, 0x06, 0x3c, - 0x00, 0x60, 0x60, 0x6c, 0x78, 0x6c, 0x66, 0x00, - 0x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, - 0x00, 0x00, 0x66, 0x7f, 0x7f, 0x6b, 0x63, 0x00, - 0x00, 0x00, 0x7c, 0x66, 0x66, 0x66, 0x66, 0x00, - 0x00, 0x00, 0x3c, 0x66, 0x66, 0x66, 0x3c, 0x00, - 0x00, 0x00, 0x7c, 0x66, 0x66, 0x7c, 0x60, 0x60, - 0x00, 0x00, 0x3e, 0x66, 0x66, 0x3e, 0x06, 0x06, - 0x00, 0x00, 0x7c, 0x66, 0x60, 0x60, 0x60, 0x00, - 0x00, 0x00, 0x3e, 0x60, 0x3c, 0x06, 0x7c, 0x00, - 0x00, 0x18, 0x7e, 0x18, 0x18, 0x18, 0x0e, 0x00, - 0x00, 0x00, 0x66, 0x66, 0x66, 0x66, 0x3e, 0x00, - 0x00, 0x00, 0x66, 0x66, 0x66, 0x3c, 0x18, 0x00, - 0x00, 0x00, 0x63, 0x6b, 0x7f, 0x3e, 0x36, 0x00, - 0x00, 0x00, 0x66, 0x3c, 0x18, 0x3c, 0x66, 0x00, - 0x00, 0x00, 0x66, 0x66, 0x66, 0x3e, 0x0c, 0x78, - 0x00, 0x00, 0x7e, 0x0c, 0x18, 0x30, 0x7e, 0x00, - 0x18, 0x24, 0x00, 0x38, 0x18, 0x18, 0x3c, 0x00, - 0x18, 0x24, 0x00, 0x3c, 0x66, 0x66, 0x3c, 0x00, - 0x10, 0x08, 0x00, 0x66, 0x66, 0x66, 0x3e, 0x00, - 0x18, 0x24, 0x00, 0x66, 0x66, 0x66, 0x3e, 0x00, - 0x08, 0x0c, 0x0e, 0xff, 0xff, 0x0e, 0x0c, 0x08, - }; - - writeRecord(italianCharsetDataV2, sizeof(italianCharsetDataV2), GBVARS_ITALIANCHARSETDATAV2_INDEX , GBVARS_SCUMM); -} - -static void addCharset_spanishCharsetDataV2() { - byte spanishCharsetDataV2[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x01, 0x03, 0x06, 0x0c, 0x18, 0x3e, 0x03, 0x00, - 0x80, 0xc0, 0x60, 0x30, 0x18, 0x7c, 0xc0, 0x00, - 0x00, 0x03, 0x3e, 0x18, 0x0c, 0x06, 0x03, 0x01, - 0x00, 0xc0, 0x7c, 0x18, 0x30, 0x60, 0xc0, 0x80, - 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, - 0x03, 0x03, 0x03, 0x07, 0x07, 0x0f, 0x1f, 0x7f, - 0xe0, 0x80, 0x00, 0x00, 0x00, 0x00, 0x80, 0xe0, - 0x07, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x07, - 0x00, 0x00, 0x00, 0x01, 0x03, 0x06, 0x0c, 0x18, - 0x00, 0x00, 0x00, 0x80, 0xc0, 0x60, 0x30, 0x18, - 0x18, 0x30, 0x60, 0xc0, 0x80, 0x00, 0x00, 0x00, - 0x18, 0x0c, 0x06, 0x03, 0x01, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x1f, 0x1f, 0x18, 0x18, 0x18, - 0x00, 0x00, 0x00, 0xf8, 0xf8, 0x18, 0x18, 0x18, - 0x18, 0x18, 0x18, 0xf8, 0xf8, 0x00, 0x00, 0x00, - 0x18, 0x18, 0x18, 0x1f, 0x1f, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x03, 0x07, 0x0c, 0x18, 0x18, - 0x00, 0x00, 0x00, 0xc0, 0xe0, 0x30, 0x18, 0x18, - 0x18, 0x18, 0x30, 0xe0, 0xc0, 0x00, 0x00, 0x00, - 0x18, 0x18, 0x0c, 0x07, 0x03, 0x00, 0x00, 0x00, - 0x18, 0x18, 0x18, 0x1f, 0x1f, 0x18, 0x18, 0x18, - 0x18, 0x18, 0x18, 0xf8, 0xf8, 0x18, 0x18, 0x18, - 0x18, 0x18, 0x18, 0xff, 0xff, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0xff, 0xff, 0x18, 0x18, 0x18, - 0x18, 0x18, 0x18, 0xff, 0xff, 0x18, 0x18, 0x18, - 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, - 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, - 0x18, 0x3c, 0x66, 0xc3, 0xc3, 0x66, 0x3c, 0x18, - 0x18, 0x3c, 0x7e, 0xff, 0xff, 0x7e, 0x3c, 0x18, - 0x18, 0x66, 0xc3, 0xdb, 0xdb, 0xc3, 0x66, 0x18, - 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x18, 0x18, 0x18, 0x18, 0x00, 0x00, 0x18, 0x00, - 0x66, 0x66, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x66, 0x66, 0xff, 0x66, 0xff, 0x66, 0x66, 0x00, - 0x18, 0x3e, 0x60, 0x3c, 0x06, 0x7c, 0x18, 0x00, - 0x62, 0x66, 0x0c, 0x18, 0x30, 0x66, 0x46, 0x00, - 0x3c, 0x66, 0x3c, 0x38, 0x67, 0x66, 0x3f, 0x00, - 0x30, 0x18, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x0c, 0x18, 0x30, 0x30, 0x30, 0x18, 0x0c, 0x00, - 0x30, 0x18, 0x0c, 0x0c, 0x0c, 0x18, 0x30, 0x00, - 0x00, 0x66, 0x3c, 0xff, 0x3c, 0x66, 0x00, 0x00, - 0x00, 0x18, 0x18, 0x7e, 0x18, 0x18, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x30, - 0x00, 0x00, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, - 0x00, 0x03, 0x06, 0x0c, 0x18, 0x30, 0x60, 0x00, - 0x3c, 0x66, 0x66, 0x66, 0x66, 0x66, 0x3c, 0x00, - 0x18, 0x18, 0x38, 0x18, 0x18, 0x18, 0x7e, 0x00, - 0x3c, 0x66, 0x06, 0x0c, 0x30, 0x60, 0x7e, 0x00, - 0x3c, 0x66, 0x06, 0x1c, 0x06, 0x66, 0x3c, 0x00, - 0x06, 0x0e, 0x1e, 0x66, 0x7f, 0x06, 0x06, 0x00, - 0x7e, 0x60, 0x7c, 0x06, 0x06, 0x66, 0x3c, 0x00, - 0x3c, 0x66, 0x60, 0x7c, 0x66, 0x66, 0x3c, 0x00, - 0x7e, 0x66, 0x0c, 0x18, 0x18, 0x18, 0x18, 0x00, - 0x3c, 0x66, 0x66, 0x3c, 0x66, 0x66, 0x3c, 0x00, - 0x3c, 0x66, 0x66, 0x3e, 0x06, 0x66, 0x3c, 0x00, - 0x00, 0x00, 0x18, 0x00, 0x00, 0x18, 0x00, 0x00, - 0x00, 0x00, 0x18, 0x00, 0x00, 0x18, 0x18, 0x30, - 0x10, 0x08, 0x3c, 0x06, 0x3e, 0x66, 0x3e, 0x00, - 0x18, 0x24, 0x3c, 0x06, 0x3e, 0x66, 0x3e, 0x00, - 0x00, 0x00, 0x3c, 0x60, 0x60, 0x3c, 0x18, 0x38, - 0x3c, 0x66, 0x06, 0x0c, 0x18, 0x00, 0x18, 0x00, - 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, - 0x18, 0x3c, 0x66, 0x7e, 0x66, 0x66, 0x66, 0x00, - 0x7c, 0x66, 0x66, 0x7c, 0x66, 0x66, 0x7c, 0x00, - 0x3c, 0x66, 0x60, 0x60, 0x60, 0x66, 0x3c, 0x00, - 0x78, 0x6c, 0x66, 0x66, 0x66, 0x6c, 0x78, 0x00, - 0x7e, 0x60, 0x60, 0x78, 0x60, 0x60, 0x7e, 0x00, - 0x7e, 0x60, 0x60, 0x78, 0x60, 0x60, 0x60, 0x00, - 0x3c, 0x66, 0x60, 0x6e, 0x66, 0x66, 0x3c, 0x00, - 0x66, 0x66, 0x66, 0x7e, 0x66, 0x66, 0x66, 0x00, - 0x3c, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, - 0x1e, 0x0c, 0x0c, 0x0c, 0x0c, 0x6c, 0x38, 0x00, - 0x66, 0x6c, 0x78, 0x70, 0x78, 0x6c, 0x66, 0x00, - 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x7e, 0x00, - 0x63, 0x77, 0x7f, 0x6b, 0x63, 0x63, 0x63, 0x00, - 0x66, 0x76, 0x7e, 0x7e, 0x6e, 0x66, 0x66, 0x00, - 0x3c, 0x66, 0x66, 0x66, 0x66, 0x66, 0x3c, 0x00, - 0x7c, 0x66, 0x66, 0x7c, 0x60, 0x60, 0x60, 0x00, - 0x3c, 0x66, 0x66, 0x66, 0x66, 0x3c, 0x0e, 0x00, - 0x7c, 0x66, 0x66, 0x7c, 0x78, 0x6c, 0x66, 0x00, - 0x3c, 0x66, 0x60, 0x3c, 0x06, 0x66, 0x3c, 0x00, - 0x7e, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x00, - 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x3c, 0x00, - 0x66, 0x66, 0x66, 0x66, 0x66, 0x3c, 0x18, 0x00, - 0x63, 0x63, 0x63, 0x6b, 0x7f, 0x77, 0x63, 0x00, - 0x66, 0x66, 0x3c, 0x18, 0x3c, 0x66, 0x66, 0x00, - 0x66, 0x66, 0x66, 0x3c, 0x18, 0x18, 0x18, 0x00, - 0x7e, 0x06, 0x0c, 0x18, 0x30, 0x60, 0x7e, 0x00, - 0x08, 0x10, 0x3c, 0x66, 0x7e, 0x60, 0x3c, 0x00, - 0x10, 0x08, 0x3c, 0x66, 0x7e, 0x60, 0x3c, 0x00, - 0x18, 0x24, 0x3c, 0x66, 0x7e, 0x60, 0x3c, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0xdb, 0xdb, 0x00, - 0x00, 0x6c, 0x00, 0x38, 0x18, 0x18, 0x3c, 0x00, - 0x66, 0x66, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x3c, 0x06, 0x3e, 0x66, 0x3e, 0x00, - 0x00, 0x60, 0x60, 0x7c, 0x66, 0x66, 0x7c, 0x00, - 0x00, 0x00, 0x3c, 0x60, 0x60, 0x60, 0x3c, 0x00, - 0x00, 0x06, 0x06, 0x3e, 0x66, 0x66, 0x3e, 0x00, - 0x00, 0x00, 0x3c, 0x66, 0x7e, 0x60, 0x3c, 0x00, - 0x00, 0x0e, 0x18, 0x3e, 0x18, 0x18, 0x18, 0x00, - 0x00, 0x00, 0x3e, 0x66, 0x66, 0x3e, 0x06, 0x7c, - 0x00, 0x60, 0x60, 0x7c, 0x66, 0x66, 0x66, 0x00, - 0x00, 0x18, 0x00, 0x38, 0x18, 0x18, 0x3c, 0x00, - 0x00, 0x06, 0x00, 0x06, 0x06, 0x06, 0x06, 0x3c, - 0x00, 0x60, 0x60, 0x6c, 0x78, 0x6c, 0x66, 0x00, - 0x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, - 0x00, 0x00, 0x66, 0x7f, 0x7f, 0x6b, 0x63, 0x00, - 0x00, 0x00, 0x7c, 0x66, 0x66, 0x66, 0x66, 0x00, - 0x00, 0x00, 0x3c, 0x66, 0x66, 0x66, 0x3c, 0x00, - 0x00, 0x00, 0x7c, 0x66, 0x66, 0x7c, 0x60, 0x60, - 0x00, 0x00, 0x3e, 0x66, 0x66, 0x3e, 0x06, 0x06, - 0x00, 0x00, 0x7c, 0x66, 0x60, 0x60, 0x60, 0x00, - 0x00, 0x00, 0x3e, 0x60, 0x3c, 0x06, 0x7c, 0x00, - 0x00, 0x18, 0x7e, 0x18, 0x18, 0x18, 0x0e, 0x00, - 0x00, 0x00, 0x66, 0x66, 0x66, 0x66, 0x3e, 0x00, - 0x00, 0x00, 0x66, 0x66, 0x66, 0x3c, 0x18, 0x00, - 0x00, 0x00, 0x63, 0x6b, 0x7f, 0x3e, 0x36, 0x00, - 0x00, 0x00, 0x66, 0x3c, 0x18, 0x3c, 0x66, 0x00, - 0x00, 0x00, 0x66, 0x66, 0x66, 0x3e, 0x0c, 0x78, - 0x00, 0x00, 0x7e, 0x0c, 0x18, 0x30, 0x7e, 0x00, - 0x18, 0x24, 0x00, 0x38, 0x18, 0x18, 0x3c, 0x00, - 0x18, 0x24, 0x00, 0x3c, 0x66, 0x66, 0x3c, 0x00, - 0x10, 0x08, 0x00, 0x66, 0x66, 0x66, 0x3e, 0x00, - 0x18, 0x24, 0x00, 0x66, 0x66, 0x66, 0x3e, 0x00, - 0x08, 0x0c, 0x0e, 0xff, 0xff, 0x0e, 0x0c, 0x08, - }; - - writeRecord(spanishCharsetDataV2, sizeof(spanishCharsetDataV2), GBVARS_SPANISHCHARSETDATAV2_INDEX , GBVARS_SCUMM); -} -/////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////// - -void addCharset() { - addCharset_germanCharsetDataV2(); - addCharset_frenchCharsetDataV2(); - addCharset_englishCharsetDataV2(); - addCharset_italianCharsetDataV2(); - addCharset_spanishCharsetDataV2(); -} diff --git a/backends/platform/PalmOS/Src/builder/scumm/bl_costume.c b/backends/platform/PalmOS/Src/builder/scumm/bl_costume.c deleted file mode 100644 index ec4c2bee87..0000000000 --- a/backends/platform/PalmOS/Src/builder/scumm/bl_costume.c +++ /dev/null @@ -1,44 +0,0 @@ -#include <PalmOS.h> -#include "b_globals.h" - - -static void addCostume_smallCostumeScaleTable() { - byte smallCostumeScaleTable[256] = { - 0xFF, 0xFD, 0x7D, 0xBD, 0x3D, 0xDD, 0x5D, 0x9D, - 0x1D, 0xED, 0x6D, 0xAD, 0x2D, 0xCD, 0x4D, 0x8D, - 0x0D, 0xF5, 0x75, 0xB5, 0x35, 0xD5, 0x55, 0x95, - 0x15, 0xE5, 0x65, 0xA5, 0x25, 0xC5, 0x45, 0x85, - 0x05, 0xF9, 0x79, 0xB9, 0x39, 0xD9, 0x59, 0x99, - 0x19, 0xE9, 0x69, 0xA9, 0x29, 0xC9, 0x49, 0x89, - 0x09, 0xF1, 0x71, 0xB1, 0x31, 0xD1, 0x51, 0x91, - 0x11, 0xE1, 0x61, 0xA1, 0x21, 0xC1, 0x41, 0x81, - 0x01, 0xFB, 0x7B, 0xBB, 0x3B, 0xDB, 0x5B, 0x9B, - 0x1B, 0xEB, 0x6B, 0xAB, 0x2B, 0xCB, 0x4B, 0x8B, - 0x0B, 0xF3, 0x73, 0xB3, 0x33, 0xD3, 0x53, 0x93, - 0x13, 0xE3, 0x63, 0xA3, 0x23, 0xC3, 0x43, 0x83, - 0x03, 0xF7, 0x77, 0xB7, 0x37, 0xD7, 0x57, 0x97, - 0x17, 0xE7, 0x67, 0xA7, 0x27, 0xC7, 0x47, 0x87, - 0x07, 0xEF, 0x6F, 0xAF, 0x2F, 0xCF, 0x4F, 0x8F, - 0x0F, 0xDF, 0x5F, 0x9F, 0x1F, 0xBF, 0x3F, 0x7F, - 0x00, 0x80, 0x40, 0xC0, 0x20, 0xA0, 0x60, 0xE0, - 0x10, 0x90, 0x50, 0xD0, 0x30, 0xB0, 0x70, 0xF0, - 0x08, 0x88, 0x48, 0xC8, 0x28, 0xA8, 0x68, 0xE8, - 0x18, 0x98, 0x58, 0xD8, 0x38, 0xB8, 0x78, 0xF8, - 0x04, 0x84, 0x44, 0xC4, 0x24, 0xA4, 0x64, 0xE4, - 0x14, 0x94, 0x54, 0xD4, 0x34, 0xB4, 0x74, 0xF4, - 0x0C, 0x8C, 0x4C, 0xCC, 0x2C, 0xAC, 0x6C, 0xEC, - 0x1C, 0x9C, 0x5C, 0xDC, 0x3C, 0xBC, 0x7C, 0xFC, - 0x02, 0x82, 0x42, 0xC2, 0x22, 0xA2, 0x62, 0xE2, - 0x12, 0x92, 0x52, 0xD2, 0x32, 0xB2, 0x72, 0xF2, - 0x0A, 0x8A, 0x4A, 0xCA, 0x2A, 0xAA, 0x6A, 0xEA, - 0x1A, 0x9A, 0x5A, 0xDA, 0x3A, 0xBA, 0x7A, 0xFA, - 0x06, 0x86, 0x46, 0xC6, 0x26, 0xA6, 0x66, 0xE6, - 0x16, 0x96, 0x56, 0xD6, 0x36, 0xB6, 0x76, 0xF6, - 0x0E, 0x8E, 0x4E, 0xCE, 0x2E, 0xAE, 0x6E, 0xEE, - 0x1E, 0x9E, 0x5E, 0xDE, 0x3E, 0xBE, 0x7E, 0xFE -}; - writeRecord(smallCostumeScaleTable, sizeof(smallCostumeScaleTable), GBVARS_SMALLSCALETABLE_INDEX , GBVARS_SCUMM); -} -void addCostume() { - addCostume_smallCostumeScaleTable(); -}
\ No newline at end of file diff --git a/backends/platform/PalmOS/Src/builder/scumm/bl_dialogs.c b/backends/platform/PalmOS/Src/builder/scumm/bl_dialogs.c deleted file mode 100644 index 98ed7f919e..0000000000 --- a/backends/platform/PalmOS/Src/builder/scumm/bl_dialogs.c +++ /dev/null @@ -1,100 +0,0 @@ -#include <PalmOS.h> -#include "b_globals.h" - -typedef struct { - Int32 num; - char string[80]; -} ResString; - -static void addDialogs_string_map_table_v7() { - ResString string_map_table_v7[] = { - {96, "game name and version"}, //that's how it's supposed to be - {77, "Select a game to LOAD"}, - {76, "Name your SAVE game"}, - {70, "save"}, //boot8 - {71, "load"}, //boot9 - {72, "play"}, //boot10 - {73, "cancel"}, //boot11 - {74, "quit"}, //boot12 - {75, "ok"}, //boot13 - {85, "game paused"}, // boot3 - - /* this is the almost complete string map for v7 - {63, "how may I serve you?"}, - {64, "the dig v1.0"}, //(game name/version) - {67, "text display only"}, - {68, "c:\\dig"}, //boot007 (save path ?) - {69, "the dig"}, //boot21 (game name) - {70, "save"}, //boot8 - {71, "load"}, //boot9 - {72, "play"}, //boot10 - {73, "cancel"}, //boot11 - {74, "quit"}, //boot12 - {75, "ok"}, //boot13 - {76, "name your save game"}, //boot19 - {77, "select a game to load"}, //boot20 - {78, "you must enter a name"},//boot14 - {79, "saving '%s'"}, //boot17 - {80, "loading '%s'"}, //boot18 - {81, "the game was NOT saved"}, //boot15 - {82, "the game was NOT loaded"}, //boot16 - {83, "how may I serve you?"}, - {84, "how may I serve you?"}, - {85, "game paused"}, // boot3 - {86, "Are you sure you want to restart"}, - {87, "Are you sure you want to quit?"}, //boot05 - {89, "how may I serve you?"}, - {90, "music"}, //boot22 - {91, "voice"}, //boot23 - {92, "sfx"}, //boot24 - {93, "disabled"}, //boot25 - {94, "text speed"}, //boot26 - {95, "text display"}, //boot27 - {96, "the dig v1.0"},*/ - - }; - writeRecord(string_map_table_v7, sizeof(string_map_table_v7), GBVARS_STRINGMAPTABLEV7_INDEX , GBVARS_SCUMM); -} - -static void addDialogs_string_map_table_v6() { - ResString string_map_table_v6[] = { - {117, "How may I serve you?"}, - {109, "Select a game to LOAD"}, - {108, "Name your SAVE game"}, - {96, "Save"}, - {97, "Load"}, - {98, "Play"}, - {99, "Cancel"}, - {100, "Quit"}, - {101, "OK"}, - {93, "Game paused"}, - }; - writeRecord(string_map_table_v6, sizeof(string_map_table_v6), GBVARS_STRINGMAPTABLEV6_INDEX , GBVARS_SCUMM); -} - -static void addDialogs_string_map_table_v5() { - ResString string_map_table_v5[] = { - {28, "How may I serve you?"}, - {20, "Select a game to LOAD"}, - {19, "Name your SAVE game"}, - {7, "Save"}, - {8, "Load"}, - {9, "Play"}, - {10, "Cancel"}, - {11, "Quit"}, - {12, "OK"}, - {4, "Game paused"} - }; - writeRecord(string_map_table_v5, sizeof(string_map_table_v5), GBVARS_STRINGMAPTABLEV5_INDEX , GBVARS_SCUMM); -} -/////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////// - -void addDialogs() { - addDialogs_string_map_table_v7(); - addDialogs_string_map_table_v6(); - addDialogs_string_map_table_v5(); - -}
\ No newline at end of file diff --git a/backends/platform/PalmOS/Src/builder/scumm/bl_gfx.c b/backends/platform/PalmOS/Src/builder/scumm/bl_gfx.c deleted file mode 100644 index 0ac90e5636..0000000000 --- a/backends/platform/PalmOS/Src/builder/scumm/bl_gfx.c +++ /dev/null @@ -1,111 +0,0 @@ -#include <PalmOS.h> -#include "b_globals.h" -/////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////// -typedef struct { - Int8 numOfIterations; - Int8 deltaTable[16]; // four times l / t / r / b - Int8 stripTable[16]; // ditto -} TransitionEffect; -/////////////////////////////////////////////////////////////////// -static void addGfx_transitionEffects() { - TransitionEffect transitionEffects[5] = { - // Iris effect (looks like an opening/closing camera iris) - { - 13, // Number of iterations - { - 1, 1, -1, 1, - -1, 1, -1, -1, - 1, -1, -1, -1, - 1, 1, 1, -1 - }, - { - 0, 0, 39, 0, - 39, 0, 39, 24, - 0, 24, 39, 24, - 0, 0, 0, 24 - } - }, - - // Box wipe (a box expands from the upper-left corner to the lower-right corner) - { - 25, // Number of iterations - { - 0, 1, 2, 1, - 2, 0, 2, 1, - 2, 0, 2, 1, - 0, 0, 0, 0 - }, - { - 0, 0, 0, 0, - 0, 0, 0, 0, - 1, 0, 1, 0, - 255, 0, 0, 0 - } - }, - - // Box wipe (a box expands from the lower-right corner to the upper-left corner) - { - 25, // Number of iterations - { - -2, -1, 0, -1, - -2, -1, -2, 0, - -2, -1, -2, 0, - 0, 0, 0, 0 - }, - { - 39, 24, 39, 24, - 39, 24, 39, 24, - 38, 24, 38, 24, - 255, 0, 0, 0 - } - }, - - // Inverse box wipe - { - 25, // Number of iterations - { - 0, -1, -2, -1, - -2, 0, -2, -1, - -2, 0, -2, -1, - 0, 0, 0, 0 - }, - { - 0, 24, 39, 24, - 39, 0, 39, 24, - 38, 0, 38, 24, - 255, 0, 0, 0 - } - }, - - // Inverse iris effect, specially tailored for V1/V2 games - { - 9, // Number of iterations - { - -1, -1, 1, -1, - -1, 1, 1, 1, - -1, -1, -1, 1, - 1, -1, 1, 1 - }, - { - 7, 7, 32, 7, - 7, 8, 32, 8, - 7, 8, 7, 8, - 32, 7, 32, 8 - } - } - }; - - writeRecord(transitionEffects, sizeof(transitionEffects), GBVARS_TRANSITIONEFFECTS_INDEX , GBVARS_SCUMM); -} - -/////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////// - -void addGfx() { - addGfx_transitionEffects(); - -}
\ No newline at end of file diff --git a/backends/platform/PalmOS/Src/builder/scumm/bl_md5.c b/backends/platform/PalmOS/Src/builder/scumm/bl_md5.c deleted file mode 100644 index f3f4261d99..0000000000 --- a/backends/platform/PalmOS/Src/builder/scumm/bl_md5.c +++ /dev/null @@ -1,432 +0,0 @@ -#include <PalmOS.h> -#include "b_globals.h" - -enum Language { - UNK_LANG = -1, // Use default language (i.e. none specified) - EN_ANY = 0, - EN_USA = 1, - DE_DEU = 2, - FR_FRA = 3, - IT_ITA = 4, - PT_BRA = 5, - ES_ESP = 6, - JA_JPN = 7, - ZH_TWN = 8, - KO_KOR = 9, - SE_SWE = 10, - EN_GRB = 11, - HB_ISR = 20, - RU_RUS = 21, - CZ_CZE = 22, - NL_NLD = 23, - NB_NOR = 24 -}; - -enum Platform { - kPlatformUnknown = -1, - kPlatformPC = 0, - kPlatformAmiga = 1, - kPlatformAtariST = 2, - kPlatformMacintosh = 3, - kPlatformFMTowns = 4, - kPlatformWindows = 5, - kPlatformNES = 6, - kPlatformC64 = 7 -/* - kPlatformSEGA, - kPlatformPCEngine -*/ -}; - -typedef struct { - const char md5[32 + 1]; - const char target[16 + 1]; - enum Language language; - enum Platform platform; -} MD5Table; - -static void addScumm_mdtable() { - MD5Table md5table[] = { - { "0305e850382b812fec6e5998ef88a966", "pjs-demo", NL_NLD, kPlatformWindows }, - { "035deab53b47bc43abc763560d0f8d4b", "playfate", EN_ANY, kPlatformPC }, - { "037385a953789190298494d92b89b3d0", "catalog2", EN_ANY, kPlatformWindows }, - { "0425954a9db5c340861672892c3e678d", "samdemo", EN_ANY, kPlatformMacintosh }, - { "04401d747f1a2c1c4b388daff71ed378", "ft", DE_DEU, kPlatformMacintosh }, - { "04687cdf7f975a89d2474929f7b80946", "indy3towns", EN_ANY, kPlatformFMTowns }, - { "0557df19f046a84c2fdc63507c6616cb", "farmdemo", NL_NLD, kPlatformWindows }, - { "06b187468113f9ae5a400b148a847fac", "atlantis", EN_ANY, kPlatformMacintosh }, - { "07433205acdca3bc553d0e731588b35f", "airport", EN_ANY, kPlatformWindows }, - { "07b810e37be7489263f7bc7627d4765d", "freddi4", RU_RUS, kPlatformWindows }, - { "084ed0fa98a6d1e9368d67fe9cfbd417", "freddemo", EN_ANY, kPlatformWindows }, - { "0855496dde35356b1a9691e22ba84cdc", "freddemo", EN_ANY, kPlatformWindows }, - { "08cc5c3eedaf72ebe12734eee94f7fa2", "balloon", EN_ANY, kPlatformUnknown }, - { "09820417db26687bb7fe0c83cc4c553b", "ft", EN_ANY, kPlatformUnknown }, - { "0a212fa35fa8421f31c1f3961272caf0", "monkeyvga", DE_DEU, kPlatformAmiga }, - { "0ab19be9e2a3f6938226638b2a3744fe", "timedemo", EN_ANY, kPlatformUnknown }, - { "0ac41e2e3d2174e5a042a6b565328dba", "racedemo", EN_ANY, kPlatformUnknown }, - { "0b3222aaa7efcf283eb621e0cefd26cc", "puttputt", RU_RUS, kPlatformPC }, - { "0cccfa5223099a60e76cfcca57a1a141", "freddi3", NL_NLD, kPlatformWindows }, - { "0d1b69471605201ef2fa9cec1f5f02d2", "maniac", ES_ESP, kPlatformPC }, - { "0e4c5d54a0ad4b26132e78b5ea76642a", "snmidemo", EN_ANY, kPlatformPC }, - { "0f5935bd5e88ba6f09e558d64459746d", "1grademo", EN_ANY, kPlatformWindows }, - { "0f6f2e716ba896a44e5059bba1de7ca9", "samnmax", IT_ITA, kPlatformUnknown }, - { "0f9c7a76657f0840b8f7ccb5bffeb9f4", "indy3EGA", FR_FRA, kPlatformAtariST }, - { "0fb73eddfcf584c02ba097984df131ba", "samnmax", DE_DEU, kPlatformUnknown }, - { "1005456bfe351c1b679e1ff2dc2849e9", "puttzoo", EN_ANY, kPlatformWindows }, - { "114acdc2659a273c220f86ee9edb24c1", "maniac", FR_FRA, kPlatformPC }, - { "11ddf1fde76e3156eb3a38da213f484e", "monkey2", IT_ITA, kPlatformAmiga }, - { "11e6e244078ff09b0f3832e35420e0a7", "catalog", EN_ANY, kPlatformWindows }, - { "132bff65e6367c09cc69318ce1b59333", "monkey2", EN_ANY, kPlatformAmiga }, - { "145bd3373574feb668cc2eea2ec6cf86", "balloon", RU_RUS, kPlatformWindows }, - { "14d48c95b43ddeb983254cf6c43851f1", "freddi4", NL_NLD, kPlatformWindows }, - { "157367c3c21e0d03a0cba44361b4cf65", "indy3EGA", EN_ANY, kPlatformAtariST }, - { "15e03ffbfeddb9c2aebc13dcb2a4a8f4", "monkeyvga", EN_ANY, kPlatformPC }, - { "16542a7342a918bfe4ba512007d36c47", "FreddisFunShop", EN_ANY, kPlatformUnknown }, - { "16effd200aa6b8abe9c569c3e578814d", "f4-demo", NL_NLD, kPlatformWindows }, - { "179879b6e35c1ead0d93aab26db0951b", "fbear", EN_ANY, kPlatformWindows }, - { "17b5d5e6af4ae89d62631641d66d5a05", "indy3", IT_ITA, kPlatformPC }, - { "17fa250eb72dae2dad511ba79c0b6b0a", "dottdemo", FR_FRA, kPlatformPC }, - { "182344899c2e2998fca0bebcd82aa81a", "atlantis", EN_ANY, kPlatformPC }, - { "183d7464902d40d00800e8ee1f04117c", "maniac", DE_DEU, kPlatformPC }, - { "1875b90fade138c9253a8e967007031a", "indy3", UNK_LANG, kPlatformPC }, - { "187d315f6b5168f68680dfe8c3d76a3e", "loom", HB_ISR, kPlatformPC }, - { "1900e501a52fbf55bde6e4196f6d2aa6", "zak", IT_ITA, kPlatformPC }, - { "19263586f749a560c1adf8b3393a9593", "socks", RU_RUS, kPlatformWindows }, - { "1a6e5ae2777a6a33f06ffc0226210934", "atlantis", EN_ANY, kPlatformMacintosh }, - { "1c792d28376d45e145cb916bca0400a2", "sf2-demo", NL_NLD, kPlatformUnknown }, - { "1ca86e2cf9aaa2068738a1e5ba477e60", "zakTowns", JA_JPN, kPlatformFMTowns }, - { "1d05cd189e4908f79b57e78a4402f292", "monkeyega", EN_ANY, kPlatformPC }, - { "1dd3c11ea4439adfe681e4e405b624e1", "monkeyega", FR_FRA, kPlatformPC }, - { "1dd7aa088e09f96d06818aa9a9deabe0", "indy3EGA", EN_ANY, kPlatformMacintosh }, - { "1fbebd7b2b692df5297870447a80cfed", "atlantis", DE_DEU, kPlatformPC }, - { "2012f854d83d9cc6f73b2b544cd8bbf8", "water", RU_RUS, kPlatformWindows }, - { "2108d83dcf09f8adb4bc524669c8cf51", "PuttTime", EN_ANY, kPlatformUnknown }, - { "21a6592322f92550f144f68a8a4e685e", "dig", FR_FRA, kPlatformMacintosh }, - { "21abe302e1b1e2b66d6f5c12e241ebfd", "freddicove", RU_RUS, kPlatformWindows }, - { "225e18566e810c634bf7de63e7568e3e", "mustard", EN_ANY, kPlatformUnknown }, - { "22c9eb04455440131ffc157aeb8d40a8", "fbdemo", EN_ANY, kPlatformWindows }, - { "22d07d6c386c9c25aca5dac2a0c0d94b", "maniac", SE_SWE, kPlatformNES }, - { "22f4ea88a09da12df9308ba30bcb7d0f", "loom", EN_ANY, kPlatformPC }, - { "2723fea3dae0cb47768c424b145ae0e7", "tentacle", EN_ANY, kPlatformPC }, - { "27b3a4224ad63d5b04627595c1c1a025", "zak", IT_ITA, kPlatformAmiga }, - { "28d24a33448fab6795850bc9f159a4a2", "indydemo", JA_JPN, kPlatformFMTowns }, - { "28ef68ee3ed76d7e2ee8ee13c15fbd5b", "loom", EN_ANY, kPlatformPC }, - { "2a208ffbcd0e83e86f4356e6f64aa6e1", "loom", ES_ESP, kPlatformPC }, - { "2ccd8891ce4d3f1a334d21bff6a88ca2", "monkey", EN_ANY, kPlatformMacintosh }, - { "2d1e891fe52df707c30185e52c50cd92", "monkey", EN_ANY, kPlatformPC }, - { "2d388339d6050d8ccaa757b64633954e", "zakTowns", EN_ANY, kPlatformFMTowns }, - { "2d4536a56e01da4b02eb021e7770afa2", "zakTowns", EN_ANY, kPlatformFMTowns }, - { "2e85f7aa054930c692a5b1bed1dfc295", "footdemo", EN_ANY, kPlatformUnknown }, - { "2fe369ad70f52a8cf7ad6077ee64f81a", "loom", DE_DEU, kPlatformAmiga }, - { "305d3dd57c96c65b017bc70c8c7cfb5e", "monkey", DE_DEU, kPlatformPC }, - { "30ba1e825d4ad2b448143ae8df18482a", "pj2demo", NL_NLD, kPlatformWindows }, - { "319a4dde52c7960b5aae8a1ec348d918", "monkeyvga", DE_DEU, kPlatformAmiga }, - { "31aa57f460a3d12429f0552a46a90b39", "puttdemo", EN_ANY, kPlatformPC }, - { "31b8fda4c8c7413fa6b39997e776eba4", "loomTowns", JA_JPN, kPlatformFMTowns }, - { "32709cbeeb3044b34129950860a83f14", "pajama2", RU_RUS, kPlatformWindows }, - { "32a433dea56b86a55b59e4ff7d755711", "ftpcdemo", EN_ANY, kPlatformPC }, - { "330f631502e381a4e199a3f7cb483c20", "indy3EGA", DE_DEU, kPlatformAmiga }, - { "3433be9866ca4261b2d5d25374e3f243", "monkeyvga", FR_FRA, kPlatformAmiga }, - { "3486ede0f904789267d4bcc5537a46d4", "zoodemo", EN_ANY, kPlatformMacintosh }, - { "35a2d3040fa512f8232d9e443319d84d", "dig", EN_ANY, kPlatformMacintosh }, - { "362c1d281fb9899254cda66ad246c66a", "digdemo", EN_ANY, kPlatformUnknown }, - { "3686cf8f89e102ececf4366e1d2c8126", "monkey2", EN_ANY, kPlatformPC }, - { "36a6750e03fb505fc19fc2bf3e4dbe91", "pj2demo", EN_ANY, kPlatformUnknown }, - { "37aed3f91c1ef959e0bd265f9b13781f", "pajama", EN_ANY, kPlatformUnknown }, - { "37f56ceb13e401a7ac7d9e6b37fecaf7", "loom", EN_ANY, kPlatformPC }, - { "37ff1b308999c4cca7319edfcc1280a0", "puttdemo", EN_ANY, kPlatformWindows }, - { "3824e60cdf639d22f6df92a03dc4b131", "fbear", EN_ANY, kPlatformPC }, - { "387a544b8b10b26912d8413bab63a853", "mi2demo", EN_ANY, kPlatformPC }, - { "3905799e081b80a61d4460b7b733c206", "maniac", EN_ANY, kPlatformNES }, - { "3938ee1aa4433fca9d9308c9891172b1", "zakTowns", EN_ANY, kPlatformFMTowns }, - { "399b217b0c8d65d0398076da486363a9", "indy3", DE_DEU, kPlatformPC }, - { "39cb9dec16fa16f38d79acd80effb059", "loom", FR_FRA, kPlatformAmiga }, - { "39cb9dec16fa16f38d79acd80effb059", "loom", IT_ITA, kPlatformAmiga }, - { "3a03dab514e4038df192d8a8de469788", "atlantis", EN_ANY, kPlatformAmiga }, - { "3a0c35f3c147b98a2bdf8d400cfc4ab5", "indy3towns", JA_JPN, kPlatformFMTowns }, - { "3b301b7892f883ce42ab4be6a274fea6", "samnmax", EN_ANY, kPlatformPC }, - { "3de99ef0523f8ca7958faa3afccd035a", "spyfox", EN_ANY, kPlatformUnknown }, - { "3df6ead57930488bc61e6e41901d0e97", "fbear", EN_ANY, kPlatformMacintosh }, - { "40564ec47da48a67787d1f9bd043902a", "maniac", EN_ANY, kPlatformPC }, - { "4167a92a1d46baa4f4127d918d561f88", "tentacle", EN_ANY, kPlatformUnknown }, - { "430bc518017b6fac046f58bab6baad5d", "monkey2", JA_JPN, kPlatformFMTowns }, - { "45082a5c9f42ba14dacfe1fdeeba819d", "ff5demo", EN_ANY, kPlatformWindows }, - { "45152f7cf2ba8f43cf8a8ea2e740ae09", "monkeyvga", ES_ESP, kPlatformPC }, - { "46b53fd430adcfbed791b48a0d4b079f", "funpack", EN_ANY, kPlatformPC }, - { "477dbafbd66a53c98416dc01aef019ad", "monkeyega", IT_ITA, kPlatformPC }, - { "47e75b1bdcb44c78cb94883d1731ccf8", "fbdemo", EN_ANY, kPlatformPC }, - { "49210e124e4c2b30f1290a9ef6306301", "monkeyega", EN_ANY, kPlatformPC }, - { "499c958affc394f2a3868f1eb568c3ee", "f4-demo", NL_NLD, kPlatformWindows }, - { "4af4a6b248103c1fe9edef619677f540", "moondemo", EN_ANY, kPlatformMacintosh }, - { "4ba37f835be11a59d969f90f272f575b", "water", EN_ANY, kPlatformUnknown }, - { "4ba7fb331296c283e73d8f5b2096e551", "samnmax", ES_ESP, kPlatformUnknown }, - { "4bedb49943df95a9c900a5a82ccbe9de", "ft", FR_FRA, kPlatformUnknown }, - { "4cb9c3618f71668f8e4346c8f323fa82", "monkey2", EN_ANY, kPlatformMacintosh }, - { "4ce2d5b355964bbcb5e5ce73236ef868", "freddicove", RU_RUS, kPlatformWindows }, - { "4d34042713958b971cb139fba4658586", "indy4", JA_JPN, kPlatformFMTowns }, - { "4dbff3787aedcd96b0b325f2d92d7ad9", "maze", EN_ANY, kPlatformUnknown }, - { "4dc780f1bc587a193ce8a97652791438", "loom", EN_ANY, kPlatformAmiga }, - { "4e5867848ee61bc30d157e2c94eee9b4", "timedemo", EN_ANY, kPlatformUnknown }, - { "4edbf9d03550f7ba01e7f34d69b678dd", "spydemo", NL_NLD, kPlatformWindows }, - { "4f04b321a95d4315ce6d65f8e1dd0368", "maze", EN_ANY, kPlatformUnknown }, - { "4f267a901719623de7dde83e47d5b474", "atlantis", DE_DEU, kPlatformAmiga }, - { "4f580a021eee026f3b4589e17d130d78", "freddi4", UNK_LANG, kPlatformUnknown }, - { "4fa6870d9bc8c313b65d54b1da5a1891", "pajama", NL_NLD, kPlatformWindows }, - { "4fbbe9f64b8bc547503a379a301183ce", "tentacle", IT_ITA, kPlatformUnknown }, - { "5057fb0e99e5aa29df1836329232f101", "freddi2", UNK_LANG, kPlatformWindows }, - { "507bb360688dc4180fdf0d7597352a69", "freddi", SE_SWE, kPlatformWindows }, - { "50fcdc982a25063b78ad46bf389b8e8d", "tentacle", IT_ITA, kPlatformPC }, - { "51305e929e330e24a75a0351c8f9975e", "freddi2", EN_ANY, kPlatformUnknown }, - { "5262a27afcaee04e5c4900220bd463e7", "PuttsFunShop", EN_ANY, kPlatformUnknown }, - { "52a4bae0746a11d7b1e8554e91a6645c", "zak", FR_FRA, kPlatformPC }, - { "53e94115b55dd51d4b8ff0871aa1df1e", "spydemo", EN_ANY, kPlatformUnknown }, - { "54a936ad06161ff7bfefcb96200f7bff", "monkeyvga", EN_ANY, kPlatformAmiga }, - { "55518cd73cf9c6d23ea29c51ee06bdfe", "ft", IT_ITA, kPlatformUnknown }, - { "55e4cc866ff9046824e1c638ba2b8c7f", "ft", RU_RUS, kPlatformUnknown }, - { "566165a7338fa11029e7c14d94fa70d0", "freddemo", EN_ANY, kPlatformWindows }, - { "5798972220cd458be2626d54c80f71d7", "atlantis", IT_ITA, kPlatformAmiga }, - { "57b0d89af79befe1cabce3bece869e7f", "tentacle", DE_DEU, kPlatformPC }, - { "589601b676c98b1c0c987bc031ab68b3", "chase", EN_ANY, kPlatformUnknown }, - { "58fdf4c7ad13540a734e18f8584cad89", "puttzoo", EN_ANY, kPlatformMacintosh }, - { "590e6546aacd0d374b7f3a4f53013ab1", "freddicove", EN_ANY, kPlatformUnknown }, - { "5a35e36fd777e9c37a49c5b2faca52f9", "loom", EN_ANY, kPlatformPC }, - { "5b08000a9c47b2887df6506ac767ca68", "fbear", EN_ANY, kPlatformUnknown }, - { "5bd335265a61caa3d78956ad9f88ba23", "footdemo", EN_ANY, kPlatformUnknown }, - { "5c21fc49aee8f46e58fef21579e614a1", "thinker1", EN_ANY, kPlatformUnknown }, - { "5d88b9d6a88e6f8e90cded9d01b7f082", "loomcd", EN_ANY, kPlatformPC }, - { "5e8fb66971a60e523e5afbc4c129c0e8", "socks", EN_ANY, kPlatformUnknown }, - { "5fbe557049892eb4b709d90916ec97ca", "indy3EGA", EN_ANY, kPlatformPC }, - { "600abd3e9f47e63e670188b7e4e86ac7", "spyozon", EN_ANY, kPlatformUnknown }, - { "6027e9ca9c35746d95dee2068cec17e5", "zak", DE_DEU, kPlatformAmiga }, - { "60ba818dc3bede86d40357e3913f8505", "ft", EN_ANY, kPlatformUnknown }, - { "613f64f78ea26c7353b2a5940eb61d6a", "zak", FR_FRA, kPlatformAtariST }, - { "624cdb93654667c869d204a64af7e57f", "maniac", EN_ANY, kPlatformPC }, - { "6271130f440066830eca9056c1d7926f", "water", RU_RUS, kPlatformWindows }, - { "66236cd1aec24e1d4aff4c4cc93b7e18", "indy3EGA", FR_FRA, kPlatformPC }, - { "66fd5ff9a810dfeb6d6bdada18221140", "monkeyvga", IT_ITA, kPlatformPC }, - { "672dec94b82f7f0877ebb5b5cf7f4bc1", "pajama", EN_ANY, kPlatformUnknown }, - { "675d71151e9b5a968c8ce46d9fbf4cbf", "zak", EN_ANY, kPlatformPC }, - { "68155a6bf082221525f431c2cbdac8ab", "SamsFunShop", EN_ANY, kPlatformUnknown }, - { "684732efb5799c0f78804c99d8de9aba", "puttputt", EN_ANY, kPlatformMacintosh }, - { "6886e5d08cee329b1f2e743ae2e3ceed", "monkey2", DE_DEU, kPlatformPC }, - { "695fe0b3963333b7e15b37514db3c745", "kinddemo", EN_ANY, kPlatformUnknown }, - { "697c9b7c55a05d8199c48b48e379d2c8", "puttmoon", HB_ISR, kPlatformPC }, - { "69ea626f1f87eecb78ea0d6c6b983a1d", "monkey2", IT_ITA, kPlatformPC }, - { "6a30a07f353a75cdc602db27d73e1b42", "puttputt", EN_ANY, kPlatformWindows }, - { "6af2419fe3db5c2fdb091ae4e5833770", "racedemo", NL_NLD, kPlatformUnknown }, - { "6b19d0e25cbf720d05822379b8b90ed9", "timedemo", NL_NLD, kPlatformWindows }, - { "6b257bb2827dd894b8109a50a1a18b5a", "FF5Demo", NL_NLD, kPlatformWindows }, - { "6b3ec67da214f558dc5ceaa2acd47453", "indy3EGA", EN_ANY, kPlatformPC }, - { "6bf70eee5de3d24d2403e0dd3d267e8a", "spyfox", EN_ANY, kPlatformWindows }, - { "6c2bff0e327f2962e809c2e1a82d7309", "monkeyvga", EN_ANY, kPlatformAmiga }, - { "6df20c50c1ab19799de9be7ae7716881", "fbdemo", EN_ANY, kPlatformMacintosh }, - { "6e959d65358eedf9b68b81e304b97fa4", "tentacle", DE_DEU, kPlatformUnknown }, - { "6ea966b4d660c870b9ee790d1fbfc535", "monkey2", ES_ESP, kPlatformAmiga }, - { "6f0be328c64d689bb606d22a389e1b0f", "loom", EN_ANY, kPlatformMacintosh }, - { "6f6ef668c608c7f534fea6e6d3878dde", "indy3EGA", DE_DEU, kPlatformPC }, - { "701246819d1a70573f41bf33fc19214f", "soccer", EN_ANY, kPlatformWindows }, - { "7020931d5a2be0a49d68e7a1882363e4", "zak", EN_ANY, kPlatformPC }, - { "71523b539491527d9860f4407faf0411", "monkeyega", EN_ANY, kPlatformPC }, - { "71fe97c3108678cf604f14abe342341b", "spyfox2", NL_NLD, kPlatformWindows }, - { "7222f260253f325c21fcfa68b5bfab67", "sf2-demo", EN_ANY, kPlatformUnknown }, - { "72ac6bc980d5101c2142189d746bd62f", "spyfox", RU_RUS, kPlatformWindows }, - { "73e5ab7dbb9a8061cc6d25df02dbd1e7", "loom", EN_ANY, kPlatformPC }, - { "746e88c172a5b7a1ae89ac0ee3ee681a", "freddi", RU_RUS, kPlatformWindows }, - { "754feb59d3bf86b8a00840df74fd7b26", "f3-mdemo", NL_NLD, kPlatformWindows }, - { "75ba23fff4fd63fa446c02864f2a5a4b", "zak", IT_ITA, kPlatformPC }, - { "75bff95816b84672b877d22a911ab811", "freddi3", RU_RUS, kPlatformWindows }, - { "771bc18ec6f93837b839c992b211904b", "monkeyega", DE_DEU, kPlatformPC }, - { "77f5c9cc0986eb729c1a6b4c8823bbae", "zakTowns", EN_ANY, kPlatformFMTowns }, - { "780e4a0ae2ff17dc296f4a79543b44f8", "puttmoon", UNK_LANG, kPlatformPC }, - { "78bd5f036ea35a878b74e4f47941f784", "freddi4", RU_RUS, kPlatformWindows }, - { "7974365d3dc0f43a2748c975f91ff042", "monkey2", ES_ESP, kPlatformPC }, - { "7bad72e332a59f9fcc1d437f4edad32a", "puttcircus", RU_RUS, kPlatformUnknown }, - { "7c2e76087027eeee9c8f8985f93a1cc5", "f4-demo", EN_ANY, kPlatformUnknown }, - { "7ddeaf52c8b9a50551ce0aa2ac811d07", "BluesABCTimeDemo", EN_ANY, kPlatformUnknown }, - { "7e151c17adf624f1966c8fc5827c95e9", "puttputt", EN_ANY, kPlatformUnknown }, - { "7ea2da67ebabea4ac20cee9f4f9d2934", "airdemo", EN_ANY, kPlatformMacintosh }, - { "7edd665bbede7ea8b7233f8e650be6f8", "samnmax", FR_FRA, kPlatformUnknown }, - { "7f45ddd6dbfbf8f80c0c0efea4c295bc", "maniac", EN_ANY, kPlatformPC }, - { "7fc6cdb46b4c9d384c52327f4bca6416", "football", EN_ANY, kPlatformWindows }, - { "810a9da887aefa597b0cf3c77d262897", "BluesABCTimeDemo", EN_ANY, kPlatformWindows }, - { "81bbfa181184cb494e7a81dcfa94fbd9", "maniac", FR_FRA, kPlatformNES }, - { "8299d9b8a1b0e7b881bae7a9971dc5e2", "zak", EN_ANY, kPlatformAtariST }, - { "8368f552b1e3eba559f8d559bcc4cadb", "freddi3", UNK_LANG, kPlatformUnknown }, - { "861e59ed72a1cd0e6d454f7ee7e2bf3d", "comi", RU_RUS, kPlatformUnknown }, - { "86be8ada36371d4fdc35659d0e912a26", "indy3EGA", ES_ESP, kPlatformPC }, - { "86c9902b7bec1a17926d4dae85beaa45", "airdemo", EN_ANY, kPlatformWindows }, - { "870d1e3c86bc50846d808d14a36b4e08", "monkeyvga", ES_ESP, kPlatformAmiga }, - { "87f6e8037b7cc996e13474b491a7a98e", "maniac", IT_ITA, kPlatformPC }, - { "8801fb4a1200b347f7a38523339526dd", "jungle", EN_ANY, kPlatformWindows }, - { "883af4b0af4f77a92f1dcf1d0a283140", "tentacle", ES_ESP, kPlatformUnknown }, - { "898ce8eb1234a955ef75e87141902bb3", "freddi3", RU_RUS, kPlatformWindows }, - { "8a484262363a8e18be87112454f1456b", "pjgames", EN_ANY, kPlatformWindows }, - { "8aa05d3cdb0e795436043f0546af2da2", "tentacle", FR_FRA, kPlatformUnknown }, - { "8afb3cf9f95abf208358e984f0c9e738", "funpack", EN_ANY, kPlatformUnknown }, - { "8bdb0bf87b5e303dd35693afb9351215", "ft", DE_DEU, kPlatformUnknown }, - { "8d479e36f35e80257dfc102cf4b8a912", "farmdemo", EN_ANY, kPlatformWindows }, - { "8e3241ddd6c8dadf64305e8740d45e13", "balloon", EN_ANY, kPlatformUnknown }, - { "8e4ee4db46954bfe2912e259a16fad82", "monkey2", FR_FRA, kPlatformPC }, - { "8eb84cee9b429314c7f0bdcf560723eb", "monkey", EN_ANY, kPlatformFMTowns }, - { "8ee63cafb1fe9d62aa0d5a23117e70e7", "freddi2", EN_ANY, kPlatformUnknown }, - { "8f3758ff98c9c5d78e5d635222cad026", "atlantis", IT_ITA, kPlatformPC }, - { "8fec68383202d38c0d25e9e3b757c5df", "comidemo", UNK_LANG, kPlatformUnknown }, - { "8ffd618a776a4c0d8922bb28b09f8ce8", "airdemo", EN_ANY, kPlatformWindows }, - { "90a329d8ad5b7ce0690429e98cfbb32f", "funpack", HB_ISR, kPlatformPC }, - { "90c755e1c9b9b8a4129d37b2259d0655", "chase", EN_ANY, kPlatformUnknown }, - { "910e31cffb28226bd68c569668a0d6b4", "monkeyega", ES_ESP, kPlatformPC }, - { "91469353f7be1b122fa88d23480a1320", "zak", FR_FRA, kPlatformAmiga }, - { "92b078d9d6d9d751da9c26b8b3075779", "tentacle", FR_FRA, kPlatformPC }, - { "92e7727e67f5cd979d8a1070e4eb8cb3", "puttzoo", EN_ANY, kPlatformUnknown }, - { "92fc0073a4cf259ff36070ecb8628ba8", "thinkerk", EN_ANY, kPlatformUnknown }, - { "96a3069a3c63caa7329588ce1fef41ee", "spyozon", RU_RUS, kPlatformUnknown }, - { "9708cf716ed8bcc9ff3fcfc69413b746", "puttputt", EN_ANY, kPlatformPC }, - { "981e1e1891f2be7e25a01f50ae55a5af", "puttrace", EN_ANY, kPlatformUnknown }, - { "98744fe66ff730e8c2b3b1f58803ab0b", "playfate", EN_ANY, kPlatformPC }, - { "99a3699f80b8f776efae592b44b9b991", "maniac", FR_FRA, kPlatformPC }, - { "99b6f822b0b2612415407865438697d6", "fate", EN_ANY, kPlatformPC }, - { "9bc548e179cdb0767009401c094d0895", "maniac", DE_DEU, kPlatformAmiga }, - { "9bd2a8f72613e715c199246dd511e10f", "atlantis", ES_ESP, kPlatformPC }, - { "9bda5fee51d2fda5253d02c642016bf4", "spyfox", NL_NLD, kPlatformWindows }, - { "9c0fee288ad564a7d25ec3e841810d79", "indy3EGA", EN_ANY, kPlatformAmiga }, - { "9c143c5905055d5df7a0f014ab379aee", "moondemo", EN_ANY, kPlatformWindows }, - { "9c92eeaf517a31b7221ec2546ab669fd", "puttmoon", EN_ANY, kPlatformWindows }, - { "9cdd327c1034c046cb595d251c44da2f", "chase", RU_RUS, kPlatformWindows }, - { "9d4ab3e0e1d1ebc6ba8a6a4c470ed184", "spydemo", EN_ANY, kPlatformWindows }, - { "9d7b67be003fea60be4dcbd193611936", "ftdemo", EN_ANY, kPlatformMacintosh }, - { "9dc02577bf50d4cfaf3de3fbac06fbe2", "puttmoon", EN_ANY, kPlatformMacintosh }, - { "9e5e0fb43bd22f4628719b7501adb717", "monkeyega", FR_FRA, kPlatformAtariST }, - { "a194f15f51ee62badab74b9e7da97693", "bb2demo", EN_ANY, kPlatformWindows }, - { "a28135a7ade38cc0208b04507c46efd1", "spyfox", DE_DEU, kPlatformWindows }, - { "a2bb6aa0537402c1b3c2ea899ccef64b", "smaller", EN_ANY, kPlatformWindows }, - { "a3036878840720fbefa41e6965fa4a0a", "samnmax", EN_ANY, kPlatformPC }, - { "a525c1753c1db5011c00417da37887ef", "PuttTime", EN_ANY, kPlatformUnknown }, - { "a561d2e2413cc1c71d5a1bf87bf493ea", "lost", EN_ANY, kPlatformUnknown }, - { "a570381b028972d891052ee1e51dc011", "maniac", EN_ANY, kPlatformAtariST }, - { "a654fb60c3b67d6317a7894ffd9f25c5", "pj3-demo", EN_ANY, kPlatformWindows }, - { "a7cacad9c40c4dc9e1812abf6c8af9d5", "circdemo", EN_ANY, kPlatformUnknown }, - { "a85856675429fe88051744f755b72f93", "farm", EN_ANY, kPlatformWindows }, - { "a86f9c49355579c30d4a55b477c0d869", "baseball2001", EN_ANY, kPlatformUnknown }, - { "a9543ef0d79bcb47cd76ec197ad0a967", "puttmoon", EN_ANY, kPlatformUnknown }, - { "a9f2f04b1ecaab9495b59befffe9bf88", "pj3-demo", EN_ANY, kPlatformUnknown }, - { "aa6a91b7f6f119d1b7b1f2a4c9e24d59", "moondemo", EN_ANY, kPlatformPC }, - { "aa7a07d94ae853f6460be4ce0a1bf530", "monkeyega", FR_FRA, kPlatformPC }, - { "aa8a0cb65f3afbbe2c14c3f9f92775a3", "monkey", FR_FRA, kPlatformPC }, - { "aaa587701cde7e74692c68c1024b85eb", "racedemo", NL_NLD, kPlatformUnknown }, - { "ab0693e9324cfcf498fdcbb12acf8bb4", "puttcircus", EN_ANY, kPlatformUnknown }, - { "ac1642b6edfb8521ca03760126f1c250", "dottdemo", DE_DEU, kPlatformPC }, - { "ac62d50e39492ee3738b4e83a5ac780f", "freddi2", NL_NLD, kPlatformWindows }, - { "acad97ab1c6fc2a5b2d98abf6db4a190", "tentacle", EN_ANY, kPlatformUnknown }, - { "ae94f110a14ce71fc515d5b648827a8f", "tentacle", ES_ESP, kPlatformPC }, - { "b23f7cd7c304d7dff08e92a96120d5b4", "zak", EN_ANY, kPlatformPC }, - { "b250d0f9cc83f80ced56fe11a4fb057c", "maniac", EN_ANY, kPlatformPC }, - { "b289a2a8cbedbf45786e0b4ad2f510f1", "samnmax", IT_ITA, kPlatformPC }, - { "b597e0403cc0002f69170e6caba7edd9", "indy3EGA", EN_ANY, kPlatformPC }, - { "b628506f7def772e40de0aa5440fb8e1", "activity", EN_ANY, kPlatformWindows }, - { "b886b0a5d909c7158a914e1d7c1c6c65", "loom", FR_FRA, kPlatformPC }, - { "b8955d7d23b4972229060d1592489fef", "freddicove", NL_NLD, kPlatformWindows }, - { "bd126753de619a495f9f22adc951c8d5", "monkey2", IT_ITA, kPlatformPC }, - { "be39a5d4db60e8aa736b9086778cb45c", "spyozon", EN_ANY, kPlatformWindows }, - { "bf8b52fdd9a69c67f34e8e9fec72661c", "farmdemo", EN_ANY, kPlatformWindows }, - { "bfdf584b01503f0762baded581f6a0a2", "SoccerMLS", EN_ANY, kPlatformWindows }, - { "c0039ad982999c92d0de81910d640fa0", "freddi", NL_NLD, kPlatformWindows }, - { "c13225cb1bbd3bc9fe578301696d8021", "game", EN_ANY, kPlatformUnknown }, - { "c24c490373aeb48fbd54caa8e7ae376d", "loom", DE_DEU, kPlatformAtariST }, - { "c25755b08a8d0d47695e05f1e2111bfc", "f4-demo", EN_ANY, kPlatformWindows }, - { "c30ef068add4277104243c31ce46c12b", "monkey2", FR_FRA, kPlatformAmiga }, - { "c3196c5349e53e387aaff1533d95e53a", "snmdemo", EN_ANY, kPlatformPC }, - { "c3b22fa4654bb580b20325ebf4174841", "puttzoo", NL_NLD, kPlatformWindows }, - { "c3df37df9d3b481b45f75283a9907c47", "loom", IT_ITA, kPlatformPC }, - { "c4787c3e8b5e2dfda90850ee800af00f ", "zak", FR_FRA, kPlatformPC }, - { "c4ffae9fac495475d6bc3343ccc8faf9", "Soccer2004", EN_ANY, kPlatformUnknown }, - { "c5d10e190d4b4d59114b824f2fdbd00e", "loomTowns", EN_ANY, kPlatformFMTowns }, - { "c63ee46143ba65f9ce14cf539ca51bd7", "atlantis", EN_ANY, kPlatformPC }, - { "c6907d44f1166941d982864cd42cdc89", "pajama2", DE_DEU, kPlatformWindows }, - { "c7890e038806df2bb5c0c8c6f1986ea2", "monkeyvga", EN_ANY, kPlatformPC }, - { "c7be10f775404fd9785a8b92a06d240c", "indy4", EN_ANY, kPlatformFMTowns }, - { "c83079157ec765a28de445aec9768d60", "dottdemo", EN_ANY, kPlatformPC }, - { "c8aac5e3e701874e2fa4117896f9e1b1", "freddemo", EN_ANY, kPlatformMacintosh }, - { "cb1559e8405d17a5a278a6b5ad9338d1", "f3-mdemo", EN_ANY, kPlatformUnknown }, - { "cc8ba2b0df2f9c450bcf055fe2711979", "snmdemo", DE_DEU, kPlatformPC }, - { "cd9c05e755d7bf8e9b9590ad1ebe273e", "digdemo", EN_ANY, kPlatformMacintosh }, - { "cdd760228cf1010c2903f37e788ea31c", "zak", DE_DEU, kPlatformPC }, - { "ce3edc99cd4f478c5b37104d70c68ca5", "zakTowns", JA_JPN, kPlatformFMTowns }, - { "ce6a4cef315b20fef58a95bc40a2d8d3", "monkeyega", FR_FRA, kPlatformPC }, - { "ce7733f185b838e248927c7ba1a04204", "maniac", FR_FRA, kPlatformAmiga }, - { "ce7fd0c382389a6791fc3e199c117ef4", "indy3EGA", ES_ESP, kPlatformPC }, - { "cea91e3dd47f2518ea418e41611aa77f", "spyfox2", RU_RUS, kPlatformUnknown }, - { "cf8d13446ec6cb6222287a925fd47c1d", "baseball", EN_ANY, kPlatformWindows }, - { "cf90b4db5486ef798db78fe6fbf897e5", "pj3-demo", EN_ANY, kPlatformWindows }, - { "d06fbe28818fef7bfc45c2cdf0c0849d", "zak", DE_DEU, kPlatformPC }, - { "d0b531227a27c6662018d2bd05aac52a", "monkeyvga", DE_DEU, kPlatformPC }, - { "d37c55388294b66e53e7ced3af88fa68", "ff2-demo", EN_ANY, kPlatformUnknown }, - { "d43352a805d78b5f4936c6d7779bf575", "samnmax", RU_RUS, kPlatformPC }, - { "d4b8ee426b1afd3e53bc0cf020418cf6", "dog", EN_ANY, kPlatformWindows }, - { "d4cccb5af88f3e77f370896e9ba8c5f9", "freddi", RU_RUS, kPlatformWindows }, - { "d4e79c3d8645b8266cd78c325bc35154", "pajama2", EN_ANY, kPlatformUnknown }, - { "d62047a6729349ab36f7ee065bf26509", "dig", RU_RUS, kPlatformUnknown }, - { "d62d248c3df6ec177405e2cb23d923b2", "indy3EGA", IT_ITA, kPlatformPC }, - { "d6dd0646404768a63e963891a96daadd", "atlantis", EN_ANY, kPlatformMacintosh }, - { "d7ab7cd6105546016e6a0d46fb36b964", "pjs-demo", EN_ANY, kPlatformUnknown }, - { "d8323015ecb8b10bf53474f6e6b0ae33", "dig", UNK_LANG, kPlatformUnknown }, - { "d8d07efcb88f396bee0b402b10c3b1c9", "maniac", EN_ANY, kPlatformNES }, - { "d917f311a448e3cc7239c31bddb00dd2", "samnmax", EN_ANY, kPlatformUnknown }, - { "d9d0dd93d16ab4dec55cabc2b86bbd17", "samdemo", EN_ANY, kPlatformPC }, - { "da09e666fc8f5b78d7b0ac65d1a3b56e", "monkey2", EN_ANY, kPlatformFMTowns }, - { "da6269b18fcb08189c0aa9c95533cce2", "monkey", IT_ITA, kPlatformPC }, - { "da669b20271b85182e9c17a2a37ea02e", "monkey2", DE_DEU, kPlatformAmiga }, - { "dd30a53035393baa5a5e222e716559af", "maniac", FR_FRA, kPlatformAtariST }, - { "de4efb910210736813c9a1185384bace", "zoodemo", EN_ANY, kPlatformWindows }, - { "debe337f73d660e951ece7c1f1c81add", "zak", EN_ANY, kPlatformPC }, - { "defb8cb9ec4b0f91acfb6b61c6129ad9", "PuttTime", RU_RUS, kPlatformWindows }, - { "df03ee021aa9b81d90cab9c26da07614", "indy3EGA", IT_ITA, kPlatformAmiga }, - { "df047cc4792150f601290357566d36a6", "freddi", EN_ANY, kPlatformUnknown }, - { "e01acc8c12ef44e8f778fe87e5f90f4e", "fbpack", EN_ANY, kPlatformUnknown }, - { "e144f5f49d9241d2a9dee2576b3d09cb", "airdemo", EN_ANY, kPlatformWindows }, - { "e17db1ddf91b39ca6bbc8ad3ed19e883", "monkey", JA_JPN, kPlatformFMTowns }, - { "e246e02db9630533a40d99c9f54a8e01", "monkey2", EN_ANY, kPlatformMacintosh }, - { "e361a7058ed8e8ebb462663c0a3ae8d6", "puttputt", HB_ISR, kPlatformPC }, - { "e41de1c2a15abbcdbf9977e2d7e8a340", "freddi2", RU_RUS, kPlatformWindows }, - { "e534d29afb3c6e0ee9dc3d53c5956714", "atlantis", DE_DEU, kPlatformAmiga }, - { "e63a0b9249b5ca4cc4d3ac34305ae360", "freddi", NB_NOR, kPlatformWindows }, - { "e689bdf67f98b1d760ce4487ec0e8d06", "indy3EGA", FR_FRA, kPlatformAmiga }, - { "e6cd81b25ab1453a8a6d3482118c391e", "pass", EN_ANY, kPlatformPC }, - { "e72bb4c2b613db2cf50f89ff6350e70a", "ft", ES_ESP, kPlatformUnknown }, - { "e781230da44a44e2f0770edb2b3b3633", "maniac", EN_ANY, kPlatformAmiga }, - { "e94c7cc3686fce406d3c91b5eae5a72d", "zak", EN_ANY, kPlatformAmiga }, - { "eae95b2b3546d8ba86ae1d397c383253", "dog", EN_ANY, kPlatformUnknown }, - { "ebd0b2c8a387f18887282afe6cad894a", "sf3-demo", EN_ANY, kPlatformUnknown }, - { "ebd324dcf06a4c49e1ba5c231eee1060", "f4-demo", EN_ANY, kPlatformUnknown }, - { "ed361270102e355afe5236954216aba2", "lost", EN_ANY, kPlatformUnknown }, - { "edfdb24a499d92c59f824c52987c0eec", "atlantis", FR_FRA, kPlatformPC }, - { "ef347474f3c7be3b29584eaa133cca05", "samnmax", FR_FRA, kPlatformPC }, - { "ef74d9071d4e564b037cb44bd6774de7", "fbear", HB_ISR, kPlatformPC }, - { "efe0a04a703e765ebebe92b6c8aa6b86", "baseball2003", EN_ANY, kPlatformWindows }, - { "f049e38c1f8302b5db6170f1872af89a", "monkey", ES_ESP, kPlatformPC }, - { "f06e66fd45b2f8b0f4a2833ff4476050", "fbpack", HB_ISR, kPlatformPC }, - { "f08145577e4f13584cc90b3d6e9caa55", "pj3-demo", NL_NLD, kPlatformUnknown }, - { "f237bf8a5ef9af78b2a6a4f3901da341", "pjs-demo", EN_ANY, kPlatformUnknown }, - { "f27b1ba0eadaf2a6617b2b58192d1dbf", "samnmax", DE_DEU, kPlatformPC }, - { "f3d55aea441e260e9e9c7d2a187097e0", "zoodemo", EN_ANY, kPlatformWindows }, - { "f40a7f495f59188ca57a9d1d50301bb6", "puttdemo", EN_ANY, kPlatformMacintosh }, - { "f7711f9264d4d43c2a1518ec7c10a607", "pajama3", EN_ANY, kPlatformWindows }, - { "f79e60c17cca601e411f1f75e8ee9b5a", "spyfox2", EN_ANY, kPlatformUnknown }, - { "fa127d7c4bb47d05bb1c33ddcaa9f767", "loom", DE_DEU, kPlatformPC }, - { "fb66aa42de21675116346213f176a366", "monkeyvga", IT_ITA, kPlatformAmiga }, - { "fbbbb38a81fc9d6a61d509278390a290", "farm", EN_ANY, kPlatformMacintosh }, - { "fbdd947d21e8f5bac6d6f7a316af1c5a", "spydemo", EN_ANY, kPlatformUnknown }, - { "fc53ce0e5f6562b1c1e1b4b8203acafb", "samnmax", ES_ESP, kPlatformPC }, - { "fc6b6148e80d67939d9a18697c0f626a", "monkeyega", DE_DEU, kPlatformPC }, - { "fc8d197a22146e74766e9cb0cfcaf1da", "ff2-demo", EN_ANY, kPlatformUnknown }, - { "fcb78ebecab2757264c590890c319cc5", "PuttTime", NL_NLD, kPlatformWindows }, - { "fe381e45117878b1e942cb876b050fd6", "ft", EN_ANY, kPlatformMacintosh }, - { "fe60d6b5ff51b0553ac59963123b5777", "comi", UNK_LANG, kPlatformUnknown }, - { 0, 0, UNK_LANG, kPlatformUnknown } -}; - - writeRecord(md5table, sizeof(md5table), GBVARS_MD5TABLE_INDEX , GBVARS_SCUMM); -} - -void addScummTables() { - addScumm_mdtable(); -} diff --git a/backends/platform/PalmOS/Src/builder/scumm/bl_newgui.c b/backends/platform/PalmOS/Src/builder/scumm/bl_newgui.c deleted file mode 100644 index 528bcf5b25..0000000000 --- a/backends/platform/PalmOS/Src/builder/scumm/bl_newgui.c +++ /dev/null @@ -1,47 +0,0 @@ -#include <PalmOS.h> -#include "b_globals.h" - -typedef unsigned short bitmap_t; -/////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////// -static void addNewGui_guifont() { - UInt8 guifont[] = { -0,0,99,1,226,8,4,8,6,8,6,0,0,0,0,0,0,0,0,0,0,0,8,2,1,8,0,0,0,0,0,0,0,0,0,0,0,0,4,3,7,8,7,7,8,4,5,5,8,7,4,7,3,8,7,7,7,7,8,7,7,7,7,7,3,4,7,5,7,7,8,7,7,7,7,7,7,7,7,5,7,7, -7,8,7,7,7,7,7,7,7,7,7,8,7,7,7,5,8,5,8,8,7,7,7,6,7,7,7,7,7,5,6,7,5,8,7,7,7,7,7,7,7,7,7,8,7,7,7,5,3,5,7,8,7,7,7,7,7,7,0,6,7,7,7,5,5,5,7,0,6,8,8,7,7,7,7,7,0,7,7,0,0, -0,0,0,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,0,0,0,0,0,0,0,0,1,3,6,12, -24,62,3,0,128,192,96,48,24,124,192,0,0,3,62,24,12,6,3,1,0,192,124,24,48,96,192,128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,237,74,72,0,0,0,0,0,128,128,128,0,0,0,0,0,0,0,0,0,0,0,0,0,60,66,153,161,161,153,66,60,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,96,96,96,96,0,0,96,0,102,102,102,0,0,0,0,0,102,102,255,102,255,102,102,0,24,62,96,60,6,124,24,0,98,102,12,24,48,102,70,0,60,102,60,56,103,102,63,0,96,48,16,0,0,0,0,0,24,48,96,96,96,48,24,0,96,48,24,24,24,48,96,0, -0,102,60,255,60,102,0,0,0,24,24,126,24,24,0,0,0,0,0,0,0,48,48,96,0,0,0,126,0,0,0,0,0,0,0,0,0,96,96,0,0,3,6,12,24,48,96,0,60,102,102,102,102,102,60,0,24,24,56,24,24,24,126,0,60,102,6,12,48,96,126,0,60,102,6,28,6,102,60,0,6, -14,30,102,127,6,6,0,126,96,124,6,6,102,60,0,60,102,96,124,102,102,60,0,126,102,12,24,24,24,24,0,60,102,102,60,102,102,60,0,60,102,102,62,6,102,60,0,0,0,96,0,0,96,0,0,0,0,48,0,0,48,48,96,14,24,48,96,48,24,14,0,0,0,120,0,120,0,0,0,112,24, -12,6,12,24,112,0,60,102,6,12,24,0,24,0,0,0,0,255,255,0,0,0,24,60,102,126,102,102,102,0,124,102,102,124,102,102,124,0,60,102,96,96,96,102,60,0,120,108,102,102,102,108,120,0,126,96,96,120,96,96,126,0,126,96,96,120,96,96,96,0,60,102,96,110,102,102,60,0,102,102,102, -126,102,102,102,0,120,48,48,48,48,48,120,0,30,12,12,12,12,108,56,0,102,108,120,112,120,108,102,0,96,96,96,96,96,96,126,0,99,119,127,107,99,99,99,0,102,118,126,126,110,102,102,0,60,102,102,102,102,102,60,0,124,102,102,124,96,96,96,0,60,102,102,102,102,60,14,0,124,102,102,124, -120,108,102,0,60,102,96,60,6,102,60,0,126,24,24,24,24,24,24,0,102,102,102,102,102,102,60,0,102,102,102,102,102,60,24,0,99,99,99,107,127,119,99,0,102,102,60,24,60,102,102,0,102,102,102,60,24,24,24,0,126,6,12,24,48,96,126,0,120,96,96,96,96,96,120,0,3,6,12,24,48, -96,192,0,120,24,24,24,24,24,120,0,0,0,0,0,0,219,219,0,0,0,0,0,0,0,0,255,102,102,102,0,0,0,0,0,0,0,60,6,62,102,62,0,0,96,96,124,102,102,124,0,0,0,60,96,96,96,60,0,0,6,6,62,102,102,62,0,0,0,60,102,126,96,60,0,0,14,24,62,24,24, -24,0,0,0,62,102,102,62,6,124,0,96,96,124,102,102,102,0,0,48,0,112,48,48,120,0,0,12,0,12,12,12,12,120,0,96,96,108,120,108,102,0,0,112,48,48,48,48,120,0,0,0,102,127,127,107,99,0,0,0,124,102,102,102,102,0,0,0,60,102,102,102,60,0,0,0,124,102,102,124,96, -96,0,0,62,102,102,62,6,6,0,0,124,102,96,96,96,0,0,0,62,96,60,6,124,0,0,24,126,24,24,24,14,0,0,0,102,102,102,102,62,0,0,0,102,102,102,60,24,0,0,0,99,107,127,62,54,0,0,0,102,60,24,60,102,0,0,0,102,102,102,62,12,120,0,0,126,12,24,48,126,0, -24,48,48,96,48,48,24,0,96,96,96,0,96,96,96,0,96,48,48,24,48,48,96,0,0,0,97,153,134,0,0,0,8,12,14,255,255,14,12,8,60,102,96,96,102,60,24,56,102,0,102,102,102,102,62,0,12,24,60,102,126,96,60,0,24,36,60,6,62,102,62,0,102,0,60,6,62,102,62,0,48, -24,60,6,62,102,62,0,0,0,0,0,0,0,0,0,0,60,96,96,96,60,24,56,24,36,60,102,126,96,60,0,102,0,60,102,126,96,60,0,48,24,60,102,126,96,60,0,0,216,0,112,48,48,120,0,48,72,0,112,48,48,120,0,96,48,0,112,48,48,120,0,102,24,60,102,126,102,102,0,0,0, -0,0,0,0,0,0,24,48,124,96,120,96,124,0,0,0,108,26,126,216,110,0,30,40,40,126,72,136,142,0,24,36,60,102,102,102,60,0,102,0,60,102,102,102,60,0,48,24,60,102,102,102,60,0,24,36,0,102,102,102,62,0,48,24,102,102,102,102,62,0,0,0,0,0,0,0,0,0,102,60,102, -102,102,102,60,0,102,0,102,102,102,102,60,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12,24,60,6,62,102,62,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,28,54,54,124,102,102,124,64,0,0,0 -}; - writeRecord(guifont, sizeof(guifont), GBVARS_GUIFONT_INDEX, GBVARS_COMMON); -} - -/////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////// - -void addNewGui() { - addNewGui_guifont(); -}
\ No newline at end of file diff --git a/backends/platform/PalmOS/Src/builder/scumm/bl_player_v2.c b/backends/platform/PalmOS/Src/builder/scumm/bl_player_v2.c deleted file mode 100644 index 9b2a7b0987..0000000000 --- a/backends/platform/PalmOS/Src/builder/scumm/bl_player_v2.c +++ /dev/null @@ -1,334 +0,0 @@ -#include <PalmOS.h> -#include "b_globals.h" - -static void PlayerV2_note_lengths() { - UInt8 note_lengths[] = { - 0, - 0, 0, 2, - 0, 3, 4, - 5, 6, 8, - 9, 12, 16, - 18, 24, 32, - 36, 48, 64, - 72, 96 - }; - - writeRecord(note_lengths, sizeof(note_lengths), GBVARS_NOTELENGTHS_INDEX , GBVARS_SCUMM); -} - -static void PlayerV2_hull_offsets() { - UInt16 hull_offsets[] = { - 0, 12, 24, 36, 48, 60, - 72, 88, 104, 120, 136, 256, - 152, 164, 180 - }; - - writeRecord(hull_offsets, sizeof(hull_offsets), GBVARS_HULLOFFSETS_INDEX , GBVARS_SCUMM); -} - -typedef Int16 int16; - -static void PlayerV2_hulls() { - Int16 hulls[] = { - // hull 0 - 3, -1, 0, 0, 0, 0, 0, 0, - 0, -1, 0, 0, - // hull 1 (staccato) - 3, -1, 0, 32, 0, -1, 0, 0, - 0, -1, 0, 0, - // hull 2 (legato) - 3, -1, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, - // hull 3 (staccatissimo) - 3, -1, 0, 2, 0, -1, 0, 0, - 0, -1, 0, 0, - // hull 4 - 3, -1, 0, 6, 0, -1, 0, 0, - 0, -1, 0, 0, - // hull 5 - 3, -1, 0, 16, 0, -1, 0, 0, - 0, -1, 0, 0, - // hull 6 - (int16) 60000, -1, -1000, 20, 0, 0, 0, 0, - (int16) 40000, -1, -5000, 5, 0, -1, 0, 0, - // hull 7 - (int16) 50000, -1, 0, 8, 30000, -1, 0, 0, - 28000, -1, -5000, 5, 0, -1, 0, 0, - // hull 8 - (int16) 60000, -1, -2000, 16, 0, 0, 0, 0, - 28000, -1, -6000, 5, 0, -1, 0, 0, - // hull 9 - (int16) 55000, -1, 0, 8, (int16) 35000, -1, 0, 0, - (int16) 40000, -1, -2000, 10, 0, -1, 0, 0, - // hull 10 - (int16) 60000, -1, 0, 4, -2000, 8, 0, 0, - (int16) 40000, -1, -6000, 5, 0, -1, 0, 0, - // hull 12 - 0, -1, 150, 340, -150, 340, 0, -1, - 0, -1, 0, 0, - // hull 13 == 164 - 20000, -1, 4000, 7, 1000, 15, 0, 0, - (int16) 35000, -1, -2000, 15, 0, -1, 0, 0, - - // hull 14 == 180 - (int16) 35000, -1, 500, 20, 0, 0, 0, 0, - (int16) 45000, -1, -500, 60, 0, -1, 0, 0, - - // hull misc = 196 - (int16) 44000, -1, -4400, 10, 0, -1, 0, 0, - 0, -1, 0, 0, - - (int16) 53000, -1, -5300, 10, 0, -1, 0, 0, - 0, -1, 0, 0, - - (int16) 63000, -1, -6300, 10, 0, -1, 0, 0, - 0, -1, 0, 0, - - (int16) 44000, -1, -1375, 32, 0, -1, 0, 0, - 0, -1, 0, 0, - - (int16) 53000, -1, -1656, 32, 0, -1, 0, 0, - 0, -1, 0, 0, - - // hull 11 == 256 - (int16) 63000, -1, -1968, 32, 0, -1, 0, 0, - 0, -1, 0, 0, - - (int16) 44000, -1, - 733, 60, 0, -1, 0, 0, - 0, -1, 0, 0, - - (int16) 53000, -1, - 883, 60, 0, -1, 0, 0, - 0, -1, 0, 0, - - (int16) 63000, -1, -1050, 60, 0, -1, 0, 0, - 0, -1, 0, 0, - - (int16) 44000, -1, - 488, 90, 0, -1, 0, 0, - 0, -1, 0, 0, - - (int16) 53000, -1, - 588, 90, 0, -1, 0, 0, - 0, -1, 0, 0, - - (int16) 63000, -1, - 700, 90, 0, -1, 0, 0, - 0, -1, 0, 0 - }; - - writeRecord(hulls, sizeof(hulls), GBVARS_HULLS_INDEX , GBVARS_SCUMM); -} - -static void PlayerV2_freqmod_lengths() { - UInt16 freqmod_lengths[] = { - 0x1000, 0x1000, 0x20, 0x2000, 0x1000 - }; - - writeRecord(freqmod_lengths, sizeof(freqmod_lengths), GBVARS_FREQMODLENGTHS_INDEX , GBVARS_SCUMM); -} - -static void PlayerV2_freqmod_offsets() { - UInt16 freqmod_offsets[] = { - 0, 0x100, 0x200, 0x302, 0x202 - }; - - writeRecord(freqmod_offsets, sizeof(freqmod_offsets), GBVARS_FREQMODOFFSETS_INDEX , GBVARS_SCUMM); -} - -static void PlayerV2_freqmod_table() { - Int8 freqmod_table[0x502] = { - 0, 3, 6, 9, 12, 15, 18, 21, - 24, 27, 30, 33, 36, 39, 42, 45, - 48, 51, 54, 57, 59, 62, 65, 67, - 70, 73, 75, 78, 80, 82, 85, 87, - 89, 91, 94, 96, 98, 100, 102, 103, - 105, 107, 108, 110, 112, 113, 114, 116, - 117, 118, 119, 120, 121, 122, 123, 123, - 124, 125, 125, 126, 126, 126, 126, 126, - 126, 126, 126, 126, 126, 126, 125, 125, - 124, 123, 123, 122, 121, 120, 119, 118, - 117, 116, 114, 113, 112, 110, 108, 107, - 105, 103, 102, 100, 98, 96, 94, 91, - 89, 87, 85, 82, 80, 78, 75, 73, - 70, 67, 65, 62, 59, 57, 54, 51, - 48, 45, 42, 39, 36, 33, 30, 27, - 24, 21, 18, 15, 12, 9, 6, 3, - 0, -3, -6, -9, -12, -15, -18, -21, - -24, -27, -30, -33, -36, -39, -42, -45, - -48, -51, -54, -57, -59, -62, -65, -67, - -70, -73, -75, -78, -80, -82, -85, -87, - -89, -91, -94, -96, -98,-100,-102,-103, - -105,-107,-108,-110,-112,-113,-114,-116, - -117,-118,-119,-120,-121,-122,-123,-123, - -124,-125,-125,-126,-126,-126,-126,-126, - -126,-126,-126,-126,-126,-126,-125,-125, - -124,-123,-123,-122,-121,-120,-119,-118, - -117,-116,-114,-113,-112,-110,-108,-107, - -105,-103,-102,-100, -98, -96, -94, -91, - -89, -87, -85, -82, -80, -78, -75, -73, - -70, -67, -65, -62, -59, -57, -54, -51, - -48, -45, -42, -39, -36, -33, -30, -27, - -24, -21, -18, -15, -12, -9, -6, -3, - - 0, 1, 2, 3, 4, 5, 6, 7, - 8, 9, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, - 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, - 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, - 56, 57, 58, 59, 60, 61, 62, 63, - 64, 65, 66, 67, 68, 69, 70, 71, - 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, - 88, 89, 90, 91, 92, 93, 94, 95, - 96, 97, 98, 99, 100, 101, 102, 103, - 104, 105, 106, 107, 108, 109, 110, 111, - 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 126, 127, - -128,-127,-126,-125,-124,-123,-122,-121, - -120,-119,-118,-117,-116,-115,-114,-113, - -112,-111,-110,-109,-108,-107,-106,-105, - -104,-103,-102,-101,-100, -99, -98, -97, - -96, -95, -94, -93, -92, -91, -90, -89, - -88, -87, -86, -85, -84, -83, -82, -81, - -80, -79, -78, -77, -76, -75, -74, -73, - -72, -71, -70, -69, -68, -67, -66, -65, - -64, -63, -62, -61, -60, -59, -58, -57, - -56, -55, -54, -53, -52, -51, -50, -49, - -48, -47, -46, -45, -44, -43, -42, -41, - -40, -39, -38, -37, -36, -35, -34, -33, - -32, -31, -30, -29, -28, -27, -26, -25, - -24, -23, -22, -21, -20, -19, -18, -17, - -16, -15, -14, -13, -12, -11, -10, -9, - -8, -7, -6, -5, -4, -3, -2, -1, - - -120, 120, - - -120,-120,-120,-120,-120,-120,-120,-120, - -120,-120,-120,-120,-120,-120,-120,-120, - -120,-120,-120,-120,-120,-120,-120,-120, - -120,-120,-120,-120,-120,-120,-120,-120, - -120,-120,-120,-120,-120,-120,-120,-120, - -120,-120,-120,-120,-120,-120,-120,-120, - -120,-120,-120,-120,-120,-120,-120,-120, - -120,-120,-120,-120,-120,-120,-120,-120, - -120,-120,-120,-120,-120,-120,-120,-120, - -120,-120,-120,-120,-120,-120,-120,-120, - -120,-120,-120,-120,-120,-120,-120,-120, - -120,-120,-120,-120,-120,-120,-120,-120, - -120,-120,-120,-120,-120,-120,-120,-120, - -120,-120,-120,-120,-120,-120,-120,-120, - -120,-120,-120,-120,-120,-120,-120,-120, - -120,-120,-120,-120,-120,-120,-120,-120, - 120, 120, 120, 120, 120, 120, 120, 120, - 120, 120, 120, 120, 120, 120, 120, 120, - 120, 120, 120, 120, 120, 120, 120, 120, - 120, 120, 120, 120, 120, 120, 120, 120, - 120, 120, 120, 120, 120, 120, 120, 120, - 120, 120, 120, 120, 120, 120, 120, 120, - 120, 120, 120, 120, 120, 120, 120, 120, - 120, 120, 120, 120, 120, 120, 120, 120, - 120, 120, 120, 120, 120, 120, 120, 120, - 120, 120, 120, 120, 120, 120, 120, 120, - 120, 120, 120, 120, 120, 120, 120, 120, - 120, 120, 120, 120, 120, 120, 120, 120, - 120, 120, 120, 120, 120, 120, 120, 120, - 120, 120, 120, 120, 120, 120, 120, 120, - 120, 120, 120, 120, 120, 120, 120, 120, - 120, 120, 120, 120, 120, 120, 120, 120, - - 41, 35, -66,-124, -31, 108, -42, -82, - 82,-112, 73, -15, -15, -69, -23, -21, - -77, -90, -37, 60,-121, 12, 62,-103, - 36, 94, 13, 28, 6, -73, 71, -34, - -77, 18, 77, -56, 67, -69,-117, -90, - 31, 3, 90, 125, 9, 56, 37, 31, - 93, -44, -53, -4,-106, -11, 69, 59, - 19, 13,-119, 10, 28, -37, -82, 50, - 32,-102, 80, -18, 64, 120, 54, -3, - 18, 73, 50, -10, -98, 125, 73, -36, - -83, 79, 20, -14, 68, 64, 102, -48, - 107, -60, 48, -73, 50, 59, -95, 34, - -10, 34,-111, -99, -31,-117, 31, -38, - -80, -54,-103, 2, -71, 114, -99, 73, - 44,-128, 126, -59,-103, -43, -23,-128, - -78, -22, -55, -52, 83, -65, 103, -42, - -65, 20, -42, 126, 45, -36,-114, 102, - -125, -17, 87, 73, 97, -1, 105,-113, - 97, -51, -47, 30, -99,-100, 22, 114, - 114, -26, 29, -16,-124, 79, 74, 119, - 2, -41, -24, 57, 44, 83, -53, -55, - 18, 30, 51, 116, -98, 12, -12, -43, - -44, -97, -44, -92, 89, 126, 53, -49, - 50, 34, -12, -52, -49, -45,-112, 45, - 72, -45,-113, 117, -26, -39, 29, 42, - -27, -64, -9, 43, 120,-127,-121, 68, - 14, 95, 80, 0, -44, 97,-115, -66, - 123, 5, 21, 7, 59, 51,-126, 31, - 24, 112,-110, -38, 100, 84, -50, -79, - -123, 62, 105, 21, -8, 70, 106, 4, - -106, 115, 14, -39, 22, 47, 103, 104, - -44, -9, 74, 74, -48, 87, 104, 118, - -6, 22, -69, 17, -83, -82, 36,-120, - 121, -2, 82, -37, 37, 67, -27, 60, - -12, 69, -45, -40, 40, -50, 11, -11, - -59, 96, 89, 61,-105, 39,-118, 89, - 118, 45, -48, -62, -55, -51, 104, -44, - 73, 106, 121, 37, 8, 97, 64, 20, - -79, 59, 106, -91, 17, 40, -63,-116, - -42, -87, 11,-121,-105,-116, 47, -15, - 21, 29,-102,-107, -63,-101, -31, -64, - 126, -23, -88,-102, -89,-122, -62, -75, - 84, -65,-102, -25, -39, 35, -47, 85, - -112, 56, 40, -47, -39, 108, -95, 102, - 94, 78, -31, 48,-100, -2, -39, 113, - -97, -30, -91, -30, 12,-101, -76, 71, - 101, 56, 42, 70,-119, -87,-126, 121, - 122, 118, 120, -62, 99, -79, 38, -33, - -38, 41, 109, 62, 98, -32,-106, 18, - 52, -65, 57, -90, 63,-119, 94, -15, - 109, 14, -29, 108, 40, -95, 30, 32, - 29, -53, -62, 3, 63, 65, 7,-124, - 15, 20, 5, 101, 27, 40, 97, -55, - -59, -25, 44,-114, 70, 54, 8, -36, - -13, -88,-115, -2, -66, -14, -21, 113, - -1, -96, -48, 59, 117, 6,-116, 126, - -121, 120, 115, 77, -48, -66,-126, -66, - -37, -62, 70, 65, 43,-116, -6, 48, - 127, 112, -16, -89, 84,-122, 50,-107, - -86, 91, 104, 19, 11, -26, -4, -11, - -54, -66, 125, -97,-119,-118, 65, 27, - -3, -72, 79, 104, -10, 114, 123, 20, - -103, -51, -45, 13, -16, 68, 58, -76, - -90, 102, 83, 51, 11, -53, -95, 16 -}; - - writeRecord(freqmod_table, sizeof(freqmod_table), GBVARS_FREQMODTABLE_INDEX , GBVARS_SCUMM); -} - -static void PlayerV2_spk_freq_table() { - UInt16 spk_freq_table[12] = { - 36484, 34436, 32503, 30679, 28957, 27332, - 25798, 24350, 22983, 21693, 20476, 19326 -}; - - writeRecord(spk_freq_table, sizeof(spk_freq_table), GBVARS_SPKFREQTABLE_INDEX , GBVARS_SCUMM); -} - -static void PlayerV2_pcjr_freq_table() { - UInt16 pcjr_freq_table[12] = { - 65472, 61760, 58304, 55040, 52032, 49024, - 46272, 43648, 41216, 38912, 36736, 34624 -}; - - writeRecord(pcjr_freq_table, sizeof(pcjr_freq_table), GBVARS_PCJRFREQTABLE_INDEX , GBVARS_SCUMM); -} - -void addPlayerV2() { - PlayerV2_note_lengths(); - PlayerV2_hull_offsets(); - PlayerV2_hulls(); - PlayerV2_freqmod_lengths(); - PlayerV2_freqmod_offsets(); - PlayerV2_freqmod_table(); - PlayerV2_spk_freq_table(); - PlayerV2_pcjr_freq_table(); -}
\ No newline at end of file diff --git a/backends/platform/PalmOS/Src/builder/scumm/bl_scumm.c b/backends/platform/PalmOS/Src/builder/scumm/bl_scumm.c deleted file mode 100644 index e69de29bb2..0000000000 --- a/backends/platform/PalmOS/Src/builder/scumm/bl_scumm.c +++ /dev/null diff --git a/backends/platform/PalmOS/Src/builder/scumm/imuse_digi/bl_dimuse_codecs.c b/backends/platform/PalmOS/Src/builder/scumm/imuse_digi/bl_dimuse_codecs.c deleted file mode 100644 index 635bba344f..0000000000 --- a/backends/platform/PalmOS/Src/builder/scumm/imuse_digi/bl_dimuse_codecs.c +++ /dev/null @@ -1,21 +0,0 @@ -#include <PalmOS.h> -#include "b_globals.h" - -static void addDimuseCodecs_imcTable() { - Int16 imcTable[] = { - 0x0007, 0x0008, 0x0009, 0x000A, 0x000B, 0x000C, 0x000D, 0x000E, 0x0010, 0x0011, - 0x0013, 0x0015, 0x0017, 0x0019, 0x001C, 0x001F, 0x0022, 0x0025, 0x0029, 0x002D, - 0x0032, 0x0037, 0x003C, 0x0042, 0x0049, 0x0050, 0x0058, 0x0061, 0x006B, 0x0076, - 0x0082, 0x008F, 0x009D, 0x00AD, 0x00BE, 0x00D1, 0x00E6, 0x00FD, 0x0117, 0x0133, - 0x0151, 0x0173, 0x0198, 0x01C1, 0x01EE, 0x0220, 0x0256, 0x0292, 0x02D4, 0x031C, - 0x036C, 0x03C3, 0x0424, 0x048E, 0x0502, 0x0583, 0x0610, 0x06AB, 0x0756, 0x0812, - 0x08E0, 0x09C3, 0x0ABD, 0x0BD0, 0x0CFF, 0x0E4C, 0x0FBA, 0x114C, 0x1307, 0x14EE, - 0x1706, 0x1954, 0x1BDC, 0x1EA5, 0x21B6, 0x2515, 0x28CA, 0x2CDF, 0x315B, 0x364B, - 0x3BB9, 0x41B2, 0x4844, 0x4F7E, 0x5771, 0x602F, 0x69CE, 0x7462, 0x7FFF -}; - writeRecord(imcTable, sizeof(imcTable), GBVARS_IMCTABLE_INDEX , GBVARS_SCUMM); -} - -void addDimuseCodecs() { - addDimuseCodecs_imcTable(); -}
\ No newline at end of file diff --git a/backends/platform/PalmOS/Src/builder/scumm/imuse_digi/bl_dimuse_tables.c b/backends/platform/PalmOS/Src/builder/scumm/imuse_digi/bl_dimuse_tables.c deleted file mode 100644 index 1614932343..0000000000 --- a/backends/platform/PalmOS/Src/builder/scumm/imuse_digi/bl_dimuse_tables.c +++ /dev/null @@ -1,921 +0,0 @@ -#include <PalmOS.h> -#include "b_globals.h" -/////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////// -typedef Int16 int16; -typedef Int8 int8; -typedef unsigned char byte; - -typedef struct { - int8 roomId; - byte musicTableIndex; - byte unk1; - byte unk2; - byte unk3; - byte unk4; -} imuseRoomMap; - - -typedef struct { - byte opcode; - int16 soundId; - char name[20]; - byte param; - byte hookId; - char filename[13]; -} imuseDigTable; - -typedef struct { - byte opcode; - int16 soundId; - char name[20]; - byte param; - byte hookId; - int16 fadeDelay; - char filename[13]; -} imuseComiTable; - - - -typedef struct { - char audioName[9]; - byte opcode; - byte volume; - char name[21]; -} imuseFtStateTable; - -typedef struct { - char audioName[9]; - byte opcode; - byte volume; -} imuseFtSeqTable; - -typedef struct { - char name[20]; -} imuseFtNames; -/////////////////////////////////////////////////////////////////// - -static void addDimuseTables_digStateMusicMap() { - imuseRoomMap _digStateMusicMap[] = { - {0, 0, 0, 0, 0, 0 }, - {1, 0, 0, 0, 0, 0 }, - {2, 2, 0, 0, 0, 0 }, - {4, 3, 0, 0, 0, 0 }, - {5, 3, 0, 0, 0, 0 }, - {6, 3, 0, 0, 0, 0 }, - {7, 3, 0, 0, 0, 0 }, - {8, 4, 0, 0, 0, 0 }, - {9, 5, 0, 0, 0, 0 }, - {10, 4, 0, 0, 0, 0 }, - {12, 5, 0, 0, 0, 0 }, - {14, 5, 0, 0, 0, 0 }, - {15, 6, 29, 7, 0, 0 }, - {16, 8, 0, 0, 0, 0 }, - {17, 1, 0, 0, 0, 0 }, - {18, 9, 0, 0, 0, 0 }, - {19, 9, 0, 0, 0, 0 }, - {20, 6, 0, 0, 0, 0 }, - {21, 6, 0, 0, 0, 0 }, - {22, 44, 0, 0, 0, 0 }, - {23, 10, 7, 0, 0, 0 }, - {24, 26, 0, 0, 0, 0 }, - {25, 17, 0, 0, 0, 0 }, - {26, 17, 0, 0, 0, 0 }, - {27, 18, 0, 0, 0, 0 }, - {28, 1, 0, 0, 0, 0 }, - {29, 20, 0, 0, 0, 0 }, - {30, 22, 0, 0, 0, 0 }, - {31, 23, 0, 0, 0, 0 }, - {32, 22, 0, 0, 0, 0 }, - {33, 26, 0, 0, 0, 0 }, - {34, 24, 0, 0, 0, 0 }, - {35, 1, 0, 0, 0, 0 }, - {36, 1, 0, 0, 0, 0 }, - {37, 42, 0, 0, 0, 0 }, - {38, 43, 0, 0, 0, 0 }, - {39, 44, 0, 0, 0, 0 }, - {40, 1, 0, 0, 0, 0 }, - {41, 43, 0, 0, 0, 0 }, - {42, 44, 0, 0, 0, 0 }, - {43, 43, 0, 0, 0, 0 }, - {44, 45, 117,45, 114,46}, - {47, 1, 0, 0, 0, 0 }, - {48, 43, 0, 0, 0, 0 }, - {49, 44, 0, 0, 0, 0 }, - {51, 1, 0, 0, 0, 0 }, - {53, 28, 0, 0, 0, 0 }, - {54, 28, 0, 0, 0, 0 }, - {55, 29, 0, 0, 0, 0 }, - {56, 29, 0, 0, 0, 0 }, - {57, 29, 0, 0, 0, 0 }, - {58, 31, 0, 0, 0, 0 }, - {59, 1, 0, 0, 0, 0 }, - {60, 37, 0, 0, 0, 0 }, - {61, 39, 0, 0, 0, 0 }, - {62, 38, 0, 0, 0, 0 }, - {63, 39, 0, 0, 0, 0 }, - {64, 39, 0, 0, 0, 0 }, - {65, 40, 0, 0, 0, 0 }, - {67, 40, 0, 0, 0, 0 }, - {68, 39, 0, 0, 0, 0 }, - {69, 1, 0, 0, 0, 0 }, - {70, 49, 0, 0, 0, 0 }, - {73, 50, 0, 0, 0, 0 }, - {75, 51, 0, 0, 0, 0 }, - {76, 1, 0, 0, 0, 0 }, - {77, 52, 7, 0, 0, 0 }, - {78, 63, 0, 0, 0, 0 }, - {79, 1, 0, 0, 0, 0 }, - {82, 21, 0, 0, 0, 0 }, - {85, 1, 0, 0, 0, 0 }, - {86, 0, 0, 0, 0, 0 }, - {89, 33, 6, 35, 5, 34}, - {90, 16, 0, 0, 0, 0 }, - {91, 57, 0, 0, 0, 0 }, - {88, 32, 0, 0, 0, 0 }, - {92, 25, 0, 0, 0, 0 }, - {93, 0, 0, 0, 0, 0 }, - {95, 19, 0, 0, 0, 0 }, - {80, 41, 0, 0, 0, 0 }, - {81, 48, 0, 0, 0, 0 }, - {83, 27, 0, 0, 0, 0 }, - {94, 36, 0, 0, 0, 0 }, - {40, 1, 0, 0, 0, 0 }, - {96, 13, 0, 0, 0, 0 }, - {97, 14, 0, 0, 0, 0 }, - {98, 11, 0, 0, 0, 0 }, - {99, 15, 0, 0, 0, 0 }, - {100, 17, 0, 0, 0, 0 }, - {101, 38, 0, 0, 0, 0 }, - {103, 0, 0, 0, 0, 0 }, - {104, 0, 0, 0, 0, 0 }, - {11, 44, 0, 0, 0, 0 }, - {3, 47, 0, 0, 0, 0 }, - {105, 30, 128,29, 0, 0 }, - {106, 0, 0, 0, 0, 0 }, - {107, 1, 0, 0, 0, 0 }, - {108, 1, 0, 0, 0, 0 }, - {47, 1, 0, 0, 0, 0 }, - {50, 1, 0, 0, 0, 0 }, - {52, 0, 0, 0, 0, 0 }, - {71, 1, 0, 0, 0, 0 }, - {13, 1, 0, 0, 0, 0 }, - {72, 1, 0, 0, 0, 0 }, - {46, 33, 6, 35, 5, 34}, - {74, 1, 0, 0, 0, 0 }, - {84, 1, 0, 0, 0, 0 }, - {66, 1, 0, 0, 0, 0 }, - {102, 1, 0, 0, 0, 0 }, - {109, 1, 0, 0, 0, 0 }, - {110, 2, 0, 0, 0, 0 }, - {45, 1, 0, 0, 0, 0 }, - {87, 1, 0, 0, 0, 0 }, - {111, 1, 0, 0, 0, 0 }, - {-1, 1, 0, 0, 0, 0 } -}; - writeRecord(_digStateMusicMap, sizeof(_digStateMusicMap), GBVARS_DIGSTATEMUSICMAP_INDEX , GBVARS_SCUMM); -} -/////////////////////////////////////////////////////////////////// -static void addDimuseTables_digStateMusicTable() { - imuseDigTable _digStateMusicTable[] = { - {0, 1000, "STATE_NULL", 0, 0, ""}, /* 00 */ - {0, 1001, "stateNoChange", 0, 0, ""}, /* 01 */ - {3, 1100, "stateAstShip", 2, 0, "ASTERO~1.IMU"}, /* 02 */ - {3, 1120, "stateAstClose", 2, 0, "ASTERO~2.IMU"}, /* 03 */ - {3, 1140, "stateAstInside", 0, 0, "ASTERO~3.IMU"}, /* 04 */ - {3, 1150, "stateAstCore", 0, 2, "ASTERO~4.IMU"}, /* 05 */ - {3, 1200, "stateCanyonClose", 0, 1, "CANYON~1.IMU"}, /* 06 */ - {3, 1205, "stateCanyonClose_m", 0, 0, "CANYON~2.IMU"}, /* 07 */ - {3, 1210, "stateCanyonOver", 0, 1, "CANYON~3.IMU"}, /* 08 */ - {3, 1220, "stateCanyonWreck", 0, 1, "CANYON~4.IMU"}, /* 09 */ - {3, 1300, "stateNexusCanyon", 10, 0, "NEXUS(~1.IMU"}, /* 10 */ - {3, 1310, "stateNexusPlan", 10, 0, "NEXUS(~1.IMU"}, /* 11 */ - {3, 1320, "stateNexusRamp", 10, 0, "NEXUS(~2.IMU"}, /* 12 */ - {3, 1330, "stateNexusMuseum", 10, 0, "NEXUS(~3.IMU"}, /* 13 */ - {3, 1340, "stateNexusMap", 10, 0, "NEXUS(~4.IMU"}, /* 14 */ - {3, 1350, "stateNexusTomb", 10, 0, "NE3706~5.IMU"}, /* 15 */ - {3, 1360, "stateNexusCath", 10, 0, "NE3305~5.IMU"}, /* 16 */ - {3, 1370, "stateNexusAirlock", 0, 0, "NE2D3A~5.IMU"}, /* 17 */ - {3, 1380, "stateNexusPowerOff", 0, 1, "NE8522~5.IMU"}, /* 18 */ - {3, 1400, "stateMuseumTramNear", 0, 1, "TRAM(M~1.IMU"}, /* 19 */ - {3, 1410, "stateMuseumTramFar", 0, 0, "TRAM(M~2.IMU"}, /* 20 */ - {3, 1420, "stateMuseumLockup", 0, 0, "MUSEUM~1.IMU"}, /* 21 */ - {3, 1433, "stateMuseumPool", 22, 1, "MUSEUM~2.IMU"}, /* 22 */ - {3, 1436, "stateMuseumSpire", 22, 2, "MUSEUM~3.IMU"}, /* 23 */ - {3, 1440, "stateMuseumMuseum", 22, 2, "MUSEUM~4.IMU"}, /* 24 */ - {3, 1450, "stateMuseumLibrary", 0, 0, "MUB575~5.IMU"}, /* 25 */ - {3, 1460, "stateMuseumCavern", 0, 0, "MUF9BE~5.IMU"}, /* 26 */ - {3, 1500, "stateTombTramNear", 0, 1, "TRAM(T~1.IMU"}, /* 27 */ - {3, 1510, "stateTombBase", 28, 2, "TOMB(A~1.IMU"}, /* 28 */ - {3, 1520, "stateTombSpire", 28, 2, "TOMB(A~2.IMU"}, /* 29 */ - {3, 1530, "stateTombCave", 28, 2, "TOMB(A~3.IMU"}, /* 30 */ - {3, 1540, "stateTombCrypt", 31, 1, "TOMB(C~1.IMU"}, /* 31 */ - {3, 1550, "stateTombGuards", 31, 1, "TOMB(C~2.IMU"}, /* 32 */ - {3, 1560, "stateTombInner", 0, 1, "TOMB(I~1.IMU"}, /* 33 */ - {3, 1570, "stateTombCreator1", 0, 0, "TOMB(C~3.IMU"}, /* 34 */ - {3, 1580, "stateTombCreator2", 0, 0, "TOMB(C~4.IMU"}, /* 35 */ - {3, 1600, "statePlanTramNear", 0, 1, "TRAM(P~1.IMU"}, /* 36 */ - {3, 1610, "statePlanTramFar", 0, 0, "TRAM(P~2.IMU"}, /* 37 */ - {3, 1620, "statePlanBase", 38, 2, "PLAN(A~1.IMU"}, /* 38 */ - {3, 1630, "statePlanSpire", 38, 2, "PLAN(A~2.IMU"}, /* 39 */ - {3, 1650, "statePlanDome", 0, 0, "PLAN(D~1.IMU"}, /* 40 */ - {3, 1700, "stateMapTramNear", 0, 1, "TRAM(M~3.IMU"}, /* 41 */ - {3, 1710, "stateMapTramFar", 0, 0, "TRAM(M~4.IMU"}, /* 42 */ - {3, 1720, "stateMapCanyon", 43, 2, "MAP(AM~1.IMU"}, /* 43 */ - {3, 1730, "stateMapExposed", 43, 2, "MAP(AM~2.IMU"}, /* 44 */ - {3, 1750, "stateMapNestEmpty", 43, 2, "MAP(AM~4.IMU"}, /* 45 */ - {3, 1760, "stateMapNestMonster", 0, 0, "MAP(MO~1.IMU"}, /* 46 */ - {3, 1770, "stateMapKlein", 0, 0, "MAP(KL~1.IMU"}, /* 47 */ - {3, 1800, "stateCathTramNear", 0, 1, "TRAM(C~1.IMU"}, /* 48 */ - {3, 1810, "stateCathTramFar", 0, 0, "TRAM(C~2.IMU"}, /* 49 */ - {3, 1820, "stateCathLab", 50, 1, "CATH(A~1.IMU"}, /* 50 */ - {3, 1830, "stateCathOutside", 50, 1, "CATH(A~2.IMU"}, /* 51 */ - {3, 1900, "stateWorldMuseum", 52, 0, "WORLD(~1.IMU"}, /* 52 */ - {3, 1901, "stateWorldPlan", 52, 0, "WORLD(~2.IMU"}, /* 53 */ - {3, 1902, "stateWorldTomb", 52, 0, "WORLD(~3.IMU"}, /* 54 */ - {3, 1903, "stateWorldMap", 52, 0, "WORLD(~4.IMU"}, /* 55 */ - {3, 1904, "stateWorldCath", 52, 0, "WO3227~5.IMU"}, /* 56 */ - {3, 1910, "stateEye1", 0, 0, "EYE1~1.IMU"}, /* 57 */ - {3, 1911, "stateEye2", 0, 0, "EYE2~1.IMU"}, /* 58 */ - {3, 1912, "stateEye3", 0, 0, "EYE3~1.IMU"}, /* 59 */ - {3, 1913, "stateEye4", 0, 0, "EYE4~1.IMU"}, /* 60 */ - {3, 1914, "stateEye5", 0, 0, "EYE5~1.IMU"}, /* 61 */ - {3, 1915, "stateEye6", 0, 0, "EYE6~1.IMU"}, /* 62 */ - {3, 1916, "stateEye7", 0, 0, "EYE7~1.IMU"}, /* 63 */ - {0, -1, "", 0, 0, ""} -}; - - writeRecord(_digStateMusicTable, sizeof(_digStateMusicTable), GBVARS_DIGSTATEMUSICTABLE_INDEX , GBVARS_SCUMM); -} -/////////////////////////////////////////////////////////////////// -static void addDimuseTables_comiStateMusicTable() { - imuseComiTable _comiStateMusicTable[] = { - {0, 1000, "STATE_NULL", 0, 0, 0, ""}, /* 00 */ - {0, 1001, "stateNoChange", 0, 0, 0, ""}, /* 01 */ - {3, 1098, "stateCredits1", 0, 0, 60, "1098-C~1.IMX"}, /* 02 */ - {3, 1099, "stateMenu", 0, 0, 60, "1099-M~1.IMX"}, /* 03 */ - {3, 1100, "stateHold1", 4, 0, 60, "1100-H~1.IMX"}, /* 04 */ - {3, 1101, "stateWaterline1", 4, 0, 60, "1101-W~1.IMX"}, /* 05 */ - {3, 1102, "stateHold2", 6, 1, 60, "1102-H~1.IMX"}, /* 06 */ - {3, 1103, "stateWaterline2", 6, 0, 60, "1103-W~1.IMX"}, /* 07 */ - {3, 1104, "stateCannon", 0, 0, 60, "1104-C~1.IMX"}, /* 08 */ - {3, 1105, "stateTreasure", 0, 0, 60, "1105-T~1.IMX"}, /* 09 */ - {3, 1200, "stateFortBase", 10, 1, 60, "1200-F~1.IMX"}, /* 10 */ - {3, 1201, "statePreFort", 10, 1, 60, "1201-P~1.IMX"}, /* 11 */ - {3, 1202, "statePreVooOut", 12, 0, 60, "1202-P~1.IMX"}, /* 12 */ - {3, 1203, "statePreVooIn", 12, 0, 60, "1203-P~1.IMX"}, /* 13 */ - {3, 1204, "statePreVooLady", 12, 0, 60, "1204-P~1.IMX"}, /* 14 */ - {3, 1205, "stateVoodooOut", 0, 0, 60, "1205-V~1.IMX"}, /* 15 */ - {3, 1210, "stateVoodooIn", 0, 0, 60, "1210-V~1.IMX"}, /* 16 */ - {12,1212, "stateVoodooInAlt", 0, 1, 42, "1210-V~1.IMX"}, /* 17 */ - {3, 1215, "stateVoodooLady", 0, 0, 60, "1215-V~1.IMX"}, /* 18 */ - {3, 1219, "statePrePlundermap", 0, 0, 60, "1219-P~1.IMX"}, /* 19 */ - {3, 1220, "statePlundermap", 0, 0, 60, "1220-P~1.IMX"}, /* 20 */ - {3, 1222, "statePreCabana", 0, 0, 60, "1222-P~1.IMX"}, /* 21 */ - {3, 1223, "stateCabana", 0, 0, 60, "1223-C~1.IMX"}, /* 22 */ - {3, 1224, "statePostCabana", 23, 0, 60, "1224-P~1.IMX"}, /* 23 */ - {3, 1225, "stateBeachClub", 23, 0, 60, "1225-B~1.IMX"}, /* 24 */ - {3, 1230, "stateCliff", 0, 0, 60, "1230-C~1.IMX"}, /* 25 */ - {3, 1232, "stateBelly", 0, 0, 48, "1232-B~1.IMX"}, /* 26 */ - {3, 1235, "stateQuicksand", 0, 0, 60, "1235-Q~1.IMX"}, /* 27 */ - {3, 1240, "stateDangerBeach", 0, 0, 48, "1240-D~1.IMX"}, /* 28 */ - {12,1241, "stateDangerBeachAlt",0, 2, 48, "1240-D~1.IMX"}, /* 29 */ - {3, 1245, "stateRowBoat", 0, 0, 60, "1245-R~1.IMX"}, /* 30 */ - {3, 1247, "stateAlongside", 0, 0, 48, "1247-A~1.IMX"}, /* 31 */ - {12,1248, "stateAlongsideAlt", 0, 1, 48, "1247-A~1.IMX"}, /* 32 */ - {3, 1250, "stateChimpBoat", 0, 0, 30, "1250-C~1.IMX"}, /* 33 */ - {3, 1255, "stateMrFossey", 0, 0, 48, "1255-M~1.IMX"}, /* 34 */ - {3, 1259, "statePreTown", 0, 0, 60, "1259-P~1.IMX"}, /* 35 */ - {3, 1260, "stateTown", 0, 0, 60, "1260-T~1.IMX"}, /* 36 */ - {3, 1264, "statePreMeadow", 0, 0, 60, "1264-P~1.IMX"}, /* 37 */ - {3, 1265, "stateMeadow", 0, 0, 60, "1265-M~1.IMX"}, /* 38 */ - {3, 1266, "stateMeadowAmb", 0, 0, 60, "1266-M~1.IMX"}, /* 39 */ - {3, 1270, "stateWardrobePre", 40, 0, 60, "1270-W~1.IMX"}, /* 40 */ - {3, 1272, "statePreShow", 40, 0, 60, "1272-P~1.IMX"}, /* 41 */ - {3, 1274, "stateWardrobeShow", 42, 0, 60, "1274-W~1.IMX"}, /* 42 */ - {3, 1276, "stateShow", 42, 0, 60, "1276-S~1.IMX"}, /* 43 */ - {3, 1277, "stateWardrobeJug", 44, 0, 60, "1277-W~1.IMX"}, /* 44 */ - {3, 1278, "stateJuggling", 44, 0, 60, "1278-J~1.IMX"}, /* 45 */ - {3, 1279, "statePostShow", 0, 0, 60, "1279-P~1.IMX"}, /* 46 */ - {3, 1280, "stateChickenShop", 0, 0, 60, "1280-C~1.IMX"}, /* 47 */ - {3, 1285, "stateBarberShop", 48, 0, 60, "1285-B~1.IMX"}, /* 48 */ - {3, 1286, "stateVanHelgen", 48, 0, 60, "1286-V~1.IMX"}, /* 49 */ - {3, 1287, "stateBill", 48, 0, 60, "1287-B~1.IMX"}, /* 50 */ - {3, 1288, "stateHaggis", 48, 0, 60, "1288-H~1.IMX"}, /* 51 */ - {3, 1289, "stateRottingham", 48, 0, 60, "1289-R~1.IMX"}, /* 52 */ - {3, 1305, "stateDeck", 0, 0, 60, "1305-D~1.IMX"}, /* 53 */ - {3, 1310, "stateCombatMap", 0, 0, 60, "1310-C~1.IMX"}, /* 54 */ - {3, 1320, "stateShipCombat", 0, 0, 60, "1320-S~1.IMX"}, /* 55 */ - {3, 1325, "stateSwordfight", 0, 0, 60, "1325-S~1.IMX"}, /* 56 */ - {3, 1327, "stateSwordRott", 0, 0, 60, "1327-S~1.IMX"}, /* 57 */ - {3, 1330, "stateTownEdge", 0, 0, 60, "1330-T~1.IMX"}, /* 58 */ - {3, 1335, "stateSwordLose", 0, 0, 60, "1335-S~1.IMX"}, /* 59 */ - {3, 1340, "stateSwordWin", 0, 0, 60, "1340-S~1.IMX"}, /* 60 */ - {3, 1345, "stateGetMap", 0, 0, 60, "1345-G~1.IMX"}, /* 61 */ - {3, 1400, "stateWreckBeach", 0, 0, 60, "1400-W~1.IMX"}, /* 62 */ - {3, 1405, "stateBloodMap", 63, 0, 60, "1405-B~1.IMX"}, /* 63 */ - {3, 1410, "stateClearing", 0, 0, 60, "1410-C~1.IMX"}, /* 64 */ - {3, 1415, "stateLighthouse", 63, 0, 60, "1415-L~1.IMX"}, /* 65 */ - {3, 1420, "stateVillage", 66, 0, 60, "1420-V~1.IMX"}, /* 66 */ - {3, 1423, "stateVolcano", 66, 0, 60, "1423-V~1.IMX"}, /* 67 */ - {3, 1425, "stateAltar", 66, 0, 60, "1425-A~1.IMX"}, /* 68 */ - {3, 1430, "stateHotelOut", 0, 0, 60, "1430-H~1.IMX"}, /* 69 */ - {3, 1435, "stateHotelBar", 70, 0, 60, "1435-H~1.IMX"}, /* 70 */ - {3, 1440, "stateHotelIn", 70, 0, 60, "1440-H~1.IMX"}, /* 71 */ - {3, 1445, "stateTarotLady", 70, 0, 60, "1445-T~1.IMX"}, /* 72 */ - {3, 1447, "stateGoodsoup", 70, 0, 60, "1447-G~1.IMX"}, /* 73 */ - {3, 1448, "stateGuestRoom", 0, 0, 60, "1448-G~1.IMX"}, /* 74 */ - {3, 1450, "stateWindmill", 63, 0, 60, "1450-W~1.IMX"}, /* 75 */ - {3, 1455, "stateCemetary", 0, 0, 60, "1455-C~1.IMX"}, /* 76 */ - {3, 1460, "stateCrypt", 77, 0, 60, "1460-C~1.IMX"}, /* 77 */ - {3, 1463, "stateGraveDigger", 77, 0, 60, "1463-G~1.IMX"}, /* 78 */ - {3, 1465, "stateMonkey1", 0, 0, 60, "1465-M~1.IMX"}, /* 79 */ - {3, 1475, "stateStanDark", 0, 0, 60, "1475-S~1.IMX"}, /* 80 */ - {3, 1477, "stateStanLight", 0, 0, 60, "1477-S~1.IMX"}, /* 81 */ - {3, 1480, "stateEggBeach", 63, 0, 60, "1480-E~1.IMX"}, /* 82 */ - {3, 1485, "stateSkullIsland", 0, 0, 60, "1485-S~1.IMX"}, /* 83 */ - {3, 1490, "stateSmugglersCave", 0, 0, 60, "1490-S~1.IMX"}, /* 84 */ - {3, 1500, "stateLeChuckTalk", 0, 0, 60, "1500-L~1.IMX"}, /* 85 */ - {3, 1505, "stateCarnival", 0, 0, 60, "1505-C~1.IMX"}, /* 86 */ - {3, 1511, "stateHang", 87, 0, 60, "1511-H~1.IMX"}, /* 87 */ - {3, 1512, "stateRum", 87, 0, 60, "1512-RUM.IMX"}, /* 88 */ - {3, 1513, "stateTorture", 87, 0, 60, "1513-T~1.IMX"}, /* 89 */ - {3, 1514, "stateSnow", 87, 0, 60, "1514-S~1.IMX"}, /* 90 */ - {3, 1515, "stateCredits", 0, 0, 60, "1515-C~1.IMX"}, /* 91 */ - {3, 1520, "stateCarnAmb", 0, 0, 60, "1520-C~1.IMX"}, /* 92 */ - {0, -1, "", 0, 0, 0, ""} -}; - - writeRecord(_comiStateMusicTable, sizeof(_comiStateMusicTable), GBVARS_COMISTATEMUSICTABLE_INDEX , GBVARS_SCUMM); -} -/////////////////////////////////////////////////////////////////// -static void addDimuseTables_comiSeqMusicTable() { - imuseComiTable _comiSeqMusicTable[] = { - {0, 2000, "SEQ_NULL", 0, 0, 0, ""}, - {0, 2100, "seqINTRO", 0, 0, 0, ""}, - {3, 2105, "seqInterlude1", 0, 0, 60, "2105-I~1.IMX"}, - {8, 2110, "seqLastBoat", 0, 1, 0, ""}, - {0, 2115, "seqSINK_SHIP", 0, 0, 0, ""}, - {0, 2120, "seqCURSED_RING", 0, 0, 60, ""}, - {3, 2200, "seqInterlude2", 0, 0, 60, "2200-I~1.IMX"}, - {3, 2210, "seqKidnapped", 0, 0, 60, "2210-K~1.IMX"}, - {8, 2220, "seqSnakeVomits", 0, 1, 0, ""}, - {8, 2222, "seqPopBalloon", 0, 1, 0, ""}, - {3, 2225, "seqDropBalls", 0, 0, 60, "2225-D~1.IMX"}, - {4, 2232, "seqArriveBarber", 0, 0, 60, "2232-A~1.IMX"}, - {3, 2233, "seqAtonal", 0, 0, 60, "2233-A~1.IMX"}, - {3, 2235, "seqShaveHead1", 0, 0, 60, "2235-S~1.IMX"}, - {2, 2236, "seqShaveHead2", 0, 2, 60, "2235-S~1.IMX"}, - {3, 2245, "seqCaberLose", 0, 0, 60, "2245-C~1.IMX"}, - {3, 2250, "seqCaberWin", 0, 0, 60, "2250-C~1.IMX"}, - {3, 2255, "seqDuel1", 0, 0, 60, "2255-D~1.IMX"}, - {2, 2256, "seqDuel2", 0, 2, 60, "2255-D~1.IMX"}, - {2, 2257, "seqDuel3", 0, 3, 60, "2255-D~1.IMX"}, - {3, 2260, "seqBlowUpTree1", 0, 0, 60, "2260-B~1.IMX"}, - {2, 2261, "seqBlowUpTree2", 0, 2, 60, "2260-B~1.IMX"}, - {3, 2275, "seqMonkeys", 0, 0, 60, "2275-M~1.IMX"}, - {9, 2277, "seqAttack", 0, 1, 0, ""}, - {3, 2285, "seqSharks", 0, 0, 60, "2285-S~1.IMX"}, - {3, 2287, "seqTowelWalk", 0, 0, 60, "2287-T~1.IMX"}, - {0, 2293, "seqNICE_BOOTS", 0, 0, 0, ""}, - {0, 2295, "seqBIG_BONED", 0, 0, 0, ""}, - {3, 2300, "seqToBlood", 0, 0, 60, "2300-T~1.IMX"}, - {3, 2301, "seqInterlude3", 0, 0, 60, "2301-I~1.IMX"}, - {3, 2302, "seqRott1", 0, 0, 60, "2302-R~1.IMX"}, - {2, 2304, "seqRott2", 0, 2, 60, "2302-R~1.IMX"}, - {2, 2305, "seqRott2b", 0,21, 60, "2302-R~1.IMX"}, - {2, 2306, "seqRott3", 0, 3, 60, "2302-R~1.IMX"}, - {2, 2308, "seqRott4", 0, 4, 60, "2302-R~1.IMX"}, - {2, 2309, "seqRott5", 0, 5, 60, "2302-R~1.IMX"}, - {3, 2311, "seqVerse1", 0, 0, 60, "2311-S~1.IMX"}, - {2, 2312, "seqVerse2", 0, 2, 60, "2311-S~1.IMX"}, - {2, 2313, "seqVerse3", 0, 3, 60, "2311-S~1.IMX"}, - {2, 2314, "seqVerse4", 0, 4, 60, "2311-S~1.IMX"}, - {2, 2315, "seqVerse5", 0, 5, 60, "2311-S~1.IMX"}, - {2, 2316, "seqVerse6", 0, 6, 60, "2311-S~1.IMX"}, - {2, 2317, "seqVerse7", 0, 7, 60, "2311-S~1.IMX"}, - {2, 2318, "seqVerse8", 0, 8, 60, "2311-S~1.IMX"}, - {2, 2319, "seqSongEnd", 0, 9, 60, "2311-S~1.IMX"}, - {2, 2336, "seqRiposteLose", 0, 0, 60, "2336-R~1.IMX"}, - {2, 2337, "seqRiposteWin", 0, 0, 60, "2337-R~1.IMX"}, - {2, 2338, "seqInsultLose", 0, 0, 60, "2338-I~1.IMX"}, - {2, 2339, "seqInsultWin", 0, 0, 60, "2339-I~1.IMX"}, - {3, 2340, "seqSwordLose", 0, 0, 60, "1335-S~1.IMX"}, - {3, 2345, "seqSwordWin", 0, 0, 60, "1340-S~1.IMX"}, - {3, 2347, "seqGetMap", 0, 0, 60, "1345-G~1.IMX"}, - {3, 2400, "seqInterlude4", 0, 0, 60, "2400-I~1.IMX"}, - {0, 2405, "seqSHIPWRECK", 0, 0, 0, ""}, - {3, 2408, "seqFakeCredits", 0, 0, 60, "2408-F~1.IMX"}, - {3, 2410, "seqPassOut", 0, 0, 60, "2410-P~1.IMX"}, - {3, 2414, "seqGhostTalk", 0, 0, 60, "2414-G~1.IMX"}, - {2, 2415, "seqGhostWedding", 0, 1, 60, "2414-G~1.IMX"}, - {3, 2420, "seqEruption", 0, 0, 60, "2420-E~1.IMX"}, - {3, 2425, "seqSacrifice", 0, 0, 60, "2425-S~1.IMX"}, - {2, 2426, "seqSacrificeEnd", 0, 1, 60, "2425-S~1.IMX"}, - {3, 2430, "seqScareDigger", 0, 0, 60, "2430-S~1.IMX"}, - {3, 2445, "seqSkullArrive", 0, 0, 60, "2445-S~1.IMX"}, - {3, 2450, "seqFloat", 0, 0, 60, "2450-C~1.IMX"}, - {2, 2451, "seqFall", 0, 1, 60, "2450-C~1.IMX"}, - {2, 2452, "seqUmbrella", 0, 0, 60, "2450-C~1.IMX"}, - {3, 2460, "seqFight", 0, 0, 60, "2460-F~1.IMX"}, - {0, 2465, "seqLAVE_RIDE", 0, 0, 0, ""}, - {0, 2470, "seqMORE_SLAW", 0, 0, 0, ""}, - {0, 2475, "seqLIFT_CURSE", 0, 0, 0, ""}, - {3, 2500, "seqInterlude5", 0, 0, 60, "2500-I~1.IMX"}, - {3, 2502, "seqExitSkycar", 0, 0, 60, "2502-E~1.IMX"}, - {3, 2504, "seqGrow1", 0, 0, 60, "2504-G~1.IMX"}, - {2, 2505, "seqGrow2", 0, 1, 60, "2504-G~1.IMX"}, - {3, 2508, "seqInterlude6", 0, 0, 60, "2508-I~1.IMX"}, - {0, 2515, "seqFINALE", 0, 0, 0, ""}, - {3, 2520, "seqOut", 0, 0, 60, "2520-OUT.IMX"}, - {3, 2530, "seqZap1a", 0, 0, 60, "2530-Z~1.IMX"}, - {2, 2531, "seqZap1b", 0, 1, 60, "2530-Z~1.IMX"}, - {2, 2532, "seqZap1c", 0, 2, 60, "2530-Z~1.IMX"}, - {2, 2540, "seqZap2a", 0, 0, 60, "2540-Z~1.IMX"}, - {2, 2541, "seqZap2b", 0, 1, 60, "2540-Z~1.IMX"}, - {2, 2542, "seqZap2c", 0, 2, 60, "2540-Z~1.IMX"}, - {3, 2550, "seqZap3a", 0, 0, 60, "2550-Z~1.IMX"}, - {2, 2551, "seqZap3b", 0, 1, 60, "2550-Z~1.IMX"}, - {2, 2552, "seqZap3c", 0, 2, 60, "2550-Z~1.IMX"}, - {3, 2560, "seqZap4a", 0, 0, 60, "2560-Z~1.IMX"}, - {2, 2561, "seqZap4b", 0, 1, 60, "2560-Z~1.IMX"}, - {2, 2562, "seqZap4c", 0, 2, 60, "2560-Z~1.IMX"}, - {0, -1, "", 0, 0, 0, ""} -}; - - writeRecord(_comiSeqMusicTable, sizeof(_comiSeqMusicTable), GBVARS_COMISEQMUSICTABLE_INDEX ,GBVARS_SCUMM); -} -/////////////////////////////////////////////////////////////////// -static void addDimuseTables_digSeqMusicTable() { - - imuseDigTable _digSeqMusicTable[] = { - {0, 2000, "SEQ_NULL", 0, 0, ""}, - {0, 2005, "seqLogo", 0, 0, ""}, - {0, 2010, "seqIntro", 0, 0, ""}, - {6, 2020, "seqExplosion1b", 0, 0, ""}, - {3, 2030, "seqAstTunnel1a", 0, 0, "SEQ(AS~1.IMU"}, - {6, 2031, "seqAstTunnel2b", 0, 0, ""}, - {4, 2032, "seqAstTunnel3a", 0, 0, "SEQ(AS~2.IMU"}, - {5, 2040, "seqToPlanet1b", 0, 0, ""}, - {4, 2045, "seqArgBegin", 0, 0, "SEQ(AR~1.IMU"}, - {4, 2046, "seqArgEnd", 0, 0, "SEQ(AR~2.IMU"}, - {4, 2050, "seqWreckGhost", 0, 0, "SEQ(GH~1.IMU"}, - {4, 2060, "seqCanyonGhost", 0, 0, "SEQ(GH~2.IMU"}, - {0, 2070, "seqBrinkFall", 0, 0, ""}, - {4, 2080, "seqPanUpCanyon", 0, 0, "SEQ(PA~1.IMU"}, - {6, 2091, "seqAirlockTunnel1b", 0, 0, ""}, - {6, 2100, "seqTramToMu", 0, 0, ""}, - {6, 2101, "seqTramFromMu", 0, 0, ""}, - {6, 2102, "seqTramToTomb", 0, 0, ""}, - {6, 2103, "seqTramFromTomb", 0, 0, ""}, - {6, 2104, "seqTramToPlan", 0, 0, ""}, - {6, 2105, "seqTramFromPlan", 0, 0, ""}, - {6, 2106, "seqTramToMap", 0, 0, ""}, - {6, 2107, "seqTramFromMap", 0, 0, ""}, - {6, 2108, "seqTramToCath", 0, 0, ""}, - {6, 2109, "seqTramFromCath", 0, 0, ""}, - {0, 2110, "seqMuseumGhost", 0, 0, ""}, - {0, 2120, "seqSerpentAppears", 0, 0, ""}, - {0, 2130, "seqSerpentEats", 0, 0, ""}, - {6, 2140, "seqBrinkRes1b", 0, 0, ""}, - {4, 2141, "seqBrinkRes2a", 0, 0, "SEQ(BR~1.IMU"}, - {3, 2150, "seqLockupEntry", 0, 0, "SEQ(BR~1.IMU"}, - {0, 2160, "seqSerpentExplodes", 0, 0, ""}, - {4, 2170, "seqSwimUnderwater", 0, 0, "SEQ(DE~1.IMU"}, - {4, 2175, "seqWavesPlunge", 0, 0, "SEQ(PL~1.IMU"}, - {0, 2180, "seqCryptOpens", 0, 0, ""}, - {0, 2190, "seqGuardsFight", 0, 0, ""}, - {3, 2200, "seqCreatorRes1.1a", 0, 0, "SEQ(CR~1.IMU"}, - {6, 2201, "seqCreatorRes1.2b", 0, 0, ""}, - {6, 2210, "seqMaggieCapture1b", 0, 0, ""}, - {3, 2220, "seqStealCrystals", 0, 0, "SEQ(BR~1.IMU"}, - {0, 2230, "seqGetByMonster", 0, 0, ""}, - {6, 2240, "seqKillMonster1b", 0, 0, ""}, - {3, 2250, "seqCreatorRes2.1a", 0, 0, "SEQ(CR~2.IMU"}, - {6, 2251, "seqCreatorRes2.2b", 0, 0, ""}, - {4, 2252, "seqCreatorRes2.3a", 0, 0, "SEQ(CR~3.IMU"}, - {0, 2260, "seqMaggieInsists", 0, 0, ""}, - {0, 2270, "seqBrinkHelpCall", 0, 0, ""}, - {3, 2280, "seqBrinkCrevice1a", 0, 0, "SEQ(BR~2.IMU"}, - {3, 2281, "seqBrinkCrevice2a", 0, 0, "SEQ(BR~3.IMU"}, - {6, 2290, "seqCathAccess1b", 0, 0, ""}, - {4, 2291, "seqCathAccess2a", 0, 0, "SEQ(CA~1.IMU"}, - {3, 2300, "seqBrinkAtGenerator", 0, 0, "SEQ(BR~1.IMU"}, - {6, 2320, "seqFightBrink1b", 0, 0, ""}, - {6, 2340, "seqMaggieDies1b", 0, 0, ""}, - {6, 2346, "seqMaggieRes1b", 0, 0, ""}, - {4, 2347, "seqMaggieRes2a", 0, 0, "SEQ(MA~1.IMU"}, - {0, 2350, "seqCreatureFalls", 0, 0, ""}, - {5, 2360, "seqFinale1b", 0, 0, ""}, - {3, 2370, "seqFinale2a", 0, 0, "SEQ(FI~1.IMU"}, - {6, 2380, "seqFinale3b1", 0, 0, ""}, - {6, 2390, "seqFinale3b2", 0, 0, ""}, - {3, 2400, "seqFinale4a", 0, 0, "SEQ(FI~2.IMU"}, - {3, 2410, "seqFinale5a", 0, 0, "SEQ(FI~3.IMU"}, - {3, 2420, "seqFinale6a", 0, 0, "SEQ(FI~4.IMU"}, - {3, 2430, "seqFinale7a", 0, 0, "SE3D2B~5.IMU"}, - {6, 2440, "seqFinale8b", 0, 0, ""}, - {4, 2450, "seqFinale9a", 0, 0, "SE313B~5.IMU"}, - {0, -1, "", 0, 0, ""} -}; - - writeRecord(_digSeqMusicTable, sizeof(_digSeqMusicTable), GBVARS_DIGSEQMUSICTABLE_INDEX ,GBVARS_SCUMM); -} -/////////////////////////////////////////////////////////////////// -static void addDimuseTables_ftStateMusicTable() { - - imuseFtStateTable _ftStateMusicTable[] = { - {"", 0, 0, "STATE_NULL" }, - {"", 4, 127, "stateKstandOutside" }, - {"kinside", 2, 127, "stateKstandInside" }, - {"moshop", 3, 64, "stateMoesInside" }, - {"melcut", 2, 127, "stateMoesOutside" }, - {"mellover", 2, 127, "stateMellonAbove" }, - {"radloop", 3, 28, "stateTrailerOutside" }, - {"radloop", 3, 58, "stateTrailerInside" }, - {"radloop", 3, 127, "stateTodShop" }, - {"junkgate", 2, 127, "stateJunkGate" }, - {"junkover", 3, 127, "stateJunkAbove" }, - {"gastower", 2, 127, "stateGasTower" }, - {"", 4, 0, "stateTowerAlarm" }, - {"melcut", 2, 127, "stateCopsOnGround" }, - {"melcut", 2, 127, "stateCopsAround" }, - {"melcut", 2, 127, "stateMoesRuins" }, - {"melcut", 2, 127, "stateKstandNight" }, - {"trukblu2", 2, 127, "stateTruckerTalk" }, - {"stretch", 2, 127, "stateMumblyPeg" }, - {"kstand", 2, 100, "stateRanchOutside" }, - {"kinside", 2, 127, "stateRanchInside" }, - {"desert", 2, 127, "stateWreckedTruck" }, - {"opening", 2, 100, "stateGorgeVista" }, - {"caveopen", 2, 127, "stateCaveOpen" }, - {"cavecut1", 2, 127, "stateCaveOuter" }, - {"cavecut1", 1, 127, "stateCaveMiddle" }, - {"cave", 2, 127, "stateCaveInner" }, - {"corville", 2, 127, "stateCorvilleFront" }, - {"mines", 2, 127, "stateMineField" }, - {"bunyman3", 2, 127, "stateBunnyStore" }, - {"stretch", 2, 127, "stateStretchBen" }, - {"saveme", 2, 127, "stateBenPleas" }, - {"", 4, 0, "stateBenConvinces" }, - {"derby", 3, 127, "stateDemoDerby" }, - {"fire", 3, 127, "stateLightMyFire" }, - {"derby", 3, 127, "stateDerbyChase" }, - {"carparts", 2, 127, "stateVultureCarParts"}, - {"cavecut1", 2, 127, "stateVulturesInside" }, - {"mines", 2, 127, "stateFactoryRear" }, - {"croffice", 2, 127, "stateCorleyOffice" }, - {"melcut", 2, 127, "stateCorleyHall" }, - {"", 4, 0, "stateProjRoom" }, - {"", 4, 0, "stateMMRoom" }, - {"bumper", 2, 127, "stateBenOnBumper" }, - {"benump", 2, 127, "stateBenOnBack" }, - {"plane", 2, 127, "stateInCargoPlane" }, - {"saveme", 2, 127, "statePlaneControls" }, - {"", 4, 0, "stateCliffHanger1" }, - {"", 4, 0, "stateCliffHanger2" }, -}; - - writeRecord(_ftStateMusicTable, sizeof(_ftStateMusicTable), GBVARS_FTSTATEMUSICTABLE_INDEX , GBVARS_SCUMM); -} -/////////////////////////////////////////////////////////////////// -static void addDimuseTables_ftSeqMusicTable() { - - imuseFtSeqTable _ftSeqMusicTable[] = { - {"", 2, 127}, - {"", 0, 0 }, - {"", 0, 0 }, - {"", 0, 0 }, - - {"opening", 2, 127}, - {"", 0, 0 }, - {"", 0, 0 }, - {"", 0, 0 }, - - {"barbeat", 2, 127}, - {"barwarn", 2, 127}, - {"", 0, 0 }, - {"", 0, 0, }, - - {"benwakes", 2, 127}, - {"", 0, 0 }, - {"", 0, 0 }, - {"", 0, 0 }, - - {"barwarn", 2, 127}, - {"", 0, 0 }, - {"", 0, 0 }, - {"", 0, 0 }, - - {"swatben", 2, 127}, - {"", 0, 0 }, - {"", 0, 0 }, - {"", 0, 0 }, - - {"dogattak", 2, 127}, - {"", 0, 0 }, - {"", 0, 0 }, - {"", 0, 0 }, - - {"", 4, 0 }, - {"", 0, 0 }, - {"", 0, 0 }, - {"", 0, 0 }, - - {"", 4, 0 }, - {"", 0, 0 }, - {"", 0, 0 }, - {"", 0, 0 }, - - {"cops2", 2, 127}, - {"", 0, 0 }, - {"", 0, 0 }, - {"", 0, 0 }, - - {"cops2", 2, 127}, - {"", 0, 0 }, - {"", 0, 0 }, - {"", 0, 0 }, - - {"cops2", 2, 127}, - {"", 0, 0 }, - {"", 0, 0 }, - {"", 0, 0 }, - - {"", 0, 0 }, - {"", 0, 0 }, - {"", 0, 0 }, - {"", 0, 0 }, - - {"bunymrch", 2, 127}, - {"", 0, 0 }, - {"", 0, 0 }, - {"", 0, 0 }, - - {"", 4, 0 }, - {"", 0, 0 }, - {"", 0, 0 }, - {"", 0, 0 }, - - {"", 0, 0 }, - {"melcut", 2, 127}, - {"tada", 2, 127}, - {"", 0, 0 }, - - {"", 4, 0 }, - {"", 0, 0 }, - {"", 0, 0 }, - {"", 0, 0 }, - - {"trucker", 2, 127}, - {"", 0, 0 }, - {"", 0, 0 }, - {"", 0, 0 }, - - {"cops2", 2, 127}, - {"", 0, 0 }, - {"", 0, 0 }, - {"", 0, 0 }, - - {"barwarn", 2, 127}, - {"murder", 2, 127}, - {"murder2", 2, 127}, - {"", 0, 0 }, - - {"corldie", 2, 127}, - {"", 0, 0 }, - {"", 0, 0 }, - {"", 0, 0 }, - - {"barwarn", 2, 127}, - {"", 0, 0 }, - {"", 0, 0 }, - {"", 0, 0 }, - - {"picture", 2, 127}, - {"", 0, 0 }, - {"", 0, 0 }, - {"", 0, 0 }, - - {"ripintro", 2, 127}, - {"", 0, 0 }, - {"", 0, 0 }, - {"", 0, 0 }, - - {"trucker", 2, 127}, - {"", 0, 0 }, - {"", 0, 0 }, - {"hosed", 2, 127}, - - {"ripdead", 2, 127}, - {"", 0, 0 }, - {"", 0, 0 }, - {"", 0, 0 }, - - {"nesranch", 2, 127}, - {"", 0, 0 }, - {"", 0, 0 }, - {"", 0, 0 }, - - {"scolding", 2, 127}, - {"", 0, 0 }, - {"", 0, 0 }, - {"", 0, 0 }, - - {"desert", 2, 127}, - {"", 0, 0 }, - {"", 0, 0 }, - {"", 0, 0 }, - - {"cavecut1", 2, 127}, - {"", 0, 0 }, - {"", 0, 0 }, - {"", 0, 0 }, - - {"caveamb", 2, 80 }, - {"", 0, 0 }, - {"", 0, 0 }, - {"", 0, 0 }, - - {"castle", 2, 127}, - {"", 0, 0 }, - {"", 0, 0 }, - {"", 0, 0 }, - - {"bunymrch", 2, 105}, - {"", 0, 0 }, - {"", 0, 0 }, - {"", 0, 0 }, - - {"valkyrs", 2, 127}, - {"", 0, 0 }, - {"", 0, 0 }, - {"", 0, 0 }, - - {"melcut", 2, 127}, - {"", 0, 0 }, - {"", 0, 0 }, - {"", 0, 0 }, - - {"veltures", 2, 127}, - {"", 0, 0 }, - {"", 0, 0 }, - {"", 0, 0 }, - - {"sorry", 2, 127}, - {"", 0, 0 }, - {"", 0, 0 }, - {"", 0, 0 }, - - {"makeplan", 2, 127}, - {"", 0, 0 }, - {"", 0, 0 }, - {"", 0, 0 }, - - {"castle", 2, 127}, - {"derby", 2, 127}, - {"", 0, 0 }, - {"", 0, 0 }, - - {"fire", 3, 127}, - {"", 0, 0 }, - {"", 0, 0 }, - {"", 0, 0 }, - - {"saveme", 3, 127}, - {"", 0, 0 }, - {"", 0, 0 }, - {"scolding", 2, 127}, - - {"cops2", 2, 127}, - {"", 0, 0 }, - {"", 0, 0 }, - {"", 0, 0 }, - - {"sorry", 2, 127}, - {"", 0, 0 }, - {"", 0, 0 }, - {"", 0, 0 }, - - {"sorry", 2, 127}, - {"", 0, 0 }, - {"", 0, 0 }, - {"", 0, 0 }, - - {"caveamb", 2, 85 }, - {"tada", 2, 127}, - {"", 0, 0 }, - {"", 0, 0 }, - - {"expose", 2, 127}, - {"", 4, 0 }, - {"", 0, 0 }, - {"mocoup", 2, 127}, - - {"ripscram", 2, 127}, - {"", 0, 0 }, - {"", 0, 0 }, - {"", 0, 0 }, - - {"", 2, 127}, - {"", 0, 0 }, - {"", 0, 0 }, - {"", 0, 0 }, - - {"valkyrs", 2, 127}, - {"", 0, 0 }, - {"", 0, 0 }, - {"", 0, 0 }, - - {"ripdead", 2, 127}, - {"", 0, 0 }, - {"", 0, 0 }, - {"", 0, 0 }, - - {"funeral", 2, 127}, - {"", 2, 127}, - {"moshop", 3, 64 }, - {"", 0, 0 }, - - {"bornbad", 2, 127}, - {"hammvox", 2, 127}, - {"legavox", 2, 127}, - {"chances", 2, 90 }, -}; - writeRecord(_ftSeqMusicTable, sizeof(_ftSeqMusicTable), GBVARS_FTSEQMUSICTABLE_INDEX , GBVARS_SCUMM); -} - -static void addDimuseTables_ftSeqNames() { - imuseFtNames _ftSeqNames[] = { - {"SEQ_NULL" }, - {"seqLogo" }, - {"seqOpenFlick" }, - {"seqBartender" }, - {"seqBenWakes" }, - {"seqPhotoScram" }, - {"seqClimbChain" }, - {"seqDogChase" }, - {"seqDogSquish" }, - {"seqDogHoist" }, - {"seqCopsArrive" }, - {"seqCopsLand" }, - {"seqCopsLeave" }, - {"seqCopterFlyby" }, - {"seqCopterCrash" }, - {"seqMoGetsParts" }, - {"seqMoFixesBike" }, - {"seqFirstGoodbye" }, - {"seqCopRoadblock" }, - {"seqDivertCops" }, - {"seqMurder" }, - {"seqCorleyDies" }, - {"seqTooLateAtMoes" }, - {"seqPicture" }, - {"seqNewsReel" }, - {"seqCopsInspect" }, - {"seqHijack" }, - {"seqNestolusAtRanch" }, - {"seqRipLimo" }, - {"seqGorgeTurn" }, - {"seqCavefishTalk" }, - {"seqArriveCorville" }, - {"seqSingleBunny" }, - {"seqBunnyArmy" }, - {"seqArriveAtMines" }, - {"seqArriveAtVultures"}, - {"seqMakePlan" }, - {"seqShowPlan" }, - {"seqDerbyStart" }, - {"seqLightBales" }, - {"seqNestolusBBQ" }, - {"seqCallSecurity" }, - {"seqFilmFail" }, - {"seqFilmBurn" }, - {"seqRipSpeech" }, - {"seqExposeRip" }, - {"seqRipEscape" }, - {"seqRareMoment" }, - {"seqFanBunnies" }, - {"seqRipDead" }, - {"seqFuneral" }, - {"seqCredits" } -}; - writeRecord(_ftSeqNames, sizeof(_ftSeqNames), GBVARS_FTSEQNAMES_INDEX , GBVARS_SCUMM); -} - -/////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////// - -void addDimuseTables() { - addDimuseTables_digStateMusicMap(); - addDimuseTables_digStateMusicTable(); - addDimuseTables_digSeqMusicTable(); - addDimuseTables_comiStateMusicTable(); - addDimuseTables_comiSeqMusicTable(); - addDimuseTables_ftStateMusicTable(); - addDimuseTables_ftSeqMusicTable(); - addDimuseTables_ftSeqNames(); -}
\ No newline at end of file diff --git a/backends/platform/PalmOS/Src/builder/scumm/smush/bl_codec47.c b/backends/platform/PalmOS/Src/builder/scumm/smush/bl_codec47.c deleted file mode 100644 index 8a3f3e1b99..0000000000 --- a/backends/platform/PalmOS/Src/builder/scumm/smush/bl_codec47.c +++ /dev/null @@ -1,63 +0,0 @@ -#include <PalmOS.h> -#include "b_globals.h" - -static void addCodec47_codec47_table() { - Int8 codec47_table[] = { - 0, 0, -1, -43, 6, -43, -9, -42, 13, -41, - -16, -40, 19, -39, -23, -36, 26, -34, -2, -33, - 4, -33, -29, -32, -9, -32, 11, -31, -16, -29, - 32, -29, 18, -28, -34, -26, -22, -25, -1, -25, - 3, -25, -7, -24, 8, -24, 24, -23, 36, -23, - -12, -22, 13, -21, -38, -20, 0, -20, -27, -19, - -4, -19, 4, -19, -17, -18, -8, -17, 8, -17, - 18, -17, 28, -17, 39, -17, -12, -15, 12, -15, - -21, -14, -1, -14, 1, -14, -41, -13, -5, -13, - 5, -13, 21, -13, -31, -12, -15, -11, -8, -11, - 8, -11, 15, -11, -2, -10, 1, -10, 31, -10, - -23, -9, -11, -9, -5, -9, 4, -9, 11, -9, - 42, -9, 6, -8, 24, -8, -18, -7, -7, -7, - -3, -7, -1, -7, 2, -7, 18, -7, -43, -6, - -13, -6, -4, -6, 4, -6, 8, -6, -33, -5, - -9, -5, -2, -5, 0, -5, 2, -5, 5, -5, - 13, -5, -25, -4, -6, -4, -3, -4, 3, -4, - 9, -4, -19, -3, -7, -3, -4, -3, -2, -3, - -1, -3, 0, -3, 1, -3, 2, -3, 4, -3, - 6, -3, 33, -3, -14, -2, -10, -2, -5, -2, - -3, -2, -2, -2, -1, -2, 0, -2, 1, -2, - 2, -2, 3, -2, 5, -2, 7, -2, 14, -2, - 19, -2, 25, -2, 43, -2, -7, -1, -3, -1, - -2, -1, -1, -1, 0, -1, 1, -1, 2, -1, - 3, -1, 10, -1, -5, 0, -3, 0, -2, 0, - -1, 0, 1, 0, 2, 0, 3, 0, 5, 0, - 7, 0, -10, 1, -7, 1, -3, 1, -2, 1, - -1, 1, 0, 1, 1, 1, 2, 1, 3, 1, - -43, 2, -25, 2, -19, 2, -14, 2, -5, 2, - -3, 2, -2, 2, -1, 2, 0, 2, 1, 2, - 2, 2, 3, 2, 5, 2, 7, 2, 10, 2, - 14, 2, -33, 3, -6, 3, -4, 3, -2, 3, - -1, 3, 0, 3, 1, 3, 2, 3, 4, 3, - 19, 3, -9, 4, -3, 4, 3, 4, 7, 4, - 25, 4, -13, 5, -5, 5, -2, 5, 0, 5, - 2, 5, 5, 5, 9, 5, 33, 5, -8, 6, - -4, 6, 4, 6, 13, 6, 43, 6, -18, 7, - -2, 7, 0, 7, 2, 7, 7, 7, 18, 7, - -24, 8, -6, 8, -42, 9, -11, 9, -4, 9, - 5, 9, 11, 9, 23, 9, -31, 10, -1, 10, - 2, 10, -15, 11, -8, 11, 8, 11, 15, 11, - 31, 12, -21, 13, -5, 13, 5, 13, 41, 13, - -1, 14, 1, 14, 21, 14, -12, 15, 12, 15, - -39, 17, -28, 17, -18, 17, -8, 17, 8, 17, - 17, 18, -4, 19, 0, 19, 4, 19, 27, 19, - 38, 20, -13, 21, 12, 22, -36, 23, -24, 23, - -8, 24, 7, 24, -3, 25, 1, 25, 22, 25, - 34, 26, -18, 28, -32, 29, 16, 29, -11, 31, - 9, 32, 29, 32, -4, 33, 2, 33, -26, 34, - 23, 36, -19, 39, 16, 40, -13, 41, 9, 42, - -6, 43, 1, 43, 0, 0, 0, 0, 0, 0 -}; - writeRecord(codec47_table, sizeof(codec47_table), GBVARS_CODEC47TABLE_INDEX , GBVARS_SCUMM); -} - -void addCodec47() { - addCodec47_codec47_table(); -}
\ No newline at end of file diff --git a/backends/platform/PalmOS/Src/builder/sky/sk_hufftext.c b/backends/platform/PalmOS/Src/builder/sky/sk_hufftext.c deleted file mode 100644 index 36c770eeda..0000000000 --- a/backends/platform/PalmOS/Src/builder/sky/sk_hufftext.c +++ /dev/null @@ -1,2031 +0,0 @@ -#include <PalmOS.h> -#include "b_globals.h" - -typedef struct { - unsigned char lChild; - unsigned char rChild; - unsigned char value; -} HuffTree; - -static void addHufftext_huffTree_00109() { - HuffTree _huffTree_00109[] = { - { 1, 22, 0 }, - { 2, 9, 0 }, - { 3, 6, 0 }, - { 4, 5, 0 }, - { 0, 0, 0x20 }, - { 0, 0, 0x65 }, - { 7, 8, 0 }, - { 0, 0, 0x74 }, - { 0, 0, 0x6F }, - { 10, 17, 0 }, - { 11, 14, 0 }, - { 12, 13, 0 }, - { 0, 0, 0x2E }, - { 0, 0, 0x61 }, - { 15, 16, 0 }, - { 0, 0, 0x00 }, - { 0, 0, 0x73 }, - { 18, 21, 0 }, - { 19, 20, 0 }, - { 0, 0, 0x6E }, - { 0, 0, 0x68 }, - { 0, 0, 0x69 }, - { 23, 46, 0 }, - { 24, 35, 0 }, - { 25, 30, 0 }, - { 26, 29, 0 }, - { 27, 28, 0 }, - { 0, 0, 0x45 }, - { 0, 0, 0x49 }, - { 0, 0, 0x72 }, - { 31, 34, 0 }, - { 32, 33, 0 }, - { 0, 0, 0x54 }, - { 0, 0, 0x75 }, - { 0, 0, 0x6D }, - { 36, 41, 0 }, - { 37, 40, 0 }, - { 38, 39, 0 }, - { 0, 0, 0x6C }, - { 0, 0, 0x79 }, - { 0, 0, 0x4F }, - { 42, 45, 0 }, - { 43, 44, 0 }, - { 0, 0, 0x41 }, - { 0, 0, 0x53 }, - { 0, 0, 0x4E }, - { 47, 66, 0 }, - { 48, 57, 0 }, - { 49, 54, 0 }, - { 50, 53, 0 }, - { 51, 52, 0 }, - { 0, 0, 0x52 }, - { 0, 0, 0x64 }, - { 0, 0, 0x27 }, - { 55, 56, 0 }, - { 0, 0, 0x44 }, - { 0, 0, 0x4C }, - { 58, 63, 0 }, - { 59, 62, 0 }, - { 60, 61, 0 }, - { 0, 0, 0x67 }, - { 0, 0, 0x43 }, - { 0, 0, 0x63 }, - { 64, 65, 0 }, - { 0, 0, 0x48 }, - { 0, 0, 0x21 }, - { 67, 84, 0 }, - { 68, 77, 0 }, - { 69, 74, 0 }, - { 70, 73, 0 }, - { 71, 72, 0 }, - { 0, 0, 0x55 }, - { 0, 0, 0x77 }, - { 0, 0, 0x66 }, - { 75, 76, 0 }, - { 0, 0, 0x50 }, - { 0, 0, 0x4D }, - { 78, 81, 0 }, - { 79, 80, 0 }, - { 0, 0, 0x62 }, - { 0, 0, 0x57 }, - { 82, 83, 0 }, - { 0, 0, 0x3F }, - { 0, 0, 0x47 }, - { 85, 94, 0 }, - { 86, 91, 0 }, - { 87, 90, 0 }, - { 88, 89, 0 }, - { 0, 0, 0x59 }, - { 0, 0, 0x2C }, - { 0, 0, 0x70 }, - { 92, 93, 0 }, - { 0, 0, 0x42 }, - { 0, 0, 0x6B }, - { 95, 100, 0 }, - { 96, 99, 0 }, - { 97, 98, 0 }, - { 0, 0, 0x76 }, - { 0, 0, 0x46 }, - { 0, 0, 0x4B }, - { 101, 106, 0 }, - { 102, 105, 0 }, - { 103, 104, 0 }, - { 0, 0, 0x2D }, - { 0, 0, 0x56 }, - { 0, 0, 0x4A }, - { 107, 120, 0 }, - { 108, 113, 0 }, - { 109, 112, 0 }, - { 110, 111, 0 }, - { 0, 0, 0x3A }, - { 0, 0, 0x58 }, - { 0, 0, 0x6A }, - { 114, 117, 0 }, - { 115, 116, 0 }, - { 0, 0, 0x60 }, - { 0, 0, 0x5A }, - { 118, 119, 0 }, - { 0, 0, 0x78 }, - { 0, 0, 0x30 }, - { 121, 132, 0 }, - { 122, 127, 0 }, - { 123, 126, 0 }, - { 124, 125, 0 }, - { 0, 0, 0x32 }, - { 0, 0, 0x31 }, - { 0, 0, 0x51 }, - { 128, 131, 0 }, - { 129, 130, 0 }, - { 0, 0, 0x33 }, - { 0, 0, 0x39 }, - { 0, 0, 0x71 }, - { 133, 142, 0 }, - { 134, 137, 0 }, - { 135, 136, 0 }, - { 0, 0, 0x34 }, - { 0, 0, 0x38 }, - { 138, 141, 0 }, - { 139, 140, 0 }, - { 0, 0, 0x35 }, - { 0, 0, 0x7A }, - { 0, 0, 0x26 }, - { 143, 150, 0 }, - { 144, 147, 0 }, - { 145, 146, 0 }, - { 0, 0, 0x36 }, - { 0, 0, 0x29 }, - { 148, 149, 0 }, - { 0, 0, 0x28 }, - { 0, 0, 0x37 }, - { 151, 158, 0 }, - { 152, 155, 0 }, - { 153, 154, 0 }, - { 0, 0, 0x24 }, - { 0, 0, 0x22 }, - { 156, 157, 0 }, - { 0, 0, 0x2F }, - { 0, 0, 0x3C }, - { 159, 162, 0 }, - { 160, 161, 0 }, - { 0, 0, 0x3E }, - { 0, 0, 0x25 }, - { 163, 164, 0 }, - { 0, 0, 0x23 }, - { 165, 166, 0 }, - { 0, 0, 0x5F }, - { 0, 0, 0x7C } - }; - writeRecord(_huffTree_00109, sizeof(_huffTree_00109), GBVARS_HUFFTREE_00109_INDEX , GBVARS_SKY); -} - -static void addHufftext_huffTree_00267() { - HuffTree _huffTree_00267[] = { - { 1, 20, 0 }, - { 2, 7, 0 }, - { 3, 6, 0 }, - { 4, 5, 0 }, - { 0, 0, 0x20 }, - { 0, 0, 0x65 }, - { 0, 0, 0x73 }, - { 8, 15, 0 }, - { 9, 12, 0 }, - { 10, 11, 0 }, - { 0, 0, 0x6d }, - { 0, 0, 0x61 }, - { 13, 14, 0 }, - { 0, 0, 0x0 }, - { 0, 0, 0x6e }, - { 16, 19, 0 }, - { 17, 18, 0 }, - { 0, 0, 0x69 }, - { 0, 0, 0x74 }, - { 0, 0, 0x75 }, - { 21, 44, 0 }, - { 22, 31, 0 }, - { 23, 28, 0 }, - { 24, 27, 0 }, - { 25, 26, 0 }, - { 0, 0, 0x2e }, - { 0, 0, 0x72 }, - { 0, 0, 0x45 }, - { 29, 30, 0 }, - { 0, 0, 0x6f }, - { 0, 0, 0x68 }, - { 32, 39, 0 }, - { 33, 36, 0 }, - { 34, 35, 0 }, - { 0, 0, 0x44 }, - { 0, 0, 0x67 }, - { 37, 38, 0 }, - { 0, 0, 0x49 }, - { 0, 0, 0x79 }, - { 40, 43, 0 }, - { 41, 42, 0 }, - { 0, 0, 0x53 }, - { 0, 0, 0x64 }, - { 0, 0, 0x6c }, - { 45, 64, 0 }, - { 46, 53, 0 }, - { 47, 50, 0 }, - { 48, 49, 0 }, - { 0, 0, 0x54 }, - { 0, 0, 0x4e }, - { 51, 52, 0 }, - { 0, 0, 0x63 }, - { 0, 0, 0x52 }, - { 54, 59, 0 }, - { 55, 58, 0 }, - { 56, 57, 0 }, - { 0, 0, 0x41 }, - { 0, 0, 0x4f }, - { 0, 0, 0x4c }, - { 60, 63, 0 }, - { 61, 62, 0 }, - { 0, 0, 0x48 }, - { 0, 0, 0x43 }, - { 0, 0, 0x55 }, - { 65, 84, 0 }, - { 66, 75, 0 }, - { 67, 72, 0 }, - { 68, 71, 0 }, - { 69, 70, 0 }, - { 0, 0, 0x62 }, - { 0, 0, 0x21 }, - { 0, 0, 0x27 }, - { 73, 74, 0 }, - { 0, 0, 0x77 }, - { 0, 0, 0x66 }, - { 76, 81, 0 }, - { 77, 80, 0 }, - { 78, 79, 0 }, - { 0, 0, 0x47 }, - { 0, 0, 0x4d }, - { 0, 0, 0x2c }, - { 82, 83, 0 }, - { 0, 0, 0x57 }, - { 0, 0, 0x42 }, - { 85, 98, 0 }, - { 86, 93, 0 }, - { 87, 90, 0 }, - { 88, 89, 0 }, - { 0, 0, 0x3f }, - { 0, 0, 0x50 }, - { 91, 92, 0 }, - { 0, 0, 0x6b }, - { 0, 0, 0x70 }, - { 94, 97, 0 }, - { 95, 96, 0 }, - { 0, 0, 0x76 }, - { 0, 0, 0x46 }, - { 0, 0, 0x4b }, - { 99, 110, 0 }, - { 100, 105, 0 }, - { 101, 104, 0 }, - { 102, 103, 0 }, - { 0, 0, 0x56 }, - { 0, 0, 0x59 }, - { 0, 0, 0x7a }, - { 106, 109, 0 }, - { 107, 108, 0 }, - { 0, 0, 0x2d }, - { 0, 0, 0x23 }, - { 0, 0, 0x4a }, - { 111, 124, 0 }, - { 112, 117, 0 }, - { 113, 116, 0 }, - { 114, 115, 0 }, - { 0, 0, 0x5a }, - { 0, 0, 0x28 }, - { 0, 0, 0x29 }, - { 118, 121, 0 }, - { 119, 120, 0 }, - { 0, 0, 0x6a }, - { 0, 0, 0x2b }, - { 122, 123, 0 }, - { 0, 0, 0x2a }, - { 0, 0, 0x71 }, - { 125, 138, 0 }, - { 126, 131, 0 }, - { 127, 130, 0 }, - { 128, 129, 0 }, - { 0, 0, 0x7d }, - { 0, 0, 0x3a }, - { 0, 0, 0x60 }, - { 132, 135, 0 }, - { 133, 134, 0 }, - { 0, 0, 0x30 }, - { 0, 0, 0x32 }, - { 136, 137, 0 }, - { 0, 0, 0x31 }, - { 0, 0, 0x51 }, - { 139, 150, 0 }, - { 140, 145, 0 }, - { 141, 144, 0 }, - { 142, 143, 0 }, - { 0, 0, 0x58 }, - { 0, 0, 0x78 }, - { 0, 0, 0x33 }, - { 146, 149, 0 }, - { 147, 148, 0 }, - { 0, 0, 0x39 }, - { 0, 0, 0x34 }, - { 0, 0, 0x3c }, - { 151, 160, 0 }, - { 152, 157, 0 }, - { 153, 156, 0 }, - { 154, 155, 0 }, - { 0, 0, 0x38 }, - { 0, 0, 0x5d }, - { 0, 0, 0x3d }, - { 158, 159, 0 }, - { 0, 0, 0x26 }, - { 0, 0, 0x35 }, - { 161, 168, 0 }, - { 162, 165, 0 }, - { 163, 164, 0 }, - { 0, 0, 0x36 }, - { 0, 0, 0x2f }, - { 166, 167, 0 }, - { 0, 0, 0x37 }, - { 0, 0, 0x24 }, - { 169, 174, 0 }, - { 170, 173, 0 }, - { 171, 172, 0 }, - { 0, 0, 0x3e }, - { 0, 0, 0x25 }, - { 0, 0, 0x5e }, - { 175, 180, 0 }, - { 176, 179, 0 }, - { 177, 178, 0 }, - { 0, 0, 0x22 }, - { 0, 0, 0x40 }, - { 0, 0, 0x5b }, - { 181, 184, 0 }, - { 182, 183, 0 }, - { 0, 0, 0x5f }, - { 0, 0, 0x7b }, - { 185, 186, 0 }, - { 0, 0, 0x5c }, - { 0, 0, 0x7c }, - }; - writeRecord(_huffTree_00267, sizeof(_huffTree_00267), GBVARS_HUFFTREE_00267_INDEX , GBVARS_SKY); -} - -static void addHufftext_huffTree_00288() { - HuffTree _huffTree_00288[] = { - { 1, 20, 0 }, - { 2, 7, 0 }, - { 3, 4, 0 }, - { 0, 0, 0x20 }, - { 5, 6, 0 }, - { 0, 0, 0x65 }, - { 0, 0, 0x73 }, - { 8, 15, 0 }, - { 9, 12, 0 }, - { 10, 11, 0 }, - { 0, 0, 0x6e }, - { 0, 0, 0x69 }, - { 13, 14, 0 }, - { 0, 0, 0x74 }, - { 0, 0, 0x61 }, - { 16, 19, 0 }, - { 17, 18, 0 }, - { 0, 0, 0x2e }, - { 0, 0, 0x0 }, - { 0, 0, 0x45 }, - { 21, 44, 0 }, - { 22, 31, 0 }, - { 23, 28, 0 }, - { 24, 27, 0 }, - { 25, 26, 0 }, - { 0, 0, 0x72 }, - { 0, 0, 0x6f }, - { 0, 0, 0x75 }, - { 29, 30, 0 }, - { 0, 0, 0x6d }, - { 0, 0, 0x68 }, - { 32, 39, 0 }, - { 33, 36, 0 }, - { 34, 35, 0 }, - { 0, 0, 0x49 }, - { 0, 0, 0x6c }, - { 37, 38, 0 }, - { 0, 0, 0x53 }, - { 0, 0, 0x52 }, - { 40, 43, 0 }, - { 41, 42, 0 }, - { 0, 0, 0x64 }, - { 0, 0, 0x4e }, - { 0, 0, 0x54 }, - { 45, 68, 0 }, - { 46, 55, 0 }, - { 47, 52, 0 }, - { 48, 51, 0 }, - { 49, 50, 0 }, - { 0, 0, 0x63 }, - { 0, 0, 0x41 }, - { 0, 0, 0x4f }, - { 53, 54, 0 }, - { 0, 0, 0x44 }, - { 0, 0, 0x4c }, - { 56, 63, 0 }, - { 57, 60, 0 }, - { 58, 59, 0 }, - { 0, 0, 0x43 }, - { 0, 0, 0x67 }, - { 61, 62, 0 }, - { 0, 0, 0x55 }, - { 0, 0, 0x27 }, - { 64, 67, 0 }, - { 65, 66, 0 }, - { 0, 0, 0x79 }, - { 0, 0, 0x48 }, - { 0, 0, 0x70 }, - { 69, 88, 0 }, - { 70, 79, 0 }, - { 71, 76, 0 }, - { 72, 75, 0 }, - { 73, 74, 0 }, - { 0, 0, 0x21 }, - { 0, 0, 0x4d }, - { 0, 0, 0x62 }, - { 77, 78, 0 }, - { 0, 0, 0x76 }, - { 0, 0, 0x2c }, - { 80, 85, 0 }, - { 81, 84, 0 }, - { 82, 83, 0 }, - { 0, 0, 0x50 }, - { 0, 0, 0x66 }, - { 0, 0, 0x3f }, - { 86, 87, 0 }, - { 0, 0, 0x47 }, - { 0, 0, 0x42 }, - { 89, 104, 0 }, - { 90, 97, 0 }, - { 91, 94, 0 }, - { 92, 93, 0 }, - { 0, 0, 0x77 }, - { 0, 0, 0x57 }, - { 95, 96, 0 }, - { 0, 0, 0x46 }, - { 0, 0, 0x56 }, - { 98, 101, 0 }, - { 99, 100, 0 }, - { 0, 0, 0x6b }, - { 0, 0, 0x7a }, - { 102, 103, 0 }, - { 0, 0, 0x4b }, - { 0, 0, 0x2d }, - { 105, 116, 0 }, - { 106, 111, 0 }, - { 107, 110, 0 }, - { 108, 109, 0 }, - { 0, 0, 0x4a }, - { 0, 0, 0x2b }, - { 0, 0, 0x71 }, - { 112, 115, 0 }, - { 113, 114, 0 }, - { 0, 0, 0x59 }, - { 0, 0, 0x6a }, - { 0, 0, 0x5a }, - { 117, 132, 0 }, - { 118, 125, 0 }, - { 119, 122, 0 }, - { 120, 121, 0 }, - { 0, 0, 0x23 }, - { 0, 0, 0x51 }, - { 123, 124, 0 }, - { 0, 0, 0x28 }, - { 0, 0, 0x29 }, - { 126, 129, 0 }, - { 127, 128, 0 }, - { 0, 0, 0x3c }, - { 0, 0, 0x78 }, - { 130, 131, 0 }, - { 0, 0, 0x3a }, - { 0, 0, 0x2a }, - { 133, 146, 0 }, - { 134, 141, 0 }, - { 135, 138, 0 }, - { 136, 137, 0 }, - { 0, 0, 0x58 }, - { 0, 0, 0x7d }, - { 139, 140, 0 }, - { 0, 0, 0x3d }, - { 0, 0, 0x60 }, - { 142, 145, 0 }, - { 143, 144, 0 }, - { 0, 0, 0x5d }, - { 0, 0, 0x30 }, - { 0, 0, 0x32 }, - { 147, 158, 0 }, - { 148, 153, 0 }, - { 149, 152, 0 }, - { 150, 151, 0 }, - { 0, 0, 0x31 }, - { 0, 0, 0x33 }, - { 0, 0, 0x39 }, - { 154, 157, 0 }, - { 155, 156, 0 }, - { 0, 0, 0x2f }, - { 0, 0, 0x34 }, - { 0, 0, 0x5e }, - { 159, 168, 0 }, - { 160, 165, 0 }, - { 161, 164, 0 }, - { 162, 163, 0 }, - { 0, 0, 0x38 }, - { 0, 0, 0x3e }, - { 0, 0, 0x26 }, - { 166, 167, 0 }, - { 0, 0, 0x35 }, - { 0, 0, 0x40 }, - { 169, 176, 0 }, - { 170, 173, 0 }, - { 171, 172, 0 }, - { 0, 0, 0x36 }, - { 0, 0, 0x5f }, - { 174, 175, 0 }, - { 0, 0, 0x5c }, - { 0, 0, 0x37 }, - { 177, 182, 0 }, - { 178, 181, 0 }, - { 179, 180, 0 }, - { 0, 0, 0x5b }, - { 0, 0, 0x24 }, - { 0, 0, 0x7b }, - { 183, 186, 0 }, - { 184, 185, 0 }, - { 0, 0, 0x25 }, - { 0, 0, 0x9 }, - { 187, 188, 0 }, - { 0, 0, 0x22 }, - { 0, 0, 0x7c }, - }; - writeRecord(_huffTree_00288, sizeof(_huffTree_00288), GBVARS_HUFFTREE_00288_INDEX , GBVARS_SKY); -} - -static void addHufftext_huffTree_00303() { - HuffTree _huffTree_00303[] = { - { 1, 22, 0 }, - { 2, 9, 0 }, - { 3, 6, 0 }, - { 4, 5, 0 }, - { 0, 0, 0x20 }, - { 0, 0, 0x65 }, - { 7, 8, 0 }, - { 0, 0, 0x74 }, - { 0, 0, 0x73 }, - { 10, 17, 0 }, - { 11, 14, 0 }, - { 12, 13, 0 }, - { 0, 0, 0x6e }, - { 0, 0, 0x61 }, - { 15, 16, 0 }, - { 0, 0, 0x69 }, - { 0, 0, 0x2e }, - { 18, 21, 0 }, - { 19, 20, 0 }, - { 0, 0, 0x6f }, - { 0, 0, 0x0 }, - { 0, 0, 0x45 }, - { 23, 46, 0 }, - { 24, 35, 0 }, - { 25, 30, 0 }, - { 26, 29, 0 }, - { 27, 28, 0 }, - { 0, 0, 0x72 }, - { 0, 0, 0x75 }, - { 0, 0, 0x68 }, - { 31, 34, 0 }, - { 32, 33, 0 }, - { 0, 0, 0x49 }, - { 0, 0, 0x6d }, - { 0, 0, 0x6c }, - { 36, 41, 0 }, - { 37, 40, 0 }, - { 38, 39, 0 }, - { 0, 0, 0x54 }, - { 0, 0, 0x53 }, - { 0, 0, 0x52 }, - { 42, 45, 0 }, - { 43, 44, 0 }, - { 0, 0, 0x64 }, - { 0, 0, 0x4e }, - { 0, 0, 0x41 }, - { 47, 70, 0 }, - { 48, 59, 0 }, - { 49, 54, 0 }, - { 50, 53, 0 }, - { 51, 52, 0 }, - { 0, 0, 0x63 }, - { 0, 0, 0x4f }, - { 0, 0, 0x44 }, - { 55, 58, 0 }, - { 56, 57, 0 }, - { 0, 0, 0x4c }, - { 0, 0, 0x43 }, - { 0, 0, 0x79 }, - { 60, 65, 0 }, - { 61, 64, 0 }, - { 62, 63, 0 }, - { 0, 0, 0x67 }, - { 0, 0, 0x27 }, - { 0, 0, 0x55 }, - { 66, 69, 0 }, - { 67, 68, 0 }, - { 0, 0, 0x48 }, - { 0, 0, 0x21 }, - { 0, 0, 0x70 }, - { 71, 88, 0 }, - { 72, 81, 0 }, - { 73, 78, 0 }, - { 74, 77, 0 }, - { 75, 76, 0 }, - { 0, 0, 0x4d }, - { 0, 0, 0x62 }, - { 0, 0, 0x3f }, - { 79, 80, 0 }, - { 0, 0, 0x76 }, - { 0, 0, 0x66 }, - { 82, 85, 0 }, - { 83, 84, 0 }, - { 0, 0, 0x50 }, - { 0, 0, 0x2c }, - { 86, 87, 0 }, - { 0, 0, 0x77 }, - { 0, 0, 0x47 }, - { 89, 102, 0 }, - { 90, 95, 0 }, - { 91, 94, 0 }, - { 92, 93, 0 }, - { 0, 0, 0x42 }, - { 0, 0, 0x57 }, - { 0, 0, 0x6b }, - { 96, 99, 0 }, - { 97, 98, 0 }, - { 0, 0, 0x46 }, - { 0, 0, 0x56 }, - { 100, 101, 0 }, - { 0, 0, 0x59 }, - { 0, 0, 0x4b }, - { 103, 114, 0 }, - { 104, 109, 0 }, - { 105, 108, 0 }, - { 106, 107, 0 }, - { 0, 0, 0x2d }, - { 0, 0, 0x7a }, - { 0, 0, 0x4a }, - { 110, 113, 0 }, - { 111, 112, 0 }, - { 0, 0, 0x71 }, - { 0, 0, 0x2b }, - { 0, 0, 0x6a }, - { 115, 132, 0 }, - { 116, 123, 0 }, - { 117, 120, 0 }, - { 118, 119, 0 }, - { 0, 0, 0x5a }, - { 0, 0, 0x23 }, - { 121, 122, 0 }, - { 0, 0, 0x51 }, - { 0, 0, 0x78 }, - { 124, 129, 0 }, - { 125, 128, 0 }, - { 126, 127, 0 }, - { 0, 0, 0x3a }, - { 0, 0, 0x29 }, - { 0, 0, 0x28 }, - { 130, 131, 0 }, - { 0, 0, 0x3c }, - { 0, 0, 0x58 }, - { 133, 148, 0 }, - { 134, 141, 0 }, - { 135, 138, 0 }, - { 136, 137, 0 }, - { 0, 0, 0x2a }, - { 0, 0, 0x60 }, - { 139, 140, 0 }, - { 0, 0, 0x7d }, - { 0, 0, 0x3d }, - { 142, 145, 0 }, - { 143, 144, 0 }, - { 0, 0, 0x32 }, - { 0, 0, 0x30 }, - { 146, 147, 0 }, - { 0, 0, 0x5d }, - { 0, 0, 0x31 }, - { 149, 160, 0 }, - { 150, 155, 0 }, - { 151, 154, 0 }, - { 152, 153, 0 }, - { 0, 0, 0x7e }, - { 0, 0, 0x33 }, - { 0, 0, 0x7f }, - { 156, 159, 0 }, - { 157, 158, 0 }, - { 0, 0, 0x39 }, - { 0, 0, 0x34 }, - { 0, 0, 0x2f }, - { 161, 172, 0 }, - { 162, 167, 0 }, - { 163, 166, 0 }, - { 164, 165, 0 }, - { 0, 0, 0x38 }, - { 0, 0, 0x5e }, - { 0, 0, 0x26 }, - { 168, 171, 0 }, - { 169, 170, 0 }, - { 0, 0, 0x35 }, - { 0, 0, 0x36 }, - { 0, 0, 0x3e }, - { 173, 182, 0 }, - { 174, 179, 0 }, - { 175, 178, 0 }, - { 176, 177, 0 }, - { 0, 0, 0x40 }, - { 0, 0, 0x37 }, - { 0, 0, 0x5f }, - { 180, 181, 0 }, - { 0, 0, 0x5c }, - { 0, 0, 0x24 }, - { 183, 190, 0 }, - { 184, 187, 0 }, - { 185, 186, 0 }, - { 0, 0, 0x5b }, - { 0, 0, 0x80 }, - { 188, 189, 0 }, - { 0, 0, 0x81 }, - { 0, 0, 0x22 }, - { 191, 194, 0 }, - { 192, 193, 0 }, - { 0, 0, 0x25 }, - { 0, 0, 0x82 }, - { 195, 196, 0 }, - { 0, 0, 0x7b }, - { 197, 198, 0 }, - { 0, 0, 0x9 }, - { 0, 0, 0x7c }, - }; - writeRecord(_huffTree_00303, sizeof(_huffTree_00303), GBVARS_HUFFTREE_00303_INDEX , GBVARS_SKY); -} - -static void addHufftext_huffTree_00331() { - HuffTree _huffTree_00331[] = { - { 1, 20, 0 }, - { 2, 7, 0 }, - { 3, 4, 0 }, - { 0, 0, 0x20 }, - { 5, 6, 0 }, - { 0, 0, 0x65 }, - { 0, 0, 0x61 }, - { 8, 15, 0 }, - { 9, 12, 0 }, - { 10, 11, 0 }, - { 0, 0, 0x6f }, - { 0, 0, 0x73 }, - { 13, 14, 0 }, - { 0, 0, 0x74 }, - { 0, 0, 0x6e }, - { 16, 19, 0 }, - { 17, 18, 0 }, - { 0, 0, 0x2e }, - { 0, 0, 0x69 }, - { 0, 0, 0x72 }, - { 21, 44, 0 }, - { 22, 31, 0 }, - { 23, 28, 0 }, - { 24, 27, 0 }, - { 25, 26, 0 }, - { 0, 0, 0x0 }, - { 0, 0, 0x45 }, - { 0, 0, 0x75 }, - { 29, 30, 0 }, - { 0, 0, 0x6d }, - { 0, 0, 0x41 }, - { 32, 39, 0 }, - { 33, 36, 0 }, - { 34, 35, 0 }, - { 0, 0, 0x6c }, - { 0, 0, 0x49 }, - { 37, 38, 0 }, - { 0, 0, 0x64 }, - { 0, 0, 0x52 }, - { 40, 43, 0 }, - { 41, 42, 0 }, - { 0, 0, 0x4e }, - { 0, 0, 0x53 }, - { 0, 0, 0x54 }, - { 45, 68, 0 }, - { 46, 55, 0 }, - { 47, 52, 0 }, - { 48, 51, 0 }, - { 49, 50, 0 }, - { 0, 0, 0x4f }, - { 0, 0, 0x68 }, - { 0, 0, 0x63 }, - { 53, 54, 0 }, - { 0, 0, 0x44 }, - { 0, 0, 0x67 }, - { 56, 63, 0 }, - { 57, 60, 0 }, - { 58, 59, 0 }, - { 0, 0, 0x4c }, - { 0, 0, 0x43 }, - { 61, 62, 0 }, - { 0, 0, 0x70 }, - { 0, 0, 0x55 }, - { 64, 67, 0 }, - { 65, 66, 0 }, - { 0, 0, 0x21 }, - { 0, 0, 0x79 }, - { 0, 0, 0x4d }, - { 69, 88, 0 }, - { 70, 79, 0 }, - { 71, 76, 0 }, - { 72, 75, 0 }, - { 73, 74, 0 }, - { 0, 0, 0x50 }, - { 0, 0, 0x76 }, - { 0, 0, 0x48 }, - { 77, 78, 0 }, - { 0, 0, 0x3f }, - { 0, 0, 0x62 }, - { 80, 85, 0 }, - { 81, 84, 0 }, - { 82, 83, 0 }, - { 0, 0, 0x27 }, - { 0, 0, 0x66 }, - { 0, 0, 0x2c }, - { 86, 87, 0 }, - { 0, 0, 0x47 }, - { 0, 0, 0x42 }, - { 89, 108, 0 }, - { 90, 99, 0 }, - { 91, 96, 0 }, - { 92, 95, 0 }, - { 93, 94, 0 }, - { 0, 0, 0x56 }, - { 0, 0, 0x6b }, - { 0, 0, 0x46 }, - { 97, 98, 0 }, - { 0, 0, 0x71 }, - { 0, 0, 0x2a }, - { 100, 105, 0 }, - { 101, 104, 0 }, - { 102, 103, 0 }, - { 0, 0, 0x77 }, - { 0, 0, 0x4b }, - { 0, 0, 0x2d }, - { 106, 107, 0 }, - { 0, 0, 0x57 }, - { 0, 0, 0x4a }, - { 109, 126, 0 }, - { 110, 117, 0 }, - { 111, 114, 0 }, - { 112, 113, 0 }, - { 0, 0, 0x7a }, - { 0, 0, 0x2b }, - { 115, 116, 0 }, - { 0, 0, 0x59 }, - { 0, 0, 0x6a }, - { 118, 123, 0 }, - { 119, 122, 0 }, - { 120, 121, 0 }, - { 0, 0, 0x85 }, - { 0, 0, 0x29 }, - { 0, 0, 0x51 }, - { 124, 125, 0 }, - { 0, 0, 0x5a }, - { 0, 0, 0x7e }, - { 127, 148, 0 }, - { 128, 137, 0 }, - { 129, 134, 0 }, - { 130, 133, 0 }, - { 131, 132, 0 }, - { 0, 0, 0x8b }, - { 0, 0, 0x3c }, - { 0, 0, 0x8a }, - { 135, 136, 0 }, - { 0, 0, 0x7f }, - { 0, 0, 0x3a }, - { 138, 143, 0 }, - { 139, 142, 0 }, - { 140, 141, 0 }, - { 0, 0, 0x87 }, - { 0, 0, 0x23 }, - { 0, 0, 0x78 }, - { 144, 147, 0 }, - { 145, 146, 0 }, - { 0, 0, 0x58 }, - { 0, 0, 0x91 }, - { 0, 0, 0x83 }, - { 149, 168, 0 }, - { 150, 159, 0 }, - { 151, 156, 0 }, - { 152, 155, 0 }, - { 153, 154, 0 }, - { 0, 0, 0x88 }, - { 0, 0, 0x60 }, - { 0, 0, 0x32 }, - { 157, 158, 0 }, - { 0, 0, 0x30 }, - { 0, 0, 0x31 }, - { 160, 165, 0 }, - { 161, 164, 0 }, - { 162, 163, 0 }, - { 0, 0, 0x28 }, - { 0, 0, 0x2f }, - { 0, 0, 0x5d }, - { 166, 167, 0 }, - { 0, 0, 0x3d }, - { 0, 0, 0x86 }, - { 169, 184, 0 }, - { 170, 177, 0 }, - { 171, 174, 0 }, - { 172, 173, 0 }, - { 0, 0, 0x5e }, - { 0, 0, 0x33 }, - { 175, 176, 0 }, - { 0, 0, 0x39 }, - { 0, 0, 0x34 }, - { 178, 181, 0 }, - { 179, 180, 0 }, - { 0, 0, 0x7d }, - { 0, 0, 0x38 }, - { 182, 183, 0 }, - { 0, 0, 0x5c }, - { 0, 0, 0x22 }, - { 185, 198, 0 }, - { 186, 193, 0 }, - { 187, 190, 0 }, - { 188, 189, 0 }, - { 0, 0, 0x3e }, - { 0, 0, 0x26 }, - { 191, 192, 0 }, - { 0, 0, 0x8d }, - { 0, 0, 0x7b }, - { 194, 197, 0 }, - { 195, 196, 0 }, - { 0, 0, 0x35 }, - { 0, 0, 0x36 }, - { 0, 0, 0x8f }, - { 199, 210, 0 }, - { 200, 205, 0 }, - { 201, 204, 0 }, - { 202, 203, 0 }, - { 0, 0, 0x8e }, - { 0, 0, 0x8c }, - { 0, 0, 0x37 }, - { 206, 209, 0 }, - { 207, 208, 0 }, - { 0, 0, 0x89 }, - { 0, 0, 0x24 }, - { 0, 0, 0x92 }, - { 211, 218, 0 }, - { 212, 215, 0 }, - { 213, 214, 0 }, - { 0, 0, 0x5b }, - { 0, 0, 0x80 }, - { 216, 217, 0 }, - { 0, 0, 0x81 }, - { 0, 0, 0x40 }, - { 219, 222, 0 }, - { 220, 221, 0 }, - { 0, 0, 0x5f }, - { 0, 0, 0x82 }, - { 223, 224, 0 }, - { 0, 0, 0x25 }, - { 225, 226, 0 }, - { 0, 0, 0x9 }, - { 227, 228, 0 }, - { 0, 0, 0x3b }, - { 0, 0, 0x7c }, - }; - writeRecord(_huffTree_00331, sizeof(_huffTree_00331), GBVARS_HUFFTREE_00331_INDEX , GBVARS_SKY); -} - -static void addHufftext_huffTree_00348() { - HuffTree _huffTree_00348[] = { - { 1, 20, 0 }, - { 2, 7, 0 }, - { 3, 4, 0 }, - { 0, 0, 0x20 }, - { 5, 6, 0 }, - { 0, 0, 0x65 }, - { 0, 0, 0x61 }, - { 8, 15, 0 }, - { 9, 12, 0 }, - { 10, 11, 0 }, - { 0, 0, 0x6F }, - { 0, 0, 0x73 }, - { 13, 14, 0 }, - { 0, 0, 0x74 }, - { 0, 0, 0x6E }, - { 16, 19, 0 }, - { 17, 18, 0 }, - { 0, 0, 0x2E }, - { 0, 0, 0x69 }, - { 0, 0, 0x72 }, - { 21, 44, 0 }, - { 22, 31, 0 }, - { 23, 28, 0 }, - { 24, 27, 0 }, - { 25, 26, 0 }, - { 0, 0, 0x00 }, - { 0, 0, 0x45 }, - { 0, 0, 0x75 }, - { 29, 30, 0 }, - { 0, 0, 0x6D }, - { 0, 0, 0x41 }, - { 32, 39, 0 }, - { 33, 36, 0 }, - { 34, 35, 0 }, - { 0, 0, 0x6C }, - { 0, 0, 0x49 }, - { 37, 38, 0 }, - { 0, 0, 0x64 }, - { 0, 0, 0x52 }, - { 40, 43, 0 }, - { 41, 42, 0 }, - { 0, 0, 0x4E }, - { 0, 0, 0x53 }, - { 0, 0, 0x54 }, - { 45, 68, 0 }, - { 46, 55, 0 }, - { 47, 52, 0 }, - { 48, 51, 0 }, - { 49, 50, 0 }, - { 0, 0, 0x4F }, - { 0, 0, 0x68 }, - { 0, 0, 0x63 }, - { 53, 54, 0 }, - { 0, 0, 0x44 }, - { 0, 0, 0x67 }, - { 56, 63, 0 }, - { 57, 60, 0 }, - { 58, 59, 0 }, - { 0, 0, 0x4C }, - { 0, 0, 0x43 }, - { 61, 62, 0 }, - { 0, 0, 0x70 }, - { 0, 0, 0x55 }, - { 64, 67, 0 }, - { 65, 66, 0 }, - { 0, 0, 0x21 }, - { 0, 0, 0x79 }, - { 0, 0, 0x4D }, - { 69, 88, 0 }, - { 70, 79, 0 }, - { 71, 76, 0 }, - { 72, 75, 0 }, - { 73, 74, 0 }, - { 0, 0, 0x50 }, - { 0, 0, 0x76 }, - { 0, 0, 0x48 }, - { 77, 78, 0 }, - { 0, 0, 0x3F }, - { 0, 0, 0x62 }, - { 80, 85, 0 }, - { 81, 84, 0 }, - { 82, 83, 0 }, - { 0, 0, 0x27 }, - { 0, 0, 0x66 }, - { 0, 0, 0x2C }, - { 86, 87, 0 }, - { 0, 0, 0x47 }, - { 0, 0, 0x42 }, - { 89, 108, 0 }, - { 90, 99, 0 }, - { 91, 96, 0 }, - { 92, 95, 0 }, - { 93, 94, 0 }, - { 0, 0, 0x56 }, - { 0, 0, 0x6B }, - { 0, 0, 0x46 }, - { 97, 98, 0 }, - { 0, 0, 0x71 }, - { 0, 0, 0x77 }, - { 100, 105, 0 }, - { 101, 104, 0 }, - { 102, 103, 0 }, - { 0, 0, 0x4B }, - { 0, 0, 0x2D }, - { 0, 0, 0x57 }, - { 106, 107, 0 }, - { 0, 0, 0x4A }, - { 0, 0, 0x2A }, - { 109, 128, 0 }, - { 110, 117, 0 }, - { 111, 114, 0 }, - { 112, 113, 0 }, - { 0, 0, 0x7A }, - { 0, 0, 0x59 }, - { 115, 116, 0 }, - { 0, 0, 0x6A }, - { 0, 0, 0x2B }, - { 118, 123, 0 }, - { 119, 122, 0 }, - { 120, 121, 0 }, - { 0, 0, 0x51 }, - { 0, 0, 0x29 }, - { 0, 0, 0x85 }, - { 124, 127, 0 }, - { 125, 126, 0 }, - { 0, 0, 0x5A }, - { 0, 0, 0x8B }, - { 0, 0, 0x3C }, - { 129, 150, 0 }, - { 130, 139, 0 }, - { 131, 136, 0 }, - { 132, 135, 0 }, - { 133, 134, 0 }, - { 0, 0, 0x95 }, - { 0, 0, 0x7E }, - { 0, 0, 0x8A }, - { 137, 138, 0 }, - { 0, 0, 0x87 }, - { 0, 0, 0x3A }, - { 140, 145, 0 }, - { 141, 144, 0 }, - { 142, 143, 0 }, - { 0, 0, 0x7F }, - { 0, 0, 0x5D }, - { 0, 0, 0x23 }, - { 146, 149, 0 }, - { 147, 148, 0 }, - { 0, 0, 0x78 }, - { 0, 0, 0x58 }, - { 0, 0, 0x91 }, - { 151, 172, 0 }, - { 152, 163, 0 }, - { 153, 158, 0 }, - { 154, 157, 0 }, - { 155, 156, 0 }, - { 0, 0, 0x88 }, - { 0, 0, 0x60 }, - { 0, 0, 0x32 }, - { 159, 162, 0 }, - { 160, 161, 0 }, - { 0, 0, 0x30 }, - { 0, 0, 0x83 }, - { 0, 0, 0x31 }, - { 164, 169, 0 }, - { 165, 168, 0 }, - { 166, 167, 0 }, - { 0, 0, 0x2F }, - { 0, 0, 0x28 }, - { 0, 0, 0x3D }, - { 170, 171, 0 }, - { 0, 0, 0x86 }, - { 0, 0, 0x5E }, - { 173, 190, 0 }, - { 174, 181, 0 }, - { 175, 178, 0 }, - { 176, 177, 0 }, - { 0, 0, 0x33 }, - { 0, 0, 0x39 }, - { 179, 180, 0 }, - { 0, 0, 0x98 }, - { 0, 0, 0x34 }, - { 182, 187, 0 }, - { 183, 186, 0 }, - { 184, 185, 0 }, - { 0, 0, 0x7D }, - { 0, 0, 0x38 }, - { 0, 0, 0x5C }, - { 188, 189, 0 }, - { 0, 0, 0x22 }, - { 0, 0, 0x9B }, - { 191, 206, 0 }, - { 192, 199, 0 }, - { 193, 196, 0 }, - { 194, 195, 0 }, - { 0, 0, 0x26 }, - { 0, 0, 0x8D }, - { 197, 198, 0 }, - { 0, 0, 0x35 }, - { 0, 0, 0x36 }, - { 200, 203, 0 }, - { 201, 202, 0 }, - { 0, 0, 0x92 }, - { 0, 0, 0x8F }, - { 204, 205, 0 }, - { 0, 0, 0x8E }, - { 0, 0, 0x93 }, - { 207, 222, 0 }, - { 208, 215, 0 }, - { 209, 212, 0 }, - { 210, 211, 0 }, - { 0, 0, 0x8C }, - { 0, 0, 0x37 }, - { 213, 214, 0 }, - { 0, 0, 0x99 }, - { 0, 0, 0x24 }, - { 216, 219, 0 }, - { 217, 218, 0 }, - { 0, 0, 0x80 }, - { 0, 0, 0x81 }, - { 220, 221, 0 }, - { 0, 0, 0x40 }, - { 0, 0, 0x5B }, - { 223, 232, 0 }, - { 224, 229, 0 }, - { 225, 228, 0 }, - { 226, 227, 0 }, - { 0, 0, 0x9A }, - { 0, 0, 0x5F }, - { 0, 0, 0x3E }, - { 230, 231, 0 }, - { 0, 0, 0x96 }, - { 0, 0, 0x82 }, - { 233, 238, 0 }, - { 234, 237, 0 }, - { 235, 236, 0 }, - { 0, 0, 0x25 }, - { 0, 0, 0x09 }, - { 0, 0, 0x9C }, - { 239, 240, 0 }, - { 0, 0, 0x97 }, - { 241, 242, 0 }, - { 0, 0, 0x7B }, - { 243, 244, 0 }, - { 0, 0, 0x94 }, - { 0, 0, 0x7C }, - }; - - writeRecord(_huffTree_00348, sizeof(_huffTree_00348), GBVARS_HUFFTREE_00348_INDEX , GBVARS_SKY); -} - -static void addHufftext_huffTree_00365() { - HuffTree _huffTree_00365[] = { - { 1, 20, 0 }, - { 2, 7, 0 }, - { 3, 4, 0 }, - { 0, 0, 0x20 }, - { 5, 6, 0 }, - { 0, 0, 0x65 }, - { 0, 0, 0x61 }, - { 8, 15, 0 }, - { 9, 12, 0 }, - { 10, 11, 0 }, - { 0, 0, 0x6F }, - { 0, 0, 0x73 }, - { 13, 14, 0 }, - { 0, 0, 0x74 }, - { 0, 0, 0x6E }, - { 16, 19, 0 }, - { 17, 18, 0 }, - { 0, 0, 0x2E }, - { 0, 0, 0x69 }, - { 0, 0, 0x72 }, - { 21, 44, 0 }, - { 22, 31, 0 }, - { 23, 28, 0 }, - { 24, 27, 0 }, - { 25, 26, 0 }, - { 0, 0, 0x00 }, - { 0, 0, 0x45 }, - { 0, 0, 0x75 }, - { 29, 30, 0 }, - { 0, 0, 0x6D }, - { 0, 0, 0x41 }, - { 32, 39, 0 }, - { 33, 36, 0 }, - { 34, 35, 0 }, - { 0, 0, 0x6C }, - { 0, 0, 0x49 }, - { 37, 38, 0 }, - { 0, 0, 0x64 }, - { 0, 0, 0x52 }, - { 40, 43, 0 }, - { 41, 42, 0 }, - { 0, 0, 0x4E }, - { 0, 0, 0x53 }, - { 0, 0, 0x54 }, - { 45, 68, 0 }, - { 46, 55, 0 }, - { 47, 52, 0 }, - { 48, 51, 0 }, - { 49, 50, 0 }, - { 0, 0, 0x4F }, - { 0, 0, 0x68 }, - { 0, 0, 0x63 }, - { 53, 54, 0 }, - { 0, 0, 0x44 }, - { 0, 0, 0x67 }, - { 56, 63, 0 }, - { 57, 60, 0 }, - { 58, 59, 0 }, - { 0, 0, 0x4C }, - { 0, 0, 0x43 }, - { 61, 62, 0 }, - { 0, 0, 0x70 }, - { 0, 0, 0x55 }, - { 64, 67, 0 }, - { 65, 66, 0 }, - { 0, 0, 0x21 }, - { 0, 0, 0x79 }, - { 0, 0, 0x4D }, - { 69, 88, 0 }, - { 70, 79, 0 }, - { 71, 76, 0 }, - { 72, 75, 0 }, - { 73, 74, 0 }, - { 0, 0, 0x50 }, - { 0, 0, 0x76 }, - { 0, 0, 0x48 }, - { 77, 78, 0 }, - { 0, 0, 0x3F }, - { 0, 0, 0x62 }, - { 80, 85, 0 }, - { 81, 84, 0 }, - { 82, 83, 0 }, - { 0, 0, 0x27 }, - { 0, 0, 0x66 }, - { 0, 0, 0x2C }, - { 86, 87, 0 }, - { 0, 0, 0x47 }, - { 0, 0, 0x42 }, - { 89, 108, 0 }, - { 90, 99, 0 }, - { 91, 96, 0 }, - { 92, 95, 0 }, - { 93, 94, 0 }, - { 0, 0, 0x56 }, - { 0, 0, 0x6B }, - { 0, 0, 0x46 }, - { 97, 98, 0 }, - { 0, 0, 0x71 }, - { 0, 0, 0x77 }, - { 100, 105, 0 }, - { 101, 104, 0 }, - { 102, 103, 0 }, - { 0, 0, 0x4B }, - { 0, 0, 0x2D }, - { 0, 0, 0x57 }, - { 106, 107, 0 }, - { 0, 0, 0x4A }, - { 0, 0, 0x2A }, - { 109, 128, 0 }, - { 110, 117, 0 }, - { 111, 114, 0 }, - { 112, 113, 0 }, - { 0, 0, 0x7A }, - { 0, 0, 0x59 }, - { 115, 116, 0 }, - { 0, 0, 0x6A }, - { 0, 0, 0x2B }, - { 118, 123, 0 }, - { 119, 122, 0 }, - { 120, 121, 0 }, - { 0, 0, 0x51 }, - { 0, 0, 0x85 }, - { 0, 0, 0x29 }, - { 124, 127, 0 }, - { 125, 126, 0 }, - { 0, 0, 0x5A }, - { 0, 0, 0x8B }, - { 0, 0, 0x3C }, - { 129, 150, 0 }, - { 130, 139, 0 }, - { 131, 136, 0 }, - { 132, 135, 0 }, - { 133, 134, 0 }, - { 0, 0, 0x95 }, - { 0, 0, 0x7E }, - { 0, 0, 0x8A }, - { 137, 138, 0 }, - { 0, 0, 0x87 }, - { 0, 0, 0x3A }, - { 140, 145, 0 }, - { 141, 144, 0 }, - { 142, 143, 0 }, - { 0, 0, 0x7F }, - { 0, 0, 0x5D }, - { 0, 0, 0x23 }, - { 146, 149, 0 }, - { 147, 148, 0 }, - { 0, 0, 0x78 }, - { 0, 0, 0x58 }, - { 0, 0, 0x91 }, - { 151, 172, 0 }, - { 152, 163, 0 }, - { 153, 158, 0 }, - { 154, 157, 0 }, - { 155, 156, 0 }, - { 0, 0, 0x88 }, - { 0, 0, 0x60 }, - { 0, 0, 0x32 }, - { 159, 162, 0 }, - { 160, 161, 0 }, - { 0, 0, 0x30 }, - { 0, 0, 0x83 }, - { 0, 0, 0x31 }, - { 164, 169, 0 }, - { 165, 168, 0 }, - { 166, 167, 0 }, - { 0, 0, 0x2F }, - { 0, 0, 0x28 }, - { 0, 0, 0x3D }, - { 170, 171, 0 }, - { 0, 0, 0x86 }, - { 0, 0, 0x5E }, - { 173, 190, 0 }, - { 174, 181, 0 }, - { 175, 178, 0 }, - { 176, 177, 0 }, - { 0, 0, 0x33 }, - { 0, 0, 0x39 }, - { 179, 180, 0 }, - { 0, 0, 0x98 }, - { 0, 0, 0x34 }, - { 182, 187, 0 }, - { 183, 186, 0 }, - { 184, 185, 0 }, - { 0, 0, 0x7D }, - { 0, 0, 0x38 }, - { 0, 0, 0x5C }, - { 188, 189, 0 }, - { 0, 0, 0x22 }, - { 0, 0, 0x90 }, - { 191, 206, 0 }, - { 192, 199, 0 }, - { 193, 196, 0 }, - { 194, 195, 0 }, - { 0, 0, 0x26 }, - { 0, 0, 0x8D }, - { 197, 198, 0 }, - { 0, 0, 0x35 }, - { 0, 0, 0x36 }, - { 200, 203, 0 }, - { 201, 202, 0 }, - { 0, 0, 0x92 }, - { 0, 0, 0x8F }, - { 204, 205, 0 }, - { 0, 0, 0x8E }, - { 0, 0, 0x93 }, - { 207, 220, 0 }, - { 208, 213, 0 }, - { 209, 212, 0 }, - { 210, 211, 0 }, - { 0, 0, 0x8C }, - { 0, 0, 0x37 }, - { 0, 0, 0x80 }, - { 214, 217, 0 }, - { 215, 216, 0 }, - { 0, 0, 0x81 }, - { 0, 0, 0x99 }, - { 218, 219, 0 }, - { 0, 0, 0x24 }, - { 0, 0, 0x40 }, - { 221, 230, 0 }, - { 222, 227, 0 }, - { 223, 226, 0 }, - { 224, 225, 0 }, - { 0, 0, 0x5B }, - { 0, 0, 0x9A }, - { 0, 0, 0x5F }, - { 228, 229, 0 }, - { 0, 0, 0x3E }, - { 0, 0, 0x96 }, - { 231, 236, 0 }, - { 232, 235, 0 }, - { 233, 234, 0 }, - { 0, 0, 0x82 }, - { 0, 0, 0x25 }, - { 0, 0, 0x09 }, - { 237, 240, 0 }, - { 238, 239, 0 }, - { 0, 0, 0x9C }, - { 0, 0, 0x97 }, - { 241, 242, 0 }, - { 0, 0, 0x7B }, - { 243, 244, 0 }, - { 0, 0, 0x94 }, - { 0, 0, 0x7C }, - }; - writeRecord(_huffTree_00365, sizeof(_huffTree_00365), GBVARS_HUFFTREE_00365_INDEX , GBVARS_SKY); -} - -static void addHufftext_huffTree_00368() { - HuffTree _huffTree_00368[] = { - { 1, 20, 0 }, - { 2, 7, 0 }, - { 3, 4, 0 }, - { 0, 0, 0x20 }, - { 5, 6, 0 }, - { 0, 0, 0x65 }, - { 0, 0, 0x61 }, - { 8, 15, 0 }, - { 9, 12, 0 }, - { 10, 11, 0 }, - { 0, 0, 0x6F }, - { 0, 0, 0x73 }, - { 13, 14, 0 }, - { 0, 0, 0x74 }, - { 0, 0, 0x6E }, - { 16, 19, 0 }, - { 17, 18, 0 }, - { 0, 0, 0x2E }, - { 0, 0, 0x69 }, - { 0, 0, 0x72 }, - { 21, 44, 0 }, - { 22, 31, 0 }, - { 23, 28, 0 }, - { 24, 27, 0 }, - { 25, 26, 0 }, - { 0, 0, 0x00 }, - { 0, 0, 0x45 }, - { 0, 0, 0x75 }, - { 29, 30, 0 }, - { 0, 0, 0x6D }, - { 0, 0, 0x41 }, - { 32, 39, 0 }, - { 33, 36, 0 }, - { 34, 35, 0 }, - { 0, 0, 0x6C }, - { 0, 0, 0x49 }, - { 37, 38, 0 }, - { 0, 0, 0x64 }, - { 0, 0, 0x52 }, - { 40, 43, 0 }, - { 41, 42, 0 }, - { 0, 0, 0x4E }, - { 0, 0, 0x53 }, - { 0, 0, 0x54 }, - { 45, 68, 0 }, - { 46, 55, 0 }, - { 47, 52, 0 }, - { 48, 51, 0 }, - { 49, 50, 0 }, - { 0, 0, 0x4F }, - { 0, 0, 0x68 }, - { 0, 0, 0x63 }, - { 53, 54, 0 }, - { 0, 0, 0x44 }, - { 0, 0, 0x67 }, - { 56, 63, 0 }, - { 57, 60, 0 }, - { 58, 59, 0 }, - { 0, 0, 0x4C }, - { 0, 0, 0x43 }, - { 61, 62, 0 }, - { 0, 0, 0x70 }, - { 0, 0, 0x55 }, - { 64, 67, 0 }, - { 65, 66, 0 }, - { 0, 0, 0x21 }, - { 0, 0, 0x79 }, - { 0, 0, 0x4D }, - { 69, 88, 0 }, - { 70, 79, 0 }, - { 71, 76, 0 }, - { 72, 75, 0 }, - { 73, 74, 0 }, - { 0, 0, 0x50 }, - { 0, 0, 0x76 }, - { 0, 0, 0x48 }, - { 77, 78, 0 }, - { 0, 0, 0x3F }, - { 0, 0, 0x62 }, - { 80, 85, 0 }, - { 81, 84, 0 }, - { 82, 83, 0 }, - { 0, 0, 0x27 }, - { 0, 0, 0x66 }, - { 0, 0, 0x2C }, - { 86, 87, 0 }, - { 0, 0, 0x47 }, - { 0, 0, 0x42 }, - { 89, 108, 0 }, - { 90, 99, 0 }, - { 91, 96, 0 }, - { 92, 95, 0 }, - { 93, 94, 0 }, - { 0, 0, 0x56 }, - { 0, 0, 0x6B }, - { 0, 0, 0x46 }, - { 97, 98, 0 }, - { 0, 0, 0x71 }, - { 0, 0, 0x77 }, - { 100, 105, 0 }, - { 101, 104, 0 }, - { 102, 103, 0 }, - { 0, 0, 0x4B }, - { 0, 0, 0x2D }, - { 0, 0, 0x57 }, - { 106, 107, 0 }, - { 0, 0, 0x4A }, - { 0, 0, 0x2A }, - { 109, 128, 0 }, - { 110, 117, 0 }, - { 111, 114, 0 }, - { 112, 113, 0 }, - { 0, 0, 0x7A }, - { 0, 0, 0x59 }, - { 115, 116, 0 }, - { 0, 0, 0x6A }, - { 0, 0, 0x2B }, - { 118, 123, 0 }, - { 119, 122, 0 }, - { 120, 121, 0 }, - { 0, 0, 0x51 }, - { 0, 0, 0x85 }, - { 0, 0, 0x29 }, - { 124, 127, 0 }, - { 125, 126, 0 }, - { 0, 0, 0x5A }, - { 0, 0, 0x8B }, - { 0, 0, 0x3C }, - { 129, 152, 0 }, - { 130, 139, 0 }, - { 131, 136, 0 }, - { 132, 135, 0 }, - { 133, 134, 0 }, - { 0, 0, 0x95 }, - { 0, 0, 0x7E }, - { 0, 0, 0x8A }, - { 137, 138, 0 }, - { 0, 0, 0x87 }, - { 0, 0, 0x3A }, - { 140, 145, 0 }, - { 141, 144, 0 }, - { 142, 143, 0 }, - { 0, 0, 0x7F }, - { 0, 0, 0x23 }, - { 0, 0, 0x78 }, - { 146, 149, 0 }, - { 147, 148, 0 }, - { 0, 0, 0x58 }, - { 0, 0, 0x5D }, - { 150, 151, 0 }, - { 0, 0, 0x91 }, - { 0, 0, 0x88 }, - { 153, 174, 0 }, - { 154, 165, 0 }, - { 155, 160, 0 }, - { 156, 159, 0 }, - { 157, 158, 0 }, - { 0, 0, 0x5F }, - { 0, 0, 0x60 }, - { 0, 0, 0x32 }, - { 161, 164, 0 }, - { 162, 163, 0 }, - { 0, 0, 0x30 }, - { 0, 0, 0x83 }, - { 0, 0, 0x31 }, - { 166, 171, 0 }, - { 167, 170, 0 }, - { 168, 169, 0 }, - { 0, 0, 0x2F }, - { 0, 0, 0x28 }, - { 0, 0, 0x3D }, - { 172, 173, 0 }, - { 0, 0, 0x86 }, - { 0, 0, 0x5E }, - { 175, 190, 0 }, - { 176, 183, 0 }, - { 177, 180, 0 }, - { 178, 179, 0 }, - { 0, 0, 0x33 }, - { 0, 0, 0x39 }, - { 181, 182, 0 }, - { 0, 0, 0x98 }, - { 0, 0, 0x34 }, - { 184, 187, 0 }, - { 185, 186, 0 }, - { 0, 0, 0x7D }, - { 0, 0, 0x38 }, - { 188, 189, 0 }, - { 0, 0, 0x5C }, - { 0, 0, 0x22 }, - { 191, 206, 0 }, - { 192, 199, 0 }, - { 193, 196, 0 }, - { 194, 195, 0 }, - { 0, 0, 0x90 }, - { 0, 0, 0x26 }, - { 197, 198, 0 }, - { 0, 0, 0x8D }, - { 0, 0, 0x35 }, - { 200, 203, 0 }, - { 201, 202, 0 }, - { 0, 0, 0x36 }, - { 0, 0, 0x3E }, - { 204, 205, 0 }, - { 0, 0, 0x93 }, - { 0, 0, 0x8C }, - { 207, 220, 0 }, - { 208, 215, 0 }, - { 209, 212, 0 }, - { 210, 211, 0 }, - { 0, 0, 0x37 }, - { 0, 0, 0x80 }, - { 213, 214, 0 }, - { 0, 0, 0x81 }, - { 0, 0, 0x8E }, - { 216, 219, 0 }, - { 217, 218, 0 }, - { 0, 0, 0x8F }, - { 0, 0, 0x99 }, - { 0, 0, 0x24 }, - { 221, 230, 0 }, - { 222, 227, 0 }, - { 223, 226, 0 }, - { 224, 225, 0 }, - { 0, 0, 0x92 }, - { 0, 0, 0x40 }, - { 0, 0, 0x5B }, - { 228, 229, 0 }, - { 0, 0, 0x9A }, - { 0, 0, 0x96 }, - { 231, 236, 0 }, - { 232, 235, 0 }, - { 233, 234, 0 }, - { 0, 0, 0x82 }, - { 0, 0, 0x25 }, - { 0, 0, 0x09 }, - { 237, 240, 0 }, - { 238, 239, 0 }, - { 0, 0, 0x9C }, - { 0, 0, 0x97 }, - { 241, 242, 0 }, - { 0, 0, 0x7B }, - { 243, 244, 0 }, - { 0, 0, 0x94 }, - { 0, 0, 0x7C }, - }; - writeRecord(_huffTree_00368, sizeof(_huffTree_00368), GBVARS_HUFFTREE_00368_INDEX , GBVARS_SKY); -} - -static void addHufftext_huffTree_00372() { - HuffTree _huffTree_00372[] = { - { 1, 20, 0 }, - { 2, 7, 0 }, - { 3, 4, 0 }, - { 0, 0, ' ' }, - { 5, 6, 0 }, - { 0, 0, 'e' }, - { 0, 0, 'a' }, - { 8, 15, 0 }, - { 9, 12, 0 }, - { 10, 11, 0 }, - { 0, 0, 'o' }, - { 0, 0, 's' }, - { 13, 14, 0 }, - { 0, 0, 't' }, - { 0, 0, 'n' }, - { 16, 19, 0 }, - { 17, 18, 0 }, - { 0, 0, '.' }, - { 0, 0, 'i' }, - { 0, 0, 'r' }, - { 21, 44, 0 }, - { 22, 31, 0 }, - { 23, 28, 0 }, - { 24, 27, 0 }, - { 25, 26, 0 }, - { 0, 0, 0 }, - { 0, 0, 'E' }, - { 0, 0, 'u' }, - { 29, 30, 0 }, - { 0, 0, 'm' }, - { 0, 0, 'A' }, - { 32, 39, 0 }, - { 33, 36, 0 }, - { 34, 35, 0 }, - { 0, 0, 'l' }, - { 0, 0, 'I' }, - { 37, 38, 0 }, - { 0, 0, 'd' }, - { 0, 0, 'R' }, - { 40, 43, 0 }, - { 41, 42, 0 }, - { 0, 0, 'N' }, - { 0, 0, 'S' }, - { 0, 0, 'T' }, - { 45, 68, 0 }, - { 46, 55, 0 }, - { 47, 52, 0 }, - { 48, 51, 0 }, - { 49, 50, 0 }, - { 0, 0, 'O' }, - { 0, 0, 'h' }, - { 0, 0, 'c' }, - { 53, 54, 0 }, - { 0, 0, 'D' }, - { 0, 0, 'g' }, - { 56, 63, 0 }, - { 57, 60, 0 }, - { 58, 59, 0 }, - { 0, 0, 'L' }, - { 0, 0, 'C' }, - { 61, 62, 0 }, - { 0, 0, 'p' }, - { 0, 0, 'U' }, - { 64, 67, 0 }, - { 65, 66, 0 }, - { 0, 0, '!' }, - { 0, 0, 'y' }, - { 0, 0, 'M' }, - { 69, 88, 0 }, - { 70, 79, 0 }, - { 71, 76, 0 }, - { 72, 75, 0 }, - { 73, 74, 0 }, - { 0, 0, 'P' }, - { 0, 0, 'v' }, - { 0, 0, 'H' }, - { 77, 78, 0 }, - { 0, 0, '?' }, - { 0, 0, 'b' }, - { 80, 85, 0 }, - { 81, 84, 0 }, - { 82, 83, 0 }, - { 0, 0, 39 }, - { 0, 0, 'f' }, - { 0, 0, ',' }, - { 86, 87, 0 }, - { 0, 0, 'G' }, - { 0, 0, 'B' }, - { 89, 108, 0 }, - { 90, 99, 0 }, - { 91, 96, 0 }, - { 92, 95, 0 }, - { 93, 94, 0 }, - { 0, 0, 'V' }, - { 0, 0, 'k' }, - { 0, 0, 'F' }, - { 97, 98, 0 }, - { 0, 0, 'q' }, - { 0, 0, 'w' }, - { 100, 105, 0 }, - { 101, 104, 0 }, - { 102, 103, 0 }, - { 0, 0, 'K' }, - { 0, 0, '-' }, - { 0, 0, 'W' }, - { 106, 107, 0 }, - { 0, 0, 'J' }, - { 0, 0, '*' }, - { 109, 128, 0 }, - { 110, 117, 0 }, - { 111, 114, 0 }, - { 112, 113, 0 }, - { 0, 0, 'z' }, - { 0, 0, 'Y' }, - { 115, 116, 0 }, - { 0, 0, 'j' }, - { 0, 0, '+' }, - { 118, 123, 0 }, - { 119, 122, 0 }, - { 120, 121, 0 }, - { 0, 0, 'Q' }, - { 0, 0, 133 }, - { 0, 0, ')' }, - { 124, 127, 0 }, - { 125, 126, 0 }, - { 0, 0, 'Z' }, - { 0, 0, 139 }, - { 0, 0, '<' }, - { 129, 150, 0 }, - { 130, 139, 0 }, - { 131, 136, 0 }, - { 132, 135, 0 }, - { 133, 134, 0 }, - { 0, 0, 149 }, - { 0, 0, 126 }, - { 0, 0, 138 }, - { 137, 138, 0 }, - { 0, 0, 135 }, - { 0, 0, ':' }, - { 140, 145, 0 }, - { 141, 144, 0 }, - { 142, 143, 0 }, - { 0, 0, 127 }, - { 0, 0, ']' }, - { 0, 0, '#' }, - { 146, 149, 0 }, - { 147, 148, 0 }, - { 0, 0, 'x' }, - { 0, 0, 'X' }, - { 0, 0, 145 }, - { 151, 172, 0 }, - { 152, 163, 0 }, - { 153, 158, 0 }, - { 154, 157, 0 }, - { 155, 156, 0 }, - { 0, 0, 136 }, - { 0, 0, '`' }, - { 0, 0, '2' }, - { 159, 162, 0 }, - { 160, 161, 0 }, - { 0, 0, '0' }, - { 0, 0, 131 }, - { 0, 0, '1' }, - { 164, 169, 0 }, - { 165, 168, 0 }, - { 166, 167, 0 }, - { 0, 0, '/' }, - { 0, 0, '(' }, - { 0, 0, '=' }, - { 170, 171, 0 }, - { 0, 0, 134 }, - { 0, 0, '^' }, - { 173, 190, 0 }, - { 174, 181, 0 }, - { 175, 178, 0 }, - { 176, 177, 0 }, - { 0, 0, '3' }, - { 0, 0, '9' }, - { 179, 180, 0 }, - { 0, 0, 152 }, - { 0, 0, '4' }, - { 182, 187, 0 }, - { 183, 186, 0 }, - { 184, 185, 0 }, - { 0, 0, '}' }, - { 0, 0, '8' }, - { 0, 0, '\\' }, - { 188, 189, 0 }, - { 0, 0, '"' }, - { 0, 0, 144 }, - { 191, 206, 0 }, - { 192, 199, 0 }, - { 193, 196, 0 }, - { 194, 195, 0 }, - { 0, 0, '&' }, - { 0, 0, 141 }, - { 197, 198, 0 }, - { 0, 0, '5' }, - { 0, 0, '6' }, - { 200, 203, 0 }, - { 201, 202, 0 }, - { 0, 0, 146 }, - { 0, 0, 143 }, - { 204, 205, 0 }, - { 0, 0, 142 }, - { 0, 0, 147 }, - { 207, 220, 0 }, - { 208, 213, 0 }, - { 209, 212, 0 }, - { 210, 211, 0 }, - { 0, 0, 140 }, - { 0, 0, '7' }, - { 0, 0, 128 }, - { 214, 217, 0 }, - { 215, 216, 0 }, - { 0, 0, 129 }, - { 0, 0, 153 }, - { 218, 219, 0 }, - { 0, 0, '$' }, - { 0, 0, '@' }, - { 221, 230, 0 }, - { 222, 227, 0 }, - { 223, 226, 0 }, - { 224, 225, 0 }, - { 0, 0, '[' }, - { 0, 0, 154 }, - { 0, 0, '_' }, - { 228, 229, 0 }, - { 0, 0, '>' }, - { 0, 0, 150 }, - { 231, 236, 0 }, - { 232, 235, 0 }, - { 233, 234, 0 }, - { 0, 0, 130 }, - { 0, 0, '%' }, - { 0, 0, 9 }, - { 237, 240, 0 }, - { 238, 239, 0 }, - { 0, 0, 156 }, - { 0, 0, 151 }, - { 241, 242, 0 }, - { 0, 0, '{' }, - { 243, 244, 0 }, - { 0, 0, 148 }, - { 0, 0, '!' }, - }; - writeRecord(_huffTree_00372, sizeof(_huffTree_00372), GBVARS_HUFFTREE_00372_INDEX , GBVARS_SKY); -} - -/////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////// - -void Sky_addHufftext() { - addHufftext_huffTree_00109(); - addHufftext_huffTree_00267(); - addHufftext_huffTree_00288(); - addHufftext_huffTree_00303(); - addHufftext_huffTree_00331(); - addHufftext_huffTree_00348(); - addHufftext_huffTree_00365(); - addHufftext_huffTree_00368(); - addHufftext_huffTree_00372(); -} diff --git a/backends/platform/PalmOS/Src/builder/sword1/sw1_staticres.c b/backends/platform/PalmOS/Src/builder/sword1/sw1_staticres.c deleted file mode 100644 index 92860a843c..0000000000 --- a/backends/platform/PalmOS/Src/builder/sword1/sw1_staticres.c +++ /dev/null @@ -1,3576 +0,0 @@ -#include <PalmOS.h> -#include "b_globals.h" - -#include "sw1_staticres.h" - -#define MAX_ROOMS_PER_FX 7 - -#define FX_SPOT 1 -#define FX_LOOP 2 -#define FX_RANDOM 3 - -typedef struct { - int32 roomNo, leftVol, rightVol; -} RoomVol; - -typedef struct { - uint32 sampleId, type, delay; - RoomVol roomVolList[MAX_ROOMS_PER_FX]; -} FxDef; - -static void addStaticres_fxList() { - FxDef _fxList[312] = { - // 0 - { - 0, // sampleId - 0, // type (FX_LOOP, FX_RANDOM or FX_SPOT) - 0, // delay (random chance for FX_RANDOM sound fx) - { // roomVolList - {0,0,0}, // {roomNo,leftVol,rightVol} - }, - }, - //------------------------ - // 1 Newton's cradle. Anim=NEWTON. - { - FX_NEWTON, // sampleId - FX_SPOT, // type - 7, // delay (or random chance) - { // roomVolList - {45,4,2}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 2 - { - FX_TRAFFIC2, // sampleId - FX_LOOP, // type - 0, // delay (or random chance) - { // roomVolList - {1,12,12}, // {roomNo,leftVol,rightVol} - {2,1,1}, - {3,1,1}, - {4,13,13}, - {5,1,1}, - {8,7,7}, - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 3 - { - FX_HORN1, // sampleId - FX_RANDOM, // type - 1200, // delay (or random chance) - { // roomVolList - {1,3,3}, // {roomNo,leftVol,rightVol} - {3,1,1}, - {4,1,1}, - {5,2,2}, - {8,4,4}, - {18,2,3}, - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 4 - { - FX_HORN2, // sampleId - FX_RANDOM, // type - 1200, // delay (or random chance) - { // roomVolList - {1,4,4}, // {roomNo,leftVol,rightVol} - {3,2,2}, - {4,3,3}, - {5,2,2}, - {8,4,4}, - {18,1,1}, - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 5 - { - FX_HORN3, // sampleId - FX_RANDOM, // type - 1200, // delay (or random chance) - { // roomVolList - {1,4,4}, // {roomNo,leftVol,rightVol} - {2,4,4}, - {3,2,2}, - {4,3,3}, - {5,2,2}, - {8,4,4}, - {18,1,1}, - }, - }, - //------------------------ - // 6 - { - FX_CAMERA1, // sampleId - FX_SPOT, // type - 25, // delay (or random chance) - { // roomVolList - {1,8,8}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 7 - { - FX_CAMERA2, // sampleId - FX_SPOT, // type - 25, // delay (or random chance) - { // roomVolList - {1,8,8}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 8 - { - FX_CAMERA3, // sampleId - FX_SPOT, // type - 25, // delay (or random chance) - { // roomVolList - {1,8,8}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 9 - { - FX_SWATER1, // sampleId - FX_LOOP, // type - 0, // delay (or random chance) - { // roomVolList - {7,12,12}, // {roomNo,leftVol,rightVol} - {6,12,10}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 10 Mad dogs in Spain, triggered by George going around the corner in the villa hall. - // In 56 and 57, the dogs will continue barking after George has either been ejected or sneaked up stairs - // for a couple of loops before stopping. - { - FX_DOGS56, // sampleId - FX_LOOP, // type - 0, // delay (or random chance) - { // roomVolList - {60,16,16}, // {roomNo,leftVol,rightVol} - {0,0,0} // NULL-TERMINATOR - }, - }, - //------------------------ - // 11 - { - FX_DRIP1, // sampleId - FX_RANDOM, // type - 20, // delay (or random chance) - { // roomVolList - {7,15,15}, // {roomNo,leftVol,rightVol} - {6,8,8}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 12 - { - FX_DRIP2, // sampleId - FX_RANDOM, // type - 30, // delay (or random chance) - { // roomVolList - {7,15,15}, // {roomNo,leftVol,rightVol} - {6,8,8}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 13 - { - FX_DRIP3, // sampleId - FX_RANDOM, // type - 40, // delay (or random chance) - { // roomVolList - {7,15,15}, // {roomNo,leftVol,rightVol} - {6,8,8}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 14 - { - FX_TWEET1, // sampleId - FX_SPOT, // type - 10, // delay (or random chance) - { // roomVolList - {1,5,5}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 15 - { - FX_TWEET2, // sampleId - FX_SPOT, // type - 10, // delay (or random chance) - { // roomVolList - {1,5,5}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 16 - { - FX_TWEET3, // sampleId - FX_SPOT, // type - 10, // delay (or random chance) - { // roomVolList - {1,5,5}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 17 - { - FX_TWEET4, // sampleId - FX_SPOT, // type - 10, // delay (or random chance) - { // roomVolList - {1,5,5}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 18 - { - FX_TWEET5, // sampleId - FX_SPOT, // type - 10, // delay (or random chance) - { // roomVolList - {1,5,5}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 19 Tied to large bird flying up screen anim - { - FX_CAW1, // sampleId - FX_SPOT, // type - 20, // delay (or random chance) - { // roomVolList - {1,5,5}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - //------------------------ - // 20 George picking the canopy up: GEOCAN - { - FX_CANUP, // sampleId - FX_SPOT, // type - 5, // delay (or random chance) * - { // roomVolList - {1,10,10}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 21 George dropping the canopy: GEOCAN - { - FX_CANDO, // sampleId - FX_SPOT, // type - 52, // delay (or random chance) * - { // roomVolList - {1,10,10}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 22 George dusts himself down: GEOCAN - { - FX_DUST, // sampleId - FX_SPOT, // type - 58, // delay (or random chance) * - { // roomVolList - {1,10,10}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 23 George picks up the paper and opens it: GEOPAP - { - FX_PAP1, // sampleId - FX_SPOT, // type - 23, // delay (or random chance) * - { // roomVolList - {1,10,10}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 24 George puts the paper away: GEOPAP2 - { - FX_PAP2, // sampleId - FX_SPOT, // type - 3, // delay (or random chance) * - { // roomVolList - {1,10,10}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 25 George gives the paper away: GEOWRK8 - { - FX_PAP3, // sampleId - FX_SPOT, // type - 13, // delay (or random chance) * - { // roomVolList - {4,14,12}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 26 Workman examines paper: WRKOPN - it's now just WRKPPR - { - FX_PAP4, // sampleId - FX_SPOT, // type - 15, // delay (or random chance) * - { // roomVolList - {4,14,12}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 27 Workman puts paper down: WRKOPN (REVERSED) - now just WRKCLM - { - FX_PAP5, // sampleId - FX_SPOT, // type - 2, // delay (or random chance)* - { // roomVolList - {4,14,12}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 28 Pickaxe sound 1:, Screen 4 - WRKDIG - { - FX_PICK1, // sampleId - FX_SPOT, // type - 11, // delay (or random chance) * - { // roomVolList - {4,10,10}, - {0,0,0} // NULL-TERMINATOR - }, - }, - //------------------------ - // 29 Pickaxe sound 2:, Screen 4 - WRKDIG - { - FX_PICK2, // sampleId - FX_SPOT, // type - 11, // delay (or random chance) * - { // roomVolList - {4,10,10}, - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - //------------------------ - // 30 Pickaxe sound 3:, Screen 4 - WRKDIG - { - FX_PICK3, // sampleId - FX_SPOT, // type - 11, // delay (or random chance) * - { // roomVolList - {4,10,10}, - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 31 Pickaxe sound 4:, Screen 4 - WRKDIG - { - FX_PICK4, // sampleId - FX_SPOT, // type - 11, // delay (or random chance) * - { // roomVolList - {4,10,10}, - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 32 Shorting light: FLICKER - { - FX_LIGHT, // sampleId - FX_SPOT, // type - 1, // delay (or random chance) * - { // roomVolList - {3,15,15}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 33 Cat leaps out of bin and runs: CATJMP! - { - FX_CAT, // sampleId - FX_SPOT, // type - 20, // delay (or random chance) * - { // roomVolList - {2,10,10}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 34 George rocks plastic crate: GEOCRT - { - FX_CRATE, // sampleId - FX_SPOT, // type - 10, // delay (or random chance) * - { // roomVolList - {2,8,8}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 35 George tries to climb drainpipe: GEOCLM02 - { - FX_DRAIN, // sampleId - FX_SPOT, // type - 9, // delay (or random chance) * - { // roomVolList - {2,10,10}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 36 George removes manhole cover: GEOMAN8 - { - FX_HOLE, // sampleId - FX_SPOT, // type - 19, // delay (or random chance) ? - { // roomVolList - {2,12,11}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 37 Brandy bottle put down: CHNDRN - { - FX_BOTDN, // sampleId - FX_SPOT, // type - 43, // delay (or random chance) * - { // roomVolList - {3,8,8}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 38 Brandy bottle picked up: GEOBOT3 - { - FX_BOTUP, // sampleId - FX_SPOT, // type - 9, // delay (or random chance) * - { // roomVolList - {3,10,10}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 39 Chantelle gulps on brandy: CHNDRN - { - FX_GULP, // sampleId - FX_SPOT, // type - 23, // delay (or random chance) * - { // roomVolList - {3,4,3}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 40 Chantelle picked up off the floor: GEOCHN - { - FX_PIKUP, // sampleId - FX_SPOT, // type - 28, // delay (or random chance) * - { // roomVolList - {3,11,10}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 41 George searches Plantard's body: GEOCPS - { - FX_BODY, // sampleId - FX_SPOT, // type - 10, // delay (or random chance) * - { // roomVolList - {3,10,10}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 42 Moue cocks handgun. MOUENT - { - FX_PISTOL, // sampleId - FX_SPOT, // type - 23, // delay (or random chance) * - { // roomVolList - {4,4,7}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 43 George rummages in toolbox: GEOTBX - { - FX_TBOX, // sampleId - FX_SPOT, // type - 12, // delay (or random chance) * - { // roomVolList - {4,12,10}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 44 rat squeak 1 - { - FX_RAT1, // sampleId - FX_RANDOM, // type - 193, // delay (or random chance) - { // roomVolList - {6,5,7}, // {roomNo,leftVol,rightVol} - {7,5,3}, - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 45 rat squeak 2 - { - FX_RAT2, // sampleId - FX_RANDOM, // type - 201, // delay (or random chance) - { // roomVolList - {6,3,5}, // {roomNo,leftVol,rightVol} - {7,4,6}, - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 46 George climbs down ladder: - { - FX_LADD1, // sampleId - FX_SPOT, // type - 10, // delay (or random chance) - { // roomVolList - {6,10,8}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 47 Rushing water loop - { - FX_SWATER3, // sampleId - FX_LOOP, // type - 0, // delay (or random chance) - { // roomVolList - {6,10,11}, // {roomNo,leftVol,rightVol} - {7,12,11}, - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 48 Left hand bin being opened: GEOCAT? - { - FX_BIN3, // sampleId - FX_SPOT, // type - 12, // delay (or random chance) - { // roomVolList - {2,12,11}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 49 Middle bin being opened: GEOBIN - { - FX_BIN2, // sampleId - FX_SPOT, // type - 12, // delay (or random chance) - { // roomVolList - {2,11,11}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 50 Right hand bin being opened: GEOLID? - { - FX_BIN1, // sampleId - FX_SPOT, // type - 12, // delay (or random chance) - { // roomVolList - {2,10,11}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 51 Passing car sound - { - FX_CARS, // sampleId - FX_RANDOM, // type - 120, // delay (or random chance) - { // roomVolList - {10,8,1}, - {12,7,7}, - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 52 Passing car sound - { - FX_FIESTA, // sampleId - FX_RANDOM, // type - 127, // delay (or random chance) - { // roomVolList - {10,8,1}, - {12,7,7}, - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 53 Passing car sound - { - FX_CARLTON , // sampleId - FX_RANDOM, // type - 119, // delay (or random chance) - { // roomVolList - {10,8,1}, - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 54 Bird - { - FX_BIRD, // sampleId - FX_RANDOM, // type - 500, // delay (or random chance) - { // roomVolList - {9,10,10}, // {roomNo,leftVol,rightVol} - {10,2,1}, - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 55 George tries the door: GEOTRY - { - FX_DOORTRY, // sampleId - FX_SPOT, // type - 7, // delay (or random chance) - { // roomVolList - {9,9,9}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 56 George opens the door: GEODOOR9 - { - FX_FLATDOOR, // sampleId - FX_SPOT, // type - 10, // delay (or random chance) - { // roomVolList - {9,9,9}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 57 George picks the 'phone up: GEOPHN10 - { - FX_FONEUP, // sampleId - FX_SPOT, // type - 15, // delay (or random chance) - { // roomVolList - {10,9,9}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 58 George puts the 'phone down: GEPDWN10 - { - FX_FONEDN, // sampleId - FX_SPOT, // type - 4, // delay (or random chance) - { // roomVolList - {10,9,9}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 59 Albert opens the door: ALBOPEN - { - FX_ALBOP, // sampleId - FX_SPOT, // type - 13, // delay (or random chance) - { // roomVolList - {5,10,10}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - //------------------------ - // 60 Albert closes the door: ALBCLOSE - { - FX_ALBCLO, // sampleId - FX_SPOT, // type - 20, // delay (or random chance) - { // roomVolList - {5,9,9}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 61 George enter Nico's flat. GEOENT10 - { - FX_NICOPEN, // sampleId - FX_SPOT, // type - 1, // delay (or random chance) - { // roomVolList - {10,7,8}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 62 George leaves Nico's. GEOLVS10 - { - FX_NICLOSE, // sampleId - FX_SPOT, // type - 13, // delay (or random chance) - { // roomVolList - {10,7,8}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 63 Another bird for the street. - { - FX_BIRD2, // sampleId - FX_RANDOM, // type - 500, // WAS 15 (TOO LATE) - { // roomVolList - {9,10,10}, // {roomNo,leftVol,rightVol} - {10,2,1}, - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 64 George sits in the chair: GEOCHR - { - FX_GEOCHAIR, // sampleId - FX_SPOT, // type - 14, // delay (or random chance) - { // roomVolList - {10,5,5}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 65 George sits on the couch: GEOCCH - { - FX_GEOCCH, // sampleId - FX_SPOT, // type - 14, // delay (or random chance) - { // roomVolList - {10,5,5}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 66 George gets up from the chair: GEOCHR9 - { - FX_GEOCHR9, // sampleId - FX_SPOT, // type - 5, // delay (or random chance) - { // roomVolList - {10,3,3}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 67 George is electrocuted: COSSHK - { - FX_SHOCK1, // sampleId - FX_SPOT, // type - 19, // delay (or random chance) - { // roomVolList - {11,10,10}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 68 George plays record: GEOWIND - { - FX_GRAMOFON, // sampleId - FX_SPOT, // type - 0, // delay (or random chance) - { // roomVolList - {11,11,13}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 69 George is frisked: GORFRK - { - FX_FRISK, // sampleId - FX_SPOT, // type - 6, // delay (or random chance) - { // roomVolList - {12,8,8}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 70 Traffic sound - { - FX_TRAFFIC3, // sampleId - FX_LOOP, // type - 0, // delay (or random chance) - { // roomVolList - {11,5,4}, - {12,1,1}, - {16,4,4}, - {18,2,3}, - {46,4,3}, - {0,0,0}, // NULL-TERMINATOR - } - }, - //------------------------ - // 71 Latvian reading: LATRDS - { - FX_PAPER6, // sampleId - FX_SPOT, // type - 8, // delay (or random chance) - { // roomVolList - {13,8,8}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 72 Deskbell - { - FX_DESKBELL, // sampleId - FX_SPOT, // type - 0, // delay (or random chance) - { // roomVolList - {13,10,8}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 73 George picks up hotel 'phone: GEOTEL - { - FX_PHONEUP2, // sampleId - FX_SPOT, // type - 10, // delay (or random chance) - { // roomVolList - {13,8,8}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 74 George puts down hotel 'phone: GEOTEL9 - { - FX_PHONEDN2, // sampleId - FX_SPOT, // type - 10, // delay (or random chance) - { // roomVolList - {13,8,8}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 75 George tries doors in corridor: GEODOR - { - FX_TRYDOR14, // sampleId - FX_SPOT, // type - 10, // delay (or random chance) - { // roomVolList - {14,8,8}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 76 George opens bedside cabinet: BEDDOR - { - FX_CABOPEN, // sampleId - FX_SPOT, // type - 11, // delay (or random chance) - { // roomVolList - {15,10,14}, // {roomNo,leftVol,rightVol} - {17,10,14}, - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 77 George closes bedside cabinet: BEDDOR (reversed) - { - FX_CABCLOSE, // sampleId - FX_SPOT, // type - 5, // delay (or random chance) - { // roomVolList - {15,10,14}, // {roomNo,leftVol,rightVol} - {17,10,14}, - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 78 George opens the window: WINDOW - { - FX_WINDOPEN, // sampleId - FX_SPOT, // type - 19, // delay (or random chance) - { // roomVolList - {15,8,8}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 79 George goes right along the ledge: GEOIRW - { - FX_LEDGE1, // sampleId - FX_SPOT, // type - 1, // delay (or random chance) - { // roomVolList - {16,12,12}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - //------------------------ - // 80 George goes left along the ledge: GEOILW - { - FX_LEDGE2, // sampleId - FX_SPOT, // type - 1, // delay (or random chance) - { // roomVolList - {16,12,12}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 81 Pigeon noises - { - FX_COO, // sampleId - FX_RANDOM, // type - 80, // delay (or random chance) - { // roomVolList - {16,7,9}, // {roomNo,leftVol,rightVol} - {46,5,4}, - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 82 Pigeon noises - { - FX_COO2, // sampleId - FX_RANDOM, // type - 60, // delay (or random chance) - { // roomVolList - {15,3,4}, // {roomNo,leftVol,rightVol} - {16,8,5}, // {roomNo,leftVol,rightVol} - {17,3,4}, - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 83 George picks up and opens case: GEOBFC - { - FX_BRIEFON, // sampleId - FX_SPOT, // type - 16, // delay (or random chance) - { // roomVolList - {17,12,12}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 84 George closes and puts down case: GEOBFC (reversed) - { - FX_BRIEFOFF, // sampleId - FX_SPOT, // type - 12, // delay (or random chance) - { // roomVolList - {17,12,12}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 85 George gets into wardrobe. GEOWRB2 Attention, James. This is new as of 15/7/96 - { - FX_WARDIN, // sampleId - FX_SPOT, // type - 6, // delay (or random chance) - { // roomVolList - {17,4,4}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 86 George gets out of wardrobe. GEOWRB2 (Reversed). Attention, James. This is new as of 15/7/96 - { - FX_WARDOUT, // sampleId - FX_SPOT, // type - 41, // delay (or random chance) - { // roomVolList - {17,4,4}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 87 George jumps in through window: GEOWIN2 - { - FX_JUMPIN, // sampleId - FX_SPOT, // type - 7, // delay (or random chance) - { // roomVolList - {15,8,10}, - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 88 George climbs in: GEOWIN2/GEOWIN8 - { - FX_CLIMBIN, // sampleId - FX_SPOT, // type - 0, // delay (or random chance) - { // roomVolList - {17,8,16}, // {roomNo,leftVol,rightVol} - {15,8,16}, - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 89 George climbs out: GEOWIN1/GEOWIN9 - { - FX_CLIMBOUT, // sampleId - FX_SPOT, // type - 17, // delay (or random chance) - { // roomVolList - {17,9,10}, // {roomNo,leftVol,rightVol} - {15,9,10}, - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 90 George picks the 'phone up: GEOTEL18 - { - FX_FONEUP, // sampleId - FX_SPOT, // type - 10, // delay (or random chance) - { // roomVolList - {18,4,3}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 91 George puts the 'phone down: GEOTL18A - { - FX_FONEDN, // sampleId - FX_SPOT, // type - 11, // delay (or random chance) - { // roomVolList - {18,4,3}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 92 George tries to get keys. GEOKEY - { - FX_KEY13, // sampleId - FX_SPOT, // type - 8, // delay (or random chance) - { // roomVolList - {13,3,2}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 93 George manages to get keys. GEOKEY13 - { - FX_KEY13, // sampleId - FX_SPOT, // type - 9, // delay (or random chance) - { // roomVolList - {13,3,2}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 94 George electrocutes Maguire: MAGSHK - { - FX_SHOCK2, // sampleId - FX_SPOT, // type - 8, // delay (or random chance) - { // roomVolList - {19,9,10}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 95 George opens dray door : GEOTRP8 - { - FX_TRAPOPEN, // sampleId - FX_SPOT, // type - 20, // delay (or random chance) - { // roomVolList - {19,10,10}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 96 George breaks switch : Which anim? - { - FX_SWITCH19, // sampleId - FX_SPOT, // type - 10, // delay (or random chance) - { // roomVolList - {19,10,10}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 97 Leary pulls pint: LESPMP - { - FX_PULLPINT, // sampleId - FX_SPOT, // type - 6, // delay (or random chance) - { // roomVolList - {20,10,8}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 98 Glasswasher fuse blows (and the glass washer grinds to a halt) - { - FX_FUSE20, // sampleId - FX_SPOT, // type - 0, // delay (or random chance) - { // roomVolList - {20,8,8}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 99 Fitz leaps to his feet: FTZSTD - { - FX_FITZUP, // sampleId - FX_SPOT, // type - 5, // delay (or random chance) - { // roomVolList - {20,8,8}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - //------------------------ - // 100 Fitz runs for it: FTZRUN - { - FX_FITZRUN, // sampleId - FX_SPOT, // type - 15, // delay (or random chance) - { // roomVolList - {20,12,10}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 101 George pulls lever: GEOLVR & GEOLVR26 - { - FX_LEVER, // sampleId - FX_SPOT, // type - 26, // delay (or random chance) - { // roomVolList - {21,8,10}, // {roomNo,leftVol,rightVol} - {26,8,10}, - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 102 George pulls lever: GEOLVR8 & GEOLVR08 - { - FX_LEVER2, // sampleId - FX_SPOT, // type - 9, // delay (or random chance) - { // roomVolList - {21,8,10}, // {roomNo,leftVol,rightVol} - {26,8,10}, - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 103 George opens tap: No idea what the anim is - { - FX_TAP, // sampleId - FX_SPOT, // type - 10, // delay (or random chance) - { // roomVolList - {21,8,8}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 104 George closes tap: No idea what this anim is either - { - FX_TAP2, // sampleId - FX_SPOT, // type - 10, // delay (or random chance) - { // roomVolList - {21,8,8}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 105 Bar flap: FLPOPN - { - FX_BARFLAP, // sampleId - FX_SPOT, // type - 1, // delay (or random chance) - { // roomVolList - {20,6,6}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 106 Farmer leaves: FRMWLK - { - FX_FARMERGO, // sampleId - FX_SPOT, // type - 11, // delay (or random chance) - { // roomVolList - {22,6,9}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 107 George climbs haystack: GEOCLM - { - FX_CLIMBHAY, // sampleId - FX_SPOT, // type - 11, // delay (or random chance) - { // roomVolList - {22,14,14}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 108 George drives sewer key into wall: GEOKEY23 - { - FX_KEYSTEP, // sampleId - FX_SPOT, // type - 39, // delay (or random chance) - { // roomVolList - {23,8,10}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 109 George climbs over wall: GEOCLM23 - { - FX_CASTLWAL, // sampleId - FX_SPOT, // type - 17, // delay (or random chance) - { // roomVolList - {23,8,8}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - //------------------------ - // 110 George falls from wall: GEOTRY23 - { - FX_CLIMBFAL, // sampleId - FX_SPOT, // type - 43, // delay (or random chance) - { // roomVolList - {23,12,12}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 111 Goat chewing: GOTEAT - { - FX_GOATCHEW, // sampleId - FX_SPOT, // type - 1, // delay (or random chance) - { // roomVolList - {24,10,10}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 112 George moves plough: GEOPLW - { - FX_PLOUGH, // sampleId - FX_SPOT, // type - 8, // delay (or random chance) - { // roomVolList - {24,10,10}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 113 George drops slab: STNFALL - { - FX_SLABFALL, // sampleId - FX_SPOT, // type - 6, // delay (or random chance) - { // roomVolList - {25,10,10}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 114 George picks up slab: GEOSTN8 - { - FX_SLABUP, // sampleId - FX_SPOT, // type - 29, // delay (or random chance) - { // roomVolList - {25,10,10}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 115 Secret door opens: ALTOPN - { - FX_SECDOR25, // sampleId - FX_SPOT, // type - 17, // delay (or random chance) - { // roomVolList - {25,10,10}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 116 George wrings out cloth: GEOTWL25 - { - FX_WRING, // sampleId - FX_SPOT, // type - 24, // delay (or random chance) - { // roomVolList - {25,10,10}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 117 Rat running across barrels: RATJMP - { - FX_RAT3A, // sampleId - FX_SPOT, // type - 1, // delay (or random chance) - { // roomVolList - {26,8,5}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 118 Rat running across barrels: RATJMP - { - FX_RAT3B, // sampleId - FX_SPOT, // type - 8, // delay (or random chance) - { // roomVolList - {26,7,6}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 119 Rat running across barrels: RATJMP - { - FX_RAT3C, // sampleId - FX_SPOT, // type - 26, // delay (or random chance) - { // roomVolList - {26,8,8}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - //------------------------ - // 120 Irish bird song 1: - { - FX_EIRBIRD1, // sampleId - FX_RANDOM, // type - 720, // delay (or random chance) - { // roomVolList - {19,6,8}, // {roomNo,leftVol,rightVol} - {21,2,3}, - {22,8,5}, - {23,6,5}, - {24,8,8}, - {0,0,0}, // NULL-TERMINATOR - } - }, - //------------------------ - // 121 Irish bird song 2: - { - FX_EIRBIRD2, // sampleId - FX_RANDOM, // type - 720, // delay (or random chance) - { // roomVolList - {19,8,6}, // {roomNo,leftVol,rightVol} - {21,2,3}, - {22,6,8}, - {23,5,5}, - {24,8,8}, - {0,0,0}, // NULL-TERMINATOR - } - }, - //------------------------ - // 122 Irish bird song 3: - { - FX_EIRBIRD3, // sampleId - FX_RANDOM, // type - 720, // delay (or random chance) - { // roomVolList - {19,8,8}, // {roomNo,leftVol,rightVol} - {21,3,4}, - {22,8,8}, - {23,5,6}, - {24,6,8}, - {0,0,0}, // NULL-TERMINATOR - } - }, - //------------------------ - // 123 Rat 3D: - { - FX_RAT3D, // sampleId - FX_RANDOM, // type - 600, // delay (or random chance) - { // roomVolList - {26,2,3}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - } - }, - //------------------------ - // 124 Wind atop the battlements - { - FX_WIND, // sampleId - FX_LOOP, // type - 0, // delay (or random chance) - { // roomVolList - {23,6,6}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - } - }, - //------------------------ - // 125 Glasswasher in the pub (Room 20) *JEL* Stops after fuse blows and starts when george fixes it. - { - FX_WASHER, // sampleId - FX_LOOP, // type - 0, // delay (or random chance) - { // roomVolList - {20,4,4}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - } - }, - //------------------------ - // 126 Running tap in the cellar: (Room 21) *JEL* Only when the tap is on. - { - FX_CELTAP, // sampleId - FX_LOOP, // type - 0, // delay (or random chance) - { // roomVolList - {21,3,3}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - } - }, - //------------------------ - // 127 Lopez's hose. Basically a loop but stops when George cuts the water supply. Replaces MUTTER1. - { - FX_HOSE57, // sampleId - FX_LOOP, // type - 0, // delay (or random chance) - { // roomVolList - {57,3,1}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - } - }, - //------------------------ - // 128 Lopez's hose being switched off. Anim GARD05. Replaces MUTTER2. - { - FX_HOSE57B, // sampleId - FX_SPOT, // type - 1, // delay (or random chance) - { // roomVolList - {57,3,2}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - } - }, - //------------------------ - // 129 Nejo bouncing the ball off the door. NEJ8 - { - FX_BALLPLAY, // sampleId - FX_SPOT, // type - 13, // delay (or random chance) - { // roomVolList - {45,5,1}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - } - }, - //------------------------ - //------------------------ - // 130 Cricket loop for Syrian desert Only audible in 55 when the cave door is open. - { - FX_CRICKET, // sampleId - FX_LOOP, // type - 0, // delay (or random chance) - { // roomVolList - {54,8,8}, // {roomNo,leftVol,rightVol} - {55,3,5}, - {0,0,0}, // NULL-TERMINATOR - } - }, - //------------------------ - // 131 Display case shatters: GEOTOTB - { - FX_SMASHGLA, // sampleId - FX_SPOT, // type - 35, // delay (or random chance) - { // roomVolList - {29,16,12}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - } - }, - //------------------------ - // 132 Burglar alarm: Once the case is smashed (see 131) - { - FX_ALARM, // sampleId - FX_LOOP, // type - 0, // delay (or random chance) - { // roomVolList - {28,12,12}, // {roomNo,leftVol,rightVol} - {29,16,16}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - } - }, - //------------------------ - // 133 Guido fires: GUIGUN - { - FX_GUN1, // sampleId - FX_SPOT, // type - 7, // delay (or random chance) - { // roomVolList - {29,16,16}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - } - }, - //------------------------ - // 134 Guido knocked down: NICPUS1 - { - FX_GUI_HIT, // sampleId - FX_SPOT, // type - 40, // delay (or random chance) - { // roomVolList - {29,10,10}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - } - }, - //------------------------ - // 135 Museum exterior ambience - { - FX_MUESEXT, // sampleId - FX_LOOP, // type - 0, // delay (or random chance) - { // roomVolList - {27,10,10}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - } - }, - //------------------------ - // 136 Cat gets nowty: CAT3 - { - FX_STALLCAT, // sampleId - FX_SPOT, // type - 1, // delay (or random chance) - { // roomVolList - {45,10,6}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - } - }, - //------------------------ - // 137 Cat gets very nowty: CAT5 - { - FX_CATHIT, // sampleId - FX_SPOT, // type - 4, // delay (or random chance) - { // roomVolList - {45,10,6}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - } - }, - //------------------------ - // 138 Desert wind: Only audible in 55 when the cave door is open. - { - FX_SYRIWIND, // sampleId - FX_RANDOM, // type - 720, // delay (or random chance) - { // roomVolList - {54,10,10}, // {roomNo,leftVol,rightVol} - {55,5,7}, - {0,0,0}, // NULL-TERMINATOR - } - }, - //------------------------ - // 139 Bell on Nejo's stall: GEOSYR7 - { - FX_STALLBEL, // sampleId - FX_SPOT, // type - 7, // delay (or random chance) - { // roomVolList - {45,10,8}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - } - }, - //------------------------ - //------------------------ - // 140 George electrocutes Khan: GEOSYR40 - { - FX_SHOCK3, // sampleId - FX_SPOT, // type - 6, // delay (or random chance) - { // roomVolList - {54,10,10}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 141 George thumps Khan: GEOSYR40 - { - FX_THUMP1, // sampleId - FX_SPOT, // type - 22, // delay (or random chance) - { // roomVolList - {54,12,12}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 142 Khan hits the floor: KHS9 - { - FX_KHANDOWN, // sampleId - FX_SPOT, // type - 24, // delay (or random chance) - { // roomVolList - {54,8,8}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 143 Hospital ambience - { - FX_HOSPNOIS, // sampleId - FX_LOOP, // type - 0, // delay (or random chance) - { // roomVolList - {32,6,4}, // {roomNo,leftVol,rightVol} - {33,7,7}, - {34,3,4}, - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 144 Mr Shiny switched on: DOMPLG (Start FX_SHINY) - { - FX_SHINYON, // sampleId - FX_SPOT, // type - 0, // delay (or random chance) - { // roomVolList - {33,12,14}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 145 Mr Shiny running - { - FX_SHINY, // sampleId - FX_LOOP, // type - 0, // delay (or random chance) - { // roomVolList - {32,4,3}, // {roomNo,leftVol,rightVol} - {33,12,14}, - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 146 Mr Shiny switched off: GEOPLG33 (Turn off FX_SHINY at the same time) - { - FX_SHINYOFF, // sampleId - FX_SPOT, // type - 0, // delay (or random chance) - { // roomVolList - {33,12,16}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 147 Benoir takes blood pressure: BENBP1 or BENBP2 - { - FX_BLOODPRE, // sampleId - FX_SPOT, // type - 39, // delay (or random chance) - { // roomVolList - {34,14,16}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 148 George takes blood pressure: GEOBP1 or GEOBP2 - { - FX_BLOODPRE, // sampleId - FX_SPOT, // type - 62, // delay (or random chance) - { // roomVolList - {34,14,16}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 149 Goat baas as it attacks: GOTCR and GOTCL - { - FX_GOATBAA, // sampleId - FX_SPOT, // type - 1, // delay (or random chance) - { // roomVolList - {24,12,12}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - //------------------------ - // 150 Goat peeved at being trapped: GOTPLW (I'd advise triggering this anim randomly if you haven't done that) - { - FX_GOATDOH, // sampleId - FX_SPOT, // type - 7, // delay (or random chance) - { // roomVolList - {24,7,6}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 151 George triggers the Irish secret door: GEOPUT - { - FX_TRIGER25, // sampleId - FX_SPOT, // type - 35, // delay (or random chance) - { // roomVolList - {25,6,5}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 152 George winds up gramophone: GEOWIND - { - FX_WINDUP11, // sampleId - FX_SPOT, // type - 16, // delay (or random chance) - { // roomVolList - {11,7,7}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 153 Marib ambience - { - FX_MARIB, // sampleId - FX_LOOP, // type - 0, // delay (or random chance) - { // roomVolList - {45,7,7}, // {roomNo,leftVol,rightVol} - {47,5,5}, - {50,5,4}, - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 154 Statuette breaks: STA2 - { - FX_STATBREK, // sampleId - FX_SPOT, // type - 10, // delay (or random chance) - { // roomVolList - {45,7,4}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 155 George opens toilet door: CUBDOR50 - { - FX_CUBDOR, // sampleId - FX_SPOT, // type - 6, // delay (or random chance) - { // roomVolList - {50,6,6}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 156 Crowd goes, "Ooh!": CRO36APP - { - FX_OOH, // sampleId - FX_SPOT, // type - 1, // delay (or random chance) - { // roomVolList - {36,6,7}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 157 Phone rings: When Nico calls back in room 41. Loops until the guard answers it. - { - FX_PHONCALL, // sampleId - FX_LOOP, // type - 0, // delay (or random chance) - { // roomVolList - {41,16,16}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 158 Phone picked up in 41: GUA41ANS - { - FX_FONEUP41, // sampleId - FX_SPOT, // type - 18, // delay (or random chance) - { // roomVolList - {41,5,6}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 159 George turns thermostat: GEO41THE (another dummy). Also used on the reverse. - { - FX_THERMO1, // sampleId - FX_SPOT, // type - 10, // delay (or random chance) - { // roomVolList - {41,6,5}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 160 Low echoing rumble of large church - { - FX_CHURCHFX, // sampleId - FX_LOOP, // type - 0, // delay (or random chance) - { // roomVolList - {38,5,5}, // {roomNo,leftVol,rightVol} - {48,5,5}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 161 George drys hand: GEO43HAN - { - FX_DRIER1, // sampleId - FX_SPOT, // type - 9, // delay (or random chance) - { // roomVolList - {43,16,16}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 162 George jumps in through window: GEOWIN8 - { - FX_JUMPIN, // sampleId - FX_SPOT, // type - 49, // delay (or random chance) - { // roomVolList - {17,8,10}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 163 Khan fires: KHS12 - { - FX_SHOTKHAN, // sampleId - FX_SPOT, // type - 30, // delay (or random chance) - { // roomVolList - {54,5,5}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 164 Khan fires: KHS5 - { - FX_SHOTKHAN, // sampleId - FX_SPOT, // type - 5, // delay (or random chance) - { // roomVolList - {54,5,5}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 165 George falls: GEOSYR37 - { - FX_GEOFAL54, // sampleId - FX_SPOT, // type - 25, // delay (or random chance) - { // roomVolList - {54,5,5}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 166 George falls after going for the gun (GEOSYR42) - { - FX_GEOFAL54, // sampleId - FX_SPOT, // type - 46, // delay (or random chance) - { // roomVolList - {54,5,5}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 167 Pickaxe sound 5: Screen 1 - WRKDIG01 - { - FX_PICK5, // sampleId - FX_SPOT, // type - 9, // delay (or random chance) * - { // roomVolList - {1,3,3}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 168 George climbs ladder in 7: GEOASC07 - { - FX_SEWLADU7, // sampleId - FX_SPOT, // type - 7, // delay (or random chance) * - { // roomVolList - {7,8,9}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 169 George picks keys up in Alamut: GEOKEYS1 - { - FX_KEYS49, // sampleId - FX_SPOT, // type - 9, // delay (or random chance) * - { // roomVolList - {49,8,7}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - //------------------------ - // 170 George puts down keys up in Alamut: GEOKEYS2 - { - FX_KEYS49, // sampleId - FX_SPOT, // type - 7, // delay (or random chance) * - { // roomVolList - {49,8,7}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 171 George unlocks toilet door: GEOSYR43 - { - FX_UNLOCK49, // sampleId - FX_SPOT, // type - 16, // delay (or random chance) * - { // roomVolList - {49,6,8}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 172 George breaks the toilet chain. GEOSYR48 - { - FX_WCCHAIN, // sampleId - FX_SPOT, // type - 10, // delay (or random chance) * - { // roomVolList - {50,6,7}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 173 George breaks the branch of the cliff edge tree. GEOSYR20 - { - FX_BREKSTIK, // sampleId - FX_SPOT, // type - 16, // delay (or random chance) * - { // roomVolList - {54,6,6}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 174 George climbs down the cliff face. GEOSYR23 - { - FX_CLIMBDWN, // sampleId - FX_SPOT, // type - 6, // delay (or random chance) * - { // roomVolList - {54,6,7}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 175 George pulls ring: GEOSYR26 - { - FX_RINGPULL, // sampleId - FX_SPOT, // type - 1, // delay (or random chance) * - { // roomVolList - {54,7,4}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 176 Bull's Head door opens: SECDOR - { - FX_SECDOR54, // sampleId - FX_SPOT, // type - 1, // delay (or random chance) * - { // roomVolList - {54,7,8}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 177 Inside Bull's Head door opens: DOOR55 (and its reverse). - { - FX_SECDOR55, // sampleId - FX_SPOT, // type - 1, // delay (or random chance) * - { // roomVolList - {55,4,12}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 178 Ayub opens door. AYU1 - { - FX_AYUBDOOR, // sampleId - FX_SPOT, // type - 1, // delay (or random chance) * - { // roomVolList - {45,8,3}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 179 George knocks at the door in location 4: GEONOK followed by reverse of GEONOK - { - FX_KNOKKNOK, // sampleId - FX_SPOT, // type - 13, // delay (or random chance) * - { // roomVolList - {4,16,16}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 180 George knocks at the door in location 5: GEONOK05 - { - FX_KNOKKNOK, // sampleId - FX_SPOT, // type - 8, // delay (or random chance) * - { // roomVolList - {5,8,8}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 181 Those pesky Irish birds turn up in Spain, too. - { - FX_SPNBIRD1, // sampleId - FX_RANDOM, // type - 720, // delay (or random chance) * - { // roomVolList - {57,1,4}, - {58,8,4}, - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 182 Those pesky Irish birds turn up in Spain, too. - { - FX_SPNBIRD2, // sampleId - FX_RANDOM, // type - 697, // delay (or random chance) * - { // roomVolList - {57,4,8}, // {roomNo,leftVol,rightVol} - {58,4,1}, - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 183 The secret door in the well: SECDOR61 anim - { - FX_SECDOR61, // sampleId - FX_SPOT, // type - 1, // delay (or random chance) * - { // roomVolList - {61,4,8}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 184 Spanish countryside ambience - { - FX_SPAIN, // sampleId - FX_LOOP, // type - 0, // delay (or random chance) * - { // roomVolList - {57,1,2}, // - {58,2,2}, // - {60,1,1}, // - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 185 Spanish well ambience - { - FX_WELLDRIP, // sampleId - FX_LOOP, // type - 0, // delay (or random chance) * - { // roomVolList - {61,4,4}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 186 Fish falls on George's head: GEOTOT29 - { - FX_FISHFALL, // sampleId - FX_SPOT, // type - 60, // delay (or random chance) * - { // roomVolList - {29,10,16}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 187 Hospital exterior ambience - { - FX_HOSPEXT, // sampleId - FX_LOOP, // type - 0, // delay (or random chance) * - { // roomVolList - {31,3,4}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 188 Hospital exterior gravel footstep #1 - { - FX_GRAVEL1, // sampleId - FX_SPOT, // type - 0, // delay (or random chance) * - { // roomVolList - {31,16,16}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 189 Hospital exterior gravel footstep #2 - { - FX_GRAVEL2, // sampleId - FX_SPOT, // type - 0, // delay (or random chance) * - { // roomVolList - {31,16,16}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - //------------------------ - // 190 George opens sarcophagus: GEOSAR - { - FX_SARCO28A, // sampleId - FX_SPOT, // type - 26, // delay (or random chance) * - { // roomVolList - {28,6,6}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 191 George closes sarcophagus: GEOSAR2 - { - FX_SARCO28B, // sampleId - FX_SPOT, // type - 24, // delay (or random chance) * - { // roomVolList - {28,3,3}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 192 Guard opens sarcophagus: MUSOPN - { - FX_SARCO28C, // sampleId - FX_SPOT, // type - 14, // delay (or random chance) * - { // roomVolList - {28,3,3}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 193 George peeks out of sarcophagus: GEOPEEK - { - FX_SARCO29, // sampleId - FX_SPOT, // type - 4, // delay (or random chance) * - { // roomVolList - {29,5,10}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 194 The rope drops into the room: ROPE29 - { - FX_ROPEDOWN, // sampleId - FX_SPOT, // type - 3, // delay (or random chance) * - { // roomVolList - {29,3,3}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 195 George pushes the totem pole: GEOTOT29 - { - FX_TOTEM29A, // sampleId - FX_SPOT, // type - 30, // delay (or random chance) * - { // roomVolList - {29,12,12}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 196 George pushes the totem pole over: GEOTOTB - { - FX_TOTEM29B, // sampleId - FX_SPOT, // type - 1, // delay (or random chance) * - { // roomVolList - {29,16,16}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 197 George rocks the totem pole in museum hours: TOTEM28 - { - FX_TOTEM28A, // sampleId - FX_SPOT, // type - 8, // delay (or random chance) * - { // roomVolList - {28,4,4}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 198 Ambient sound for Montfauçon Square - { - FX_MONTAMB, // sampleId - FX_LOOP, // type - 0, // delay (or random chance) * - { // roomVolList - {36,6,6}, // {roomNo,leftVol,rightVol} - {40,6,6}, - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 199 Ambient sound churchyard. - { - FX_WIND71, // sampleId - FX_RANDOM, // type - 720, // delay (or random chance) * - { // roomVolList - {71,10,10}, // {roomNo,leftVol,rightVol} - {72,7,7}, - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 200 Owl cry #1 in churchyard - { - FX_OWL71A, // sampleId - FX_RANDOM, // type - 720, // delay (or random chance) * - { // roomVolList - {71,8,8}, // {roomNo,leftVol,rightVol} - {72,6,4}, - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 201 Owl cry #2 in churchyard - { - FX_OWL71B, // sampleId - FX_RANDOM, // type - 1080, // delay (or random chance) * - { // roomVolList - {71,8,8}, // {roomNo,leftVol,rightVol} - {72,7,6}, - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 202 Air conditioner in the museum - { - FX_AIRCON28, // sampleId - FX_LOOP, // type - 0, // delay (or random chance) * - { // roomVolList - {28,6,6}, // {roomNo,leftVol,rightVol} - {29,3,3}, - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 203 George breaks the handle off in the church tower. GEOWND72 - { - FX_COG72A, // sampleId - FX_SPOT, // type - 5, // delay (or random chance) * - { // roomVolList - {72,10,10}, - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 204 Countess' room ambience - { - FX_AMBIEN56, // sampleId - FX_LOOP, // type - 0, // delay (or random chance) * - { // roomVolList - {56,3,2}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 205 Musical effect for George drinking beer. GEODRN20 - { - FX_DRINK, // sampleId - FX_SPOT, // type - 17, // delay (or random chance) * - { // roomVolList - {20,12,12}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 206 Torch thrown through the air. GEOTHROW - { - FX_TORCH73, // sampleId - FX_SPOT, // type - 14, // delay (or random chance) * - { // roomVolList - {73,16,16}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 207 Internal train ambience. - { - FX_TRAININT, // sampleId - FX_LOOP, // type - 0, // delay (or random chance) * - { // roomVolList - {63,3,3}, // {roomNo,leftVol,rightVol} - {65,2,2}, - {66,2,2}, - {67,2,2}, - {69,2,2}, - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 208 Countess' clock. PENDULUM. Note: Trigger the sound effect on alternate runs of the pendulum animation. - { - FX_PENDULUM, // sampleId - FX_SPOT, // type - 6, // delay (or random chance) * - { // roomVolList - {56,2,2}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 209 Compartment door. DOOR65 - { - FX_DOOR65, // sampleId - FX_SPOT, // type - 1, // delay (or random chance) * - { // roomVolList - {65,3,3}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - //------------------------ - // 210 Opening window. GEOOPN1 - { - FX_WINDOW66, // sampleId - FX_SPOT, // type - 8, // delay (or random chance) * - { // roomVolList - {66,5,5}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 211 Wind rip by the open window. Triggered at the end of effect 210. - { - FX_WIND66, // sampleId - FX_LOOP, // type - 0, // delay (or random chance) * - { // roomVolList - {66,5,5}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 212 George electrocutes himself on the pantograph. Fool. GEOSHK64 - { - FX_SHOCK63, // sampleId - FX_SPOT, // type - 11, // delay (or random chance) * - { // roomVolList - {63,12,14}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 213 The train brakes violently. GEOSTP69 - { - FX_BRAKES, // sampleId - FX_SPOT, // type - 13, // delay (or random chance) * - { // roomVolList - {69,16,16}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 214 The train ticks over. From the end of BRAKE. - { - FX_TICK69, // sampleId - FX_LOOP, // type - 0, // delay (or random chance) * - { // roomVolList - {69,8,8}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 215 Eklund shoot Khan. FIGHT69 - { - FX_EKSHOOT, // sampleId - FX_SPOT, // type - 120, // delay (or random chance) * - { // roomVolList - {69,12,12}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 216 Eklund shoots George. GEODIE69 - { - FX_EKSHOOT, // sampleId - FX_SPOT, // type - 21, // delay (or random chance) * - { // roomVolList - {69,12,12}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 217 Khan pulls the door open. FIGHT69 - { - FX_DOOR69, // sampleId - FX_SPOT, // type - 42, // delay (or random chance) * - { // roomVolList - {69,8,12}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 218 Wind shriek. Loops from the end of DOOR69 wav to the beginning of BRAKES. - { - FX_WIND66, // sampleId - FX_LOOP, // type - 0, // delay (or random chance) * - { // roomVolList - {69,8,12}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 219 Brakes releasing pressure. Only after BRAKE has been run. - { - FX_PNEUMO69, // sampleId - FX_RANDOM, // type - 720, // delay (or random chance) * - { // roomVolList - {69,8,8}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 220 External train sound. Played while George is on the top of the train. - { - FX_TRAINEXT, // sampleId - FX_LOOP, // type - 0, // delay (or random chance) * - { // roomVolList - {63,8,8}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 221 The passing train. FIGHT69 - { - FX_TRNPASS, // sampleId - FX_SPOT, // type - 102, // delay (or random chance) * - { // roomVolList - {69,4,16}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 222 George descends into sewer. GEODESO6 - { - FX_LADD2, // sampleId - FX_SPOT, // type - 1, // delay (or random chance) * - { // roomVolList - {6,4,4}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 223 George ascends into alley. GEOASC06 - { - FX_LADD3, // sampleId - FX_SPOT, // type - 10, // delay (or random chance) * - { // roomVolList - {6,4,4}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 224 George replaces manhole cover. GEOMAN9 - { - FX_COVERON2, // sampleId - FX_SPOT, // type - 19, // delay (or random chance) * - { // roomVolList - {2,12,11}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 225 Montfaucon sewer ambience. - { - FX_AMBIEN37, // sampleId - FX_LOOP, // type - 0, // delay (or random chance) * - { // roomVolList - {37,5,5}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 226 George's winning smile. GEOJMP72. - { - FX_PING, // sampleId - FX_SPOT, // type - 26, // delay (or random chance) * - { // roomVolList - {72,10,14}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 227 George starts to open the manhole. GEO36KNE - { - FX_MANOP36, // sampleId - FX_SPOT, // type - 19, // delay (or random chance) * - { // roomVolList - {36,4,6}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 228 George opens the manhole. GEO36OPE - { - FX_PULLUP36, // sampleId - FX_SPOT, // type - 9, // delay (or random chance) * - { // roomVolList - {36,4,6}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 229 George replaces the manhole cover. GEO36CLO - { - FX_REPLCE36, // sampleId - FX_SPOT, // type - 20, // delay (or random chance) * - { // roomVolList - {36,4,6}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - //------------------------ - // 230 George knocks at righthand arch. GEO37TA3 - { - FX_KNOCK37, // sampleId - FX_SPOT, // type - 20, // delay (or random chance) * - { // roomVolList - {37,6,12}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 231 George knocks at middle or lefthand arch. GEO37TA1 or GEO37TA2. - { - FX_KNOCK37B, // sampleId - FX_SPOT, // type - 20, // delay (or random chance) * - { // roomVolList - {37,4,8}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 232 George winds the chain down HOO37LBO - { - FX_CHAIN37, // sampleId - FX_SPOT, // type - 14, // delay (or random chance) * - { // roomVolList - {37,6,10}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 233 George winds the chain up. HOO37LBO (In reverse) - { - FX_CHAIN37B, // sampleId - FX_SPOT, // type - 1, // delay (or random chance) * - { // roomVolList - {37,6,10}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 234 George breaks hole in door. GEO37TA4 - { - FX_HOLE37, // sampleId - FX_SPOT, // type - 11, // delay (or random chance) * - { // roomVolList - {37,6,12}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 235 Plaster door collapses. DOR37COL - { - FX_DOOR37, // sampleId - FX_SPOT, // type - 23, // delay (or random chance) * - { // roomVolList - {37,8,15}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 236 Barge winch. GEO37TUL (If it runs more than once, trigger the effect on frame one. Incidentally, this is a reversible so the effect must launch on frame one of the .cdr version as well. ) - { - FX_WINCH37, // sampleId - FX_SPOT, // type - 1, // delay (or random chance) * - { // roomVolList - {37,16,16}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 237 George places chess piece. GEOSPA17 - { - FX_CHESS, // sampleId - FX_SPOT, // type - 23, // delay (or random chance) * - { // roomVolList - {59,4,4}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 238 Piano loop for the upstairs hotel corridor. - { - FX_PIANO14, // sampleId - FX_LOOP, // type - 0, // delay (or random chance) * - { // roomVolList - {14,2,2}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 239 Door opens in church tower. PANEL72 - { - FX_SECDOR72, // sampleId - FX_SPOT, // type - 1, // delay (or random chance) * - { // roomVolList - {72,8,10}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - //------------------------ - // 240 George rummages through debris. Tied to the end of the whichever crouch is used. Use either this one or RUMMAGE2 alternatively or randomly. Same kind of schtick as the pick axe noises, I suppose. - { - FX_RUMMAGE1, // sampleId - FX_SPOT, // type - 9, // delay (or random chance) * - { // roomVolList - {72,8,6}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 241 George rummages through debris. See above for notes. - { - FX_RUMMAGE2, // sampleId - FX_SPOT, // type - 9, // delay (or random chance) * - { // roomVolList - {72,8,6}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 242 Gust of wind in the graveyard. - { - FX_GUST71, // sampleId - FX_RANDOM, // type - 1080, // delay (or random chance) * - { // roomVolList - {71,3,3}, // {roomNo,leftVol,rightVol} - {72,2,1}, - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 243 Violin ambience for Ireland. - { - FX_VIOLIN19, // sampleId - FX_LOOP, // type - 0, // delay (or random chance) * - { // roomVolList - {19,3,3}, // {roomNo,leftVol,rightVol} - {21,2,2}, - {26,2,2}, - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 244 Footstep #1 for underground locations. Same schtick as for 188 and 189. - { - FX_SEWSTEP1, // sampleId - FX_SPOT, // type - 0, // delay (or random chance) * - { // roomVolList - {6,8,8}, // {roomNo,leftVol,rightVol} - {7,8,8}, - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 245 Footstep #2 for underground locations. Same schtick as for 188 and 189. - { - FX_SEWSTEP2, // sampleId - FX_SPOT, // type - 0, // delay (or random chance) * - { // roomVolList - {6,16,16}, // {roomNo,leftVol,rightVol} - {7,16,16}, - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 246 Nico's carabiner as she descends into the museum. NICPUS1 - { - FX_CARABINE, // sampleId - FX_SPOT, // type - 4, // delay (or random chance) * - { // roomVolList - {29,8,8}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 247 Rosso is shot (with a piece of field artillery). ROSSHOT - { - FX_GUN79, // sampleId - FX_SPOT, // type - 2, // delay (or random chance) * - { // roomVolList - {79,16,16}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 248 George is hit by the thrown stilletto. GEODIE1 - { - FX_DAGGER1, // sampleId - FX_SPOT, // type - 2, // delay (or random chance) * - { // roomVolList - {73,12,12}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 249 George is hit by the thrown stilletto after walking forward. GEODIE2 - { - FX_DAGGER1, // sampleId - FX_SPOT, // type - 9, // delay (or random chance) * - { // roomVolList - {73,12,12}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - //------------------------ - // 250 Can hits the well water. The cue is in GAR2SC57.TXT immediately after the line, "over: Lopez threw the can away. It seemed to fall an awfully long way." - { - FX_CANFALL, // sampleId - FX_SPOT, // type - 4, // delay (or random chance) * - { // roomVolList - {57,16,16}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 251 Mad, fizzing damp and ancient gunpowder after the application of a torch. - { - FX_GUNPOWDR, // sampleId - FX_LOOP, // type - 0, // delay (or random chance) * - { // roomVolList - {73,12,12}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 252 Maguire whistling. MAGSLK. Plays while Maguire is idling, stops abruptly when he does something else. - { - FX_WHISTLE, // sampleId - FX_LOOP, // type - 0, // delay (or random chance) * - { // roomVolList - {19,2,5}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 253 George is hit by the goat. GEOHITR and GEOHITL. - { - FX_GEOGOAT, // sampleId - FX_SPOT, // type - 11, // delay (or random chance) * - { // roomVolList - {24,10,10}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 254 Manager says, "Hello". MAN2 - { - FX_MANG1, // sampleId - FX_SPOT, // type - 7, // delay (or random chance) * - { // roomVolList - {49,6,5}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 255 Manager says, Don't go in there!" MAN3 - { - FX_MANG2, // sampleId - FX_SPOT, // type - 11, // delay (or random chance) * - { // roomVolList - {49,6,5}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 256 Manager says, "Here are the keys." MAN4 - { - FX_MANG3, // sampleId - FX_SPOT, // type - 6, // delay (or random chance) * - { // roomVolList - {49,6,5}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 257 George pulls the lion's tooth. GEOSPA26 - { - FX_TOOTHPUL, // sampleId - FX_SPOT, // type - 19, // delay (or random chance) * - { // roomVolList - {61,8,16}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 258 George escapes the lion. LION1 - { - FX_LIONFALL, // sampleId - FX_SPOT, // type - 7, // delay (or random chance) * - { // roomVolList - {61,8,16}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 259 George gets flattened. LION2 - { - FX_LIONFAL2, // sampleId - FX_SPOT, // type - 4, // delay (or random chance) * - { // roomVolList - {61,8,16}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 260 Rosso dies. ROSSFALL - { - FX_ROSSODIE, // sampleId - FX_SPOT, // type - 1, // delay (or random chance) * - { // roomVolList - {74,16,16}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 261 Eklund chokes George. FIGHT79 - { - FX_CHOKE1, // sampleId - FX_SPOT, // type - 9, // delay (or random chance) * - { // roomVolList - {79,16,16}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 262 Eklund chokes George some more. FIGHT79 - { - FX_CHOKE2, // sampleId - FX_SPOT, // type - 54, // delay (or random chance) * - { // roomVolList - {79,16,16}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 263 Eklund dies. FIGHT79 - { - FX_FIGHT2, // sampleId - FX_SPOT, // type - 44, // delay (or random chance) * - { // roomVolList - {79,16,16}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 264 George hears museum break-in. GEOSUR29 - { - FX_DOOR29, // sampleId - FX_SPOT, // type - 10, // delay (or random chance) * - { // roomVolList - {94,14,10}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 265 George hits the floor having been shot. GEODED. - { - FX_GDROP29, // sampleId - FX_SPOT, // type - 27, // delay (or random chance) * - { // roomVolList - {29,10,16}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 266 George hits the floor having been stunned. GEOFISH - { - FX_GDROP29, // sampleId - FX_SPOT, // type - 27, // delay (or random chance) * - { // roomVolList - {29,10,16}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 267 Fitz being knocked down as heard from inside the pub. Triggered from the script, I think. This is just a stopgap until Hackenbacker do the full version for the Smacker, then I'll sample the requisite bit and put it in here. - { - FX_FITZHIT, // sampleId - FX_SPOT, // type - 1, // delay (or random chance) * - { // roomVolList - {20,16,10}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 268 Gendarme shoots lock off. GENSHOT - { - FX_GUN34, // sampleId - FX_SPOT, // type - 1, // delay (or random chance) * - { // roomVolList - {34,16,16}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 269 ECG alarm, Marquet in trouble. Start looping imeediately before George says, "Thanks, Bunny". - // Incidentally, James, please switch off Mr Shiney permanently when George first gets into Marquet's room. He gets in the way when they're figuring out that Eklund's an imposter. - { - FX_PULSE2, // sampleId - FX_LOOP, // type - 1, // delay (or random chance) * - { // roomVolList - {30,16,16}, // {roomNo,leftVol,rightVol} - {34,12,12}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - //------------------------ - // 270 ECG alarm, Marquet dead. Switch off the previous effect and replace with this immediately before the gendarme says, "Stand back, messieurs." - { - FX_PULSE3, // sampleId - FX_LOOP, // type - 1, // delay (or random chance) * - { // roomVolList - {30,16,16}, // {roomNo,leftVol,rightVol} - {34,13,13}, - {35,13,13}, - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 271 Door closing. GEOENT15 - { - FX_DORCLOSE, // sampleId - FX_SPOT, // type - 4, // delay (or random chance) * - { // roomVolList - {15,12,12}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 272 Cupboard opening. GEOCOT - { - FX_CUPBOPEN, // sampleId - FX_SPOT, // type - 8, // delay (or random chance) * - { // roomVolList - {33,12,12}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 273 Cupboard closing. GEOCOT - { - FX_CUPBCLOS, // sampleId - FX_SPOT, // type - 33, // delay (or random chance) * - { // roomVolList - {33,12,12}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 274 Closing door when George leaves hotel room. GEOLVS15 and GEODOR17 (they're identical). - { - FX_DORCLOSE, // sampleId - FX_SPOT, // type - 44, // delay (or random chance) * - { // roomVolList - {15,12,12}, // {roomNo,leftVol,rightVol} - {17,12,12}, - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 275 Closing door when George leaves the pub. DOROPN20 (Reversed) - { - FX_DORCLOSE20,// sampleId - FX_SPOT, // type - 11, // delay (or random chance) * - { // roomVolList - {20,12,12}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 276 Nico call for a cab. NICPHN10 - { - FX_PHONICO1, // sampleId - FX_SPOT, // type - 15, // delay (or random chance) * - { // roomVolList - {10,12,12}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 277 Nico puts down the phone. NICDWN10 - { - FX_FONEDN, // sampleId - FX_SPOT, // type - 6, // delay (or random chance) * - { // roomVolList - {10,12,12}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 278 Painter puts down the phone. PAI41HAN - { - FX_FONEDN41, // sampleId - FX_SPOT, // type - 5, // delay (or random chance) * - { // roomVolList - {41,12,12}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 279 Mechanical hum of heating system in the dig lobby. - { - FX_AIRCON41, // sampleId - FX_LOOP, // type - 0, // delay (or random chance) * - { // roomVolList - {41,6,6}, // {roomNo,leftVol,rightVol} - {43,8,8}, - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - //------------------------ - // 280 The Sword is Reforged (Grandmaster gets zapped) GMPOWER - { - FX_REFORGE1, // sampleId - FX_SPOT, // type - 1, // delay (or random chance) * - { // roomVolList - {78,16,16}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 281 The Sword is Reforged (G&N gawp at the spectacle) There's no anim I know of to tie it to unless the flickering blue light is one. - { - FX_REFORGE2, // sampleId - FX_SPOT, // type - 1, // delay (or random chance) * - { // roomVolList - {75,12,12}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 282 The Sword is Reforged (We watch over G&N's heads as the Grandmaster gets zapped) GMWRIT74 - { - FX_REFORGE2, // sampleId - FX_SPOT, // type - 1, // delay (or random chance) * - { // roomVolList - {74,14,14}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 283 The Sword is Reforged (Grandmaster finishes being zapped) GMWRITH - { - FX_REFORGE4, // sampleId - FX_SPOT, // type - 1, // delay (or random chance) * - { // roomVolList - {78,16,16}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 284 Baphomet Cavern Ambience - { - FX_BAPHAMB, // sampleId - FX_LOOP, // type - 0, // delay (or random chance) * - { // roomVolList - {74,6,8}, // {roomNo,leftVol,rightVol} - {75,7,8}, // {roomNo,leftVol,rightVol} - {76,8,8}, // {roomNo,leftVol,rightVol} - {77,8,8}, // {roomNo,leftVol,rightVol} - {78,8,8}, // {roomNo,leftVol,rightVol} - {79,7,8}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 285 Duane's Happy-Snappy Camera. XDNEPHO3 and XDNEPHO5. - { - FX_CAMERA45, // sampleId - FX_SPOT, // type - 30, // delay (or random chance) * - { // roomVolList - {45,4,4}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 286 Grand Master strikes the floor with his cane. GMENTER - { - FX_STAFF, // sampleId - FX_SPOT, // type - 28, // delay (or random chance) * - { // roomVolList - {73,8,8}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 287 George descends ladder in 7: GEOASC07 (Reversed) This used to be handled by effect #46 but it didn't fit at all. - { - FX_SEWLADD7, // sampleId - FX_SPOT, // type - 1, // delay (or random chance) * - { // roomVolList - {7,8,9}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 288 Sam kicks the recalcitrant Mr. Shiny. DOMKIK - { - FX_KIKSHINY, // sampleId - FX_SPOT, // type - 16, // delay (or random chance) * - { // roomVolList - {33,9,9}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 289 Gust of wind outside bombed cafe. LVSFLY - { - FX_LVSFLY, // sampleId - FX_SPOT, // type - 1, // delay (or random chance) * - { // roomVolList - {1,16,16}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 290 Ron's disgusting No.1 Sneeze. Either this or the next effect (randomly chosen) is used for the following animations, RONSNZ & RONSNZ2 - { - FX_SNEEZE1, // sampleId - FX_SPOT, // type - 11, // delay (or random chance) * - { // roomVolList - {20,10,16}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 291 Ron's disgusting No.2 Sneeze. Either this or the previous effect (randomly chosen) is used for the following animations, RONSNZ & RONSNZ2 - { - FX_SNEEZE2, // sampleId - FX_SPOT, // type - 11, // delay (or random chance) * - { // roomVolList - {20,10,16}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 292 Dripping tap in the pub cellar. TAPDRP - { - FX_DRIPIRE, // sampleId - FX_SPOT, // type - 9, // delay (or random chance) * - { // roomVolList - {21,4,4}, // {roomNo,leftVol,rightVol} - {26,4,4}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 293 Dripping tap in the pub cellar. TAPDRP - { - FX_DRIPIRE2, // sampleId - FX_SPOT, // type - 9, // delay (or random chance) * - { // roomVolList - {21,4,4}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 294 Dripping tap in the excavation toilet. (see WATER43 - but it's looped anyway, not triggered with anim) - { - FX_TAPDRIP, // sampleId - FX_SPOT, // type - 6, // delay (or random chance) * - { // roomVolList - {43,8,8}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 295 George closes the mausoleum window. GEOSPA23 - { - FX_WINDOW59, // sampleId - FX_SPOT, // type - 24, // delay (or random chance) * - { // roomVolList - {59,10,8}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 296 George opens the mausoleum window, the feebleminded loon. GEOSPA23 reversed. - { - FX_WINDOW59, // sampleId - FX_SPOT, // type - 14, // delay (or random chance) * - { // roomVolList - {59,10,8}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 297 When George & Nico hear chanting from sc73 - { - FX_CHANT, // sampleId - FX_SPOT, // type - 10, // delay (or random chance) * - { // roomVolList - {73,2,4}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 298 EKFIGHT - { - FX_FIGHT1, // sampleId - FX_SPOT, // type - 31, // delay (or random chance) * - { // roomVolList - {74,16,16}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 299 Small van passes, left to right. CARA9 and CARC9 - { - FX_LITEVEHR, // sampleId - FX_SPOT, // type - 1, // delay (or random chance) * - { // roomVolList - {9,16,10}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 300 Small van passes, right to left to right. CARB9 - { - FX_LITEVEHL, // sampleId - FX_SPOT, // type - 1, // delay (or random chance) * - { // roomVolList - {9,16,10}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 301 Truck passes, left to right. TRUCKA9 and TRUCKB9 - { - FX_HVYVEHR, // sampleId - FX_SPOT, // type - 1, // delay (or random chance) * - { // roomVolList - {9,14,10}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 302 Truck passes, right to left. TRUCKC9 - { - FX_HVYVEHL, // sampleId - FX_SPOT, // type - 1, // delay (or random chance) * - { // roomVolList - {9,14,10}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 303 With anim FIGHT69 - { - FX_FIGHT69, // sampleId - FX_SPOT, // type - 78, // delay (or random chance) * - { // roomVolList - {69,12,16}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 304 With anim GEODIE1 in sc73 - { - FX_GDROP73, // sampleId - FX_SPOT, // type - 14, // delay (or random chance) * - { // roomVolList - {73,12,16}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 305 With anim GEODIE2 in sc73 - { - FX_GDROP73, // sampleId - FX_SPOT, // type - 21, // delay (or random chance) * - { // roomVolList - {73,12,16}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 306 With anim GEODES25 - { - FX_LADDWN25, // sampleId - FX_SPOT, // type - 0, // delay (or random chance) * - { // roomVolList - {25,12,8}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 307 With anim GEOASC25 - { - FX_LADDUP25, // sampleId - FX_SPOT, // type - 8, // delay (or random chance) * - { // roomVolList - {25,12,8}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 308 With anim GKSWORD in sc76 - { - FX_GKSWORD, // sampleId - FX_SPOT, // type - 9, // delay (or random chance) * - { // roomVolList - {76,10,10}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 309 With anim GEO36KNE in sc36 - { - FX_KEYIN, // sampleId - FX_SPOT, // type - 18, // delay (or random chance) * - { // roomVolList - {36,14,14}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 310 With anim GEO36ENT in sc36 - { - FX_COVDWN, // sampleId - FX_SPOT, // type - 85, // delay (or random chance) * - { // roomVolList - {36,14,14}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - // 311 With anim SECDOR59 in sc59 - { - FX_SECDOR59, // sampleId - FX_SPOT, // type - 0, // delay (or random chance) * - { // roomVolList - {59,16,16}, // {roomNo,leftVol,rightVol} - {0,0,0}, // NULL-TERMINATOR - }, - }, - //------------------------ - }; - - writeRecord(_fxList, sizeof(_fxList), GBVARS_FXLIST_INDEX , GBVARS_SWORD1); -} - -void Sword1_addStaticres() { - addStaticres_fxList(); -} diff --git a/backends/platform/PalmOS/Src/builder/sword1/sw1_staticres.h b/backends/platform/PalmOS/Src/builder/sword1/sw1_staticres.h deleted file mode 100644 index 796e3d10ed..0000000000 --- a/backends/platform/PalmOS/Src/builder/sword1/sw1_staticres.h +++ /dev/null @@ -1,5201 +0,0 @@ -#ifndef SWORDRES_H -#define SWORDRES_H - -//namespace Sword1 { - -// scripts - // standard -#define SCRIPT0 0x01000000 - // 1 entities in TXTs, 1 in datafiles. - // megas -#define SCRIPT128 0x01010000 -#define SCRIPT129 0x01010001 -#define SCRIPT130 0x01010002 -#define SCRIPT131 0x01010003 -#define SCRIPT133 0x01010004 -#define SCRIPT134 0x01010005 -#define SCRIPT145 0x01010006 -#define SCRIPT146 0x01010007 - // 8 entities in TXTs, 8 in datafiles. - // maps -#define SCRIPT80 0x01020000 -#define SCRIPT86 0x01020001 -#define SCRIPT90 0x01020002 - // 3 entities in TXTs, 3 in datafiles. - // paris1 -#define SCRIPT1 0x01030000 -#define SCRIPT2 0x01030001 -#define SCRIPT3 0x01030002 -#define SCRIPT4 0x01030003 -#define SCRIPT5 0x01030004 -#define SCRIPT6 0x01030005 -#define SCRIPT7 0x01030006 -#define SCRIPT8 0x01030007 - // 8 entities in TXTs, 8 in datafiles. - // paris2 -#define SCRIPT9 0x01040000 -#define SCRIPT10 0x01040001 -#define SCRIPT11 0x01040002 -#define SCRIPT12 0x01040003 -#define SCRIPT13 0x01040004 -#define SCRIPT14 0x01040005 -#define SCRIPT15 0x01040006 -#define SCRIPT16 0x01040007 -#define SCRIPT17 0x01040008 -#define SCRIPT18 0x01040009 -#define SCRIPT46 0x0104000A - // 11 entities in TXTs, 11 in datafiles. - // paris3 -#define SCRIPT27 0x01050000 -#define SCRIPT28 0x01050001 -#define SCRIPT29 0x01050002 -#define SCRIPT31 0x01050003 -#define SCRIPT32 0x01050004 -#define SCRIPT33 0x01050005 -#define SCRIPT34 0x01050006 -#define SCRIPT35 0x01050007 - // 8 entities in TXTs, 8 in datafiles. - // paris4 -#define SCRIPT36 0x01060000 -#define SCRIPT37 0x01060001 -#define SCRIPT38 0x01060002 -#define SCRIPT39 0x01060003 -#define SCRIPT40 0x01060004 -#define SCRIPT41 0x01060005 -#define SCRIPT42 0x01060006 -#define SCRIPT43 0x01060007 -#define SCRIPT48 0x01060008 - // 9 entities in TXTs, 9 in datafiles. - // ireland -#define SCRIPT19 0x01070000 -#define SCRIPT20 0x01070001 -#define SCRIPT21 0x01070002 -#define SCRIPT22 0x01070003 -#define SCRIPT23 0x01070004 -#define SCRIPT24 0x01070005 -#define SCRIPT25 0x01070006 -#define SCRIPT26 0x01070007 - // 8 entities in TXTs, 8 in datafiles. - // spain -#define SCRIPT56 0x01080000 -#define SCRIPT57 0x01080001 -#define SCRIPT58 0x01080002 -#define SCRIPT59 0x01080003 -#define SCRIPT60 0x01080004 -#define SCRIPT61 0x01080005 -#define SCRIPT62 0x01080006 - // 7 entities in TXTs, 7 in datafiles. - // syria -#define SCRIPT45 0x01090000 -#define SCRIPT47 0x01090001 -#define SCRIPT49 0x01090002 -#define SCRIPT50 0x01090003 -#define SCRIPT54 0x01090004 -#define SCRIPT55 0x01090005 - // 6 entities in TXTs, 6 in datafiles. - // train -#define SCRIPT63 0x010A0000 -#define SCRIPT65 0x010A0001 -#define SCRIPT66 0x010A0002 -#define SCRIPT67 0x010A0003 -#define SCRIPT69 0x010A0004 - // 5 entities in TXTs, 5 in datafiles. - // scotland -#define SCRIPT71 0x010B0000 -#define SCRIPT72 0x010B0001 -#define SCRIPT73 0x010B0002 -#define SCRIPT74 0x010B0003 - // 4 entities in TXTs, 4 in datafiles. -// compacts - // standard -#define TEXT_OBS 0x02000000 - // 1 entities in TXTs, 1 in datafiles. - // megas -#define MEGA_GEO 0x02010000 -#define GEO_TLK_TABLE 0x02010001 -#define WHT_TLK_TABLE 0x02010002 -#define GEO_SHRUG_TABLE 0x02010003 -#define GEO_GIVE_TABLE 0x02010004 -#define GEO_GIVER_TABLE 0x02010005 -#define GEO_CROUCH_TABLE 0x02010006 -#define GEO_CROUCHR_TABLE 0x02010007 -#define GEO_PICKUP_TABLE 0x02010008 -#define GEO_RELAX_TABLE 0x02010009 -#define GEO_RELAXR_TABLE 0x0201000A -#define GEO_HAIR_TABLE 0x0201000B -#define GEO_BLINK_TABLE 0x0201000C -#define GEOPHN_TABLE 0x0201000D -#define GEO_GAUGE_TABLE 0x0201000E -#define GEO_SHOW_TABLE 0x0201000F -#define GEO_SHOWR_TABLE 0x02010010 -#define GEOSTA_TABLE 0x02010011 -#define GEOMON_TABLE 0x02010012 -#define MEGA_DUANE 0x02010013 -#define DUA5_TABLE 0x02010014 -#define DUA6_TABLE 0x02010015 -#define DUA7_TABLE 0x02010016 -#define DUA8_TABLE 0x02010017 -#define DUA9_TABLE 0x02010018 -#define MEGA_NICO 0x02010019 -#define NIC_TLK_TABLE 0x0201001A -#define NIC_PHOTO_TABLE 0x0201001B -#define NICPHN_TABLE 0x0201001C -#define MEGA_MUS 0x0201001D -#define MUS_TLK_TABLE 0x0201001E -#define MEGA_BENOIR 0x0201001F -#define BEN_GAUGE_TABLE 0x02010020 -#define BEN_TLK_TABLE 0x02010021 -#define MEGA_ROSSO 0x02010022 -#define MEGA_MOUE 0x02010023 -#define MEGA_ALBERT 0x02010024 - // 37 entities in TXTs, 37 in datafiles. - // maps -#define COMP80 0x02020000 -#define COMP86 0x02020001 -#define COMP90 0x02020002 -#define COMP91 0x02020003 -#define COMP99 0x02020004 - // 5 entities in TXTs, 5 in datafiles. - // paris1 -#define COMP1 0x02030000 -#define COMP2 0x02030001 -#define COMP3 0x02030002 -#define COMP4 0x02030003 -#define COMP5 0x02030004 -#define COMP6 0x02030005 -#define COMP7 0x02030006 -#define COMP8 0x02030007 - // 8 entities in TXTs, 8 in datafiles. - // paris2 -#define COMP9 0x02040000 -#define COMP10 0x02040001 -#define COMP11 0x02040002 -#define COMP12 0x02040003 -#define COMP13 0x02040004 -#define COMP14 0x02040005 -#define COMP15 0x02040006 -#define COMP16 0x02040007 -#define COMP17 0x02040008 -#define COMP18 0x02040009 -#define COMP81 0x0204000A -#define COMP46 0x0204000B - // 12 entities in TXTs, 12 in datafiles. - // paris3 -#define COMP27 0x02050000 -#define COMP28 0x02050001 -#define COMP29 0x02050002 -#define COMP30 0x02050003 -#define COMP31 0x02050004 -#define COMP32 0x02050005 -#define COMP33 0x02050006 -#define COMP34 0x02050007 -#define COMP35 0x02050008 - // 9 entities in TXTs, 9 in datafiles. - // paris4 -#define COMP36 0x02060000 -#define COMP37 0x02060001 -#define COMP38 0x02060002 -#define COMP39 0x02060003 -#define COMP40 0x02060004 -#define COMP41 0x02060005 -#define COMP42 0x02060006 -#define COMP43 0x02060007 -#define COMP48 0x02060008 - // 9 entities in TXTs, 9 in datafiles. - // ireland -#define COMP19 0x02070000 -#define COMP20 0x02070001 -#define COMP21 0x02070002 -#define COMP22 0x02070003 -#define COMP23 0x02070004 -#define COMP24 0x02070005 -#define COMP25 0x02070006 -#define COMP26 0x02070007 - // 8 entities in TXTs, 8 in datafiles. - // spain -#define COMP56 0x02080000 -#define COMP57 0x02080001 -#define COMP58 0x02080002 -#define COMP59 0x02080003 -#define COMP60 0x02080004 -#define COMP61 0x02080005 -#define COMP62 0x02080006 - // 7 entities in TXTs, 7 in datafiles. - // syria -#define COMP45 0x02090000 -#define COMP47 0x02090001 -#define COMP49 0x02090002 -#define COMP50 0x02090003 -#define COMP53 0x02090004 -#define COMP54 0x02090005 -#define COMP55 0x02090006 - // 7 entities in TXTs, 7 in datafiles. - // train -#define COMP63 0x020A0000 -#define COMP65 0x020A0001 -#define COMP66 0x020A0002 -#define COMP67 0x020A0003 -#define COMP69 0x020A0004 - // 5 entities in TXTs, 5 in datafiles. - // scotland -#define COMP71 0x020B0000 -#define COMP72 0x020B0001 -#define COMP73 0x020B0002 -#define COMP74 0x020B0003 -#define COMP75 0x020B0004 -#define COMP76 0x020B0005 -#define COMP77 0x020B0006 -#define COMP78 0x020B0007 -#define COMP79 0x020B0008 - // 9 entities in TXTs, 9 in datafiles. -// text - // english -#define ENGLISH0 0x03000000 -#define ENGLISH1 0x03000001 -#define ENGLISH2 0x03000002 -#define ENGLISH3 0x03000003 -#define ENGLISH4 0x03000004 -#define ENGLISH5 0x03000005 -#define ENGLISH6 0x03000006 -#define ENGLISH7 0x03000007 -#define ENGLISH9 0x03000008 -#define ENGLISH11 0x03000009 -#define ENGLISH12 0x0300000A -#define ENGLISH13 0x0300000B -#define ENGLISH14 0x0300000C -#define ENGLISH15 0x0300000D -#define ENGLISH16 0x0300000E -#define ENGLISH17 0x0300000F -#define ENGLISH18 0x03000010 -#define ENGLISH19 0x03000011 -#define ENGLISH20 0x03000012 -#define ENGLISH21 0x03000013 -#define ENGLISH22 0x03000014 -#define ENGLISH23 0x03000015 -#define ENGLISH24 0x03000016 -#define ENGLISH25 0x03000017 -#define ENGLISH27 0x03000018 -#define ENGLISH28 0x03000019 -#define ENGLISH29 0x0300001A -#define ENGLISH31 0x0300001B -#define ENGLISH32 0x0300001C -#define ENGLISH33 0x0300001D -#define ENGLISH34 0x0300001E -#define ENGLISH35 0x0300001F -#define ENGLISH36 0x03000020 -#define ENGLISH37 0x03000021 -#define ENGLISH38 0x03000022 -#define ENGLISH39 0x03000023 -#define ENGLISH40 0x03000024 -#define ENGLISH41 0x03000025 -#define ENGLISH42 0x03000026 -#define ENGLISH43 0x03000027 -#define ENGLISH45 0x03000028 -#define ENGLISH47 0x03000029 -#define ENGLISH48 0x0300002A -#define ENGLISH49 0x0300002B -#define ENGLISH50 0x0300002C -#define ENGLISH54 0x0300002D -#define ENGLISH55 0x0300002E -#define ENGLISH56 0x0300002F -#define ENGLISH57 0x03000030 -#define ENGLISH58 0x03000031 -#define ENGLISH59 0x03000032 -#define ENGLISH60 0x03000033 -#define ENGLISH61 0x03000034 -#define ENGLISH63 0x03000035 -#define ENGLISH65 0x03000036 -#define ENGLISH66 0x03000037 -#define ENGLISH69 0x03000038 -#define ENGLISH71 0x03000039 -#define ENGLISH72 0x0300003A -#define ENGLISH73 0x0300003B -#define ENGLISH74 0x0300003C -#define ENGLISH90 0x0300003D -#define ENGLISH99 0x0300003E -#define ENGLISH129 0x0300003F -#define ENGLISH131 0x03000040 -#define ENGLISH133 0x03000041 -#define ENGLISH145 0x03000042 -#define ENGLISH146 0x03000043 - // 68 entities in TXTs, 68 in datafiles. - // french -#define FRENCH0 0x03010000 -#define FRENCH1 0x03010001 -#define FRENCH2 0x03010002 -#define FRENCH3 0x03010003 -#define FRENCH4 0x03010004 -#define FRENCH5 0x03010005 -#define FRENCH6 0x03010006 -#define FRENCH7 0x03010007 -#define FRENCH9 0x03010008 -#define FRENCH11 0x03010009 -#define FRENCH12 0x0301000A -#define FRENCH13 0x0301000B -#define FRENCH14 0x0301000C -#define FRENCH15 0x0301000D -#define FRENCH16 0x0301000E -#define FRENCH17 0x0301000F -#define FRENCH18 0x03010010 -#define FRENCH19 0x03010011 -#define FRENCH20 0x03010012 -#define FRENCH21 0x03010013 -#define FRENCH22 0x03010014 -#define FRENCH23 0x03010015 -#define FRENCH24 0x03010016 -#define FRENCH25 0x03010017 -#define FRENCH27 0x03010018 -#define FRENCH28 0x03010019 -#define FRENCH29 0x0301001A -#define FRENCH31 0x0301001B -#define FRENCH32 0x0301001C -#define FRENCH33 0x0301001D -#define FRENCH34 0x0301001E -#define FRENCH35 0x0301001F -#define FRENCH36 0x03010020 -#define FRENCH37 0x03010021 -#define FRENCH38 0x03010022 -#define FRENCH39 0x03010023 -#define FRENCH40 0x03010024 -#define FRENCH41 0x03010025 -#define FRENCH42 0x03010026 -#define FRENCH43 0x03010027 -#define FRENCH45 0x03010028 -#define FRENCH47 0x03010029 -#define FRENCH48 0x0301002A -#define FRENCH49 0x0301002B -#define FRENCH50 0x0301002C -#define FRENCH54 0x0301002D -#define FRENCH55 0x0301002E -#define FRENCH56 0x0301002F -#define FRENCH57 0x03010030 -#define FRENCH58 0x03010031 -#define FRENCH59 0x03010032 -#define FRENCH60 0x03010033 -#define FRENCH61 0x03010034 -#define FRENCH63 0x03010035 -#define FRENCH65 0x03010036 -#define FRENCH66 0x03010037 -#define FRENCH69 0x03010038 -#define FRENCH71 0x03010039 -#define FRENCH72 0x0301003A -#define FRENCH73 0x0301003B -#define FRENCH74 0x0301003C -#define FRENCH90 0x0301003D -#define FRENCH99 0x0301003E -#define FRENCH129 0x0301003F -#define FRENCH131 0x03010040 -#define FRENCH133 0x03010041 -#define FRENCH145 0x03010042 -#define FRENCH146 0x03010043 - // 68 entities in TXTs, 68 in datafiles. - // german -#define GERMAN0 0x03020000 -#define GERMAN1 0x03020001 -#define GERMAN2 0x03020002 -#define GERMAN3 0x03020003 -#define GERMAN4 0x03020004 -#define GERMAN5 0x03020005 -#define GERMAN6 0x03020006 -#define GERMAN7 0x03020007 -#define GERMAN9 0x03020008 -#define GERMAN11 0x03020009 -#define GERMAN12 0x0302000A -#define GERMAN13 0x0302000B -#define GERMAN14 0x0302000C -#define GERMAN15 0x0302000D -#define GERMAN16 0x0302000E -#define GERMAN17 0x0302000F -#define GERMAN18 0x03020010 -#define GERMAN19 0x03020011 -#define GERMAN20 0x03020012 -#define GERMAN21 0x03020013 -#define GERMAN22 0x03020014 -#define GERMAN23 0x03020015 -#define GERMAN24 0x03020016 -#define GERMAN25 0x03020017 -#define GERMAN27 0x03020018 -#define GERMAN28 0x03020019 -#define GERMAN29 0x0302001A -#define GERMAN31 0x0302001B -#define GERMAN32 0x0302001C -#define GERMAN33 0x0302001D -#define GERMAN34 0x0302001E -#define GERMAN35 0x0302001F -#define GERMAN36 0x03020020 -#define GERMAN37 0x03020021 -#define GERMAN38 0x03020022 -#define GERMAN39 0x03020023 -#define GERMAN40 0x03020024 -#define GERMAN41 0x03020025 -#define GERMAN42 0x03020026 -#define GERMAN43 0x03020027 -#define GERMAN45 0x03020028 -#define GERMAN47 0x03020029 -#define GERMAN48 0x0302002A -#define GERMAN49 0x0302002B -#define GERMAN50 0x0302002C -#define GERMAN54 0x0302002D -#define GERMAN55 0x0302002E -#define GERMAN56 0x0302002F -#define GERMAN57 0x03020030 -#define GERMAN58 0x03020031 -#define GERMAN59 0x03020032 -#define GERMAN60 0x03020033 -#define GERMAN61 0x03020034 -#define GERMAN63 0x03020035 -#define GERMAN65 0x03020036 -#define GERMAN66 0x03020037 -#define GERMAN69 0x03020038 -#define GERMAN71 0x03020039 -#define GERMAN72 0x0302003A -#define GERMAN73 0x0302003B -#define GERMAN74 0x0302003C -#define GERMAN90 0x0302003D -#define GERMAN99 0x0302003E -#define GERMAN129 0x0302003F -#define GERMAN131 0x03020040 -#define GERMAN133 0x03020041 -#define GERMAN145 0x03020042 -#define GERMAN146 0x03020043 - // 68 entities in TXTs, 68 in datafiles. - // italian -#define ITALIAN0 0x03030000 -#define ITALIAN1 0x03030001 -#define ITALIAN2 0x03030002 -#define ITALIAN3 0x03030003 -#define ITALIAN4 0x03030004 -#define ITALIAN5 0x03030005 -#define ITALIAN6 0x03030006 -#define ITALIAN7 0x03030007 -#define ITALIAN9 0x03030008 -#define ITALIAN11 0x03030009 -#define ITALIAN12 0x0303000A -#define ITALIAN13 0x0303000B -#define ITALIAN14 0x0303000C -#define ITALIAN15 0x0303000D -#define ITALIAN16 0x0303000E -#define ITALIAN17 0x0303000F -#define ITALIAN18 0x03030010 -#define ITALIAN19 0x03030011 -#define ITALIAN20 0x03030012 -#define ITALIAN21 0x03030013 -#define ITALIAN22 0x03030014 -#define ITALIAN23 0x03030015 -#define ITALIAN24 0x03030016 -#define ITALIAN25 0x03030017 -#define ITALIAN27 0x03030018 -#define ITALIAN28 0x03030019 -#define ITALIAN29 0x0303001A -#define ITALIAN31 0x0303001B -#define ITALIAN32 0x0303001C -#define ITALIAN33 0x0303001D -#define ITALIAN34 0x0303001E -#define ITALIAN35 0x0303001F -#define ITALIAN36 0x03030020 -#define ITALIAN37 0x03030021 -#define ITALIAN38 0x03030022 -#define ITALIAN39 0x03030023 -#define ITALIAN40 0x03030024 -#define ITALIAN41 0x03030025 -#define ITALIAN42 0x03030026 -#define ITALIAN43 0x03030027 -#define ITALIAN45 0x03030028 -#define ITALIAN47 0x03030029 -#define ITALIAN48 0x0303002A -#define ITALIAN49 0x0303002B -#define ITALIAN50 0x0303002C -#define ITALIAN54 0x0303002D -#define ITALIAN55 0x0303002E -#define ITALIAN56 0x0303002F -#define ITALIAN57 0x03030030 -#define ITALIAN58 0x03030031 -#define ITALIAN59 0x03030032 -#define ITALIAN60 0x03030033 -#define ITALIAN61 0x03030034 -#define ITALIAN63 0x03030035 -#define ITALIAN65 0x03030036 -#define ITALIAN66 0x03030037 -#define ITALIAN69 0x03030038 -#define ITALIAN71 0x03030039 -#define ITALIAN72 0x0303003A -#define ITALIAN73 0x0303003B -#define ITALIAN74 0x0303003C -#define ITALIAN90 0x0303003D -#define ITALIAN99 0x0303003E -#define ITALIAN129 0x0303003F -#define ITALIAN131 0x03030040 -#define ITALIAN133 0x03030041 -#define ITALIAN145 0x03030042 -#define ITALIAN146 0x03030043 - // 68 entities in TXTs, 68 in datafiles. - // spanish -#define SPANISH0 0x03040000 -#define SPANISH1 0x03040001 -#define SPANISH2 0x03040002 -#define SPANISH3 0x03040003 -#define SPANISH4 0x03040004 -#define SPANISH5 0x03040005 -#define SPANISH6 0x03040006 -#define SPANISH7 0x03040007 -#define SPANISH9 0x03040008 -#define SPANISH11 0x03040009 -#define SPANISH12 0x0304000A -#define SPANISH13 0x0304000B -#define SPANISH14 0x0304000C -#define SPANISH15 0x0304000D -#define SPANISH16 0x0304000E -#define SPANISH17 0x0304000F -#define SPANISH18 0x03040010 -#define SPANISH19 0x03040011 -#define SPANISH20 0x03040012 -#define SPANISH21 0x03040013 -#define SPANISH22 0x03040014 -#define SPANISH23 0x03040015 -#define SPANISH24 0x03040016 -#define SPANISH25 0x03040017 -#define SPANISH27 0x03040018 -#define SPANISH28 0x03040019 -#define SPANISH29 0x0304001A -#define SPANISH31 0x0304001B -#define SPANISH32 0x0304001C -#define SPANISH33 0x0304001D -#define SPANISH34 0x0304001E -#define SPANISH35 0x0304001F -#define SPANISH36 0x03040020 -#define SPANISH37 0x03040021 -#define SPANISH38 0x03040022 -#define SPANISH39 0x03040023 -#define SPANISH40 0x03040024 -#define SPANISH41 0x03040025 -#define SPANISH42 0x03040026 -#define SPANISH43 0x03040027 -#define SPANISH45 0x03040028 -#define SPANISH47 0x03040029 -#define SPANISH48 0x0304002A -#define SPANISH49 0x0304002B -#define SPANISH50 0x0304002C -#define SPANISH54 0x0304002D -#define SPANISH55 0x0304002E -#define SPANISH56 0x0304002F -#define SPANISH57 0x03040030 -#define SPANISH58 0x03040031 -#define SPANISH59 0x03040032 -#define SPANISH60 0x03040033 -#define SPANISH61 0x03040034 -#define SPANISH63 0x03040035 -#define SPANISH65 0x03040036 -#define SPANISH66 0x03040037 -#define SPANISH69 0x03040038 -#define SPANISH71 0x03040039 -#define SPANISH72 0x0304003A -#define SPANISH73 0x0304003B -#define SPANISH74 0x0304003C -#define SPANISH90 0x0304003D -#define SPANISH99 0x0304003E -#define SPANISH129 0x0304003F -#define SPANISH131 0x03040040 -#define SPANISH133 0x03040041 -#define SPANISH145 0x03040042 -#define SPANISH146 0x03040043 - // 68 entities in TXTs, 68 in datafiles. - // czech -#define CZECH0 0x03050000 -#define CZECH1 0x03050001 -#define CZECH2 0x03050002 -#define CZECH3 0x03050003 -#define CZECH4 0x03050004 -#define CZECH5 0x03050005 -#define CZECH6 0x03050006 -#define CZECH7 0x03050007 -#define CZECH9 0x03050008 -#define CZECH11 0x03050009 -#define CZECH12 0x0305000A -#define CZECH13 0x0305000B -#define CZECH14 0x0305000C -#define CZECH15 0x0305000D -#define CZECH16 0x0305000E -#define CZECH17 0x0305000F -#define CZECH18 0x03050010 -#define CZECH19 0x03050011 -#define CZECH20 0x03050012 -#define CZECH21 0x03050013 -#define CZECH22 0x03050014 -#define CZECH23 0x03050015 -#define CZECH24 0x03050016 -#define CZECH25 0x03050017 -#define CZECH27 0x03050018 -#define CZECH28 0x03050019 -#define CZECH29 0x0305001A -#define CZECH31 0x0305001B -#define CZECH32 0x0305001C -#define CZECH33 0x0305001D -#define CZECH34 0x0305001E -#define CZECH35 0x0305001F -#define CZECH36 0x03050020 -#define CZECH37 0x03050021 -#define CZECH38 0x03050022 -#define CZECH39 0x03050023 -#define CZECH40 0x03050024 -#define CZECH41 0x03050025 -#define CZECH42 0x03050026 -#define CZECH43 0x03050027 -#define CZECH45 0x03050028 -#define CZECH47 0x03050029 -#define CZECH48 0x0305002A -#define CZECH49 0x0305002B -#define CZECH50 0x0305002C -#define CZECH54 0x0305002D -#define CZECH55 0x0305002E -#define CZECH56 0x0305002F -#define CZECH57 0x03050030 -#define CZECH58 0x03050031 -#define CZECH59 0x03050032 -#define CZECH60 0x03050033 -#define CZECH61 0x03050034 -#define CZECH63 0x03050035 -#define CZECH65 0x03050036 -#define CZECH66 0x03050037 -#define CZECH69 0x03050038 -#define CZECH71 0x03050039 -#define CZECH72 0x0305003A -#define CZECH73 0x0305003B -#define CZECH74 0x0305003C -#define CZECH90 0x0305003D -#define CZECH99 0x0305003E -#define CZECH129 0x0305003F -#define CZECH131 0x03050040 -#define CZECH133 0x03050041 -#define CZECH145 0x03050042 -#define CZECH146 0x03050043 - // 68 entities in TXTs, ??? in datafiles. - // portugese -#define PORT0 0x03060000 -#define PORT1 0x03060001 -#define PORT2 0x03060002 -#define PORT3 0x03060003 -#define PORT4 0x03060004 -#define PORT5 0x03060005 -#define PORT6 0x03060006 -#define PORT7 0x03060007 -#define PORT9 0x03060008 -#define PORT11 0x03060009 -#define PORT12 0x0306000A -#define PORT13 0x0306000B -#define PORT14 0x0306000C -#define PORT15 0x0306000D -#define PORT16 0x0306000E -#define PORT17 0x0306000F -#define PORT18 0x03060010 -#define PORT19 0x03060011 -#define PORT20 0x03060012 -#define PORT21 0x03060013 -#define PORT22 0x03060014 -#define PORT23 0x03060015 -#define PORT24 0x03060016 -#define PORT25 0x03060017 -#define PORT27 0x03060018 -#define PORT28 0x03060019 -#define PORT29 0x0306001A -#define PORT31 0x0306001B -#define PORT32 0x0306001C -#define PORT33 0x0306001D -#define PORT34 0x0306001E -#define PORT35 0x0306001F -#define PORT36 0x03060020 -#define PORT37 0x03060021 -#define PORT38 0x03060022 -#define PORT39 0x03060023 -#define PORT40 0x03060024 -#define PORT41 0x03060025 -#define PORT42 0x03060026 -#define PORT43 0x03060027 -#define PORT45 0x03060028 -#define PORT47 0x03060029 -#define PORT48 0x0306002A -#define PORT49 0x0306002B -#define PORT50 0x0306002C -#define PORT54 0x0306002D -#define PORT55 0x0306002E -#define PORT56 0x0306002F -#define PORT57 0x03060030 -#define PORT58 0x03060031 -#define PORT59 0x03060032 -#define PORT60 0x03060033 -#define PORT61 0x03060034 -#define PORT63 0x03060035 -#define PORT65 0x03060036 -#define PORT66 0x03060037 -#define PORT69 0x03060038 -#define PORT71 0x03060039 -#define PORT72 0x0306003A -#define PORT73 0x0306003B -#define PORT74 0x0306003C -#define PORT90 0x0306003D -#define PORT99 0x0306003E -#define PORT129 0x0306003F -#define PORT131 0x03060040 -#define PORT133 0x03060041 -#define PORT145 0x03060042 -#define PORT146 0x03060043 - // 68 entities in TXTs, ??? in datafiles. -// general - // fonts -#define GAME_FONT 0x04000000 -#define OTHER_SR_FONT 0x04000001 -#define OTHER_SR_REDFONT 0x04000002 -#define SR_DEATHFONT 0x04000003 -#define CZECH_GAME_FONT 0x04000004 -#define CZECH_SR_FONT 0x04000005 -#define CZECH_SR_REDFONT 0x04000006 -#define CZECH_SR_DEATHFONT 0x04000007 - // 8 entities in TXTs, 1 in datafiles. - // pointers -#define MSE_POINTER 0x04010000 -#define MSE_OPERATE 0x04010001 -#define MSE_PICKUP 0x04010002 -#define MSE_EXAMINE 0x04010003 -#define MSE_MOUTH 0x04010004 -#define MSE_BECKON_L 0x04010005 -#define MSE_BECKON_R 0x04010006 -#define MSE_ARROW0 0x04010007 -#define MSE_ARROW1 0x04010008 -#define MSE_ARROW2 0x04010009 -#define MSE_ARROW3 0x0401000A -#define MSE_ARROW4 0x0401000B -#define MSE_ARROW5 0x0401000C -#define MSE_ARROW6 0x0401000D -#define MSE_ARROW7 0x0401000E -#define MSE_ARROW8 0x0401000F -#define MSE_ARROW9 0x04010010 - // 17 entities in TXTs, 17 in datafiles. - // luggage -#define LUGG_NEWSPAPER 0x04020000 -#define LUGG_HAZEL_WAND 0x04020001 -#define LUGG_BEER_TOWEL 0x04020002 -#define LUGG_HOTEL_KEY 0x04020003 -#define LUGG_BALL 0x04020004 -#define LUGG_STATUETTE 0x04020005 -#define LUGG_RED_NOSE 0x04020006 -#define LUGG_POLISHED_CHALICE 0x04020007 -#define LUGG_DOLLAR_BILL 0x04020008 -#define LUGG_PHOTOGRAPH 0x04020009 -#define LUGG_FLASHLIGHT 0x0402000A -#define LUGG_FUSE_WIRE 0x0402000B -#define LUGG_GEM 0x0402000C -#define LUGG_STATUETTE_PAINT 0x0402000D -#define LUGG_STICK 0x0402000E -#define LUGG_EXCAV_KEY 0x0402000F -#define LUGG_LAB_PASS 0x04020010 -#define LUGG_LIFTING_KEYS 0x04020011 -#define LUGG_MANUSCRIPT 0x04020012 -#define LUGG_MATCHBOOK 0x04020013 -#define LUGG_SUIT_MATERIAL 0x04020014 -#define LUGG_STICK_TOWEL 0x04020015 -#define LUGG_PLASTER 0x04020016 -#define LUGG_PRESSURE_GAUGE 0x04020017 -#define LUGG_RAILWAY_TICKET 0x04020018 -#define LUGG_BUZZER 0x04020019 -#define LUGG_ROSSO_CARD 0x0402001A -#define LUGG_TOILET_KEY 0x0402001B -#define LUGG_SOAP 0x0402001C -#define LUGG_STONE_KEY 0x0402001D -#define LUGG_CHALICE 0x0402001E -#define LUGG_TISSUE 0x0402001F -#define LUGG_TOILET_BRUSH 0x04020020 -#define LUGG_TOILET_CHAIN 0x04020021 -#define LUGG_TOWEL 0x04020022 -#define LUGG_TRIPOD 0x04020023 -#define LUGG_LENS 0x04020024 -#define LUGG_MIRROR 0x04020025 -#define LUGG_TOWEL_CUT 0x04020026 -#define LUGG_BIBLE 0x04020027 -#define LUGG_TISSUE_CHARRED 0x04020028 -#define LUGG_FALSE_KEY 0x04020029 -#define LUGG_KEYRING 0x0402002A -#define LUGG_SOAP_IMP 0x0402002B -#define LUGG_SOAP_PLAS 0x0402002C -#define LUGG_COG_1 0x0402002D -#define LUGG_COG_2 0x0402002E -#define LUGG_HANDLE 0x0402002F -#define LUGG_COIN 0x04020030 -#define LUGG_BIRO 0x04020031 -#define LUGG_PIPE 0x04020032 -#define LUGG_KING 0x04020033 -#define LUGG_KNIGHT 0x04020034 -#define LUGG_BISHOP 0x04020035 - // 54 entities in TXTs, 54 in datafiles. - // object_icons -#define ICON_LEFT_ARROW 0x04030000 -#define ICON_RIGHT_ARROW 0x04030001 -#define ICON_NEWSPAPER 0x04030002 -#define ICON_HAZEL_WAND 0x04030003 -#define ICON_BEER_TOWEL 0x04030004 -#define ICON_HOTEL_KEY 0x04030005 -#define ICON_BALL 0x04030006 -#define ICON_STATUETTE 0x04030007 -#define ICON_RED_NOSE 0x04030008 -#define ICON_POLISHED_CHALICE 0x04030009 -#define ICON_DOLLAR_BILL 0x0403000A -#define ICON_PHOTOGRAPH 0x0403000B -#define ICON_FLASHLIGHT 0x0403000C -#define ICON_FUSE_WIRE 0x0403000D -#define ICON_GEM 0x0403000E -#define ICON_STATUETTE_PAINT 0x0403000F -#define ICON_STICK 0x04030010 -#define ICON_EXCAV_KEY 0x04030011 -#define ICON_LAB_PASS 0x04030012 -#define ICON_LIFTING_KEYS 0x04030013 -#define ICON_MANUSCRIPT 0x04030014 -#define ICON_MATCHBOOK 0x04030015 -#define ICON_SUIT_MATERIAL 0x04030016 -#define ICON_STICK_TOWEL 0x04030017 -#define ICON_PLASTER 0x04030018 -#define ICON_PRESSURE_GAUGE 0x04030019 -#define ICON_RAILWAY_TICKET 0x0403001A -#define ICON_BUZZER 0x0403001B -#define ICON_ROSSO_CARD 0x0403001C -#define ICON_TOILET_KEY 0x0403001D -#define ICON_SOAP 0x0403001E -#define ICON_STONE_KEY 0x0403001F -#define ICON_CHALICE 0x04030020 -#define ICON_TISSUE 0x04030021 -#define ICON_TOILET_BRUSH 0x04030022 -#define ICON_TOILET_CHAIN 0x04030023 -#define ICON_TOWEL 0x04030024 -#define ICON_TRIPOD 0x04030025 -#define ICON_LENS 0x04030026 -#define ICON_MIRROR 0x04030027 -#define ICON_TOWEL_CUT 0x04030028 -#define ICON_BIBLE 0x04030029 -#define ICON_TISSUE_CHARRED 0x0403002A -#define ICON_FALSE_KEY 0x0403002B -#define ICON_KEYRING 0x0403002C -#define ICON_SOAP_IMP 0x0403002D -#define ICON_SOAP_PLAS 0x0403002E -#define ICON_COG_1 0x0403002F -#define ICON_COG_2 0x04030030 -#define ICON_HANDLE 0x04030031 -#define ICON_COIN 0x04030032 -#define ICON_BIRO 0x04030033 -#define ICON_PIPE 0x04030034 - // 53 entities in TXTs, 53 in datafiles. - // subject_icons -#define ICON_ALARM 0x04040000 -#define ICON_ARTO 0x04040001 -#define ICON_ASSASSIN 0x04040002 -#define ICON_AYUB 0x04040003 -#define ICON_BANANA 0x04040004 -#define ICON_BAPHOMET 0x04040005 -#define ICON_BEER 0x04040006 -#define ICON_BOOK 0x04040007 -#define ICON_BRIEFCASE 0x04040008 -#define ICON_BULL 0x04040009 -#define ICON_BULLS_HEAD 0x0404000A -#define ICON_BUST 0x0404000B -#define ICON_CANDLE 0x0404000C -#define ICON_CAR 0x0404000D -#define ICON_CASTLE 0x0404000E -#define ICON_CAT 0x0404000F -#define ICON_CHANTELLE 0x04040010 -#define ICON_CHESSBOARD 0x04040011 -#define ICON_CHESS_SET 0x04040012 -#define ICON_CHURCH 0x04040013 -#define ICON_CLOWN 0x04040014 -#define ICON_CLUB 0x04040015 -#define ICON_COINS 0x04040016 -#define ICON_COUNTESS 0x04040017 -#define ICON_CREST 0x04040018 -#define ICON_DIG 0x04040019 -#define ICON_DOG 0x0404001A -#define ICON_DUANE 0x0404001B -#define ICON_EKLUND 0x0404001C -#define ICON_ERIC 0x0404001D -#define ICON_FISH 0x0404001E -#define ICON_FLOWERS 0x0404001F -#define ICON_FORTUNE 0x04040020 -#define ICON_GEORGE 0x04040021 -#define ICON_GHOST 0x04040022 -#define ICON_GLASS_EYE 0x04040023 -#define ICON_GOAT 0x04040024 -#define ICON_GOODBYE 0x04040025 -#define ICON_GUARD 0x04040026 -#define ICON_HASH 0x04040027 -#define ICON_HENDERSONS 0x04040028 -#define ICON_JACKET 0x04040029 -#define ICON_JUGGLER 0x0404002A -#define ICON_KLAUSNER 0x0404002B -#define ICON_KNIGHT 0x0404002C -#define ICON_LADDER 0x0404002D -#define ICON_LEARY 0x0404002E -#define ICON_LEPRECHAUN 0x0404002F -#define ICON_LIE 0x04040030 -#define ICON_LOBINEAU 0x04040031 -#define ICON_MARQUET 0x04040032 -#define ICON_MARY 0x04040033 -#define ICON_MOB 0x04040034 -#define ICON_MONTFAUCON 0x04040035 -#define ICON_MOUE 0x04040036 -#define ICON_MR_SHINY 0x04040037 -#define ICON_NEJO 0x04040038 -#define ICON_NEJO_STALL 0x04040039 -#define ICON_NICO 0x0404003A -#define ICON_NO 0x0404003B -#define ICON_NURSE 0x0404003C -#define ICON_PACKAGE 0x0404003D -#define ICON_PAINTER 0x0404003E -#define ICON_PEAGRAM 0x0404003F -#define ICON_PEARL 0x04040040 -#define ICON_PHILIPPE 0x04040041 -#define ICON_PHONE 0x04040042 -#define ICON_PHRASE 0x04040043 -#define ICON_PIERMONT 0x04040044 -#define ICON_PLANTARD 0x04040045 -#define ICON_POTS 0x04040046 -#define ICON_PRIEST 0x04040047 -#define ICON_QUEEN 0x04040048 -#define ICON_RENEE 0x04040049 -#define ICON_ROSSO 0x0404004A -#define ICON_ROZZER 0x0404004B -#define ICON_SAFE 0x0404004C -#define ICON_SCROLL 0x0404004D -#define ICON_SEAN 0x0404004E -#define ICON_SIGN 0x0404004F -#define ICON_TAXI 0x04040050 -#define ICON_TEMPLARS 0x04040051 -#define ICON_THERMOSTAT 0x04040052 -#define ICON_TOILET 0x04040053 -#define ICON_TOMB 0x04040054 -#define ICON_TOOLBOX 0x04040055 -#define ICON_TRUTH 0x04040056 -#define ICON_ULTAR 0x04040057 -#define ICON_WEASEL 0x04040058 -#define ICON_WEAVER 0x04040059 -#define ICON_WELL 0x0404005A -#define ICON_WELL2 0x0404005B -#define ICON_WINDOW 0x0404005C -#define ICON_YES 0x0404005D - // 94 entities in TXTs, 94 in datafiles. - // save_menu -#define SR_FONT 0x04050000 -#define SR_BUTTON 0x04050001 -#define SR_REDFONT 0x04050002 -#define SR_PALETTE 0x04050003 -#define SR_PANEL_ENGLISH 0x04050004 -#define SR_PANEL_FRENCH 0x04050005 -#define SR_PANEL_GERMAN 0x04050006 -#define SR_PANEL_ITALIAN 0x04050007 -#define SR_PANEL_SPANISH 0x04050008 -#define SR_PANEL_AMERICAN 0x04050009 -#define SR_TEXT_BUTTON 0x0405000A -#define SR_SPEED 0x0405000B -#define SR_SCROLL1 0x0405000C -#define SR_SCROLL2 0x0405000D -#define SR_CONFIRM 0x0405000E -#define SR_VOLUME 0x0405000F -#define SR_VLIGHT 0x04050010 -#define SR_VKNOB 0x04050011 -#define SR_WINDOW 0x04050012 -#define SR_SLAB1 0x04050013 -#define SR_SLAB2 0x04050014 -#define SR_SLAB3 0x04050015 -#define SR_SLAB4 0x04050016 -#define SR_BUTUF 0x04050017 -#define SR_BUTUS 0x04050018 -#define SR_BUTDS 0x04050019 -#define SR_BUTDF 0x0405001A -#define SR_DEATHPANEL 0x0405001B // 0x04050019 - // 26 entities in TXTs, 29 in datafiles. - // george -#define GEORGE_MEGA 0x04060000 -#define GEORGE_WLK 0x04060001 -#define GEOSHO1 0x04060002 -#define GEOSHO1CDT 0x04060003 -#define GEOSHO1CDR 0x04060004 -#define GEOSHO2 0x04060005 -#define GEOSHO2CDT 0x04060006 -#define GEOSHO2CDR 0x04060007 -#define GEOSHO3 0x04060008 -#define GEOSHO3CDT 0x04060009 -#define GEOSHO3CDR 0x0406000A -#define GEOSHO5 0x0406000B -#define GEOSHO5CDT 0x0406000C -#define GEOSHO5CDR 0x0406000D -#define GEOSHO6 0x0406000E -#define GEOSHO6CDT 0x0406000F -#define GEOSHO6CDR 0x04060010 -#define GEOSHO7 0x04060011 -#define GEOSHO7CDT 0x04060012 -#define GEOSHO7CDR 0x04060013 -#define GEOTLK0 0x04060014 -#define GEOTLK0CDT 0x04060015 -#define GEOTLK1 0x04060016 -#define GEOTLK1CDT 0x04060017 -#define GEOTLK2 0x04060018 -#define GEOTLK2CDT 0x04060019 -#define GEOTLK3 0x0406001A -#define GEOTLK3CDT 0x0406001B -#define GEOTLK4 0x0406001C -#define GEOTLK4CDT 0x0406001D -#define GEOTLK5 0x0406001E -#define GEOTLK5CDT 0x0406001F -#define GEOTLK6 0x04060020 -#define GEOTLK6CDT 0x04060021 -#define GEOTLK7 0x04060022 -#define GEOTLK7CDT 0x04060023 -#define XGEOCRW0 0x04060024 -#define XGEOCRW0CDT 0x04060025 -#define XGEOCRW0CDR 0x04060026 -#define XGEOCRW1 0x04060027 -#define XGEOCRW1CDT 0x04060028 -#define XGEOCRW1CDR 0x04060029 -#define XGEOCRW2 0x0406002A -#define XGEOCRW2CDT 0x0406002B -#define XGEOCRW2CDR 0x0406002C -#define XGEOCRW3 0x0406002D -#define XGEOCRW3CDT 0x0406002E -#define XGEOCRW3CDR 0x0406002F -#define XGEOCRW4 0x04060030 -#define XGEOCRW4CDT 0x04060031 -#define XGEOCRW4CDR 0x04060032 -#define XGEOCRW5 0x04060033 -#define XGEOCRW5CDT 0x04060034 -#define XGEOCRW5CDR 0x04060035 -#define XGEOCRW6 0x04060036 -#define XGEOCRW6CDT 0x04060037 -#define XGEOCRW6CDR 0x04060038 -#define XGEOCRW7 0x04060039 -#define XGEOCRW7CDT 0x0406003A -#define XGEOCRW7CDR 0x0406003B -#define XGEOGIV0 0x0406003C -#define XGEOGIV0CDT 0x0406003D -#define XGEOGIV0CDR 0x0406003E -#define XGEOGIV1 0x0406003F -#define XGEOGIV1CDT 0x04060040 -#define XGEOGIV1CDR 0x04060041 -#define XGEOGIV2 0x04060042 -#define XGEOGIV2CDT 0x04060043 -#define XGEOGIV2CDR 0x04060044 -#define XGEOGIV3 0x04060045 -#define XGEOGIV3CDT 0x04060046 -#define XGEOGIV3CDR 0x04060047 -#define XGEOGIV4 0x04060048 -#define XGEOGIV4CDT 0x04060049 -#define XGEOGIV4CDR 0x0406004A -#define XGEOGIV5 0x0406004B -#define XGEOGIV5CDT 0x0406004C -#define XGEOGIV5CDR 0x0406004D -#define XGEOGIV6 0x0406004E -#define XGEOGIV6CDT 0x0406004F -#define XGEOGIV6CDR 0x04060050 -#define XGEOGIV7 0x04060051 -#define XGEOGIV7CDT 0x04060052 -#define XGEOGIV7CDR 0x04060053 -#define XGEOLUK3 0x04060054 -#define XGEOLUK3CDT 0x04060055 -#define XGEOLUK5 0x04060056 -#define XGEOLUK5CDT 0x04060057 -#define XGEOPIC0 0x04060058 -#define XGEOPIC0CDT 0x04060059 -#define XGEOPIC1 0x0406005A -#define XGEOPIC1CDT 0x0406005B -#define XGEOPIC2 0x0406005C -#define XGEOPIC2CDT 0x0406005D -#define XGEOPIC3 0x0406005E -#define XGEOPIC3CDT 0x0406005F -#define XGEOPIC4 0x04060060 -#define XGEOPIC4CDT 0x04060061 -#define XGEOPIC5 0x04060062 -#define XGEOPIC5CDT 0x04060063 -#define XGEOPIC6 0x04060064 -#define XGEOPIC6CDT 0x04060065 -#define XGEOPIC7 0x04060066 -#define XGEOPIC7CDT 0x04060067 -#define XGEOSHG0 0x04060068 -#define XGEOSHG0CDT 0x04060069 -#define XGEOSHG1 0x0406006A -#define XGEOSHG1CDT 0x0406006B -#define XGEOSHG2 0x0406006C -#define XGEOSHG2CDT 0x0406006D -#define XGEOSHG3 0x0406006E -#define XGEOSHG3CDT 0x0406006F -#define XGEOSHG4 0x04060070 -#define XGEOSHG4CDT 0x04060071 -#define XGEOSHG5 0x04060072 -#define XGEOSHG5CDT 0x04060073 -#define XGEOSHG6 0x04060074 -#define XGEOSHG6CDT 0x04060075 -#define XGEOSHG7 0x04060076 -#define XGEOSHG7CDT 0x04060077 -#define XGHAIR2 0x04060078 -#define XGHAIR2CDT 0x04060079 -#define XGHAIR6 0x0406007A -#define XGHAIR6CDT 0x0406007B -#define GEOBLNK2 0x0406007C -#define GEOBLNK2CDT 0x0406007D -#define GEOBLNK3 0x0406007E -#define GEOBLNK3CDT 0x0406007F -#define GEOBLNK4 0x04060080 -#define GEOBLNK4CDT 0x04060081 -#define GEOBLNK5 0x04060082 -#define GEOBLNK5CDT 0x04060083 -#define GEOBLNK6 0x04060084 -#define GEOBLNK6CDT 0x04060085 -#define XGRELAX0 0x04060086 -#define XGRELAX0CDT 0x04060087 -#define XGRELAX0CDR 0x04060088 -#define XGRELAX1 0x04060089 -#define XGRELAX1CDT 0x0406008A -#define XGRELAX1CDR 0x0406008B -#define XGRELAX2 0x0406008C -#define XGRELAX2CDT 0x0406008D -#define XGRELAX2CDR 0x0406008E -#define XGRELAX3 0x0406008F -#define XGRELAX3CDT 0x04060090 -#define XGRELAX3CDR 0x04060091 -#define XGRELAX4 0x04060092 -#define XGRELAX4CDT 0x04060093 -#define XGRELAX4CDR 0x04060094 -#define XGRELAX5 0x04060095 -#define XGRELAX5CDT 0x04060096 -#define XGRELAX5CDR 0x04060097 -#define XGRELAX6 0x04060098 -#define XGRELAX6CDT 0x04060099 -#define XGRELAX6CDR 0x0406009A -#define XGRELAX7 0x0406009B -#define XGRELAX7CDT 0x0406009C -#define XGRELAX7CDR 0x0406009D - // 158 entities in TXTs, 158 in datafiles. - // nico -#define MEGANICO 0x04070000 -#define NICO_WLK 0x04070001 -#define NICTLK0 0x04070002 -#define NICTLK0CDT 0x04070003 -#define NICTLK1 0x04070004 -#define NICTLK1CDT 0x04070005 -#define NICTLK2 0x04070006 -#define NICTLK2CDT 0x04070007 -#define NICTLK3 0x04070008 -#define NICTLK3CDT 0x04070009 -#define NICTLK4 0x0407000A -#define NICTLK4CDT 0x0407000B -#define NICTLK5 0x0407000C -#define NICTLK5CDT 0x0407000D -#define NICTLK6 0x0407000E -#define NICTLK6CDT 0x0407000F -#define NICTLK7 0x04070010 -#define NICTLK7CDT 0x04070011 - // 18 entities in TXTs, 18 in datafiles. -// maps - // room80 -#define room80_PAL 0x05000000 -#define room80_l0 0x05000001 -#define TEST_FLR 0x05000002 -#define SPRITE_PAL 0x05000003 -#define AEROPORTCDT 0x05000004 -#define AEROPORT 0x05000005 -#define APRTSTRTCDT 0x05000006 -#define APRTSTRT 0x05000007 -#define BAPHOMETCDT 0x05000008 -#define BAPHOMET 0x05000009 -#define CAFECDT 0x0500000A -#define CAFE 0x0500000B -#define COSTUMESCDT 0x0500000C -#define COSTUMES 0x0500000D -#define HOSPITALCDT 0x0500000E -#define HOSPITAL 0x0500000F -#define HOTELCDT 0x05000010 -#define HOTEL 0x05000011 -#define MONTFACNCDT 0x05000012 -#define MONTFACN 0x05000013 -#define MUSEUMCDT 0x05000014 -#define MUSEUM 0x05000015 -#define POLICECDT 0x05000016 -#define POLICE 0x05000017 - // 24 entities in TXTs, 24 in datafiles. - // room86 -#define room86_PAL 0x05010000 -#define room86_l0 0x05010001 -#define BANNOCKCDT 0x05010002 -#define BANNOCK 0x05010003 -#define MARIBCDT 0x05010004 -#define MARIB 0x05010005 -#define LOCHMARNCDT 0x05010006 -#define LOCHMARN 0x05010007 -#define PARISCDT 0x05010008 -#define PARIS 0x05010009 -#define VILLAVASCDT 0x0501000A -#define VILLAVAS 0x0501000B - // 12 entities in TXTs, 12 in datafiles. - // room90 -#define R90L0 0x05020000 -#define R90PAL 0x05020001 -#define PHONE_PAL 0x05020002 -#define GBLINK 0x05020003 -#define GBLINKCDT 0x05020004 -#define GRISE 0x05020005 -#define GRISECDT 0x05020006 -#define GRISECDR 0x05020007 -#define GTALK 0x05020008 -#define GTALKCDT 0x05020009 -#define NBLINK 0x0502000A -#define NBLINKCDT 0x0502000B -#define NRISE 0x0502000C -#define NRISECDT 0x0502000D -#define NRISECDR 0x0502000E -#define NTALK 0x0502000F -#define NTALKCDT 0x05020010 -#define TODTALK 0x05020011 -#define TODTALKCDT 0x05020012 - // 19 entities in TXTs, 19 in datafiles. - // room91 -#define R91L0 0x05030000 -#define R91PAL 0x05030001 -#define CLOWN 0x05030002 -#define CLOWNCDT 0x05030003 -#define DESVAS 0x05030004 -#define DESVASCDT 0x05030005 -#define EIFTOWER 0x05030006 -#define EIFTOWERCDT 0x05030007 -#define HORSETIP 0x05030008 -#define HORSETIPCDT 0x05030009 -#define LOBIN91 0x0503000A -#define LOBIN91CDT 0x0503000B -#define MONTFCON 0x0503000C -#define MONTFCONCDT 0x0503000D -#define NICOADD 0x0503000E -#define NICOADDCDT 0x0503000F -#define NICOPHN 0x05030010 -#define NICOPHNCDT 0x05030011 -#define TAILOR 0x05030012 -#define TAILORCDT 0x05030013 - // 20 entities in TXTs, 20 in datafiles. - // room99 -#define room99_PAL 0x05040000 -#define room99_l0 0x05040001 - // 2 entities in TXTs, 2 in datafiles. -// paris_1 - // sound_fx -#define FX_CAMERA1 0x06000000 -#define FX_CAMERA2 0x06000001 -#define FX_CAMERA3 0x06000002 -#define FX_CANDO 0x06000003 -#define FX_CANUP 0x06000004 -#define FX_CAW1 0x06000005 -#define FX_DUST 0x06000006 -#define FX_HORN1 0x06000007 -#define FX_HORN2 0x06000008 -#define FX_HORN3 0x06000009 -#define FX_LVSFLY 0x0600000A -#define FX_PAP1 0x0600000B -#define FX_PAP2 0x0600000C -#define FX_PICK1 0x0600000D -#define FX_PICK2 0x0600000E -#define FX_PICK3 0x0600000F -#define FX_PICK4 0x06000010 -#define FX_PICK5 0x06000011 -#define FX_TRAFFIC2 0x06000012 -#define FX_TWEET1 0x06000013 -#define FX_TWEET2 0x06000014 -#define FX_TWEET3 0x06000015 -#define FX_TWEET4 0x06000016 -#define FX_TWEET5 0x06000017 -#define FX_BIN1 0x06000018 -#define FX_BIN2 0x06000019 -#define FX_BIN3 0x0600001A -#define FX_CAT 0x0600001B -#define FX_COVERON2 0x0600001C -#define FX_CRATE 0x0600001D -#define FX_DRAIN 0x0600001E -#define FX_HOLE 0x0600001F -#define FX_BODY 0x06000020 -#define FX_BOTDN 0x06000021 -#define FX_BOTUP 0x06000022 -#define FX_GULP 0x06000023 -#define FX_LIGHT 0x06000024 -#define FX_PIKUP 0x06000025 -#define FX_PAP3 0x06000026 -#define FX_PAP4 0x06000027 -#define FX_PAP5 0x06000028 -#define FX_PISTOL 0x06000029 -#define FX_TBOX 0x0600002A -#define FX_KNOKKNOK 0x0600002B -#define FX_ALBCLO 0x0600002C -#define FX_ALBOP 0x0600002D -#define FX_LADD1 0x0600002E -#define FX_LADD2 0x0600002F -#define FX_LADD3 0x06000030 -#define FX_RAT1 0x06000031 -#define FX_RAT2 0x06000032 -#define FX_SEWSTEP1 0x06000033 -#define FX_SEWSTEP2 0x06000034 -#define FX_SWATER3 0x06000035 -#define FX_DRIP1 0x06000036 -#define FX_DRIP2 0x06000037 -#define FX_DRIP3 0x06000038 -#define FX_SWATER1 0x06000039 -#define FX_SEWLADD7 0x0600003A -#define FX_SEWLADU7 0x0600003B - // 60 entities in TXTs, 60 in datafiles. - // room1 -#define PARIS1_PAL 0x06010000 -#define room1_PAL 0x06010001 -#define room1_l0 0x06010002 -#define room1_l1 0x06010003 -#define room1_l2 0x06010004 -#define room1_gd1 0x06010005 -#define room1_gd2 0x06010006 -#define room1_flr 0x06010007 -#define room1_plx 0x06010008 -#define BIRDS 0x06010009 -#define BIRDSCDT 0x0601000A -#define BIRDSA 0x0601000B -#define BIRDSACDT 0x0601000C -#define BIRDSB 0x0601000D -#define BIRDSBCDT 0x0601000E -#define BIRDSC 0x0601000F -#define BIRDSCCDT 0x06010010 -#define BIRDSD 0x06010011 -#define BIRDSDCDT 0x06010012 -#define BIRDSE 0x06010013 -#define BIRDSECDT 0x06010014 -#define BIRDSF 0x06010015 -#define BIRDSFCDT 0x06010016 -#define BIRDSG 0x06010017 -#define BIRDSGCDT 0x06010018 -#define BIRDSH 0x06010019 -#define BIRDSHCDT 0x0601001A -#define BIRDSI 0x0601001B -#define BIRDSICDT 0x0601001C -#define CANOPY 0x0601001D -#define CANOPYCDT 0x0601001E -#define GEOCAN 0x0601001F -#define GEOCANCDT 0x06010020 -#define GEONIC 0x06010021 -#define GEONICCDT 0x06010022 -#define GEOPAP 0x06010023 -#define GEOPAPCDT 0x06010024 -#define GEOPAP2 0x06010025 -#define GEOPAP2CDT 0x06010026 -#define LVSFLY 0x06010027 -#define LVSFLYCDT 0x06010028 -#define MOUGRD 0x06010029 -#define MOUGRDCDT 0x0601002A -#define MOUTLK01 0x0601002B -#define MOUTLK01CDT 0x0601002C -#define MOUWLK01 0x0601002D -#define MOUWLK01CDT 0x0601002E -#define NICPHT1CDT 0x0601002F -#define NICPHT1 0x06010030 -#define NICPHT2CDT 0x06010031 -#define NICPHT2 0x06010032 -#define NICPHT3CDT 0x06010033 -#define NICPHT3 0x06010034 -#define NICPHT5CDT 0x06010035 -#define NICPHT5 0x06010036 -#define NICPHT6CDT 0x06010037 -#define NICPHT6 0x06010038 -#define NICPHT7CDT 0x06010039 -#define NICPHT7 0x0601003A -#define NICWLK01 0x0601003B -#define NICWLK01CDT 0x0601003C -#define NWPAPER 0x0601003D -#define NWPAPERCDT 0x0601003E -#define WRKDIG01 0x0601003F -#define WRKDIG01CDT 0x06010040 -#define XGEOPHN3 0x06010041 -#define XGEOPHN3CDT 0x06010042 -#define XGEOPHN5 0x06010043 -#define XGEOPHN5CDT 0x06010044 -#define XNICPHN3CDT 0x06010045 -#define XNICPHN3 0x06010046 -#define XNICPHN5CDT 0x06010047 -#define XNICPHN5 0x06010048 - // 73 entities in TXTs, 73 in datafiles. - // room2 -#define room2_PAL 0x06020000 -#define room2_l0 0x06020001 -#define room2_l1 0x06020002 -#define room2_l2 0x06020003 -#define room2_gd1 0x06020004 -#define room2_gd2 0x06020005 -#define room2_flr 0x06020006 -#define BIN1 0x06020007 -#define BIN1CDT 0x06020008 -#define BIN2 0x06020009 -#define BIN2CDT 0x0602000A -#define BIN3 0x0602000B -#define BIN3CDT 0x0602000C -#define CATJMP 0x0602000D -#define CATJMPCDT 0x0602000E -#define CRATE 0x0602000F -#define CRATECDT 0x06020010 -#define DRNBRK 0x06020011 -#define DRNBRKCDT 0x06020012 -#define GEOBIN 0x06020013 -#define GEOBINCDT 0x06020014 -#define GEOBOX 0x06020015 -#define GEOBOXCDT 0x06020016 -#define GEOBRS 0x06020017 -#define GEOBRSCDT 0x06020018 -#define GEOCAT 0x06020019 -#define GEOCATCDT 0x0602001A -#define GEOCATE 0x0602001B -#define GEOCATECDT 0x0602001C -#define GEOCLM02 0x0602001D -#define GEOCLM02CDT 0x0602001E -#define GEOCRT 0x0602001F -#define GEOCRTCDT 0x06020020 -#define GEODWN 0x06020021 -#define GEODWNCDT 0x06020022 -#define GEOLID 0x06020023 -#define GEOLIDCDT 0x06020024 -#define GEOLIDCDR 0x06020025 -#define GEOMAN8 0x06020026 -#define GEOMAN8CDT 0x06020027 -#define GEOMAN9 0x06020028 -#define GEOMAN9CDT 0x06020029 -#define GEOOUT 0x0602002A -#define GEOOUTCDT 0x0602002B -#define GEOPLL02 0x0602002C -#define GEOPLL02CDT 0x0602002D -#define GEOTRY02 0x0602002E -#define GEOTRY02CDT 0x0602002F -#define MANCOV 0x06020030 -#define MANCOVCDT 0x06020031 -#define MANCVOFF 0x06020032 -#define MANCVOFFCDT 0x06020033 - // 52 entities in TXTs, 52 in datafiles. - // room3 -#define room3_PAL 0x06030000 -#define room3_l0 0x06030001 -#define room3_l1 0x06030002 -#define room3_l2 0x06030003 -#define room3_gd1 0x06030004 -#define room3_gd2 0x06030005 -#define room3_flr 0x06030006 -#define BOTTLE 0x06030007 -#define BOTTLECDT 0x06030008 -#define BOTTLE1 0x06030009 -#define BOTTLE1CDT 0x0603000A -#define CHNDRN 0x0603000B -#define CHNDRNCDT 0x0603000C -#define CHNFNT 0x0603000D -#define CHNFNTCDT 0x0603000E -#define CHNSITA 0x0603000F -#define CHNSITACDT 0x06030010 -#define CHNSIT 0x06030011 -#define CHNSITCDT 0x06030012 -#define CHNTLK 0x06030013 -#define CHNTLKCDT 0x06030014 -#define CHNUPP 0x06030015 -#define CHNUPPCDT 0x06030016 -#define CHNUPPCDR 0x06030017 -#define CORPSE 0x06030018 -#define CORPSECDT 0x06030019 -#define FLICKER 0x0603001A -#define FLICKERCDT 0x0603001B -#define GEOBOT3 0x0603001C -#define GEOBOT3CDT 0x0603001D -#define GEOCARD3 0x0603001E -#define GEOCARD3CDT 0x0603001F -#define GEOCHN 0x06030020 -#define GEOCHNCDT 0x06030021 -#define GEOCPS 0x06030022 -#define GEOCPSCDT 0x06030023 -#define GEOCPSCDR 0x06030024 -#define MOUCHN 0x06030025 -#define MOUCHNCDT 0x06030026 -#define MOUCHN8 0x06030027 -#define MOUCHN8CDT 0x06030028 -#define MOUCPS 0x06030029 -#define MOUCPSCDT 0x0603002A -#define MOUCPSTK 0x0603002B -#define MOUCPSTKCDT 0x0603002C -#define MOUDOR03 0x0603002D -#define MOUDOR03CDT 0x0603002E -#define MOUROS 0x0603002F -#define MOUROSCDT 0x06030030 -#define MOUROS1 0x06030031 -#define MOUROS1CDT 0x06030032 -#define MOUROS1CDR 0x06030033 -#define MOUROS2 0x06030034 -#define MOUROS2CDT 0x06030035 -#define MOUSTD 0x06030036 -#define MOUSTDCDT 0x06030037 -#define MOUTALK 0x06030038 -#define MOUTALKCDT 0x06030039 -#define MOUTLK1 0x0603003A -#define MOUTLK1CDT 0x0603003B -#define MOUTRN03 0x0603003C -#define MOUTRN03CDT 0x0603003D -#define MOUTRN03CDR 0x0603003E -#define MOUTRN2 0x0603003F -#define MOUTRN2CDT 0x06030040 -#define MOUTRN2CDR 0x06030041 -#define MOUWLK 0x06030042 -#define MOUWLKCDT 0x06030043 -#define MOUWLK03 0x06030044 -#define MOUWLK03CDT 0x06030045 -#define ROSCARD 0x06030046 -#define ROSCARDCDT 0x06030047 -#define ROSCHN 0x06030048 -#define ROSCHNCDT 0x06030049 -#define ROSCHNCDR 0x0603004A -#define ROSGEO 0x0603004B -#define ROSGEOCDT 0x0603004C -#define ROSGEOA 0x0603004D -#define ROSGEOACDT 0x0603004E -#define ROSGEOB 0x0603004F -#define ROSGEOBCDT 0x06030050 -#define ROSGEOC 0x06030051 -#define ROSGEOCCDT 0x06030052 -#define ROSLIK 0x06030053 -#define ROSLIKCDT 0x06030054 -#define ROSLUK 0x06030055 -#define ROSLUKCDT 0x06030056 -#define ROSMOU 0x06030057 -#define ROSMOUCDT 0x06030058 -#define ROSNBK 0x06030059 -#define ROSNBKCDT 0x0603005A -#define ROSNBK8 0x0603005B -#define ROSNBK8CDT 0x0603005C -#define ROSPKT 0x0603005D -#define ROSPKTCDT 0x0603005E -#define ROSTMP 0x0603005F -#define ROSTMPCDT 0x06030060 -#define ROSTMP8 0x06030061 -#define ROSTMP8CDT 0x06030062 -#define ROSTURNA 0x06030063 -#define ROSTURNACDT 0x06030064 -#define ROSTURNB 0x06030065 -#define ROSTURNBCDT 0x06030066 -#define ROSTRN2 0x06030067 -#define ROSTRN2CDT 0x06030068 -#define ROSWRT 0x06030069 -#define ROSWRTCDT 0x0603006A - // 107 entities in TXTs, 107 in datafiles. - // room4 -#define room4_PAL 0x06040000 -#define room4_l0 0x06040001 -#define room4_l1 0x06040002 -#define room4_l2 0x06040003 -#define room4_gd1 0x06040004 -#define room4_gd2 0x06040005 -#define room4_flr 0x06040006 -#define ALBDOR 0x06040007 -#define ALBDORCDR 0x06040008 -#define ALBDORCDT 0x06040009 -#define ALBDOR8 0x0604000A -#define ALBDOR8CDT 0x0604000B -#define GEONOK 0x0604000C -#define GEONOKCDT 0x0604000D -#define GEONOKCDR 0x0604000E -#define GEOTBX 0x0604000F -#define GEOTBXCDT 0x06040010 -#define GEOWRK 0x06040011 -#define GEOWRKCDT 0x06040012 -#define GEOWRK8 0x06040013 -#define GEOWRK8CDT 0x06040014 -#define MOUENT 0x06040015 -#define MOUENTCDT 0x06040016 -#define MOUSHG 0x06040017 -#define MOUSHGCDT 0x06040018 -#define MOUSTR 0x06040019 -#define MOUSTRCDT 0x0604001A -#define MOUTLK04 0x0604001B -#define MOUTLK04CDT 0x0604001C -#define MOUWLK04 0x0604001D -#define MOUWLK04CDT 0x0604001E -#define ROSENT 0x0604001F -#define ROSENTCDT 0x06040020 -#define ROSTLK04 0x06040021 -#define ROSTLK04CDT 0x06040022 -#define ROSWLK 0x06040023 -#define ROSWLKCDT 0x06040024 -#define PHONE4 0x06040025 -#define PHONE4CDT 0x06040026 -#define WRKAXE 0x06040027 -#define WRKAXECDT 0x06040028 -#define WRKBLINK 0x06040029 -#define WRKBLINKCDT 0x0604002A -#define WRKCLM 0x0604002B -#define WRKCLMCDT 0x0604002C -#define WRKDIG 0x0604002D -#define WRKDIGCDT 0x0604002E -#define WRKPPR 0x0604002F -#define WRKPPRCDT 0x06040030 -#define WRKTLK 0x06040031 -#define WRKTLKCDT 0x06040032 -#define WRKTLK8 0x06040033 -#define WRKTLK8CDT 0x06040034 -#define WRKTLK9 0x06040035 -#define WRKTLK9CDT 0x06040036 -#define WRKTRN 0x06040037 -#define WRKTRNCDR 0x06040038 -#define WRKTRNCDT 0x06040039 -#define WRKXIT 0x0604003A -#define WRKXITCDT 0x0604003B - // 60 entities in TXTs, 60 in datafiles. - // room5 -#define room5_PAL 0x06050000 -#define room5_l0 0x06050001 -#define room5_l1 0x06050002 -#define room5_l2 0x06050003 -#define room5_gd1 0x06050004 -#define room5_gd2 0x06050005 -#define room5_flr 0x06050006 -#define ALBAPT 0x06050007 -#define ALBAPTCDT 0x06050008 -#define ALBAPTCDR 0x06050009 -#define ALBCLOSECDT 0x0605000A -#define ALBCLOSE 0x0605000B -#define ALBCRD8 0x0605000C -#define ALBCRD8CDT 0x0605000D -#define ALBDORTKCDT 0x0605000E -#define ALBDORTK 0x0605000F -#define ALBDRTK2CDT 0x06050010 -#define ALBDRTK2 0x06050011 -#define ALBHND 0x06050012 -#define ALBHNDCDT 0x06050013 -#define ALBOBJ 0x06050014 -#define ALBOBJCDT 0x06050015 -#define ALBOPENCDT 0x06050016 -#define ALBOPEN 0x06050017 -#define ALBPKT 0x06050018 -#define ALBPKTCDT 0x06050019 -#define ALBTLK 0x0605001A -#define ALBTLKCDT 0x0605001B -#define ALBWLK9CDT 0x0605001C -#define ALBWLK9 0x0605001D -#define GEOCRD05 0x0605001E -#define GEOCRD05CDT 0x0605001F -#define GEODOR05CDT 0x06050020 -#define GEODOR05 0x06050021 -#define GEOEMG 0x06050022 -#define GEOEMGCDT 0x06050023 -#define GEOEMGCDR 0x06050024 -#define GEOEMGA 0x06050025 -#define GEOEMGACDT 0x06050026 -#define GEOEMGACDR 0x06050027 -#define GEOEMGB 0x06050028 -#define GEOEMGBCDT 0x06050029 -#define GEOEMGBCDR 0x0605002A -#define GEOEXITCDT 0x0605002B -#define GEOEXIT 0x0605002C -#define GEOHND05 0x0605002D -#define GEOHND05CDT 0x0605002E -#define GEONOK05CDT 0x0605002F -#define GEONOK05 0x06050030 -#define GEOTLK05 0x06050031 -#define GEOTLK05CDT 0x06050032 - // 51 entities in TXTs, 51 in datafiles. - // room6 -#define SEWER_PAL 0x06060000 -#define room6_PAL 0x06060001 -#define room6_l0 0x06060002 -#define room6_l1 0x06060003 -#define room6_gd1 0x06060004 -#define room6_flr 0x06060005 -#define GEOASC06 0x06060006 -#define GEOASC06CDT 0x06060007 -#define GEODES06 0x06060008 -#define GEODES06CDT 0x06060009 -#define GEONOSE 0x0606000A -#define GEONOSECDT 0x0606000B -#define REDNOSE 0x0606000C -#define REDNOSECDT 0x0606000D -#define WATER06 0x0606000E -#define WATER06CDT 0x0606000F - // 16 entities in TXTs, 16 in datafiles. - // room7 -#define room7_PAL 0x06070000 -#define room7_l0 0x06070001 -#define room7_l1 0x06070002 -#define room7_l2 0x06070003 -#define room7_gd1 0x06070004 -#define room7_gd2 0x06070005 -#define room7_flr 0x06070006 -#define GEOASC07 0x06070007 -#define GEOASC07CDT 0x06070008 -#define GEOASC07CDR 0x06070009 -#define GEOPLL07 0x0607000A -#define GEOPLL07CDT 0x0607000B -#define GEOPLL07CDR 0x0607000C -#define GEOSPK 0x0607000D -#define GEOSPKCDT 0x0607000E -#define GEOTIS 0x0607000F -#define GEOTISCDT 0x06070010 -#define MATERIAL 0x06070011 -#define MATERIALCDT 0x06070012 -#define TISSUE7 0x06070013 -#define TISSUE7CDT 0x06070014 -#define WATER07 0x06070015 -#define WATER07CDT 0x06070016 - // 23 entities in TXTs, 23 in datafiles. - // room8 -#define room8_PAL 0x06080000 -#define room8_l0 0x06080001 -#define room8_l1 0x06080002 -#define room8_l2 0x06080003 -#define room8_gd1 0x06080004 -#define room8_gd2 0x06080005 -#define room8_flr 0x06080006 -#define room8_plx 0x06080007 - // 8 entities in TXTs, 8 in datafiles. -// paris_2 - // sound_fx -#define FX_BIRD 0x07000000 -#define FX_BIRD2 0x07000001 -#define FX_CARLTON 0x07000002 -#define FX_CARS 0x07000003 -#define FX_DOORTRY 0x07000004 -#define FX_FIESTA 0x07000005 -#define FX_FLATDOOR 0x07000006 -#define FX_HVYVEHL 0x07000007 -#define FX_HVYVEHR 0x07000008 -#define FX_LITEVEHL 0x07000009 -#define FX_LITEVEHR 0x0700000A -#define FX_FONEUP 0x0700000B -#define FX_FONEDN 0x0700000C -#define FX_GEOCCH 0x0700000D -#define FX_GEOCHAIR 0x0700000E -#define FX_GEOCHR9 0x0700000F -#define FX_NICOPEN 0x07000010 -#define FX_NICLOSE 0x07000011 -#define FX_PHONICO1 0x07000012 -#define FX_GRAMOFON 0x07000013 -#define FX_SHOCK1 0x07000014 -#define FX_WINDUP11 0x07000015 -#define FX_FRISK 0x07000016 -#define FX_TRAFFIC3 0x07000017 -#define FX_DESKBELL 0x07000018 -#define FX_KEY13 0x07000019 -#define FX_PAPER6 0x0700001A -#define FX_PHONEDN2 0x0700001B -#define FX_PHONEUP2 0x0700001C -#define FX_PIANO14 0x0700001D -#define FX_TRYDOR14 0x0700001E -#define FX_CABCLOSE 0x0700001F -#define FX_CABOPEN 0x07000020 -#define FX_DORCLOSE 0x07000021 -#define FX_WINDOPEN 0x07000022 -#define FX_COO 0x07000023 -#define FX_COO2 0x07000024 -#define FX_LEDGE1 0x07000025 -#define FX_LEDGE2 0x07000026 -#define FX_BRIEFOFF 0x07000027 -#define FX_BRIEFON 0x07000028 -#define FX_JUMPIN 0x07000029 -#define FX_WARDIN 0x0700002A -#define FX_WARDOUT 0x0700002B -#define FX_CLIMBIN 0x0700002C -#define FX_CLIMBOUT 0x0700002D - // 46 entities in TXTs, 46 in datafiles. - // room9 -#define PARIS2_PAL 0x07010000 -#define room9_PAL 0x07010001 -#define room9_l0 0x07010002 -#define room9_l1 0x07010003 -#define room9_l2 0x07010004 -#define room9_gd1 0x07010005 -#define room9_gd2 0x07010006 -#define room9_flr 0x07010007 -#define CARA9CDT 0x07010008 -#define CARA9 0x07010009 -#define CARB9CDT 0x0701000A -#define CARB9 0x0701000B -#define CARC9CDT 0x0701000C -#define CARC9 0x0701000D -#define DOROPN09CDR 0x0701000E -#define DOROPN09CDT 0x0701000F -#define DOROPN09 0x07010010 -#define FLWLUKCDR 0x07010011 -#define FLWLUKCDT 0x07010012 -#define FLWLUK 0x07010013 -#define FLWNITCDT 0x07010014 -#define FLWNIT 0x07010015 -#define FLWTLKCDT 0x07010016 -#define FLWTLK 0x07010017 -#define GEODOOR9 0x07010018 -#define GEODOOR9CDT 0x07010019 -#define GEOSTPCDT 0x0701001A -#define GEOSTP 0x0701001B -#define GEOSTP8CDT 0x0701001C -#define GEOSTP8 0x0701001D -#define GEOTRY 0x0701001E -#define GEOTRYCDT 0x0701001F -#define TRUCKA9CDT 0x07010020 -#define TRUCKA9 0x07010021 -#define TRUCKB9CDT 0x07010022 -#define TRUCKB9 0x07010023 -#define TRUCKC9CDT 0x07010024 -#define TRUCKC9 0x07010025 - // 38 entities in TXTs, 38 in datafiles. - // room10 -#define R10SPRPAL 0x07020000 -#define room10_PAL 0x07020001 -#define room10_l0 0x07020002 -#define room10_l1 0x07020003 -#define room10_gd1 0x07020004 -#define room10_flr 0x07020005 -#define DOORCDT 0x07020006 -#define DOOR 0x07020007 -#define GEOCCHCDT 0x07020008 -#define GEOCCHCDR 0x07020009 -#define GEOCCH 0x0702000A -#define GEOCCH8CDT 0x0702000B -#define GEOCCH8 0x0702000C -#define GEOCCH9CDT 0x0702000D -#define GEOCCH9 0x0702000E -#define GEOCHRCDT 0x0702000F -#define GEOCHR 0x07020010 -#define GEOCHR8CDT 0x07020011 -#define GEOCHR8 0x07020012 -#define GEOCHR9CDT 0x07020013 -#define GEOCHR9 0x07020014 -#define GEODWN10CDT 0x07020015 -#define GEODWN10 0x07020016 -#define GEOENT10CDT 0x07020017 -#define GEOENT10 0x07020018 -#define GEOGEM10CDT 0x07020019 -#define GEOGEM10 0x0702001A -#define GEOGEMBCDT 0x0702001B -#define GEOGEMB 0x0702001C -#define GEOLUK10CDT 0x0702001D -#define GEOLUK10 0x0702001E -#define GEOLVS10CDT 0x0702001F -#define GEOLVS10 0x07020020 -#define GEOMAGTKCDT 0x07020021 -#define GEOMAGTK 0x07020022 -#define GEOMAT10CDT 0x07020023 -#define GEOMAT10 0x07020024 -#define GEOMATBCDT 0x07020025 -#define GEOMATB 0x07020026 -#define GEOMATCCDT 0x07020027 -#define GEOMATC 0x07020028 -#define GEONIC10CDR 0x07020029 -#define GEONIC10CDT 0x0702002A -#define GEONIC10 0x0702002B -#define GEONOSCDT 0x0702002C -#define GEONOS 0x0702002D -#define GEONOS10CDT 0x0702002E -#define GEONOS10 0x0702002F -#define GEONWPAPCDT 0x07020030 -#define GEONWPAP 0x07020031 -#define GEOPHN10CDT 0x07020032 -#define GEOPHN10 0x07020033 -#define GEOPHTCDT 0x07020034 -#define GEOPHT 0x07020035 -#define GEOPHT10CDT 0x07020036 -#define GEOPHT10 0x07020037 -#define GEOPHTLKCDT 0x07020038 -#define GEOPHTLK 0x07020039 -#define GEOPPR10CDT 0x0702003A -#define GEOPPR10 0x0702003B -#define GEOPRDCDT 0x0702003C -#define GEOPRD 0x0702003D -#define GEOREDCDT 0x0702003E -#define GEORED 0x0702003F -#define GEORELCDR 0x07020040 -#define GEORELCDT 0x07020041 -#define GEOREL 0x07020042 -#define GEORXTCDT 0x07020043 -#define GEORXT 0x07020044 -#define GEOTIS10CDT 0x07020045 -#define GEOTIS10 0x07020046 -#define GEOTISBCDT 0x07020047 -#define GEOTISB 0x07020048 -#define GEOTRIP1CDT 0x07020049 -#define GEOTRIP1 0x0702004A -#define GEOTRIP2CDT 0x0702004B -#define GEOTRIP2 0x0702004C -#define LOBTLK10CDT 0x0702004D -#define LOBTLK10 0x0702004E -#define MANUCDT 0x0702004F -#define MANU 0x07020050 -#define NICCHR9CDR 0x07020051 -#define NICCHR9CDT 0x07020052 -#define NICCHR9 0x07020053 -#define NICDWN10CDT 0x07020054 -#define NICDWN10 0x07020055 -#define NICLUK10CDT 0x07020056 -#define NICLUK10 0x07020057 -#define NICMAGCDR 0x07020058 -#define NICMAGCDT 0x07020059 -#define NICMAG 0x0702005A -#define NICNOSCDT 0x0702005B -#define NICNOS 0x0702005C -#define NICNOS10CDT 0x0702005D -#define NICNOS10 0x0702005E -#define NICNOSBCDT 0x0702005F -#define NICNOSB 0x07020060 -#define NICPHN10CDT 0x07020061 -#define NICPHN10 0x07020062 -#define NICPHT10CDT 0x07020063 -#define NICPHT10 0x07020064 -#define NICPPRCDT 0x07020065 -#define NICPPR 0x07020066 -#define NICPPR2CDT 0x07020067 -#define NICPPR2 0x07020068 -#define NICREDCDT 0x07020069 -#define NICRED 0x0702006A -#define NICRED2CDR 0x0702006B -#define NICRED2CDT 0x0702006C -#define NICRED2 0x0702006D -#define NICSIT 0x0702006E -#define NICSITCDT 0x0702006F -#define NICTLK10CDT 0x07020070 -#define NICTLK10 0x07020071 -#define NICTLKL 0x07020072 -#define NICTLKLCDT 0x07020073 -#define NICTLKR 0x07020074 -#define NICTLKRCDT 0x07020075 -#define NICTLKX 0x07020076 -#define NICTLKXCDT 0x07020077 -#define NICTLKXCDR 0x07020078 -#define NICTRIPCDT 0x07020079 -#define NICTRIP 0x0702007A -#define NICTURN 0x0702007B -#define NICTURNCDT 0x0702007C -#define NICTURNCDR 0x0702007D -#define NICWRT 0x0702007E -#define NICWRTCDT 0x0702007F -#define PHONE10CDT 0x07020080 -#define PHONE10 0x07020081 -#define PEAPAGECDT 0x07020082 -#define PEAPAGE 0x07020083 -#define PEAPAGE_PAL 0x07020084 -#define MANUSCRPCDT 0x07020085 -#define MANUSCRP 0x07020086 -#define MANUSCRP_PAL 0x07020087 -#define TRIPOD10CDT 0x07020088 -#define TRIPOD10 0x07020089 - // 138 entities in TXTs, 138 in datafiles. - // room11 -#define room11_PAL 0x07030000 -#define room11_l0 0x07030001 -#define room11_l1 0x07030002 -#define room11_l2 0x07030003 -#define room11_gd1 0x07030004 -#define room11_gd2 0x07030005 -#define room11_flr 0x07030006 -#define COSGIVCDR 0x07030007 -#define COSGIVCDT 0x07030008 -#define COSGIV 0x07030009 -#define COSLOOPCDT 0x0703000A -#define COSLOOP 0x0703000B -#define COSSHKCDT 0x0703000C -#define COSSHK 0x0703000D -#define COSSNFCDT 0x0703000E -#define COSSNF 0x0703000F -#define COSTLKCDT 0x07030010 -#define COSTLK 0x07030011 -#define DISCSPINCDT 0x07030012 -#define DISCSPIN 0x07030013 -#define GEOPIC11CDR 0x07030014 -#define GEOPIC11CDT 0x07030015 -#define GEOPIC11 0x07030016 -#define GEOSHK11CDT 0x07030017 -#define GEOSHK11 0x07030018 -#define GEOTURDCDT 0x07030019 -#define GEOTURD 0x0703001A -#define GEOTIS11CDT 0x0703001B -#define GEOTIS11 0x0703001C -#define GEOWINDCDT 0x0703001D -#define GEOWIND 0x0703001E -#define WINDUPCDT 0x0703001F -#define WINDUP 0x07030020 - // 33 entities in TXTs, 33 in datafiles. - // room12 -#define room12_PAL 0x07040000 -#define room12_l0 0x07040001 -#define room12_l1 0x07040002 -#define room12_gd1 0x07040003 -#define room12_flr 0x07040004 -#define FLAGSCDT 0x07040005 -#define FLAGS 0x07040006 -#define GEOAPPCDT 0x07040007 -#define GEOAPP 0x07040008 -#define GEOARMCDT 0x07040009 -#define GEOARM 0x0704000A -#define GEOASC12CDT 0x0704000B -#define GEOASC12 0x0704000C -#define GEODES12CDT 0x0704000D -#define GEODES12 0x0704000E -#define GORCOINCDT 0x0704000F -#define GORCOIN 0x07040010 -#define GORFRKCDT 0x07040011 -#define GORFRK 0x07040012 -#define GORMANCDT 0x07040013 -#define GORMAN 0x07040014 -#define GORTALKCDT 0x07040015 -#define GORTALK 0x07040016 -#define GORTLKCDT 0x07040017 -#define GORTLK 0x07040018 -#define GORTURNCDR 0x07040019 -#define GORTURNCDT 0x0704001A -#define GORTURN 0x0704001B -#define LATVIAN12CDT 0x0704001C -#define LATVIAN12 0x0704001D -#define WEABAKCDT 0x0704001E -#define WEABAK 0x0704001F -#define WEASMKCDT 0x07040020 -#define WEASMK 0x07040021 -#define WEATLKCDT 0x07040022 -#define WEATLK 0x07040023 -#define WEATLK12CDT 0x07040024 -#define WEATLK12 0x07040025 -#define WEATRNCDR 0x07040026 -#define WEATRNCDT 0x07040027 -#define WEATRN 0x07040028 - // 41 entities in TXTs, 41 in datafiles. - // room13 -#define R13SPRPAL 0x07050000 -#define room13_PAL 0x07050001 -#define room13_l0 0x07050002 -#define room13_l1 0x07050003 -#define room13_l2 0x07050004 -#define room13_gd1 0x07050005 -#define room13_gd2 0x07050006 -#define room13_flr 0x07050007 -#define CLKIDLCDT 0x07050008 -#define CLKIDL 0x07050009 -#define CLKMANCDT 0x0705000A -#define CLKMAN 0x0705000B -#define CLKTAKCDT 0x0705000C -#define CLKTAK 0x0705000D -#define CLKTLKCDT 0x0705000E -#define CLKTLK 0x0705000F -#define CLKTLK2CDT 0x07050010 -#define CLKTLK2 0x07050011 -#define CLKTLK3CDT 0x07050012 -#define CLKTLK3 0x07050013 -#define CLKTURNCDR 0x07050014 -#define CLKTURNCDT 0x07050015 -#define CLKTURN 0x07050016 -#define CLKWLKCDT 0x07050017 -#define CLKWLK 0x07050018 -#define CLKWLK2CDT 0x07050019 -#define CLKWLK2 0x0705001A -#define CLKWLK3CDT 0x0705001B -#define CLKWLK3 0x0705001C -#define CLKWULCDT 0x0705001D -#define CLKWUL 0x0705001E -#define GEOASC13CDT 0x0705001F -#define GEOASC13 0x07050020 -#define GEODES13CDT 0x07050021 -#define GEODES13 0x07050022 -#define GEOKEYCDT 0x07050023 -#define GEOKEY 0x07050024 -#define GEOKEY13CDT 0x07050025 -#define GEOKEY13 0x07050026 -#define GEOMAN13CDT 0x07050027 -#define GEOMAN13 0x07050028 -#define GEOTELCDT 0x07050029 -#define GEOTEL 0x0705002A -#define GEOTEL9CDT 0x0705002B -#define GEOTEL9 0x0705002C -#define KEY13CDT 0x0705002D -#define KEY13 0x0705002E -#define LATLUKCDR 0x0705002F -#define LATLUKCDT 0x07050030 -#define LATLUK 0x07050031 -#define LATRDSCDT 0x07050032 -#define LATRDS 0x07050033 -#define LATTLKCDT 0x07050034 -#define LATTLK 0x07050035 -#define PMTGIVCDT 0x07050036 -#define PMTGIV 0x07050037 -#define PMTPNOCDT 0x07050038 -#define PMTPNO 0x07050039 -#define PMTSTDCDT 0x0705003A -#define PMTSTD 0x0705003B -#define PMTTLKCDT 0x0705003C -#define PMTTLK 0x0705003D -#define PMTTLK8CDT 0x0705003E -#define PMTTLK8 0x0705003F -#define PMTTLK9CDT 0x07050040 -#define PMTTLK9 0x07050041 -#define PMTTOTLKCDR 0x07050042 -#define PMTTOTLKCDT 0x07050043 -#define PMTTOTLK 0x07050044 -#define PMTTURNCDR 0x07050045 -#define PMTTURNCDT 0x07050046 -#define PMTTURN 0x07050047 -#define PMTWLK1CDT 0x07050048 -#define PMTWLK1 0x07050049 -#define PMTWLK2CDT 0x0705004A -#define PMTWLK2 0x0705004B - // 76 entities in TXTs, 76 in datafiles. - // room14 -#define room14_PAL 0x07060000 -#define room14_l0 0x07060001 -#define room14_l1 0x07060002 -#define room14_gd1 0x07060003 -#define room14_flr 0x07060004 -#define GEOASC14CDT 0x07060005 -#define GEOASC14 0x07060006 -#define GEODES14CDT 0x07060007 -#define GEODES14 0x07060008 -#define GEODORCDR 0x07060009 -#define GEODORCDT 0x0706000A -#define GEODOR 0x0706000B - // 12 entities in TXTs, 12 in datafiles. - // room15 -#define room15_PAL 0x07070000 -#define room15_l0 0x07070001 -#define room15_l1 0x07070002 -#define room15_l2 0x07070003 -#define room15_gd1 0x07070004 -#define room15_gd2 0x07070005 -#define room15_flr 0x07070006 -#define DOROPN15CDT 0x07070007 -#define DOROPN15 0x07070008 -#define GEOBEDCDR 0x07070009 -#define GEOBEDCDT 0x0707000A -#define GEOBED 0x0707000B -#define GEODOR15CDT 0x0707000C -#define GEODOR15 0x0707000D -#define GEOENT15CDT 0x0707000E -#define GEOENT15 0x0707000F -#define GEOWIN1CDT 0x07070010 -#define GEOWIN1 0x07070011 -#define GEOWIN15CDT 0x07070012 -#define GEOWIN15 0x07070013 -#define GEOWIN2CDT 0x07070014 -#define GEOWIN2 0x07070015 -#define GEOWRBCDR 0x07070016 -#define GEOWRBCDT 0x07070017 -#define GEOWRB 0x07070018 -#define WINDOWCDT 0x07070019 -#define WINDOW 0x0707001A - // 27 entities in TXTs, 27 in datafiles. - // room16 -#define room16_PAL 0x07080000 -#define R16L0 0x07080001 -#define R16L1 0x07080002 -#define R16G1 0x07080003 -#define GEOILWCDT 0x07080004 -#define GEOILW 0x07080005 -#define GEOIRWCDT 0x07080006 -#define GEOIRW 0x07080007 -#define GEOMANLCDT 0x07080008 -#define GEOMANL 0x07080009 -#define GEOMANRCDT 0x0708000A -#define GEOMANR 0x0708000B -#define GEOMLWCDT 0x0708000C -#define GEOMLW 0x0708000D -#define GEOMRWCDT 0x0708000E -#define GEOMRW 0x0708000F -#define GEOOLWCDT 0x07080010 -#define GEOOLWCDR 0x07080011 -#define GEOOLW 0x07080012 -#define GEOORWCDT 0x07080013 -#define GEOORWCDR 0x07080014 -#define GEOORW 0x07080015 -#define MANLCDT 0x07080016 -#define MANL 0x07080017 -#define MANRCDT 0x07080018 -#define MANR 0x07080019 - // 26 entities in TXTs, 26 in datafiles. - // room17 -#define room17_PAL 0x07090000 -#define room17_l0 0x07090001 -#define room17_l1 0x07090002 -#define room17_l2 0x07090003 -#define room17_gd1 0x07090004 -#define room17_gd2 0x07090005 -#define room17_flr 0x07090006 -#define IBACK17 0x07090007 -#define IBACK17PAL 0x07090008 -#define GEOINQ17 0x07090009 -#define GEOINQ17CDT 0x0709000A -#define SBACK17 0x0709000B -#define SBACK17PAL 0x0709000C -#define GEOSUR17 0x0709000D -#define GEOSUR17CDT 0x0709000E -#define ASSTAIR2_PAL 0x0709000F -#define ASSTAIR2 0x07090010 -#define ASSTAIRCDT 0x07090011 -#define ASSTAIR 0x07090012 -#define ASSDORCDT 0x07090013 -#define ASSDOR 0x07090014 -#define ASSDOR2CDT 0x07090015 -#define ASSDOR2 0x07090016 -#define ASSTRWCDT 0x07090017 -#define ASSTRW 0x07090018 -#define ASSWRBCDT 0x07090019 -#define ASSWRB 0x0709001A -#define ASWLK17CDT 0x0709001B -#define ASWLK17 0x0709001C -#define BRFCASECDT 0x0709001D -#define BRFCASE 0x0709001E -#define GEOBCBCDR 0x0709001F -#define GEOBCBCDT 0x07090020 -#define GEOBCB 0x07090021 -#define GEOBED17CDT 0x07090022 -#define GEOBED17 0x07090023 -#define GEOBFCCDR 0x07090024 -#define GEOBFCCDT 0x07090025 -#define GEOBFC 0x07090026 -#define GEODOR17CDT 0x07090027 -#define GEODOR17 0x07090028 -#define GEODOR2CDR 0x07090029 -#define GEODOR2CDT 0x0709002A -#define GEODOR2 0x0709002B -#define GEOPANTSCDT 0x0709002C -#define GEOPANTS 0x0709002D -#define GEOWIN8CDT 0x0709002E -#define GEOWIN8 0x0709002F -#define GEOWIN9CDT 0x07090030 -#define GEOWIN9 0x07090031 -#define GEOWRB1CDR 0x07090032 -#define GEOWRB1CDT 0x07090033 -#define GEOWRB1 0x07090034 -#define GEOWRB2CDT 0x07090035 -#define GEOWRB2 0x07090036 -#define GEOWRB3CDR 0x07090037 -#define GEOWRB3CDT 0x07090038 -#define GEOWRB3 0x07090039 -#define GEOWRB4CDT 0x0709003A -#define GEOWRB4 0x0709003B -#define PANTS2CDT 0x0709003C -#define PANTS2 0x0709003D -#define PANTWRBCDT 0x0709003E -#define PANTWRB 0x0709003F -#define STATDOORCDT 0x07090040 -#define STATDOOR 0x07090041 -#define WRBDOR17CDT 0x07090042 -#define WRBDOR17 0x07090043 - // 68 entities in TXTs, 68 in datafiles. - // room18 -#define R18SPRPAL 0x070A0000 -#define room18_PAL 0x070A0001 -#define room18_l0 0x070A0002 -#define room18_l1 0x070A0003 -#define room18_l2 0x070A0004 -#define room18_gd1 0x070A0005 -#define room18_gd2 0x070A0006 -#define room18_flr 0x070A0007 -#define FAN18CDT 0x070A0008 -#define FAN18 0x070A0009 -#define GENBNDCDT 0x070A000A -#define GENBND 0x070A000B -#define GENSTRCDT 0x070A000C -#define GENSTR 0x070A000D -#define GENTLK18CDT 0x070A000E -#define GENTLK18 0x070A000F -#define GEOLVE18CDT 0x070A0010 -#define GEOLVE18 0x070A0011 -#define MOUBAK18CDT 0x070A0012 -#define MOUBAK18 0x070A0013 -#define MOUBUSYCDT 0x070A0014 -#define MOUBUSY 0x070A0015 -#define MOUTKROSCDT 0x070A0016 -#define MOUTKROS 0x070A0017 -#define MOUTLK18CDT 0x070A0018 -#define MOUTLK18 0x070A0019 -#define MOUWLK18CDT 0x070A001A -#define MOUWLK18 0x070A001B -#define ROSBAK18CDT 0x070A001C -#define ROSBAK18 0x070A001D -#define ROSBUSYCDT 0x070A001E -#define ROSBUSY 0x070A001F -#define ROSSTDCDT 0x070A0020 -#define ROSSTD 0x070A0021 -#define ROSTLK18CDT 0x070A0022 -#define ROSTLK18 0x070A0023 -#define ROSTLKXCDT 0x070A0024 -#define ROSTLKX 0x070A0025 -#define ROSTURNCDR 0x070A0026 -#define ROSTURNCDT 0x070A0027 -#define ROSTURN 0x070A0028 -#define ROSWLK18CDT 0x070A0029 -#define ROSWLK18 0x070A002A - // 43 entities in TXTs, 43 in datafiles. - // room46 -#define room46_PAL 0x070B0000 -#define room46_l0 0x070B0001 -#define room46_l1 0x070B0002 -#define room46_l2 0x070B0003 -#define room46_gd1 0x070B0004 -#define room46_gd2 0x070B0005 -#define room46_flr 0x070B0006 -#define MANU46CDT 0x070B0007 -#define MANU46 0x070B0008 - // 9 entities in TXTs, 9 in datafiles. -// paris_3 - // sound_fx -#define FX_MUESEXT 0x08000000 -#define FX_AIRCON28 0x08000001 -#define FX_SARCO28A 0x08000002 -#define FX_SARCO28B 0x08000003 -#define FX_SARCO28C 0x08000004 -#define FX_TOTEM28A 0x08000005 -#define FX_ALARM 0x08000006 -#define FX_CARABINE 0x08000007 -#define FX_DOOR29 0x08000008 -#define FX_FISHFALL 0x08000009 -#define FX_GDROP29 0x0800000A -#define FX_GUI_HIT 0x0800000B -#define FX_GUN1 0x0800000C -#define FX_ROPEDOWN 0x0800000D -#define FX_SARCO29 0x0800000E -#define FX_SMASHGLA 0x0800000F -#define FX_TOTEM29A 0x08000010 -#define FX_TOTEM29B 0x08000011 -#define FX_HOSPEXT 0x08000012 -#define FX_GRAVEL1 0x08000013 -#define FX_GRAVEL2 0x08000014 -#define FX_HOSPNOIS 0x08000015 -#define FX_CUPBOPEN 0x08000016 -#define FX_CUPBCLOS 0x08000017 -#define FX_KIKSHINY 0x08000018 -#define FX_SHINY 0x08000019 -#define FX_SHINYOFF 0x0800001A -#define FX_SHINYON 0x0800001B -#define FX_BLOODPRE 0x0800001C -#define FX_GUN34 0x0800001D -#define FX_PULSE2 0x0800001E -#define FX_PULSE3 0x0800001F - // 32 entities in TXTs, 32 in datafiles. - // benoir -#define MEGABEN 0x08010000 -#define BEN_WLK 0x08010001 -#define STDTAL1 0x08010002 -#define STDTAL1CDT 0x08010003 -#define STDTAL3 0x08010004 -#define STDTAL3CDT 0x08010005 -#define STDTAL5 0x08010006 -#define STDTAL5CDT 0x08010007 -#define XBENPG3 0x08010008 -#define XBENPG3CDT 0x08010009 -#define XBENPG5 0x0801000A -#define XBENPG5CDT 0x0801000B - // 12 entities in TXTs, 12 in datafiles. - // mus -#define MEGAMUS 0x08020000 -#define MUS_WLK 0x08020001 -#define MUSTLK0 0x08020002 -#define MUSTLK0CDT 0x08020003 -#define MUSTLK1 0x08020004 -#define MUSTLK1CDT 0x08020005 -#define MUSTLK2 0x08020006 -#define MUSTLK2CDT 0x08020007 -#define MUSTLK3 0x08020008 -#define MUSTLK3CDT 0x08020009 -#define MUSTLK4 0x0802000A -#define MUSTLK4CDT 0x0802000B -#define MUSTLK5 0x0802000C -#define MUSTLK5CDT 0x0802000D -#define MUSTLK6 0x0802000E -#define MUSTLK6CDT 0x0802000F -#define MUSTLK7 0x08020010 -#define MUSTLK7CDT 0x08020011 - // 18 entities in TXTs, 18 in datafiles. - // white -#define MEGA_WHITE 0x08030000 -#define WHTTLK0 0x08030001 -#define WHTTLK0CDT 0x08030002 -#define WHTTLK1 0x08030003 -#define WHTTLK1CDT 0x08030004 -#define WHTTLK2 0x08030005 -#define WHTTLK2CDT 0x08030006 -#define WHTTLK3 0x08030007 -#define WHTTLK3CDT 0x08030008 -#define WHTTLK4 0x08030009 -#define WHTTLK4CDT 0x0803000A -#define WHTTLK5 0x0803000B -#define WHTTLK5CDT 0x0803000C -#define WHTTLK6 0x0803000D -#define WHTTLK6CDT 0x0803000E -#define WHTTLK7 0x0803000F -#define WHTTLK7CDT 0x08030010 -#define WHTSHRUG 0x08030011 -#define WHTSHRUGCDT 0x08030012 -#define XGEOPG3 0x08030013 -#define XGEOPG3CDT 0x08030014 -#define XGEOPG5 0x08030015 -#define XGEOPG5CDT 0x08030016 - // 23 entities in TXTs, 23 in datafiles. - // room27 -#define PARIS3_PAL 0x08040000 -#define room27_PAL 0x08040001 -#define R27L0 0x08040002 -#define R27L1 0x08040003 -#define R27L2 0x08040004 -#define R27G1 0x08040005 -#define R27G2 0x08040006 -#define room27_flr 0x08040007 -#define GEOWIN27CDR 0x08040008 -#define GEOWIN27CDT 0x08040009 -#define GEOWIN27 0x0804000A - // 11 entities in TXTs, 11 in datafiles. - // room28 -#define R28SPRPAL 0x08050000 -#define R28PAL 0x08050001 -#define R28L0 0x08050002 -#define R28L1 0x08050003 -#define R28L2 0x08050004 -#define R28G1 0x08050005 -#define R28G2 0x08050006 -#define room28_flr 0x08050007 -#define GEOALMCDT 0x08050008 -#define GEOALM 0x08050009 -#define GEOSARCDT 0x0805000A -#define GEOSAR 0x0805000B -#define GEOSAR1CDT 0x0805000C -#define GEOSAR1 0x0805000D -#define GEOSAR2CDR 0x0805000E -#define GEOSAR2CDT 0x0805000F -#define GEOSAR2 0x08050010 -#define GEOSHK28CDT 0x08050011 -#define GEOSHK28 0x08050012 -#define GEOTOTCDT 0x08050013 -#define GEOTOT 0x08050014 -#define GEOWINCDT 0x08050015 -#define GEOWIN 0x08050016 -#define GUAWINCDT 0x08050017 -#define GUAWIN 0x08050018 -#define LOBEXITCDT 0x08050019 -#define LOBEXIT 0x0805001A -#define LOBMANCDT 0x0805001B -#define LOBMAN 0x0805001C -#define LOBSTUCDT 0x0805001D -#define LOBSTU 0x0805001E -#define LOBTLKCDT 0x0805001F -#define LOBTLK 0x08050020 -#define LOBTURN1CDT 0x08050021 -#define LOBTURN1 0x08050022 -#define LOBTURN2CDT 0x08050023 -#define LOBTURN2 0x08050024 -#define MUSOPNCDT 0x08050025 -#define MUSOPN 0x08050026 -#define SARDOR28CDT 0x08050027 -#define SARDOR28 0x08050028 -#define TOTEM28CDT 0x08050029 -#define TOTEM28 0x0805002A -#define TRIPOD28CDT 0x0805002B -#define TRIPOD28 0x0805002C -#define WINDO28CDR 0x0805002D -#define WINDO28CDT 0x0805002E -#define WINDO28 0x0805002F -#define WINROD28CDT 0x08050030 -#define WINROD28 0x08050031 - // 50 entities in TXTs, 50 in datafiles. - // room29 -#define R29SPRPAL 0x08060000 -#define BBACK29SPRPAL 0x08060001 -#define R29PAL 0x08060002 -#define R29L0 0x08060003 -#define R29L1 0x08060004 -#define R29G1 0x08060005 -#define room29_flr 0x08060006 -#define BBACK29 0x08060007 -#define BBACK29PAL 0x08060008 -#define GEOSUR29CDT 0x08060009 -#define GEOSUR29 0x0806000A -#define CASECDT 0x0806000B -#define CASE 0x0806000C -#define DOOR29CDT 0x0806000D -#define DOOR29 0x0806000E -#define FISH29CDT 0x0806000F -#define FISH29 0x08060010 -#define FLAPENTCDT 0x08060011 -#define FLAPENT 0x08060012 -#define FLAPTLK1CDT 0x08060013 -#define FLAPTLK1 0x08060014 -#define FLAPTLK3CDT 0x08060015 -#define FLAPTLK3 0x08060016 -#define FLAPTOR1CDR 0x08060017 -#define FLAPTOR1CDT 0x08060018 -#define FLAPTOR1 0x08060019 -#define FLAPTOR4CDT 0x0806001A -#define FLAPTOR4 0x0806001B -#define FLAPWLKCDT 0x0806001C -#define FLAPWLK 0x0806001D -#define GEODEDCDT 0x0806001E -#define GEODED 0x0806001F -#define GEOFISHCDT 0x08060020 -#define GEOFISH 0x08060021 -#define GEOFWDCDT 0x08060022 -#define GEOFWD 0x08060023 -#define GEOPEEKCDT 0x08060024 -#define GEOPEEK 0x08060025 -#define GEOSAR6CDT 0x08060026 -#define GEOSAR6 0x08060027 -#define GEOTOT29CDT 0x08060028 -#define GEOTOT29 0x08060029 -#define GEOTOTBCDT 0x0806002A -#define GEOTOTB 0x0806002B -#define GEOTPTOCDT 0x0806002C -#define GEOTPTO 0x0806002D -#define GUIENTCDT 0x0806002E -#define GUIENT 0x0806002F -#define GUIGUNCDT 0x08060030 -#define GUIGUN 0x08060031 -#define GUIKNECDT 0x08060032 -#define GUIKNE 0x08060033 -#define GUIKNE1CDT 0x08060034 -#define GUIKNE1 0x08060035 -#define GUITLK1CDT 0x08060036 -#define GUITLK1 0x08060037 -#define GUITLK3CDT 0x08060038 -#define GUITLK3 0x08060039 -#define GUITLK4CDT 0x0806003A -#define GUITLK4 0x0806003B -#define GUIWLKCDT 0x0806003C -#define GUIWLK 0x0806003D -#define NICPUS1CDT 0x0806003E -#define NICPUS1 0x0806003F -#define ROPE29CDT 0x08060040 -#define ROPE29 0x08060041 -#define SARDOORCDT 0x08060042 -#define SARDOOR 0x08060043 -#define TOR1CDT 0x08060044 -#define TOR1 0x08060045 -#define TOR3CDR 0x08060046 -#define TOR3CDT 0x08060047 -#define TOR3 0x08060048 -#define TOR4CDT 0x08060049 -#define TOR4 0x0806004A -#define TOR6CDT 0x0806004B -#define TOR6 0x0806004C -#define TOR7CDT 0x0806004D -#define TOR7 0x0806004E -#define TOTFALLCDT 0x0806004F -#define TOTFALL 0x08060050 - // 81 entities in TXTs, 81 in datafiles. - // room31 -#define room31_PAL 0x08070000 -#define room31_l0 0x08070001 -#define room31_flr 0x08070002 -#define GEOAMBCDT 0x08070003 -#define GEOAMB 0x08070004 -#define GEODOR31CDT 0x08070005 -#define GEODOR31 0x08070006 - // 7 entities in TXTs, 7 in datafiles. - // room32 -#define room32_PAL 0x08080000 -#define room32_l0 0x08080001 -#define room32_l1 0x08080002 -#define room32_l2 0x08080003 -#define room32_gd1 0x08080004 -#define room32_gd2 0x08080005 -#define room32_flr 0x08080006 -#define CONSTPCDT 0x08080007 -#define CONSTP 0x08080008 -#define CONTLKCDT 0x08080009 -#define CONTLK 0x0808000A -#define CONTLK2CDT 0x0808000B -#define CONTLK2 0x0808000C -#define CONWLKCDT 0x0808000D -#define CONWLK 0x0808000E -#define RECCOMCDT 0x0808000F -#define RECCOM 0x08080010 -#define RECKEYCDT 0x08080011 -#define RECKEY 0x08080012 -#define RECTLKCDT 0x08080013 -#define RECTLK 0x08080014 -#define RECTLK2CDT 0x08080015 -#define RECTLK2 0x08080016 -#define RECTRNCDT 0x08080017 -#define RECTRN 0x08080018 - // 25 entities in TXTs, 25 in datafiles. - // room33 -#define room33_PAL 0x08090000 -#define room33_l0 0x08090001 -#define room33_l1 0x08090002 -#define room33_l2 0x08090003 -#define room33_gd1 0x08090004 -#define room33_gd2 0x08090005 -#define room33_flr 0x08090006 -#define DOMDRNCDT 0x08090007 -#define DOMDRN 0x08090008 -#define DOMDUHCDT 0x08090009 -#define DOMDUH 0x0809000A -#define DOMKIKCDT 0x0809000B -#define DOMKIK 0x0809000C -#define DOMPLGCDT 0x0809000D -#define DOMPLG 0x0809000E -#define DOMTLKCDT 0x0809000F -#define DOMTLK 0x08090010 -#define DOMVACCDT 0x08090011 -#define DOMVAC 0x08090012 -#define DOMWLKCDT 0x08090013 -#define DOMWLK 0x08090014 -#define DOMWLK2CDT 0x08090015 -#define DOMWLK2 0x08090016 -#define DOMWLK3CDT 0x08090017 -#define DOMWLK3 0x08090018 -#define DOMWLK4CDT 0x08090019 -#define DOMWLK4 0x0809001A -#define GEOCOTCDT 0x0809001B -#define GEOCOT 0x0809001C -#define GEOPLG33CDT 0x0809001D -#define GEOPLG33 0x0809001E -#define GEOWATCDT 0x0809001F -#define GEOWAT 0x08090020 -#define GEOWWATCDT 0x08090021 -#define GEOWWAT 0x08090022 -#define LEAD1CDT 0x08090023 -#define LEAD1 0x08090024 -#define LEAD2CDT 0x08090025 -#define LEAD2 0x08090026 -#define SHINY33CDT 0x08090027 -#define SHINY33 0x08090028 - // 41 entities in TXTs, 41 in datafiles. - // room34 -#define room34_PAL 0x080A0000 -#define room34_l0 0x080A0001 -#define room34_l1 0x080A0002 -#define room34_l2 0x080A0003 -#define room34_l3 0x080A0004 -#define room34_gd1 0x080A0005 -#define room34_gd2 0x080A0006 -#define room34_gd3 0x080A0007 -#define room34_flr 0x080A0008 -#define R34PLX 0x080A0009 -#define BENBP1CDT 0x080A000A -#define BENBP1 0x080A000B -#define BENBP2CDT 0x080A000C -#define BENBP2 0x080A000D -#define DOOR34CDR 0x080A000E -#define DOOR34CDT 0x080A000F -#define DOOR34 0x080A0010 -#define GENDTLKCDT 0x080A0011 -#define GENDTLK 0x080A0012 -#define GENENTCDT 0x080A0013 -#define GENENT 0x080A0014 -#define GENSHOTCDT 0x080A0015 -#define GENSHOT 0x080A0016 -#define GENSTLKCDT 0x080A0017 -#define GENSTLK 0x080A0018 -#define GENSUPCDT 0x080A0019 -#define GENSUP 0x080A001A -#define GENTRNCDT 0x080A001B -#define GENTRN 0x080A001C -#define GEOBAKCDT 0x080A001D -#define GEOBAK 0x080A001E -#define GEOBP2CDT 0x080A001F -#define GEOBP2 0x080A0020 -#define GEOCH1CDR 0x080A0021 -#define GEOCH1CDT 0x080A0022 -#define GEOCH1 0x080A0023 -#define GEOCH2CDR 0x080A0024 -#define GEOCH2CDT 0x080A0025 -#define GEOCH2 0x080A0026 -#define GEOCH3CDR 0x080A0027 -#define GEOCH3CDT 0x080A0028 -#define GEOCH3 0x080A0029 -#define GEODOR34CDT 0x080A002A -#define GEODOR34 0x080A002B -#define GEOENT34CDT 0x080A002C -#define GEOENT34 0x080A002D -#define GEONURBPCDT 0x080A002E -#define GEONURBP 0x080A002F -#define GEOTAKCDT 0x080A0030 -#define GEOTAK 0x080A0031 -#define GEOTRYDCDT 0x080A0032 -#define GEOTRYD 0x080A0033 -#define GEOTRYTKCDT 0x080A0034 -#define GEOTRYTK 0x080A0035 -#define HATGIVCDT 0x080A0036 -#define HATGIV 0x080A0037 -#define HATSTPCDT 0x080A0038 -#define HATSTP 0x080A0039 -#define HATTLKCDT 0x080A003A -#define HATTLK 0x080A003B -#define HATWLKCDT 0x080A003C -#define HATWLK 0x080A003D -#define HATWLK2CDT 0x080A003E -#define HATWLK2 0x080A003F -#define MONITOR 0x080A0040 -#define MONITOR_PAL 0x080A0041 -#define PULSE1CDT 0x080A0042 -#define PULSE1 0x080A0043 -#define PULSE2CDT 0x080A0044 -#define PULSE2 0x080A0045 -#define PULSE3CDT 0x080A0046 -#define PULSE3 0x080A0047 -#define RENTLKCDT 0x080A0048 -#define RENTLK 0x080A0049 -#define SMARMCDR 0x080A004A -#define SMARMCDT 0x080A004B -#define SMARM 0x080A004C -#define SMSTPCDR 0x080A004D -#define SMSTPCDT 0x080A004E -#define SMSTP 0x080A004F -#define SMTALKCDT 0x080A0050 -#define SMTALK 0x080A0051 -#define SMTALK2CDT 0x080A0052 -#define SMTALK2 0x080A0053 -#define STUDENTCDT 0x080A0054 -#define STUDENT 0x080A0055 -#define STUDGIVCDT 0x080A0056 -#define STUDGIV 0x080A0057 -#define STUDMOVCDT 0x080A0058 -#define STUDMOV 0x080A0059 - // 90 entities in TXTs, 90 in datafiles. - // room35 -#define room35_PAL 0x080B0000 -#define room35_l0 0x080B0001 -#define room35_l1 0x080B0002 -#define room35_gd1 0x080B0003 -#define room35_flr 0x080B0004 -#define ALSHOCKCDT 0x080B0005 -#define ALSHOCK 0x080B0006 -#define CURFLATCDT 0x080B0007 -#define CURFLAT 0x080B0008 -#define EKLBED35CDT 0x080B0009 -#define EKLBED35 0x080B000A -#define EKLTLK35CDT 0x080B000B -#define EKLTLK35 0x080B000C -#define EKLWLK35CDT 0x080B000D -#define EKLWLK35 0x080B000E -#define GEORCT35CDT 0x080B000F -#define GEORCT35 0x080B0010 -#define GEOSIT35CDR 0x080B0011 -#define GEOSIT35CDT 0x080B0012 -#define GEOSIT35 0x080B0013 -#define GEOTLKCDT 0x080B0014 -#define GEOTLK 0x080B0015 -#define GEOTLK35CDT 0x080B0016 -#define GEOTLK35 0x080B0017 -#define GEOTRN35CDT 0x080B0018 -#define GEOTRN35 0x080B0019 -#define JAQTLK1CDT 0x080B001A -#define JAQTLK1 0x080B001B -#define JAQTLK2CDT 0x080B001C -#define JAQTLK2 0x080B001D - // 30 entities in TXTs, 30 in datafiles. -// paris_4 - // sound_fx -#define FX_COVDWN 0x09000000 -#define FX_KEYIN 0x09000001 -#define FX_MANOP36 0x09000002 -#define FX_MONTAMB 0x09000003 -#define FX_OOH 0x09000004 -#define FX_PULLUP36 0x09000005 -#define FX_REPLCE36 0x09000006 -#define FX_AMBIEN37 0x09000007 -#define FX_CHAIN37 0x09000008 -#define FX_CHAIN37B 0x09000009 -#define FX_DOOR37 0x0900000A -#define FX_HOLE37 0x0900000B -#define FX_KNOCK37 0x0900000C -#define FX_KNOCK37B 0x0900000D -#define FX_WINCH37 0x0900000E -#define FX_AIRCON41 0x0900000F -#define FX_FONEDN41 0x09000010 -#define FX_FONEUP41 0x09000011 -#define FX_PHONCALL 0x09000012 -#define FX_THERMO1 0x09000013 -#define FX_TAPDRIP 0x09000014 -#define FX_DRIER1 0x09000015 -#define FX_CHURCHFX 0x09000016 - // 23 entities in TXTs, 23 in datafiles. - // room36 -#define R36SPRPAL 0x09010000 -#define R36L0 0x09010001 -#define R36L1 0x09010002 -#define R36G1 0x09010003 -#define room36_PAL 0x09010004 -#define room36_flr 0x09010005 -#define R36PLX 0x09010006 -#define BAL36CDT 0x09010007 -#define BAL36 0x09010008 -#define CRO36APPCDT 0x09010009 -#define CRO36APP 0x0901000A -#define CRO36GEOCDT 0x0901000B -#define CRO36GEO 0x0901000C -#define CRO36IDLCDT 0x0901000D -#define CRO36IDL 0x0901000E -#define CRO36JUGCDT 0x0901000F -#define CRO36JUG 0x09010010 -#define CRO36UNICDT 0x09010011 -#define CRO36UNI 0x09010012 -#define GEN36DRICDT 0x09010013 -#define GEN36DRI 0x09010014 -#define GEN36FEHCDT 0x09010015 -#define GEN36FEH 0x09010016 -#define GEN36HURCDT 0x09010017 -#define GEN36HUR 0x09010018 -#define GEN36LEACDT 0x09010019 -#define GEN36LEA 0x0901001A -#define GEN36POICDR 0x0901001B -#define GEN36POICDT 0x0901001C -#define GEN36POI 0x0901001D -#define GEN36SPECDT 0x0901001E -#define GEN36SPE 0x0901001F -#define GEN36TALCDT 0x09010020 -#define GEN36TAL 0x09010021 -#define GEO36CLOCDT 0x09010022 -#define GEO36CLO 0x09010023 -#define GEO36ENTCDT 0x09010024 -#define GEO36ENT 0x09010025 -#define GEO36EXTCDT 0x09010026 -#define GEO36EXT 0x09010027 -#define GEO36JUGCDT 0x09010028 -#define GEO36JUG 0x09010029 -#define GEO36KNECDR 0x0901002A -#define GEO36KNECDT 0x0901002B -#define GEO36KNE 0x0901002C -#define GEO36LUKCDR 0x0901002D -#define GEO36LUKCDT 0x0901002E -#define GEO36LUK 0x0901002F -#define GEO36NOSCDT 0x09010030 -#define GEO36NOS 0x09010031 -#define GEO36OPECDT 0x09010032 -#define GEO36OPE 0x09010033 -#define GEO36POPCDT 0x09010034 -#define GEO36POP 0x09010035 -#define GEO36SHOCDR 0x09010036 -#define GEO36SHOCDT 0x09010037 -#define GEO36SHO 0x09010038 -#define GEO36SNTCDT 0x09010039 -#define GEO36SNT 0x0901003A -#define GEO36STDCDT 0x0901003B -#define GEO36STD 0x0901003C -#define GEO36STUCDT 0x0901003D -#define GEO36STU 0x0901003E -#define GEO36TAKCDT 0x0901003F -#define GEO36TAK 0x09010040 -#define HAT36CDT 0x09010041 -#define HAT36 0x09010042 -#define JUG36FINCDT 0x09010043 -#define JUG36FIN 0x09010044 -#define JUG36FURCDT 0x09010045 -#define JUG36FUR 0x09010046 -#define JUG36GIVCDT 0x09010047 -#define JUG36GIV 0x09010048 -#define JUG36GOCDT 0x09010049 -#define JUG36GO 0x0901004A -#define JUG36JUGCDT 0x0901004B -#define JUG36JUG 0x0901004C -#define JUG36LAFCDT 0x0901004D -#define JUG36LAF 0x0901004E -#define JUG36STACDT 0x0901004F -#define JUG36STA 0x09010050 -#define JUG36TAKCDT 0x09010051 -#define JUG36TAK 0x09010052 -#define JUG36TALCDT 0x09010053 -#define JUG36TAL 0x09010054 -#define MANCOV36CDT 0x09010055 -#define MANCOV36 0x09010056 -#define MANOFF36CDT 0x09010057 -#define MANOFF36 0x09010058 -#define VIN36CDT 0x09010059 -#define VIN36 0x0901005A - // 91 entities in TXTs, 91 in datafiles. - // room37 -#define room37_PAL 0x09020000 -#define R37L0 0x09020001 -#define R37L1 0x09020002 -#define R37G1 0x09020003 -#define room37_flr 0x09020004 -#define DOR37COLCDT 0x09020005 -#define DOR37COL 0x09020006 -#define GEO37ASCCDT 0x09020007 -#define GEO37ASC 0x09020008 -#define GEO37COGCDT 0x09020009 -#define GEO37COG 0x0902000A -#define GEO37DESCDT 0x0902000B -#define GEO37DES 0x0902000C -#define GEO37HUKCDR 0x0902000D -#define GEO37HUKCDT 0x0902000E -#define GEO37HUK 0x0902000F -#define GEO37INBCDT 0x09020010 -#define GEO37INB 0x09020011 -#define GEO37LEVCDT 0x09020012 -#define GEO37LEV 0x09020013 -#define GEO37OUTCDT 0x09020014 -#define GEO37OUT 0x09020015 -#define GEO37RUNCDT 0x09020016 -#define GEO37RUN 0x09020017 -#define GEO37TA1CDT 0x09020018 -#define GEO37TA1 0x09020019 -#define GEO37TA2CDT 0x0902001A -#define GEO37TA2 0x0902001B -#define GEO37TA3CDT 0x0902001C -#define GEO37TA3 0x0902001D -#define GEO37TA4CDT 0x0902001E -#define GEO37TA4 0x0902001F -#define GEO37TU1CDR 0x09020020 -#define GEO37TU1CDT 0x09020021 -#define GEO37TU1 0x09020022 -#define GEO37TU2CDT 0x09020023 -#define GEO37TU2 0x09020024 -#define GEO37WLCDR 0x09020025 -#define GEO37WLCDT 0x09020026 -#define GEO37WL 0x09020027 -#define HOO37LBOCDR 0x09020028 -#define HOO37LBOCDT 0x09020029 -#define HOO37LBO 0x0902002A -#define HOO37PULCDT 0x0902002B -#define HOO37PUL 0x0902002C -#define ROCKS1CDT 0x0902002D -#define ROCKS1 0x0902002E -#define WAL37BRECDT 0x0902002F -#define WAL37BRE 0x09020030 -#define WAL37SLICDT 0x09020031 -#define WAL37SLI 0x09020032 -#define WATER37CDT 0x09020033 -#define WATER37 0x09020034 -#define WATER37ACDT 0x09020035 -#define WATER37A 0x09020036 -#define WHEEL37CDT 0x09020037 -#define WHEEL37 0x09020038 - // 57 entities in TXTs, 57 in datafiles. - // room38 -#define R38SPRPAL 0x09030000 -#define room38_PAL 0x09030001 -#define R38L0 0x09030002 -#define R38L1 0x09030003 -#define R38G1 0x09030004 -#define room38_flr 0x09030005 -#define BBACK38 0x09030006 -#define BBACK38PAL 0x09030007 -#define GEOINQ38CDT 0x09030008 -#define GEOINQ38 0x09030009 -#define GEO38AS1CDT 0x0903000A -#define GEO38AS1 0x0903000B -#define GEO38AS2CDT 0x0903000C -#define GEO38AS2 0x0903000D -#define GEO38DE1CDT 0x0903000E -#define GEO38DE1 0x0903000F -#define GEO38DE2CDT 0x09030010 -#define GEO38DE2 0x09030011 -#define GEO38LUKCDR 0x09030012 -#define GEO38LUKCDT 0x09030013 -#define GEO38LUK 0x09030014 - // 21 entities in TXTs, 21 in datafiles. - // room39 -#define R39SPRPAL 0x09040000 -#define R39L0 0x09040001 -#define R39L1 0x09040002 -#define R39G1 0x09040003 -#define room39_PAL 0x09040004 -#define room39_flr 0x09040005 -#define R39PLX 0x09040006 -#define BOA39GOACDT 0x09040007 -#define BOA39GOA 0x09040008 -#define BOA39SPRCDT 0x09040009 -#define BOA39SPR 0x0904000A -#define CIV391T2CDR 0x0904000B -#define CIV391T2CDT 0x0904000C -#define CIV391T2 0x0904000D -#define CIV391T3CDR 0x0904000E -#define CIV391T3CDT 0x0904000F -#define CIV391T3 0x09040010 -#define CIV392T3CDR 0x09040011 -#define CIV392T3CDT 0x09040012 -#define CIV392T3 0x09040013 -#define CIV39T1CDT 0x09040014 -#define CIV39T1 0x09040015 -#define CIV39T2CDT 0x09040016 -#define CIV39T2 0x09040017 -#define CIV39T3CDT 0x09040018 -#define CIV39T3 0x09040019 -#define CIVLIST1CDT 0x0904001A -#define CIVLIST1 0x0904001B -#define CIVLIST2CDT 0x0904001C -#define CIVLIST2 0x0904001D -#define CIVLIST3CDT 0x0904001E -#define CIVLIST3 0x0904001F -#define COL391T2CDR 0x09040020 -#define COL391T2CDT 0x09040021 -#define COL391T2 0x09040022 -#define COL391T3CDR 0x09040023 -#define COL391T3CDT 0x09040024 -#define COL391T3 0x09040025 -#define COL392T3CDR 0x09040026 -#define COL392T3CDT 0x09040027 -#define COL392T3 0x09040028 -#define COL39T1CDT 0x09040029 -#define COL39T1 0x0904002A -#define COL39T2CDT 0x0904002B -#define COL39T2 0x0904002C -#define COL39T3CDT 0x0904002D -#define COL39T3 0x0904002E -#define COLLIST2CDT 0x0904002F -#define COLLIST2 0x09040030 -#define COLLIST3CDT 0x09040031 -#define COLLIST3 0x09040032 -#define CON39TALCDT 0x09040033 -#define CON39TAL 0x09040034 -#define EKL391T2CDR 0x09040035 -#define EKL391T2CDT 0x09040036 -#define EKL391T2 0x09040037 -#define EKL391T3CDR 0x09040038 -#define EKL391T3CDT 0x09040039 -#define EKL391T3 0x0904003A -#define EKL392T3CDR 0x0904003B -#define EKL392T3CDT 0x0904003C -#define EKL392T3 0x0904003D -#define EKL39T1CDT 0x0904003E -#define EKL39T1 0x0904003F -#define EKL39T2CDT 0x09040040 -#define EKL39T2 0x09040041 -#define EKL39T3CDT 0x09040042 -#define EKL39T3 0x09040043 -#define EKLLIST1CDT 0x09040044 -#define EKLLIST1 0x09040045 -#define EKLLIST2CDT 0x09040046 -#define EKLLIST2 0x09040047 -#define EKLLIST3CDT 0x09040048 -#define EKLLIST3 0x09040049 -#define EXE391T2CDR 0x0904004A -#define EXE391T2CDT 0x0904004B -#define EXE391T2 0x0904004C -#define EXE391T3CDR 0x0904004D -#define EXE391T3CDT 0x0904004E -#define EXE391T3 0x0904004F -#define EXE392T3CDR 0x09040050 -#define EXE392T3CDT 0x09040051 -#define EXE392T3 0x09040052 -#define EXE39T1CDT 0x09040053 -#define EXE39T1 0x09040054 -#define EXE39T2CDT 0x09040055 -#define EXE39T2 0x09040056 -#define EXE39T3CDT 0x09040057 -#define EXE39T3 0x09040058 -#define GEO39ENTCDT 0x09040059 -#define GEO39ENT 0x0904005A -#define GEO39EXTCDT 0x0904005B -#define GEO39EXT 0x0904005C -#define GEO39GEMCDR 0x0904005D -#define GEO39GEMCDT 0x0904005E -#define GEO39GEM 0x0904005F -#define GEO39TRICDR 0x09040060 -#define GEO39TRICDT 0x09040061 -#define GEO39TRI 0x09040062 -#define LAT391T2CDR 0x09040063 -#define LAT391T2CDT 0x09040064 -#define LAT391T2 0x09040065 -#define LAT391T3CDR 0x09040066 -#define LAT391T3CDT 0x09040067 -#define LAT391T3 0x09040068 -#define LAT392T3CDR 0x09040069 -#define LAT392T3CDT 0x0904006A -#define LAT392T3 0x0904006B -#define LAT39T1CDT 0x0904006C -#define LAT39T1 0x0904006D -#define LAT39T2CDT 0x0904006E -#define LAT39T2 0x0904006F -#define LAT39T3CDT 0x09040070 -#define LAT39T3 0x09040071 -#define LATLIST1CDT 0x09040072 -#define LATLIST1 0x09040073 -#define LATLIST2CDT 0x09040074 -#define LATLIST2 0x09040075 -#define LATLIST3CDT 0x09040076 -#define LATLIST3 0x09040077 -#define MAS391T2CDR 0x09040078 -#define MAS391T2CDT 0x09040079 -#define MAS391T2 0x0904007A -#define MAS391T3CDR 0x0904007B -#define MAS391T3CDT 0x0904007C -#define MAS391T3 0x0904007D -#define MAS392T3CDR 0x0904007E -#define MAS392T3CDT 0x0904007F -#define MAS392T3 0x09040080 -#define MAS39T1CDT 0x09040081 -#define MAS39T1 0x09040082 -#define MAS39T2CDT 0x09040083 -#define MAS39T2 0x09040084 -#define MAS39T3CDT 0x09040085 -#define MAS39T3 0x09040086 -#define MASLIST1CDT 0x09040087 -#define MASLIST1 0x09040088 -#define MASLIST2CDT 0x09040089 -#define MASLIST2 0x0904008A -#define MASLIST3CDT 0x0904008B -#define MASLIST3 0x0904008C -#define RAYS39CDT 0x0904008D -#define RAYS39 0x0904008E -#define TRI39ALOCDT 0x0904008F -#define TRI39ALO 0x09040090 -#define TRI39GEMCDT 0x09040091 -#define TRI39GEM 0x09040092 - // 147 entities in TXTs, 147 in datafiles. - // room40 -#define R40L0 0x09050000 -#define room40_PAL 0x09050001 -#define room40_flr 0x09050002 -#define GEO40ASCCDT 0x09050003 -#define GEO40ASC 0x09050004 -#define GEO40DESCDT 0x09050005 -#define GEO40DES 0x09050006 -#define GEO40DIPCDT 0x09050007 -#define GEO40DIP 0x09050008 -#define GUA40ENTCDT 0x09050009 -#define GUA40ENT 0x0905000A -#define GUA40STACDT 0x0905000B -#define GUA40STA 0x0905000C -#define GUA40TALCDT 0x0905000D -#define GUA40TAL 0x0905000E -#define PAI40FAGCDT 0x0905000F -#define PAI40FAG 0x09050010 -#define PAI40IDLCDT 0x09050011 -#define PAI40IDL 0x09050012 -#define PAI40LEACDT 0x09050013 -#define PAI40LEA 0x09050014 -#define PAI40STACDR 0x09050015 -#define PAI40STACDT 0x09050016 -#define PAI40STA 0x09050017 -#define PAI40TALCDT 0x09050018 -#define PAI40TAL 0x09050019 - // 26 entities in TXTs, 26 in datafiles. - // room41 -#define R41L0 0x09060000 -#define R41L1 0x09060001 -#define R41G1 0x09060002 -#define room41_PAL 0x09060003 -#define room41_flr 0x09060004 -#define GEO41ENTCDT 0x09060005 -#define GEO41ENT 0x09060006 -#define GEO41OP2CDT 0x09060007 -#define GEO41OP2 0x09060008 -#define GEO41OPECDT 0x09060009 -#define GEO41OPE 0x0906000A -#define GEO41THECDR 0x0906000B -#define GEO41THECDT 0x0906000C -#define GEO41THE 0x0906000D -#define GLO41IDLCDT 0x0906000E -#define GLO41IDL 0x0906000F -#define GLO41KEYCDR 0x09060010 -#define GLO41KEYCDT 0x09060011 -#define GLO41KEY 0x09060012 -#define GLO41TALCDT 0x09060013 -#define GLO41TAL 0x09060014 -#define GUA41ANSCDT 0x09060015 -#define GUA41ANS 0x09060016 -#define GUA41GLOCDT 0x09060017 -#define GUA41GLO 0x09060018 -#define GUA41IDLCDT 0x09060019 -#define GUA41IDL 0x0906001A -#define GUA41KEYCDR 0x0906001B -#define GUA41KEYCDT 0x0906001C -#define GUA41KEY 0x0906001D -#define GUA41PHOCDT 0x0906001E -#define GUA41PHO 0x0906001F -#define GUA41TALCDT 0x09060020 -#define GUA41TAL 0x09060021 -#define PAI41HANCDT 0x09060022 -#define PAI41HAN 0x09060023 -#define PAI41LEACDT 0x09060024 -#define PAI41LEA 0x09060025 -#define PAI41TALCDT 0x09060026 -#define PAI41TAL 0x09060027 -#define PHONE41CDT 0x09060028 -#define PHONE41 0x09060029 - // 42 entities in TXTs, 42 in datafiles. - // room42 -#define room42_PAL 0x09070000 -#define R42L0 0x09070001 -#define R42L1 0x09070002 -#define R42L2 0x09070003 -#define R42G1 0x09070004 -#define R42G2 0x09070005 -#define room42_flr 0x09070006 -#define CHALICE42 0x09070007 -#define CHALICE42_PAL 0x09070008 -#define GEO42CHACDT 0x09070009 -#define GEO42CHA 0x0907000A -#define GEO42DESCDR 0x0907000B -#define GEO42DESCDT 0x0907000C -#define GEO42DES 0x0907000D - // 14 entities in TXTs, 14 in datafiles. - // room43 -#define room43_PAL 0x09080000 -#define R43L0 0x09080001 -#define R43L1 0x09080002 -#define R43G1 0x09080003 -#define room43_flr 0x09080004 -#define GEO43DR2CDT 0x09080005 -#define GEO43DR2 0x09080006 -#define GEO43DRYCDT 0x09080007 -#define GEO43DRY 0x09080008 -#define GEO43HAN 0x09080009 -#define GEO43HANCDT 0x0908000A -#define GEO43KEYCDT 0x0908000B -#define GEO43KEY 0x0908000C -#define GEO43PLACDT 0x0908000D -#define GEO43PLA 0x0908000E -#define GEO43PRECDT 0x0908000F -#define GEO43PRE 0x09080010 -#define GEO43SOACDT 0x09080011 -#define GEO43SOA 0x09080012 -#define GEO43SWPCDT 0x09080013 -#define GEO43SWP 0x09080014 -#define GEO43WATCDT 0x09080015 -#define GEO43WAT 0x09080016 -#define SOAP43CDT 0x09080017 -#define SOAP43 0x09080018 -#define WATER43CDT 0x09080019 -#define WATER43 0x0908001A - // 27 entities in TXTs, 27 in datafiles. - // room48 -#define R48SPRPAL 0x09090000 -#define R48L0 0x09090001 -#define R48L1 0x09090002 -#define R48L2 0x09090003 -#define R48G1 0x09090004 -#define R48G2 0x09090005 -#define R48PAL 0x09090006 -#define room48_flr 0x09090007 -#define R48PLX 0x09090008 -#define GEO48BENCDR 0x09090009 -#define GEO48BENCDT 0x0909000A -#define GEO48BEN 0x0909000B -#define GEO48GIVCDR 0x0909000C -#define GEO48GIVCDT 0x0909000D -#define GEO48GIV 0x0909000E -#define GEO48LENCDT 0x0909000F -#define GEO48LEN 0x09090010 -#define PRI48CANCDR 0x09090011 -#define PRI48CANCDT 0x09090012 -#define PRI48CAN 0x09090013 -#define PRI48IDLCDT 0x09090014 -#define PRI48IDL 0x09090015 -#define PRI48PO1CDT 0x09090016 -#define PRI48PO1 0x09090017 -#define PRI48PO2CDT 0x09090018 -#define PRI48PO2 0x09090019 -#define PRI48RETCDT 0x0909001A -#define PRI48RET 0x0909001B -#define PRI48TAKCDT 0x0909001C -#define PRI48TAK 0x0909001D -#define PRI48TALCDT 0x0909001E -#define PRI48TAL 0x0909001F -#define PRI48TURCDR 0x09090020 -#define PRI48TURCDT 0x09090021 -#define PRI48TUR 0x09090022 -#define WINDOW1 0x09090023 -#define WINDOW1_PAL 0x09090024 -#define WINDOW2 0x09090025 -#define WINDOW2_PAL 0x09090026 - // 39 entities in TXTs, 39 in datafiles. -// ireland - // sound_fx -#define FX_EIRBIRD3 0x0A000000 -#define FX_SHOCK2 0x0A000001 -#define FX_EIRBIRD1 0x0A000002 -#define FX_EIRBIRD2 0x0A000003 -#define FX_SWITCH19 0x0A000004 -#define FX_TRAPOPEN 0x0A000005 -#define FX_VIOLIN19 0x0A000006 -#define FX_WHISTLE 0x0A000007 -#define FX_BARFLAP 0x0A000008 -#define FX_DORCLOSE20 0x0A000009 -#define FX_DRINK 0x0A00000A -#define FX_FITZHIT 0x0A00000B -#define FX_FITZRUN 0x0A00000C -#define FX_FITZUP 0x0A00000D -#define FX_FUSE20 0x0A00000E -#define FX_PULLPINT 0x0A00000F -#define FX_SNEEZE1 0x0A000010 -#define FX_SNEEZE2 0x0A000011 -#define FX_WASHER 0x0A000012 -#define FX_CELTAP 0x0A000013 -#define FX_DRIPIRE 0x0A000014 -#define FX_DRIPIRE2 0x0A000015 -#define FX_TAP 0x0A000016 -#define FX_TAP2 0x0A000017 -#define FX_CLIMBHAY 0x0A000018 -#define FX_FARMERGO 0x0A000019 -#define FX_CASTLWAL 0x0A00001A -#define FX_CLIMBFAL 0x0A00001B -#define FX_KEYSTEP 0x0A00001C -#define FX_WIND 0x0A00001D -#define FX_GEOGOAT 0x0A00001E -#define FX_GOATBAA 0x0A00001F -#define FX_GOATCHEW 0x0A000020 -#define FX_GOATDOH 0x0A000021 -#define FX_PLOUGH 0x0A000022 -#define FX_EIRDRIP1 0x0A000023 -#define FX_EIRDRIP2 0x0A000024 -#define FX_LADDWN25 0x0A000025 -#define FX_LADDUP25 0x0A000026 -#define FX_SECDOR25 0x0A000027 -#define FX_SLABFALL 0x0A000028 -#define FX_SLABUP 0x0A000029 -#define FX_TRIGER25 0x0A00002A -#define FX_WRING 0x0A00002B -#define FX_LEVER 0x0A00002C -#define FX_LEVER2 0x0A00002D -#define FX_RAT3A 0x0A00002E -#define FX_RAT3B 0x0A00002F -#define FX_RAT3C 0x0A000030 -#define FX_RAT3D 0x0A000031 - // 50 entities in TXTs, 50 in datafiles. - // room19 -#define R19SPRPAL 0x0A010000 -#define R19L0 0x0A010001 -#define R19L1 0x0A010002 -#define R19L2 0x0A010003 -#define R19G1 0x0A010004 -#define R19G2 0x0A010005 -#define R19PAL 0x0A010006 -#define R19FLR 0x0A010007 -#define ASSTAP 0x0A010008 -#define ASSTAPCDT 0x0A010009 -#define ASSTLK19 0x0A01000A -#define ASSTLK19CDT 0x0A01000B -#define ASSWLK2 0x0A01000C -#define ASSWLK2CDT 0x0A01000D -#define ASSWLK6 0x0A01000E -#define ASSWLK6CDT 0x0A01000F -#define BOXCVR 0x0A010010 -#define BOXCVRCDT 0x0A010011 -#define GEODRN 0x0A010012 -#define GEODRNCDT 0x0A010013 -#define GEOMAG 0x0A010014 -#define GEOMAGCDT 0x0A010015 -#define GEORCT 0x0A010016 -#define GEORCTCDT 0x0A010017 -#define GEOTRP 0x0A010018 -#define GEOTRPCDT 0x0A010019 -#define GEOTRP8 0x0A01001A -#define GEOTRP8CDT 0x0A01001B -#define GEOWRN 0x0A01001C -#define GEOWRNCDT 0x0A01001D -#define LID19 0x0A01001E -#define LID19CDT 0x0A01001F -#define MAGCON 0x0A010020 -#define MAGCONCDT 0x0A010021 -#define MAGCONCDR 0x0A010022 -#define MAGMOV 0x0A010023 -#define MAGMOVCDT 0x0A010024 -#define MAGMOVCDR 0x0A010025 -#define MAGSHK 0x0A010026 -#define MAGSHKCDT 0x0A010027 -#define MAGSHY 0x0A010028 -#define MAGSHYCDT 0x0A010029 -#define MAGSHYCDR 0x0A01002A -#define MAGSLK 0x0A01002B -#define MAGSLKCDT 0x0A01002C -#define MAGTALK 0x0A01002D -#define MAGTALKCDT 0x0A01002E -#define MAGTLK 0x0A01002F -#define MAGTLKCDT 0x0A010030 -#define MAGTLK8 0x0A010031 -#define MAGTLK8CDT 0x0A010032 -#define TRPOPN 0x0A010033 -#define TRPOPNCDT 0x0A010034 - // 53 entities in TXTs, 53 in datafiles. - // room20 -#define R20SPRPAL 0x0A020000 -#define R20L0 0x0A020001 -#define R20L1 0x0A020002 -#define R20L2 0x0A020003 -#define R20L3 0x0A020004 -#define R20G1 0x0A020005 -#define R20G2 0x0A020006 -#define R20G3 0x0A020007 -#define R20PAL 0x0A020008 -#define R20FLR 0x0A020009 -#define BARTPS 0x0A02000A -#define BARTPSCDT 0x0A02000B -#define BARTWL 0x0A02000C -#define BARTWLCDT 0x0A02000D -#define BRIDRN 0x0A02000E -#define BRIDRNCDT 0x0A02000F -#define BRIDRNCDR 0x0A020010 -#define BRIFTZ 0x0A020011 -#define BRIFTZCDT 0x0A020012 -#define BRIFTZCDR 0x0A020013 -#define BRITLK 0x0A020014 -#define BRITLKCDT 0x0A020015 -#define BRITLK8 0x0A020016 -#define BRITLK8CDT 0x0A020017 -#define BRITLK9 0x0A020018 -#define BRITLK9CDT 0x0A020019 -#define BRITRN 0x0A02001A -#define BRITRNCDT 0x0A02001B -#define BRITRNCDR 0x0A02001C -#define DOROPN20 0x0A02001D -#define DOROPN20CDT 0x0A02001E -#define DOROPN20CDR 0x0A02001F -#define DOYDRN 0x0A020020 -#define DOYDRNCDT 0x0A020021 -#define DOYDRNCDR 0x0A020022 -#define DOYFTZ 0x0A020023 -#define DOYFTZCDT 0x0A020024 -#define DOYFTZCDR 0x0A020025 -#define DOYTLK 0x0A020026 -#define DOYTLKCDT 0x0A020027 -#define DOYTLK20 0x0A020028 -#define DOYTLK20CDT 0x0A020029 -#define DOYTLK8 0x0A02002A -#define DOYTLK8CDT 0x0A02002B -#define DOYTLK9 0x0A02002C -#define DOYTLK9CDT 0x0A02002D -#define DOYTRN 0x0A02002E -#define DOYTRNCDT 0x0A02002F -#define DOYTRNCDR 0x0A020030 -#define DOYTRN20 0x0A020031 -#define DOYTRN20CDT 0x0A020032 -#define DOYTRN20CDR 0x0A020033 -#define DOYTRN8 0x0A020034 -#define DOYTRN8CDT 0x0A020035 -#define DOYTRN8CDR 0x0A020036 -#define DOYTRN9 0x0A020037 -#define DOYTRN9CDT 0x0A020038 -#define DOYTRN9CDR 0x0A020039 -#define FIDPLY 0x0A02003A -#define FIDPLYCDT 0x0A02003B -#define FLPOPN 0x0A02003C -#define FLPOPNCDT 0x0A02003D -#define FRMTLK20 0x0A02003E -#define FRMTLK20CDT 0x0A02003F -#define FTZAGT 0x0A020040 -#define FTZAGTCDT 0x0A020041 -#define FTZGET 0x0A020042 -#define FTZGETCDT 0x0A020043 -#define FTZGETCDR 0x0A020044 -#define FTZRUN 0x0A020045 -#define FTZRUNCDT 0x0A020046 -#define FTZSTD 0x0A020047 -#define FTZSTDCDT 0x0A020048 -#define FTZTALK 0x0A020049 -#define FTZTALKCDT 0x0A02004A -#define FTZTLK 0x0A02004B -#define FTZTLKCDT 0x0A02004C -#define FTZTLK8 0x0A02004D -#define FTZTLK8CDT 0x0A02004E -#define GEODRN20 0x0A02004F -#define GEODRN20CDT 0x0A020050 -#define GEOPHN20 0x0A020051 -#define GEOPHN20CDT 0x0A020052 -#define GEOPHN20CDR 0x0A020053 -#define GEOPLG 0x0A020054 -#define GEOPLGCDT 0x0A020055 -#define GEOPLG8 0x0A020056 -#define GEOPLG8CDT 0x0A020057 -#define GEOSEE 0x0A020058 -#define GEOSEECDT 0x0A020059 -#define GEOSNR 0x0A02005A -#define GEOSNRCDT 0x0A02005B -#define GEOSNR8 0x0A02005C -#define GEOSNR8CDT 0x0A02005D -#define GEOTWL20 0x0A02005E -#define GEOTWL20CDT 0x0A02005F -#define GEOXIT20 0x0A020060 -#define GEOXIT20CDT 0x0A020061 -#define GLSGEO 0x0A020062 -#define GLSGEOCDT 0x0A020063 -#define GLSWSH 0x0A020064 -#define GLSWSHCDT 0x0A020065 -#define LESDOR 0x0A020066 -#define LESDORCDT 0x0A020067 -#define LESDOY 0x0A020068 -#define LESDOYCDT 0x0A020069 -#define LESFLP 0x0A02006A -#define LESFLPCDT 0x0A02006B -#define LESFTZ 0x0A02006C -#define LESFTZCDT 0x0A02006D -#define LESFTZCDR 0x0A02006E -#define LESGLS 0x0A02006F -#define LESGLSCDT 0x0A020070 -#define LESGLSCDR 0x0A020071 -#define LESLNS 0x0A020072 -#define LESLNSCDT 0x0A020073 -#define LESLNSCDR 0x0A020074 -#define LESMOV 0x0A020075 -#define LESMOVCDT 0x0A020076 -#define LESMOVCDR 0x0A020077 -#define LESPMP 0x0A020078 -#define LESPMPCDT 0x0A020079 -#define LESPNT 0x0A02007A -#define LESPNTCDT 0x0A02007B -#define LESPNT20 0x0A02007C -#define LESPNT20CDT 0x0A02007D -#define LESPNT8 0x0A02007E -#define LESPNT8CDT 0x0A02007F -#define LESPNT8CDR 0x0A020080 -#define LESTALK 0x0A020081 -#define LESTALKCDT 0x0A020082 -#define LESTLK 0x0A020083 -#define LESTLKCDT 0x0A020084 -#define LESTLK20 0x0A020085 -#define LESTLK20CDT 0x0A020086 -#define LESTLK8 0x0A020087 -#define LESTLK8CDT 0x0A020088 -#define LESTLK9 0x0A020089 -#define LESTLK9CDT 0x0A02008A -#define LESTURN 0x0A02008B -#define LESTURNCDT 0x0A02008C -#define LESTURNCDR 0x0A02008D -#define LESWLK 0x0A02008E -#define LESWLKCDT 0x0A02008F -#define LESWLK8 0x0A020090 -#define LESWLK8CDT 0x0A020091 -#define LESWSH 0x0A020092 -#define LESWSHCDT 0x0A020093 -#define LESWSHCDR 0x0A020094 -#define MAGENT 0x0A020095 -#define MAGENTCDT 0x0A020096 -#define MAGEXIT 0x0A020097 -#define MAGEXITCDT 0x0A020098 -#define MAGMOV20 0x0A020099 -#define MAGMOV20CDT 0x0A02009A -#define MAGTEST 0x0A02009B -#define MAGTESTCDT 0x0A02009C -#define MAGTLK20 0x0A02009D -#define MAGTLK20CDT 0x0A02009E -#define PLGWLL 0x0A02009F -#define PLGWLLCDT 0x0A0200A0 -#define RONDRN 0x0A0200A1 -#define RONDRNCDT 0x0A0200A2 -#define RONDRNCDR 0x0A0200A3 -#define RONDRP 0x0A0200A4 -#define RONDRPCDT 0x0A0200A5 -#define RONFTZ 0x0A0200A6 -#define RONFTZCDT 0x0A0200A7 -#define RONFTZCDR 0x0A0200A8 -#define RONGEO 0x0A0200A9 -#define RONGEOCDT 0x0A0200AA -#define RONGEOCDR 0x0A0200AB -#define RONGLS 0x0A0200AC -#define RONGLSCDT 0x0A0200AD -#define RONGLSCDR 0x0A0200AE -#define RONGLS8 0x0A0200AF -#define RONGLS8CDT 0x0A0200B0 -#define RONPIK 0x0A0200B1 -#define RONPIKCDT 0x0A0200B2 -#define RONPKT 0x0A0200B3 -#define RONPKTCDT 0x0A0200B4 -#define RONPKTCDR 0x0A0200B5 -#define RONSNR 0x0A0200B6 -#define RONSNRCDT 0x0A0200B7 -#define RONSNZ 0x0A0200B8 -#define RONSNZCDT 0x0A0200B9 -#define RONSNZ2 0x0A0200BA -#define RONSNZ2CDT 0x0A0200BB -#define RONTLK 0x0A0200BC -#define RONTLKCDT 0x0A0200BD -#define RONTLK2 0x0A0200BE -#define RONTLK2CDT 0x0A0200BF -#define RONWIR 0x0A0200C0 -#define RONWIRCDT 0x0A0200C1 -#define RONWIRCDR 0x0A0200C2 -#define SNRTBL 0x0A0200C3 -#define SNRTBLCDT 0x0A0200C4 - // 197 entities in TXTs, 197 in datafiles. - // room21 -#define R21L0 0x0A030000 -#define R21L1 0x0A030001 -#define R21L2 0x0A030002 -#define R21G1 0x0A030003 -#define R21G2 0x0A030004 -#define R21PAL 0x0A030005 -#define R21FLR 0x0A030006 -#define CALBLO 0x0A030007 -#define CALBLOCDT 0x0A030008 -#define GEMSHN 0x0A030009 -#define GEMSHNCDT 0x0A03000A -#define GEOGEM 0x0A03000B -#define GEOGEMCDT 0x0A03000C -#define GEOGEM8 0x0A03000D -#define GEOGEM8CDT 0x0A03000E -#define GEOLVR 0x0A03000F -#define GEOLVRCDT 0x0A030010 -#define GEOLVR21 0x0A030011 -#define GEOLVR21CDT 0x0A030012 -#define GEOLVR8 0x0A030013 -#define GEOLVR8CDT 0x0A030014 -#define GEOTAP 0x0A030015 -#define GEOTAPCDT 0x0A030016 -#define GEOTLK21 0x0A030017 -#define GEOTLK21CDT 0x0A030018 -#define GEOTORCH 0x0A030019 -#define GEOTORCHCDT 0x0A03001A -#define GEOTRN21 0x0A03001B -#define GEOTRN21CDT 0x0A03001C -#define GEOTRN21CDR 0x0A03001D -#define GEOTWL21 0x0A03001E -#define GEOTWL21CDT 0x0A03001F -#define LVRPSH 0x0A030020 -#define LVRPSHCDT 0x0A030021 -#define MAGCEL 0x0A030022 -#define MAGCELCDT 0x0A030023 -#define MAGCELCDR 0x0A030024 -#define MAGTLK21 0x0A030025 -#define MAGTLK21CDT 0x0A030026 -#define TAPDRP 0x0A030027 -#define TAPDRPCDT 0x0A030028 -#define TAPRUN 0x0A030029 -#define TAPRUNCDT 0x0A03002A -#define TORCH21 0x0A03002B -#define TORCH21CDT 0x0A03002C - // 45 entities in TXTs, 45 in datafiles. - // room22 -#define R22SPRPAL 0x0A040000 -#define R22L0 0x0A040001 -#define R22L1 0x0A040002 -#define R22G1 0x0A040003 -#define R22PAL 0x0A040004 -#define R22FLR 0x0A040005 -#define FRMBUK 0x0A040006 -#define FRMBUKCDT 0x0A040007 -#define FRMSTD 0x0A040008 -#define FRMSTDCDT 0x0A040009 -#define FRMTLK 0x0A04000A -#define FRMTLKCDT 0x0A04000B -#define FRMWLK 0x0A04000C -#define FRMWLKCDT 0x0A04000D -#define GEOCLM 0x0A04000E -#define GEOCLMCDT 0x0A04000F -#define GEOCLMCDR 0x0A040010 -#define GEOPSH22 0x0A040011 -#define GEOPSH22CDT 0x0A040012 - // 19 entities in TXTs, 19 in datafiles. - // room23 -#define R23L0 0x0A050000 -#define R23PAL 0x0A050001 -#define GEOCLM23 0x0A050002 -#define GEOCLM23CDT 0x0A050003 -#define GEOCLM23CDR 0x0A050004 -#define GEOKEY23 0x0A050005 -#define GEOKEY23CDT 0x0A050006 -#define GEOTOP 0x0A050007 -#define GEOTOPCDT 0x0A050008 -#define GEOTOPCDR 0x0A050009 -#define GEOTRY23 0x0A05000A -#define GEOTRY23CDT 0x0A05000B -#define GEOTUG23 0x0A05000C -#define GEOTUG23CDT 0x0A05000D -#define LFTKEY23 0x0A05000E -#define LFTKEY23CDT 0x0A05000F - // 16 entities in TXTs, 16 in datafiles. - // room24 -#define R24L0 0x0A060000 -#define R24L1 0x0A060001 -#define R24G1 0x0A060002 -#define R24PLX 0x0A060003 -#define R24PAL 0x0A060004 -#define R24FLR 0x0A060005 -#define GEOASC24 0x0A060006 -#define GEOASC24CDT 0x0A060007 -#define GEODES24 0x0A060008 -#define GEODES24CDT 0x0A060009 -#define GEOHITL 0x0A06000A -#define GEOHITLCDT 0x0A06000B -#define GEOHITR 0x0A06000C -#define GEOHITRCDT 0x0A06000D -#define GEOLAD 0x0A06000E -#define GEOLADCDT 0x0A06000F -#define GEOLAD8 0x0A060010 -#define GEOLAD8CDT 0x0A060011 -#define GEOPLW 0x0A060012 -#define GEOPLWCDT 0x0A060013 -#define GEORUN 0x0A060014 -#define GEORUNCDT 0x0A060015 -#define GEOUPL24 0x0A060016 -#define GEOUPL24CDT 0x0A060017 -#define GEOUPR24 0x0A060018 -#define GEOUPR24CDT 0x0A060019 -#define GOTBAKL 0x0A06001A -#define GOTBAKLCDT 0x0A06001B -#define GOTBAKR 0x0A06001C -#define GOTBAKRCDT 0x0A06001D -#define GOTCL 0x0A06001E -#define GOTCLCDT 0x0A06001F -#define GOTCR 0x0A060020 -#define GOTCRCDT 0x0A060021 -#define GOTEAT 0x0A060022 -#define GOTEATCDT 0x0A060023 -#define GOTPLW 0x0A060024 -#define GOTPLWCDT 0x0A060025 -#define GOTPLW1 0x0A060026 -#define GOTPLW1CDT 0x0A060027 -#define GOTRIS 0x0A060028 -#define GOTRISCDT 0x0A060029 -#define GOTRISCDR 0x0A06002A -#define PLWMOV 0x0A06002B -#define PLWMOVCDT 0x0A06002C - // 45 entities in TXTs, 45 in datafiles. - // room25 -#define R25SPRPAL 0x0A070000 -#define R25L0 0x0A070001 -#define R25L1 0x0A070002 -#define R25G1 0x0A070003 -#define R25PAL 0x0A070004 -#define R25FLR 0x0A070005 -#define ALTOPN 0x0A070006 -#define ALTOPNCDT 0x0A070007 -#define GEOASC25 0x0A070008 -#define GEOASC25CDT 0x0A070009 -#define GEOCLM25 0x0A07000A -#define GEOCLM25CDT 0x0A07000B -#define GEODES25 0x0A07000C -#define GEODES25CDT 0x0A07000D -#define GEODRY25 0x0A07000E -#define GEODRY25CDT 0x0A07000F -#define GEOFIN25 0x0A070010 -#define GEOFIN25CDT 0x0A070011 -#define GEOPLAS 0x0A070012 -#define GEOPLASCDT 0x0A070013 -#define GEOPLASCDR 0x0A070014 -#define GEOPLS 0x0A070015 -#define GEOPLSCDT 0x0A070016 -#define GEOPSH25 0x0A070017 -#define GEOPSH25CDT 0x0A070018 -#define GEOPUT 0x0A070019 -#define GEOPUTCDT 0x0A07001A -#define GEOSAC 0x0A07001B -#define GEOSACCDT 0x0A07001C -#define GEOSAC25 0x0A07001D -#define GEOSAC25CDT 0x0A07001E -#define GEOSTD25 0x0A07001F -#define GEOSTD25CDT 0x0A070020 -#define GEOSTN 0x0A070021 -#define GEOSTNCDT 0x0A070022 -#define GEOSTN8 0x0A070023 -#define GEOSTN8CDT 0x0A070024 -#define GEOTWL25 0x0A070025 -#define GEOTWL25CDT 0x0A070026 -#define GEOWALF2 0x0A070027 -#define GEOWALF2CDT 0x0A070028 -#define IMPFLR 0x0A070029 -#define IMPFLRCDT 0x0A07002A -#define IMPPLS 0x0A07002B -#define IMPPLSCDT 0x0A07002C -#define PLASWALL 0x0A07002D -#define PLASWALLCDT 0x0A07002E -#define STNFALL 0x0A07002F -#define STNFALLCDT 0x0A070030 - // 49 entities in TXTs, 49 in datafiles. - // room26 -#define R26SPRPAL 0x0A080000 -#define R26L0 0x0A080001 -#define R26L1 0x0A080002 -#define R26L2 0x0A080003 -#define R26G1 0x0A080004 -#define R26G2 0x0A080005 -#define R26PAL 0x0A080006 -#define R26FLR 0x0A080007 -#define GEOLVR08 0x0A080008 -#define GEOLVR08CDT 0x0A080009 -#define GEOLVR26 0x0A08000A -#define GEOLVR26CDT 0x0A08000B -#define LVRDRK 0x0A08000C -#define LVRDRKCDT 0x0A08000D -#define RATJMP 0x0A08000E -#define RATJMPCDT 0x0A08000F - // 16 entities in TXTs, 16 in datafiles. -// spain - // sound_fx -#define FX_SPNBIRD1 0x0B000000 -#define FX_SPNBIRD2 0x0B000001 -#define FX_AMBIEN56 0x0B000002 -#define FX_DOGS56 0x0B000003 -#define FX_PENDULUM 0x0B000004 -#define FX_CANFALL 0x0B000005 -#define FX_HOSE57 0x0B000006 -#define FX_HOSE57B 0x0B000007 -#define FX_SPAIN 0x0B000008 -#define FX_CHESS 0x0B000009 -#define FX_SECDOR59 0x0B00000A -#define FX_WINDOW59 0x0B00000B -#define FX_LIONFALL 0x0B00000C -#define FX_LIONFAL2 0x0B00000D -#define FX_TOOTHPUL 0x0B00000E -#define FX_SECDOR61 0x0B00000F -#define FX_WELLDRIP 0x0B000010 - // 17 entities in TXTs, 17 in datafiles. - // room56 -#define SPAIN_PAL 0x0B010000 -#define R56L0 0x0B010001 -#define R56L1 0x0B010002 -#define R56L2 0x0B010003 -#define R56G1 0x0B010004 -#define R56G2 0x0B010005 -#define R56PAL 0x0B010006 -#define R56FLR 0x0B010007 -#define CHALIC56 0x0B010008 -#define CHALIC56CDT 0x0B010009 -#define GARD20 0x0B01000A -#define GARD20CDT 0x0B01000B -#define GARD21 0x0B01000C -#define GARD21CDT 0x0B01000D -#define GARD22 0x0B01000E -#define GARD22CDT 0x0B01000F -#define GEOSPA10 0x0B010010 -#define GEOSPA10CDT 0x0B010011 -#define GEOSPA10CDR 0x0B010012 -#define GEOSPA11 0x0B010013 -#define GEOSPA11CDT 0x0B010014 -#define GEOSPA13 0x0B010015 -#define GEOSPA13CDT 0x0B010016 -#define GEOSPA13CDR 0x0B010017 -#define GEOSPA19 0x0B010018 -#define GEOSPA19CDT 0x0B010019 -#define GEOSPA44 0x0B01001A -#define GEOSPA44CDT 0x0B01001B -#define GEOSPA48 0x0B01001C -#define GEOSPA48CDT 0x0B01001D -#define PENDULUM 0x0B01001E -#define PENDULUMCDT 0x0B01001F -#define PIECE56 0x0B010020 -#define PIECE56CDT 0x0B010021 -#define VASC01 0x0B010022 -#define VASC01CDT 0x0B010023 -#define VASC02 0x0B010024 -#define VASC02CDT 0x0B010025 -#define VASC04 0x0B010026 -#define VASC04CDT 0x0B010027 -#define VASC05 0x0B010028 -#define VASC05CDT 0x0B010029 -#define VASC05CDR 0x0B01002A -#define VASC06 0x0B01002B -#define VASC06CDT 0x0B01002C -#define VASC26 0x0B01002D -#define VASC26CDT 0x0B01002E -#define VASC26CDR 0x0B01002F -#define VASC27 0x0B010030 -#define VASC27CDT 0x0B010031 -#define VASC28 0x0B010032 -#define VASC28CDT 0x0B010033 -#define VASC29 0x0B010034 -#define VASC29CDT 0x0B010035 -#define VASC29CDR 0x0B010036 -#define VASC30 0x0B010037 -#define VASC30CDT 0x0B010038 -#define VASC30CDR 0x0B010039 -#define VASC32 0x0B01003A -#define VASC32CDT 0x0B01003B - // 60 entities in TXTs, 60 in datafiles. - // room57 -#define R57L0 0x0B020000 -#define R57L1 0x0B020001 -#define R57G1 0x0B020002 -#define R57PAL 0x0B020003 -#define R57FLR 0x0B020004 -#define R57PLX 0x0B020005 -#define MEGA_DOWSE 0x0B020006 -#define GAR57GOB 0x0B020007 -#define GAR57GOBCDT 0x0B020008 -#define GARD01 0x0B020009 -#define GARD01CDT 0x0B02000A -#define GARD02 0x0B02000B -#define GARD02CDT 0x0B02000C -#define GARD03 0x0B02000D -#define GARD03CDT 0x0B02000E -#define GARD04 0x0B02000F -#define GARD04CDT 0x0B020010 -#define GARD04CDR 0x0B020011 -#define GARD05 0x0B020012 -#define GARD05CDT 0x0B020013 -#define GARD06 0x0B020014 -#define GARD06CDT 0x0B020015 -#define GARD07 0x0B020016 -#define GARD07CDT 0x0B020017 -#define GARD07CDR 0x0B020018 -#define GARD08 0x0B020019 -#define GARD08CDT 0x0B02001A -#define GARD09 0x0B02001B -#define GARD09CDT 0x0B02001C -#define GARD17 0x0B02001D -#define GARD17CDT 0x0B02001E -#define GARD17CDR 0x0B02001F -#define GARD18 0x0B020020 -#define GARD18CDT 0x0B020021 -#define GARD31 0x0B020022 -#define GARD31CDT 0x0B020023 -#define GARD31CDR 0x0B020024 -#define GARD32 0x0B020025 -#define GARD32CDT 0x0B020026 -#define GARD34 0x0B020027 -#define GARD34CDT 0x0B020028 -#define GARD35 0x0B020029 -#define GARD35CDT 0x0B02002A -#define GARD36 0x0B02002B -#define GARD36CDT 0x0B02002C -#define GARD37 0x0B02002D -#define GARD37CDT 0x0B02002E -#define GARD38 0x0B02002F -#define GARD38CDT 0x0B020030 -#define GARD39 0x0B020031 -#define GARD39CDT 0x0B020032 -#define GARD40 0x0B020033 -#define GARD40CDT 0x0B020034 -#define GARD40CDR 0x0B020035 -#define GARD41 0x0B020036 -#define GARD41CDT 0x0B020037 -#define GARD42 0x0B020038 -#define GARD42CDT 0x0B020039 -#define GARD43 0x0B02003A -#define GARD43CDT 0x0B02003B -#define GARD44 0x0B02003C -#define GARD44CDT 0x0B02003D -#define GARD44CDR 0x0B02003E -#define GARD45 0x0B02003F -#define GARD45CDT 0x0B020040 -#define GARDKNE 0x0B020041 -#define GARDKNECDT 0x0B020042 -#define GAUGE57 0x0B020043 -#define GAUGE57CDT 0x0B020044 -#define GEOSPA01 0x0B020045 -#define GEOSPA01CDT 0x0B020046 -#define GEOSPA20 0x0B020047 -#define GEOSPA20CDT 0x0B020048 -#define GEOSPA22 0x0B020049 -#define GEOSPA22CDT 0x0B02004A -#define GEOSPA42 0x0B02004B -#define GEOSPA42CDT 0x0B02004C -#define GEOSPA47 0x0B02004D -#define GEOSPA47CDT 0x0B02004E -#define HOLE57 0x0B02004F -#define HOLE57CDT 0x0B020050 -#define HOSE57 0x0B020051 -#define HOSE57CDT 0x0B020052 - // 83 entities in TXTs, 83 in datafiles. - // room58 -#define R58L0 0x0B030000 -#define R58L1 0x0B030001 -#define R58G1 0x0B030002 -#define R58PAL 0x0B030003 -#define R58FLR 0x0B030004 -#define R58PLX 0x0B030005 -#define GARD24 0x0B030006 -#define GARD24CDT 0x0B030007 -#define GARD25 0x0B030008 -#define GARD25CDT 0x0B030009 -#define GARD26 0x0B03000A -#define GARD26CDT 0x0B03000B -#define MAUSDOOR 0x0B03000C -#define MAUSDOORCDT 0x0B03000D -#define VASC07 0x0B03000E -#define VASC07CDT 0x0B03000F -#define VASC08 0x0B030010 -#define VASC08CDT 0x0B030011 -#define VASC09 0x0B030012 -#define VASC09CDT 0x0B030013 -#define VASC10 0x0B030014 -#define VASC10CDT 0x0B030015 -#define VASC11 0x0B030016 -#define VASC11CDT 0x0B030017 -#define VASC12 0x0B030018 -#define VASC12CDT 0x0B030019 - // 26 entities in TXTs, 26 in datafiles. - // room59 -#define R59L0 0x0B040000 -#define R59L1 0x0B040001 -#define R59L2 0x0B040002 -#define R59G1 0x0B040003 -#define R59G2 0x0B040004 -#define R59PAL 0x0B040005 -#define R59FLR 0x0B040006 -#define BIBLE59 0x0B040007 -#define BIBLE59CDT 0x0B040008 -#define BLOWOUT 0x0B040009 -#define BLOWOUTCDT 0x0B04000A -#define CANDLE59 0x0B04000B -#define CANDLE59CDT 0x0B04000C -#define CHAL59 0x0B04000D -#define CHAL59CDT 0x0B04000E -#define FLAMEL59 0x0B04000F -#define FLAMEL59CDT 0x0B040010 -#define FLAMER59 0x0B040011 -#define FLAMER59CDT 0x0B040012 -#define FLAMET59 0x0B040013 -#define FLAMET59CDT 0x0B040014 -#define GARD27 0x0B040015 -#define GARD27CDT 0x0B040016 -#define GARD28 0x0B040017 -#define GARD28CDT 0x0B040018 -#define GARD29 0x0B040019 -#define GARD29CDT 0x0B04001A -#define GARD30 0x0B04001B -#define GARD30CDT 0x0B04001C -#define GEOBIBLE 0x0B04001D -#define GEOBIBLECDT 0x0B04001E -#define GEOSPA12 0x0B04001F -#define GEOSPA12CDT 0x0B040020 -#define GEOSPA16 0x0B040021 -#define GEOSPA16CDT 0x0B040022 -#define GEOSPA17 0x0B040023 -#define GEOSPA17CDT 0x0B040024 -#define GEOSPA18 0x0B040025 -#define GEOSPA18CDT 0x0B040026 -#define GEOSPA18CDR 0x0B040027 -#define GEOSPA23 0x0B040028 -#define GEOSPA23CDT 0x0B040029 -#define GEOSPA23CDR 0x0B04002A -#define GEOSPA37 0x0B04002B -#define GEOSPA37CDT 0x0B04002C -#define GEOSPA37CDR 0x0B04002D -#define GEOSPA38 0x0B04002E -#define GEOSPA38CDT 0x0B04002F -#define GEOSPA39 0x0B040030 -#define GEOSPA39CDT 0x0B040031 -#define GEOSPA40 0x0B040032 -#define GEOSPA40CDT 0x0B040033 -#define GEOSPA41 0x0B040034 -#define GEOSPA41CDT 0x0B040035 -#define GEOSPA43 0x0B040036 -#define GEOSPA43CDT 0x0B040037 -#define GEOSPA45 0x0B040038 -#define GEOSPA45CDT 0x0B040039 -#define GEOSPA46 0x0B04003A -#define GEOSPA46CDT 0x0B04003B -#define SECDOR59 0x0B04003C -#define SECDOR59CDT 0x0B04003D -#define SNUFF59 0x0B04003E -#define SNUFF59CDT 0x0B04003F -#define TISSUE59 0x0B040040 -#define TISSUE59CDT 0x0B040041 -#define VASC13 0x0B040042 -#define VASC13CDT 0x0B040043 -#define VASC14 0x0B040044 -#define VASC14CDT 0x0B040045 -#define VASC15 0x0B040046 -#define VASC15CDT 0x0B040047 -#define VASC16 0x0B040048 -#define VASC16CDT 0x0B040049 -#define VASC17 0x0B04004A -#define VASC17CDT 0x0B04004B -#define VASC18 0x0B04004C -#define VASC18CDT 0x0B04004D -#define VASC19 0x0B04004E -#define VASC19CDT 0x0B04004F -#define VASC20 0x0B040050 -#define VASC20CDT 0x0B040051 -#define VASC20CDR 0x0B040052 -#define VASC21 0x0B040053 -#define VASC21CDT 0x0B040054 -#define VASC22 0x0B040055 -#define VASC22CDT 0x0B040056 -#define VASC23 0x0B040057 -#define VASC23CDT 0x0B040058 -#define VASC24 0x0B040059 -#define VASC24CDT 0x0B04005A -#define VASC25 0x0B04005B -#define VASC25CDT 0x0B04005C -#define VASC31 0x0B04005D -#define VASC31CDT 0x0B04005E -#define WINDSHUT 0x0B04005F -#define WINDSHUTCDT 0x0B040060 -#define WINDSHUTCDR 0x0B040061 - // 98 entities in TXTs, 98 in datafiles. - // room60 -#define R60L0 0x0B050000 -#define R60L1 0x0B050001 -#define R60L2 0x0B050002 -#define R60G1 0x0B050003 -#define R60G2 0x0B050004 -#define R60PAL 0x0B050005 -#define R60FLR 0x0B050006 -#define GARD10 0x0B050007 -#define GARD10CDT 0x0B050008 -#define GARD11 0x0B050009 -#define GARD11CDT 0x0B05000A -#define GARD13 0x0B05000B -#define GARD13CDT 0x0B05000C -#define GARD16 0x0B05000D -#define GARD16CDT 0x0B05000E -#define GARD19 0x0B05000F -#define GARD19CDT 0x0B050010 -#define GEOSPA05 0x0B050011 -#define GEOSPA05CDT 0x0B050012 -#define GEOSPA05CDR 0x0B050013 -#define GEOSPA08 0x0B050014 -#define GEOSPA08CDT 0x0B050015 -#define GEOSPA09 0x0B050016 -#define GEOSPA09CDT 0x0B050017 -#define GEOSPA09CDR 0x0B050018 -#define GEOSPA21 0x0B050019 -#define GEOSPA21CDT 0x0B05001A -#define MIRROR60 0x0B05001B -#define MIRROR60CDT 0x0B05001C - // 29 entities in TXTs, 29 in datafiles. - // room61 -#define R61L0 0x0B060000 -#define R61L1 0x0B060001 -#define R61G1 0x0B060002 -#define R61PAL 0x0B060003 -#define R61FLR 0x0B060004 -#define DUST 0x0B060005 -#define DUSTCDT 0x0B060006 -#define GEOSPA24 0x0B060007 -#define GEOSPA24CDT 0x0B060008 -#define GEOSPA25 0x0B060009 -#define GEOSPA25CDT 0x0B06000A -#define GEOSPA26 0x0B06000B -#define GEOSPA26CDT 0x0B06000C -#define GEOSPA27 0x0B06000D -#define GEOSPA27CDT 0x0B06000E -#define GEOSPA30 0x0B06000F -#define GEOSPA30CDT 0x0B060010 -#define GEOSPA31 0x0B060011 -#define GEOSPA31CDT 0x0B060012 -#define GEOSPA32 0x0B060013 -#define GEOSPA32CDT 0x0B060014 -#define GEOSPA33 0x0B060015 -#define GEOSPA33CDT 0x0B060016 -#define GEOSPA35 0x0B060017 -#define GEOSPA35CDT 0x0B060018 -#define LION1 0x0B060019 -#define LION1CDT 0x0B06001A -#define LION2 0x0B06001B -#define LION2CDT 0x0B06001C -#define LIONDOOR 0x0B06001D -#define LIONDOORCDT 0x0B06001E -#define LIONFLOR 0x0B06001F -#define LIONFLORCDT 0x0B060020 -#define ROPE61 0x0B060021 -#define ROPE61CDT 0x0B060022 -#define SECDOR61 0x0B060023 -#define SECDOR61CDT 0x0B060024 - // 37 entities in TXTs, 37 in datafiles. - // room62 -#define R62L0 0x0B070000 -#define R62PAL 0x0B070001 -#define BISHOP62 0x0B070002 -#define BISHOP62CDT 0x0B070003 -#define KING62 0x0B070004 -#define KING62CDT 0x0B070005 -#define KNIGHT62 0x0B070006 -#define KNIGHT62CDT 0x0B070007 - // 8 entities in TXTs, 8 in datafiles. -// syria - // sound_fx -#define FX_CAMERA45 0x0C000000 -#define FX_SHOCK3 0x0C000001 -#define FX_STALLBEL 0x0C000002 -#define FX_AYUBDOOR 0x0C000003 -#define FX_BALLPLAY 0x0C000004 -#define FX_CATHIT 0x0C000005 -#define FX_MARIB 0x0C000006 -#define FX_NEWTON 0x0C000007 -#define FX_STALLCAT 0x0C000008 -#define FX_STATBREK 0x0C000009 -#define FX_KEYS49 0x0C00000A -#define FX_MANG1 0x0C00000B -#define FX_MANG2 0x0C00000C -#define FX_MANG3 0x0C00000D -#define FX_UNLOCK49 0x0C00000E -#define FX_WCCHAIN 0x0C00000F -#define FX_CUBDOR 0x0C000010 -#define FX_BREKSTIK 0x0C000011 -#define FX_CLIMBDWN 0x0C000012 -#define FX_CRICKET 0x0C000013 -#define FX_GEOFAL54 0x0C000014 -#define FX_KHANDOWN 0x0C000015 -#define FX_RINGPULL 0x0C000016 -#define FX_SECDOR54 0x0C000017 -#define FX_SHOTKHAN 0x0C000018 -#define FX_SYRIWIND 0x0C000019 -#define FX_THUMP1 0x0C00001A -#define FX_SECDOR55 0x0C00001B - // 28 entities in TXTs, 28 in datafiles. - // duane -#define DUANE_MEGA 0x0C010000 -#define DUANE_WLK 0x0C010001 -#define DNETLK3 0x0C010002 -#define DNETLK3CDT 0x0C010003 -#define DNETLK5 0x0C010004 -#define DNETLK5CDT 0x0C010005 -#define XDNEMON3 0x0C010006 -#define XDNEMON3CDT 0x0C010007 -#define XDNEMON5 0x0C010008 -#define XDNEMON5CDT 0x0C010009 -#define XDNESTA3 0x0C01000A -#define XDNESTA3CDT 0x0C01000B -#define XDNESTA5 0x0C01000C -#define XDNESTA5CDT 0x0C01000D -#define XDNEPHO3 0x0C01000E -#define XDNEPHO3CDT 0x0C01000F -#define XDNEPHO5 0x0C010010 -#define XDNEPHO5CDT 0x0C010011 - // 18 entities in TXTs, 18 in datafiles. - // room45 -#define SYRIA_PAL 0x0C020000 -#define R45SPRPAL 0x0C020001 -#define R45L0 0x0C020002 -#define R45L1 0x0C020003 -#define R45G1 0x0C020004 -#define R45PAL 0x0C020005 -#define R45FLR 0x0C020006 -#define R45PLX 0x0C020007 -#define ART1 0x0C020008 -#define ART1CDT 0x0C020009 -#define ART2 0x0C02000A -#define ART2CDT 0x0C02000B -#define ART3A 0x0C02000C -#define ART3ACDT 0x0C02000D -#define ART3ACDR 0x0C02000E -#define ART4 0x0C02000F -#define ART4CDT 0x0C020010 -#define ART5 0x0C020011 -#define ART5CDT 0x0C020012 -#define ART6 0x0C020013 -#define ART6CDT 0x0C020014 -#define ART7 0x0C020015 -#define ART7CDT 0x0C020016 -#define AYU1 0x0C020017 -#define AYU1CDT 0x0C020018 -#define AYU1A 0x0C020019 -#define AYU1ACDT 0x0C02001A -#define AYU1B 0x0C02001B -#define AYU1BCDT 0x0C02001C -#define AYU5 0x0C02001D -#define AYU5CDT 0x0C02001E -#define BRUSH 0x0C02001F -#define BRUSHCDT 0x0C020020 -#define CAT1 0x0C020021 -#define CAT1CDT 0x0C020022 -#define CAT3 0x0C020023 -#define CAT3CDT 0x0C020024 -#define CAT4 0x0C020025 -#define CAT4CDT 0x0C020026 -#define CAT5 0x0C020027 -#define CAT5CDT 0x0C020028 -#define GEOCHA 0x0C020029 -#define GEOCHACDT 0x0C02002A -#define GEOSYR1 0x0C02002B -#define GEOSYR1CDT 0x0C02002C -#define GEOSYR10 0x0C02002D -#define GEOSYR10CDT 0x0C02002E -#define GEOSYR10CDR 0x0C02002F -#define GEOSYR18 0x0C020030 -#define GEOSYR18CDT 0x0C020031 -#define GEOSYR2 0x0C020032 -#define GEOSYR2CDT 0x0C020033 -#define GEOSYR5 0x0C020034 -#define GEOSYR5CDT 0x0C020035 -#define GEOSYR6 0x0C020036 -#define GEOSYR6CDT 0x0C020037 -#define GEOSYR7 0x0C020038 -#define GEOSYR7CDT 0x0C020039 -#define NEJ1 0x0C02003A -#define NEJ1CDT 0x0C02003B -#define NEJ10 0x0C02003C -#define NEJ10CDT 0x0C02003D -#define NEJ12 0x0C02003E -#define NEJ12CDT 0x0C02003F -#define NEJ13 0x0C020040 -#define NEJ13CDT 0x0C020041 -#define NEJ13CDR 0x0C020042 -#define NEJ2 0x0C020043 -#define NEJ2CDT 0x0C020044 -#define NEJ2B 0x0C020045 -#define NEJ2BCDT 0x0C020046 -#define NEJ4 0x0C020047 -#define NEJ4CDT 0x0C020048 -#define NEJ6 0x0C020049 -#define NEJ6CDT 0x0C02004A -#define NEJ7 0x0C02004B -#define NEJ7CDT 0x0C02004C -#define NEJ7B 0x0C02004D -#define NEJ7BCDT 0x0C02004E -#define NEJ8 0x0C02004F -#define NEJ8CDT 0x0C020050 -#define NEJ9 0x0C020051 -#define NEJ9CDT 0x0C020052 -#define NEWTON 0x0C020053 -#define NEWTONCDT 0x0C020054 -#define PRL1 0x0C020055 -#define PRL1CDT 0x0C020056 -#define PRL2 0x0C020057 -#define PRL2CDT 0x0C020058 -#define PRL6 0x0C020059 -#define PRL6CDT 0x0C02005A -#define PRL7 0x0C02005B -#define PRL7CDT 0x0C02005C -#define PRL8 0x0C02005D -#define PRL8CDT 0x0C02005E -#define SHO1 0x0C02005F -#define SHO1CDT 0x0C020060 -#define SHO2 0x0C020061 -#define SHO2CDT 0x0C020062 -#define SHT1 0x0C020063 -#define SHT1CDT 0x0C020064 -#define SHT2 0x0C020065 -#define SHT2CDT 0x0C020066 -#define SHT3 0x0C020067 -#define SHT3CDT 0x0C020068 -#define STA2 0x0C020069 -#define STA2CDT 0x0C02006A -#define STEAM45 0x0C02006B -#define STEAM45CDT 0x0C02006C -#define TRUCK45 0x0C02006D -#define TRUCK45CDT 0x0C02006E -#define TRUCKEMP 0x0C02006F -#define TRUCKEMPCDT 0x0C020070 -#define ULT6 0x0C020071 -#define ULT6CDT 0x0C020072 -#define ULT7 0x0C020073 -#define ULT7CDT 0x0C020074 -#define ULT8 0x0C020075 -#define ULT8CDT 0x0C020076 -#define ULT9 0x0C020077 -#define ULT9CDT 0x0C020078 -#define XGEOMON3 0x0C020079 -#define XGEOMON3CDT 0x0C02007A -#define XGEOMON5 0x0C02007B -#define XGEOMON5CDT 0x0C02007C -#define XGEOSTA3 0x0C02007D -#define XGEOSTA3CDT 0x0C02007E -#define XGEOSTA5 0x0C02007F -#define XGEOSTA5CDT 0x0C020080 -#define XGEOSTAT 0x0C020081 -#define XGEOSTATCDT 0x0C020082 - // 131 entities in TXTs, 131 in datafiles. - // room47 -#define R47L0 0x0C030000 -#define R47L1 0x0C030001 -#define R47L2 0x0C030002 -#define R47G1 0x0C030003 -#define R47G2 0x0C030004 -#define R47PAL 0x0C030005 -#define R47FLR 0x0C030006 -#define CAR1 0x0C030007 -#define CAR1CDT 0x0C030008 -#define CAR2 0x0C030009 -#define CAR2CDT 0x0C03000A -#define CAR3 0x0C03000B -#define CAR3CDT 0x0C03000C -#define CAR4 0x0C03000D -#define CAR4CDT 0x0C03000E -#define CAR5 0x0C03000F -#define CAR5CDT 0x0C030010 -#define CAR6 0x0C030011 -#define CAR6CDT 0x0C030012 -#define CRPMOV 0x0C030013 -#define CRPMOVCDT 0x0C030014 -#define GEOSYR3 0x0C030015 -#define GEOSYR3CDT 0x0C030016 -#define GEOSYR3A 0x0C030017 -#define GEOSYR3ACDT 0x0C030018 -#define GEOSYR4 0x0C030019 -#define GEOSYR4CDT 0x0C03001A -#define GEOSYR4A 0x0C03001B -#define GEOSYR4ACDT 0x0C03001C - // 29 entities in TXTs, 29 in datafiles. - // room49 -#define R49L0 0x0C040000 -#define R49L1 0x0C040001 -#define R49L2 0x0C040002 -#define R49G1 0x0C040003 -#define R49G2 0x0C040004 -#define R49PAL 0x0C040005 -#define R49FLR 0x0C040006 -#define DOOR49 0x0C040007 -#define DOOR49CDT 0x0C040008 -#define DOOR49CDR 0x0C040009 -#define GEOKEYS1 0x0C04000A -#define GEOKEYS1CDT 0x0C04000B -#define GEOSYR43 0x0C04000C -#define GEOSYR43CDT 0x0C04000D -#define KEYS 0x0C04000E -#define KEYSCDT 0x0C04000F -#define MAN1 0x0C040010 -#define MAN1CDT 0x0C040011 -#define MAN2 0x0C040012 -#define MAN2CDT 0x0C040013 -#define MAN3 0x0C040014 -#define MAN3CDT 0x0C040015 -#define MAN4 0x0C040016 -#define MAN4CDT 0x0C040017 -#define MAN4A 0x0C040018 -#define MAN4ACDT 0x0C040019 -#define ULT10 0x0C04001A -#define ULT10CDT 0x0C04001B -#define ULT15 0x0C04001C -#define ULT15CDT 0x0C04001D -#define ULT3 0x0C04001E -#define ULT3CDT 0x0C04001F -#define ULTTAK 0x0C040020 -#define ULTTAKCDT 0x0C040021 - // 34 entities in TXTs, 34 in datafiles. - // room50 -#define R50L0 0x0C050000 -#define R50L1 0x0C050001 -#define R50L2 0x0C050002 -#define R50L3 0x0C050003 -#define R50G1 0x0C050004 -#define R50G2 0x0C050005 -#define R50G3 0x0C050006 -#define R50PAL 0x0C050007 -#define R50FLR 0x0C050008 -#define CHAIN50 0x0C050009 -#define CHAIN50CDT 0x0C05000A -#define CUBDOR50 0x0C05000B -#define CUBDOR50CDT 0x0C05000C -#define DOOR50 0x0C05000D -#define DOOR50CDT 0x0C05000E -#define DOOR50CDR 0x0C05000F -#define GEOSYR48 0x0C050010 -#define GEOSYR48CDT 0x0C050011 -#define GEOSYR49 0x0C050012 -#define GEOSYR49CDT 0x0C050013 -#define GEOSYR50 0x0C050014 -#define GEOSYR50CDT 0x0C050015 -#define GEOSYR51 0x0C050016 -#define GEOSYR51CDT 0x0C050017 -#define GEOSYR51CDR 0x0C050018 -#define GEOSYR52 0x0C050019 -#define GEOSYR52CDT 0x0C05001A -#define GEOSYR53 0x0C05001B -#define GEOSYR53CDT 0x0C05001C -#define GEOSYR54 0x0C05001D -#define GEOSYR54CDT 0x0C05001E -#define TOWEL1 0x0C05001F -#define TOWEL1CDT 0x0C050020 -#define TOWEL4 0x0C050021 -#define TOWEL4CDT 0x0C050022 - // 35 entities in TXTs, 35 in datafiles. - // room53 -#define R53L0 0x0C060000 -#define R53PAL 0x0C060001 -#define BACK53PLX 0x0C060002 -#define FRONT53PLX 0x0C060003 -#define R53SPRPAL 0x0C060004 - // 5 entities in TXTs, 5 in datafiles. - // room54 -#define R54L0 0x0C070000 -#define R54L1 0x0C070001 -#define R54G1 0x0C070002 -#define R54PAL 0x0C070003 -#define R54FLR 0x0C070004 -#define R54PLX 0x0C070005 -#define GEOSYR19 0x0C070006 -#define GEOSYR19CDT 0x0C070007 -#define GEOSYR20 0x0C070008 -#define GEOSYR20CDT 0x0C070009 -#define GEOSYR22 0x0C07000A -#define GEOSYR22CDT 0x0C07000B -#define GEOSYR23 0x0C07000C -#define GEOSYR23CDT 0x0C07000D -#define GEOSYR25 0x0C07000E -#define GEOSYR25CDT 0x0C07000F -#define GEOSYR26 0x0C070010 -#define GEOSYR26CDT 0x0C070011 -#define GEOSYR27 0x0C070012 -#define GEOSYR27CDT 0x0C070013 -#define GEOSYR37 0x0C070014 -#define GEOSYR37CDT 0x0C070015 -#define GEOSYR39 0x0C070016 -#define GEOSYR39CDT 0x0C070017 -#define GEOSYR40 0x0C070018 -#define GEOSYR40CDT 0x0C070019 -#define GEOSYR41 0x0C07001A -#define GEOSYR41CDT 0x0C07001B -#define GEOSYR42 0x0C07001C -#define GEOSYR42CDT 0x0C07001D -#define GEOSYR99 0x0C07001E -#define GEOSYR99CDT 0x0C07001F -#define GUN54 0x0C070020 -#define GUN54CDT 0x0C070021 -#define KHS10 0x0C070022 -#define KHS10CDT 0x0C070023 -#define KHS12 0x0C070024 -#define KHS12CDT 0x0C070025 -#define KHS5 0x0C070026 -#define KHS5CDT 0x0C070027 -#define KHS7 0x0C070028 -#define KHS7CDT 0x0C070029 -#define KHS8 0x0C07002A -#define KHS8CDT 0x0C07002B -#define KHS9 0x0C07002C -#define KHS9CDT 0x0C07002D -#define KHSTLK54 0x0C07002E -#define KHSTLK54CDT 0x0C07002F -#define SECDOR 0x0C070030 -#define SECDORCDT 0x0C070031 -#define STCKTREE 0x0C070032 -#define STCKTREECDT 0x0C070033 -#define STICKIN 0x0C070034 -#define STICKINCDT 0x0C070035 -#define XGEOSY21 0x0C070036 -#define XGEOSY21CDT 0x0C070037 - // 56 entities in TXTs, 56 in datafiles. - // room55 -#define R55SPRPAL 0x0C080000 -#define R55L0 0x0C080001 -#define R55PAL 0x0C080002 -#define R55FLR 0x0C080003 -#define R55PLX 0x0C080004 -#define BODY55 0x0C080005 -#define BODY55CDT 0x0C080006 -#define BRITMAP 0x0C080007 -#define BRITMAP_PAL 0x0C080008 -#define DOOR55 0x0C080009 -#define DOOR55CDT 0x0C08000A -#define DOOR55CDR 0x0C08000B -#define GEOSY30T 0x0C08000C -#define GEOSY30TCDT 0x0C08000D -#define GEOSY30U 0x0C08000E -#define GEOSY30UCDT 0x0C08000F -#define GEOSYR29 0x0C080010 -#define GEOSYR29CDT 0x0C080011 -#define GEOSYR30 0x0C080012 -#define GEOSYR30CDT 0x0C080013 -#define GEOSYR31 0x0C080014 -#define GEOSYR31CDT 0x0C080015 -#define GEOSYR33 0x0C080016 -#define GEOSYR33CDT 0x0C080017 -#define GEOSYR34 0x0C080018 -#define GEOSYR34CDT 0x0C080019 -#define GEOSYR34CDR 0x0C08001A -#define GEOSYR35 0x0C08001B -#define GEOSYR35CDT 0x0C08001C -#define GEOSYR56 0x0C08001D -#define GEOSYR56CDT 0x0C08001E -#define KHS2 0x0C08001F -#define KHS2CDT 0x0C080020 -#define KHS3 0x0C080021 -#define KHS3CDT 0x0C080022 -#define KHS6 0x0C080023 -#define KHS6CDT 0x0C080024 - // 37 entities in TXTs, 37 in datafiles. -// train - // sound_fx -#define FX_SHOCK63 0x0D000000 -#define FX_TRAINEXT 0x0D000001 -#define FX_TRAININT 0x0D000002 -#define FX_DOOR65 0x0D000003 -#define FX_WIND66 0x0D000004 -#define FX_WINDOW66 0x0D000005 -#define FX_BRAKES 0x0D000006 -#define FX_DOOR69 0x0D000007 -#define FX_EKSHOOT 0x0D000008 -#define FX_FIGHT69 0x0D000009 -#define FX_PNEUMO69 0x0D00000A -#define FX_TICK69 0x0D00000B -#define FX_TRNPASS 0x0D00000C - // 13 entities in TXTs, 13 in datafiles. - // room63 -#define TRAIN_PAL 0x0D010000 -#define R63L0 0x0D010001 -#define R63L1 0x0D010002 -#define R63G1 0x0D010003 -#define R63PAL 0x0D010004 -#define R63FLR 0x0D010005 -#define GEOTRAIN_MEGA 0x0D010006 -#define GEOTRAIN_WLK 0x0D010007 -#define BASHER63 0x0D010008 -#define BASHER63CDT 0x0D010009 -#define BOXDOR64 0x0D01000A -#define BOXDOR64CDT 0x0D01000B -#define BUSHA63 0x0D01000C -#define BUSHA63CDT 0x0D01000D -#define BUSHB63 0x0D01000E -#define BUSHB63CDT 0x0D01000F -#define BUSHC63 0x0D010010 -#define BUSHC63CDT 0x0D010011 -#define DOOR63C1 0x0D010012 -#define DOOR63C1CDT 0x0D010013 -#define DOOR63C1CDR 0x0D010014 -#define DOOR63C2 0x0D010015 -#define DOOR63C2CDT 0x0D010016 -#define DOOR63C2CDR 0x0D010017 -#define DOOR63C3 0x0D010018 -#define DOOR63C3CDT 0x0D010019 -#define DOOR63C3CDR 0x0D01001A -#define GEOCLI64 0x0D01001B -#define GEOCLI64CDT 0x0D01001C -#define GEOJGL64 0x0D01001D -#define GEOJGL64CDT 0x0D01001E -#define GEOJGR64 0x0D01001F -#define GEOJGR64CDT 0x0D010020 -#define GEOLAD64 0x0D010021 -#define GEOLAD64CDT 0x0D010022 -#define GEOSHK64 0x0D010023 -#define GEOSHK64CDT 0x0D010024 -#define GEOSTDL 0x0D010025 -#define GEOSTDLCDT 0x0D010026 -#define GEOSTDR 0x0D010027 -#define GEOSTDRCDT 0x0D010028 -#define GUIDOR63 0x0D010029 -#define GUIDOR63CDT 0x0D01002A -#define GUIDSM63 0x0D01002B -#define GUIDSM63CDT 0x0D01002C -#define LADY63 0x0D01002D -#define LADY63CDT 0x0D01002E -#define LIGHT63A 0x0D01002F -#define LIGHT63ACDT 0x0D010030 -#define LIGHT63B 0x0D010031 -#define LIGHT63BCDT 0x0D010032 -#define LIGHT63C 0x0D010033 -#define LIGHT63CCDT 0x0D010034 -#define LIGHT63D 0x0D010035 -#define LIGHT63DCDT 0x0D010036 -#define LIGHT63E 0x0D010037 -#define LIGHT63ECDT 0x0D010038 -#define NICO63 0x0D010039 -#define NICO63CDT 0x0D01003A -#define POLE63 0x0D01003B -#define POLE63CDT 0x0D01003C -#define WHEELA63 0x0D01003D -#define WHEELA63CDT 0x0D01003E -#define WHEELB63 0x0D01003F -#define WHEELB63CDT 0x0D010040 -#define WHEELC63 0x0D010041 -#define WHEELC63CDT 0x0D010042 -#define WHEELD63 0x0D010043 -#define WHEELD63CDT 0x0D010044 -#define WHEELE63 0x0D010045 -#define WHEELE63CDT 0x0D010046 -#define WHEELF63 0x0D010047 -#define WHEELF63CDT 0x0D010048 - // 73 entities in TXTs, 73 in datafiles. - // room65 -#define R65L0 0x0D020000 -#define R65L1 0x0D020001 -#define R65G1 0x0D020002 -#define R65PAL 0x0D020003 -#define R65FLR 0x0D020004 -#define DOOR65 0x0D020005 -#define DOOR65CDT 0x0D020006 -#define DOOR65CDR 0x0D020007 -#define GEOGUA 0x0D020008 -#define GEOGUACDT 0x0D020009 -#define GEOLNK3 0x0D02000A -#define GEOLNK3CDT 0x0D02000B -#define GEONIC65 0x0D02000C -#define GEONIC65CDT 0x0D02000D -#define GEOSIT 0x0D02000E -#define GEOSITCDT 0x0D02000F -#define GEOSIT65 0x0D020010 -#define GEOSIT65CDT 0x0D020011 -#define GEOSTD65 0x0D020012 -#define GEOSTD65CDT 0x0D020013 -#define GEOSTD65CDR 0x0D020014 -#define GEOTIK 0x0D020015 -#define GEOTIKCDT 0x0D020016 -#define GEOTN652 0x0D020017 -#define GEOTN652CDT 0x0D020018 -#define GEOTN652CDR 0x0D020019 -#define GEOTRN65 0x0D02001A -#define GEOTRN65CDT 0x0D02001B -#define GEOTRN65CDR 0x0D02001C -#define GUADOR65 0x0D02001D -#define GUADOR65CDT 0x0D02001E -#define GUALEA65 0x0D02001F -#define GUALEA65CDT 0x0D020020 -#define GUATGN 0x0D020021 -#define GUATGNCDT 0x0D020022 -#define GUATGNCDR 0x0D020023 -#define GUATIK1 0x0D020024 -#define GUATIK1CDT 0x0D020025 -#define GUATIK2 0x0D020026 -#define GUATIK2CDT 0x0D020027 -#define GUATLK1 0x0D020028 -#define GUATLK1CDT 0x0D020029 -#define GUATLK2 0x0D02002A -#define GUATLK2CDT 0x0D02002B -#define NICGEO65 0x0D02002C -#define NICGEO65CDT 0x0D02002D -#define NICSIT65 0x0D02002E -#define NICSIT65CDT 0x0D02002F -#define NICTRN65 0x0D020030 -#define NICTRN65CDT 0x0D020031 -#define NICTRN65CDR 0x0D020032 -#define OLDREAD 0x0D020033 -#define OLDREADCDT 0x0D020034 -#define OLDREADCDR 0x0D020035 -#define OLDTIK1 0x0D020036 -#define OLDTIK1CDT 0x0D020037 -#define OLDTLK1 0x0D020038 -#define OLDTLK1CDT 0x0D020039 - // 58 entities in TXTs, 58 in datafiles. - // room66 -#define R66L0 0x0D030000 -#define R66PAL 0x0D030001 -#define R66FLR 0x0D030002 -#define BASHBURP 0x0D030003 -#define BASHBURPCDT 0x0D030004 -#define BASHCAN 0x0D030005 -#define BASHCANCDT 0x0D030006 -#define BASHCLA 0x0D030007 -#define BASHCLACDT 0x0D030008 -#define BASHDRI 0x0D030009 -#define BASHDRICDT 0x0D03000A -#define BASHSTD 0x0D03000B -#define BASHSTDCDT 0x0D03000C -#define BASHTLK1 0x0D03000D -#define BASHTLK1CDT 0x0D03000E -#define CAN66 0x0D03000F -#define CAN66CDT 0x0D030010 -#define GEOLEA 0x0D030011 -#define GEOLEACDT 0x0D030012 -#define GEOOPN1 0x0D030013 -#define GEOOPN1CDT 0x0D030014 -#define GEOOUT66 0x0D030015 -#define GEOOUT66CDT 0x0D030016 -#define SLEEPY1 0x0D030017 -#define SLEEPY1CDT 0x0D030018 -#define SLEEPY1CDR 0x0D030019 -#define SLEEPY2 0x0D03001A -#define SLEEPY2CDT 0x0D03001B - // 28 entities in TXTs, 28 in datafiles. - // room67 -#define R67L0 0x0D040000 -#define R67L1 0x0D040001 -#define R67G1 0x0D040002 -#define R67PAL 0x0D040003 -#define R67FLR 0x0D040004 -#define DOOR67 0x0D040005 -#define DOOR67CDT 0x0D040006 -#define DOOR67CDR 0x0D040007 - // 8 entities in TXTs, 8 in datafiles. - // room69 -#define R69SPRPAL 0x0D050000 -#define R69L0 0x0D050001 -#define R69L1 0x0D050002 -#define R69G1 0x0D050003 -#define R69PAL 0x0D050004 -#define R69FLR 0x0D050005 -#define ASSDIE69 0x0D050006 -#define ASSDIE69CDT 0x0D050007 -#define ASSDWN69 0x0D050008 -#define ASSDWN69CDT 0x0D050009 -#define ASSLIFT 0x0D05000A -#define ASSLIFTCDT 0x0D05000B -#define ASSTLK69 0x0D05000C -#define ASSTLK69CDT 0x0D05000D -#define BOXES69 0x0D05000E -#define BOXES69CDT 0x0D05000F -#define EKLBOX69 0x0D050010 -#define EKLBOX69CDT 0x0D050011 -#define EKLGUN 0x0D050012 -#define EKLGUNCDT 0x0D050013 -#define EKLGUN69 0x0D050014 -#define EKLGUN69CDT 0x0D050015 -#define EKLTLK69 0x0D050016 -#define EKLTLK69CDT 0x0D050017 -#define EKLFIGHT 0x0D050018 -#define EKLFIGHTCDT 0x0D050019 -#define FIGHT69 0x0D05001A -#define FIGHT69CDT 0x0D05001B -#define GEODIE69 0x0D05001C -#define GEODIE69CDT 0x0D05001D -#define GEOENT69 0x0D05001E -#define GEOENT69CDT 0x0D05001F -#define GEOSTD69 0x0D050020 -#define GEOSTD69CDT 0x0D050021 -#define GEOSTP69 0x0D050022 -#define GEOSTP69CDT 0x0D050023 -#define GEOTLK69 0x0D050024 -#define GEOTLK69CDT 0x0D050025 -#define GEOUNTIE 0x0D050026 -#define GEOUNTIECDT 0x0D050027 -#define GEOXIT69 0x0D050028 -#define GEOXIT69CDT 0x0D050029 -#define NICTKB69 0x0D05002A -#define NICTKB69CDT 0x0D05002B -#define NICTLK69 0x0D05002C -#define NICTLK69CDT 0x0D05002D -#define NICTRN69 0x0D05002E -#define NICTRN69CDT 0x0D05002F -#define NICTRN69CDR 0x0D050030 -#define NICTUG69 0x0D050031 -#define NICTUG69CDT 0x0D050032 -#define NICWLK69 0x0D050033 -#define NICWLK69CDT 0x0D050034 -#define NICXIT69 0x0D050035 -#define NICXIT69CDT 0x0D050036 -#define RGTDOR69 0x0D050037 -#define RGTDOR69CDT 0x0D050038 - // 57 entities in TXTs, 57 in datafiles. -// scotland - // sound_fx -#define FX_WIND71 0x0E000000 -#define FX_GUST71 0x0E000001 -#define FX_OWL71A 0x0E000002 -#define FX_OWL71B 0x0E000003 -#define FX_COG72A 0x0E000004 -#define FX_PING 0x0E000005 -#define FX_RUMMAGE1 0x0E000006 -#define FX_RUMMAGE2 0x0E000007 -#define FX_SECDOR72 0x0E000008 -#define FX_CHANT 0x0E000009 -#define FX_DAGGER1 0x0E00000A -#define FX_GDROP73 0x0E00000B -#define FX_GUNPOWDR 0x0E00000C -#define FX_STAFF 0x0E00000D -#define FX_TORCH73 0x0E00000E -#define FX_BAPHAMB 0x0E00000F -#define FX_FIGHT1 0x0E000010 -#define FX_REFORGE2 0x0E000011 -#define FX_ROSSODIE 0x0E000012 -#define FX_GKSWORD 0x0E000013 -#define FX_REFORGE1 0x0E000014 -#define FX_REFORGE4 0x0E000015 -#define FX_CHOKE1 0x0E000016 -#define FX_CHOKE2 0x0E000017 -#define FX_EKDIES 0x0E000018 -#define FX_FIGHT2 0x0E000019 -#define FX_GUN79 0x0E00001A - // 27 entities in TXTs, 27 in datafiles. - // room71 -#define R71L0 0x0E010000 -#define R71L1 0x0E010001 -#define R71G1 0x0E010002 -#define R71PAL 0x0E010003 -#define R71FLR 0x0E010004 -#define R71PLX 0x0E010005 - // 6 entities in TXTs, 6 in datafiles. - // room72 -#define R72L0 0x0E020000 -#define R72L1 0x0E020001 -#define R72G1 0x0E020002 -#define R72PAL 0x0E020003 -#define R72FLR 0x0E020004 -#define COGL72 0x0E020005 -#define COGL72CDT 0x0E020006 -#define COGR72 0x0E020007 -#define COGR72CDT 0x0E020008 -#define GEOJMP72 0x0E020009 -#define GEOJMP72CDT 0x0E02000A -#define GEOPIPE 0x0E02000B -#define GEOPIPECDT 0x0E02000C -#define GEOPIPECDR 0x0E02000D -#define GEOPSH72 0x0E02000E -#define GEOPSH72CDT 0x0E02000F -#define GEOPUT72 0x0E020010 -#define GEOPUT72CDT 0x0E020011 -#define GEOTAK72 0x0E020012 -#define GEOTAK72CDT 0x0E020013 -#define GEOTAK72CDR 0x0E020014 -#define GEOTRY72 0x0E020015 -#define GEOTRY72CDT 0x0E020016 -#define GEOWIND2 0x0E020017 -#define GEOWIND2CDT 0x0E020018 -#define GEOWIND3 0x0E020019 -#define GEOWIND3CDT 0x0E02001A -#define GEOWIND4 0x0E02001B -#define GEOWIND4CDT 0x0E02001C -#define GEOWND72 0x0E02001D -#define GEOWND72CDT 0x0E02001E -#define HANDLE72 0x0E02001F -#define HANDLE72CDT 0x0E020020 -#define NICGEO72 0x0E020021 -#define NICGEO72CDT 0x0E020022 -#define NICJMP72 0x0E020023 -#define NICJMP72CDT 0x0E020024 -#define NICLNK72 0x0E020025 -#define NICLNK72CDT 0x0E020026 -#define NICLNK72CDR 0x0E020027 -#define NICOPY72 0x0E020028 -#define NICOPY72CDT 0x0E020029 -#define NICOPY72CDR 0x0E02002A -#define NICTLK72 0x0E02002B -#define NICTLK72CDT 0x0E02002C -#define NOSE72 0x0E02002D -#define NOSE72CDT 0x0E02002E -#define PANEL72 0x0E02002F -#define PANEL72CDT 0x0E020030 -#define PIPE72 0x0E020031 -#define PIPE72CDT 0x0E020032 -#define SPINDL72 0x0E020033 -#define SPINDL72CDT 0x0E020034 -#define WHEEL72 0x0E020035 -#define WHEEL72CDT 0x0E020036 - // 55 entities in TXTs, 55 in datafiles. - // room73 -#define R73SPRPAL 0x0E030000 -#define R73L0 0x0E030001 -#define R73L1 0x0E030002 -#define R73L2 0x0E030003 -#define R73G1 0x0E030004 -#define R73G2 0x0E030005 -#define R73PAL 0x0E030006 -#define R73FLR 0x0E030007 -#define DAGGER1 0x0E030008 -#define DAGGER1CDT 0x0E030009 -#define DAGGER2 0x0E03000A -#define DAGGER2CDT 0x0E03000B -#define DARKWALL 0x0E03000C -#define DARKWALLCDT 0x0E03000D -#define FLAME73 0x0E03000E -#define FLAME73CDT 0x0E03000F -#define GEOCRCH 0x0E030010 -#define GEOCRCHCDT 0x0E030011 -#define GEOCREEP 0x0E030012 -#define GEOCREEPCDT 0x0E030013 -#define GEODIE1 0x0E030014 -#define GEODIE1CDT 0x0E030015 -#define GEODIE2 0x0E030016 -#define GEODIE2CDT 0x0E030017 -#define GEOTHROW 0x0E030018 -#define GEOTHROWCDT 0x0E030019 -#define GEOTLK73 0x0E03001A -#define GEOTLK73CDT 0x0E03001B -#define GEOTN73 0x0E03001C -#define GEOTN73CDT 0x0E03001D -#define GEOTN73CDR 0x0E03001E -#define GMENTER 0x0E03001F -#define GMENTERCDT 0x0E030020 -#define GMSPEAK 0x0E030021 -#define GMSPEAKCDT 0x0E030022 -#define GUIDLE 0x0E030023 -#define GUIDLECDT 0x0E030024 -#define GUITALK 0x0E030025 -#define GUITALKCDT 0x0E030026 -#define GUITHROW 0x0E030027 -#define GUITHROWCDT 0x0E030028 -#define GUITURN7 0x0E030029 -#define GUITURN7CDT 0x0E03002A -#define GUITURN7CDR 0x0E03002B -#define NICENT73 0x0E03002C -#define NICENT73CDT 0x0E03002D -#define NICEX73 0x0E03002E -#define NICEX73CDT 0x0E03002F -#define NICOTHRO 0x0E030030 -#define NICOTHROCDT 0x0E030031 -#define NICPANIC 0x0E030032 -#define NICPANICCDT 0x0E030033 -#define NICTLK73 0x0E030034 -#define NICTLK73CDT 0x0E030035 -#define NICTRN73 0x0E030036 -#define NICTRN73CDT 0x0E030037 -#define NICTRN73CDR 0x0E030038 -#define NITALK73 0x0E030039 -#define NITALK73CDT 0x0E03003A -#define SPARKING 0x0E03003B -#define SPARKINGCDT 0x0E03003C -#define TORCH1 0x0E03003D -#define TORCH1CDT 0x0E03003E -#define TORCH2 0x0E03003F -#define TORCH2CDT 0x0E030040 -#define TORCH3 0x0E030041 -#define TORCH3CDT 0x0E030042 - // 67 entities in TXTs, 67 in datafiles. - // room74 -#define ENDSPRPAL 0x0E040000 -#define R74L0 0x0E040001 -#define R74L1 0x0E040002 -#define R74G1 0x0E040003 -#define R74PAL 0x0E040004 -#define R74APAL 0x0E040005 -#define R74BPAL 0x0E040006 -#define R74CPAL 0x0E040007 -#define R74DPAL 0x0E040008 -#define CHANT74 0x0E040009 -#define CHANT74CDT 0x0E04000A -#define EKFIGHT 0x0E04000B -#define EKFIGHTCDT 0x0E04000C -#define EKGUN74 0x0E04000D -#define EKGUN74CDT 0x0E04000E -#define GEOFIGHT 0x0E04000F -#define GEOFIGHTCDT 0x0E040010 -#define GEOLUK74 0x0E040011 -#define GEOLUK74CDT 0x0E040012 -#define GEOLUK74CDR 0x0E040013 -#define GEORCT74 0x0E040014 -#define GEORCT74CDT 0x0E040015 -#define GEORUN74 0x0E040016 -#define GEORUN74CDT 0x0E040017 -#define GEOSTND 0x0E040018 -#define GEOSTNDCDT 0x0E040019 -#define GEOTLK74 0x0E04001A -#define GEOTLK74CDT 0x0E04001B -#define GKKNEE 0x0E04001C -#define GKKNEECDT 0x0E04001D -#define GMGUN 0x0E04001E -#define GMGUNCDT 0x0E04001F -#define GMMOV1 0x0E040020 -#define GMMOV1CDT 0x0E040021 -#define GMMOV2 0x0E040022 -#define GMMOV2CDT 0x0E040023 -#define GMMOV3 0x0E040024 -#define GMMOV3CDT 0x0E040025 -#define GMMOV4 0x0E040026 -#define GMMOV4CDT 0x0E040027 -#define GMMOV5 0x0E040028 -#define GMMOV5CDT 0x0E040029 -#define GMMOV6 0x0E04002A -#define GMMOV6CDT 0x0E04002B -#define GMTLK1 0x0E04002C -#define GMTLK1CDT 0x0E04002D -#define GMTLK2 0x0E04002E -#define GMTLK2CDT 0x0E04002F -#define GMTLK3 0x0E040030 -#define GMTLK3CDT 0x0E040031 -#define GMTLK4 0x0E040032 -#define GMTLK4CDT 0x0E040033 -#define GMTLK5 0x0E040034 -#define GMTLK5CDT 0x0E040035 -#define GMTLK6 0x0E040036 -#define GMTLK6CDT 0x0E040037 -#define GMTLK7 0x0E040038 -#define GMTLK7CDT 0x0E040039 -#define GMTLK74 0x0E04003A -#define GMTLK74CDT 0x0E04003B -#define GMWLK 0x0E04003C -#define GMWLKCDT 0x0E04003D -#define GMWRIT74 0x0E04003E -#define GMWRIT74CDT 0x0E04003F -#define MONKFALL 0x0E040040 -#define MONKFALLCDT 0x0E040041 -#define MONKRISE 0x0E040042 -#define MONKRISECDT 0x0E040043 -#define MONKSTRS 0x0E040044 -#define MONKSTRSCDT 0x0E040045 -#define MONKTURN 0x0E040046 -#define MONKTURNCDT 0x0E040047 -#define NICFIGHT 0x0E040048 -#define NICFIGHTCDT 0x0E040049 -#define NICLUK74 0x0E04004A -#define NICLUK74CDT 0x0E04004B -#define NICLUK74CDR 0x0E04004C -#define NICRCVR 0x0E04004D -#define NICRCVRCDT 0x0E04004E -#define NICRUN74 0x0E04004F -#define NICRUN74CDT 0x0E040050 -#define NICSTND 0x0E040051 -#define NICSTNDCDT 0x0E040052 -#define NICTLK74 0x0E040053 -#define NICTLK74CDT 0x0E040054 -#define ROSSFALL 0x0E040055 -#define ROSSFALLCDT 0x0E040056 -#define ROSSTAIR 0x0E040057 -#define ROSSTAIRCDT 0x0E040058 -#define ROSSTND 0x0E040059 -#define ROSSTNDCDT 0x0E04005A -#define ROSSWLK 0x0E04005B -#define ROSSWLKCDT 0x0E04005C -#define RUBBLE 0x0E04005D -#define RUBBLECDT 0x0E04005E -#define STONLIT1 0x0E04005F -#define STONLIT1CDT 0x0E040060 -#define STONLIT2 0x0E040061 -#define STONLIT2CDT 0x0E040062 -#define STONWHT1 0x0E040063 -#define STONWHT1CDT 0x0E040064 -#define STONWHT2 0x0E040065 -#define STONWHT2CDT 0x0E040066 - // 103 entities in TXTs, 103 in datafiles. - // room75 -#define R75L0 0x0E050000 -#define R75PAL 0x0E050001 -#define R75APAL 0x0E050002 -#define R75BPAL 0x0E050003 -#define R75CPAL 0x0E050004 -#define R75DPAL 0x0E050005 -#define EKGUN 0x0E050006 -#define EKGUNCDT 0x0E050007 -#define EKGUN2 0x0E050008 -#define EKGUN2CDT 0x0E050009 -#define EKLITE 0x0E05000A -#define EKLITECDT 0x0E05000B -#define EKRELAX 0x0E05000C -#define EKRELAXCDT 0x0E05000D -#define EKTLK75 0x0E05000E -#define EKTLK75CDT 0x0E05000F -#define GEOLUK75 0x0E050010 -#define GEOLUK75CDT 0x0E050011 -#define GEOLUK75CDR 0x0E050012 -#define GTMP 0x0E050013 -#define GTMPCDT 0x0E050014 -#define NICLUK75 0x0E050015 -#define NICLUK75CDT 0x0E050016 -#define NICLUK75CDR 0x0E050017 -#define NTMP 0x0E050018 -#define NTMPCDT 0x0E050019 -#define TORCH75 0x0E05001A -#define TORCH75CDT 0x0E05001B - // 28 entities in TXTs, 28 in datafiles. - // room76 -#define R76L0 0x0E060000 -#define R76PAL 0x0E060001 -#define CHANT76 0x0E060002 -#define CHANT76CDT 0x0E060003 -#define EKGUN76 0x0E060004 -#define EKGUN76CDT 0x0E060005 -#define GKBAK 0x0E060006 -#define GKBAKCDT 0x0E060007 -#define GKKNEE76 0x0E060008 -#define GKKNEE76CDT 0x0E060009 -#define GKLOWER 0x0E06000A -#define GKLOWERCDT 0x0E06000B -#define GKSWORD 0x0E06000C -#define GKSWORDCDT 0x0E06000D -#define GKTLK 0x0E06000E -#define GKTLKCDT 0x0E06000F -#define GKTLK2 0x0E060010 -#define GKTLK2CDT 0x0E060011 -#define GMARMS 0x0E060012 -#define GMARMSCDT 0x0E060013 -#define GMSTONES 0x0E060014 -#define GMSTONESCDT 0x0E060015 -#define GMTLK76 0x0E060016 -#define GMTLK76CDT 0x0E060017 -#define GMTRN76 0x0E060018 -#define GMTRN76CDT 0x0E060019 -#define LSTONE76 0x0E06001A -#define LSTONE76CDT 0x0E06001B -#define MONKNEE 0x0E06001C -#define MONKNEECDT 0x0E06001D -#define ROSSTND76 0x0E06001E -#define ROSSTND76CDT 0x0E06001F -#define RSTONE76 0x0E060020 -#define RSTONE76CDT 0x0E060021 - // 34 entities in TXTs, 34 in datafiles. - // room77 -#define R77L0 0x0E070000 -#define R77PAL 0x0E070001 -#define CHANT77 0x0E070002 -#define CHANT77CDT 0x0E070003 -#define GEOPEER 0x0E070004 -#define GEOPEERCDT 0x0E070005 -#define GMHEAD 0x0E070006 -#define GMHEADCDT 0x0E070007 -#define NICPEER 0x0E070008 -#define NICPEERCDT 0x0E070009 -#define NICTLK77 0x0E07000A -#define NICTLK77CDT 0x0E07000B -#define ROSLUK77 0x0E07000C -#define ROSLUK77CDT 0x0E07000D - // 14 entities in TXTs, 14 in datafiles. - // room78 -#define R78L0 0x0E080000 -#define R78PAL 0x0E080001 -#define R78APAL 0x0E080002 -#define R78BPAL 0x0E080003 -#define R78CPAL 0x0E080004 -#define R78DPAL 0x0E080005 -#define R78EPAL 0x0E080006 -#define R78FPAL 0x0E080007 -#define LSTONE78 0x0E080008 -#define LSTONE78CDT 0x0E080009 -#define LSTONE78CDR 0x0E08000A -#define GMPOWER 0x0E08000B -#define GMPOWERCDT 0x0E08000C -#define GMWRITH 0x0E08000D -#define GMWRITHCDT 0x0E08000E -#define RSTONE78 0x0E08000F -#define RSTONE78CDT 0x0E080010 -#define RSTONE78CDR 0x0E080011 - // 18 entities in TXTs, 18 in datafiles. - // room79 -#define R79L0 0x0E090000 -#define R79PAL 0x0E090001 -#define EKSTD79 0x0E090002 -#define EKSTD79CDT 0x0E090003 -#define FIGHT79 0x0E090004 -#define FIGHT79CDT 0x0E090005 -#define GEOANG79 0x0E090006 -#define GEOANG79CDT 0x0E090007 -#define GEOTLK79 0x0E090008 -#define GEOTLK79CDT 0x0E090009 -#define NICSTD79 0x0E09000A -#define NICSTD79CDT 0x0E09000B -#define ROSENT79 0x0E09000C -#define ROSENT79CDT 0x0E09000D -#define ROSSHOT 0x0E09000E -#define ROSSHOTCDT 0x0E09000F -#define ROSTLK79 0x0E090010 -#define ROSTLK79CDT 0x0E090011 - // 18 entities in TXTs, 18 in datafiles. - -//} // End of namespace Sword1 - -#endif //SWORDRES_H diff --git a/backends/platform/PalmOS/Src/globals.h b/backends/platform/PalmOS/Src/globals.h index e02f77cf28..05e9fe70b6 100644 --- a/backends/platform/PalmOS/Src/globals.h +++ b/backends/platform/PalmOS/Src/globals.h @@ -29,21 +29,6 @@ #include <VFSMgr.h> #include "stuffs.h" -#ifdef PALMOS_68K - -#include "scumm_globals.h" - -enum { - kMemScummOldCostGames = 0, - kMemScummNewCostGames, - kMemSimon1Games, - kMemSimon2Games, - - kMemGamesCount -}; - -#endif - enum { INIT_VIBRATOR = 1 << 0x00, INIT_PA1LIB = 1 << 0x01, @@ -99,20 +84,6 @@ typedef struct { UInt8 fmQuality; UInt8 advancedMode; -#ifdef PALMOS_68K - // 68k only part - struct { - Boolean enable; - UInt8 driver, format; - UInt16 defaultTrackLength; - UInt16 firstTrack; - UInt8 volume; - } CD; - - DmOpenRef globals[GBVARS_COUNT]; - UInt32 memory[kMemGamesCount]; -#endif - } GlobalsDataType, *GlobalsDataPtr; extern GlobalsDataPtr gVars; diff --git a/backends/platform/PalmOS/Src/launcher/forms/formSelect.cpp b/backends/platform/PalmOS/Src/launcher/forms/formSelect.cpp index 085fb2499a..641d646bb2 100755 --- a/backends/platform/PalmOS/Src/launcher/forms/formSelect.cpp +++ b/backends/platform/PalmOS/Src/launcher/forms/formSelect.cpp @@ -18,8 +18,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL:https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/branches/gsoc2007-fsnode/backends/platform/PalmOS/Src/launcher/forms/formSelect.cpp $ - * $Id:formSelect.cpp 26949 2007-05-26 20:23:24Z david_corrales $ + * $URL$ + * $Id$ * */ diff --git a/backends/platform/PalmOS/Src/modules.cpp b/backends/platform/PalmOS/Src/modules.cpp index 6433c3e159..bfe2595b07 100644 --- a/backends/platform/PalmOS/Src/modules.cpp +++ b/backends/platform/PalmOS/Src/modules.cpp @@ -4,7 +4,6 @@ #include "args.h" #include "globals.h" #include "modules.h" -#include "extend.h" #include "features.h" #include "rumble.h" @@ -21,8 +20,6 @@ GlobalsDataPtr gVars; -#ifdef PALMOS_NATIVE - #include "endianutils.h" #include <PNOLoader.h> @@ -81,90 +78,6 @@ void run(int argc, char *argv[]) { WinPalette(winPaletteSetToDefault, 0, 256, NULL); } -#else - -#include "stdafx.h" -#include "base/main.h" -#include "be_zodiac.h" -#include "be_os5ex.h" - -static void palm_main(int argc, char **argvP) { -#ifdef COMPILE_OS5 - if (gVars->advancedMode) - g_system = new OSystem_PalmOS5Ex(); - else - g_system = new OSystem_PalmOS5(); -#elif defined(COMPILE_ZODIAC) - g_system = new OSystem_PalmZodiac(); -#else - #error "No target defined." -#endif - - assert(g_system); - - // Invoke the actual ScummVM main entry point: - scummvm_main(argc, argvP); - - g_system->quit(); // TODO: Consider removing / replacing this! -} - -void run(int argc, char *argv[]) { - - MathlibInit(); - gVars->HRrefNum = SonyHRInit(8); - if (gVars->HRrefNum == sysInvalidRefNum) - PalmHRInit(8); - gVars->slkRefNum= SilkInit(&(gVars->slkVersion)); - gVars->screenPitch = StuffsGetPitch(gVars->screenFullWidth); - - // create file for printf, warnings, etc... - StdioInit(gVars->VFS.volRefNum, "/PALM/Programs/ScummVM/scumm.log"); - if (gVars->indicator.showLED) StdioSetLedProc(DrawStatus); - StdioSetCacheSize(gVars->VFS.cacheSize); - gUnistdCWD = SCUMMVM_SAVEPATH; - - // init hardware - if (HWR_INIT(INIT_GOLCD)) GoLCDInit(&gGoLcdH); - if (HWR_INIT(INIT_PA1LIB)) Pa1libInit(gVars->palmVolume); - if (HWR_INIT(INIT_VIBRATOR)) gVars->vibrator = RumbleInit(); - PalmInit(HWR_GET()); - - if (!gVars->vibrator) - HWR_RST(INIT_VIBRATOR); - - GlbOpen(); - // be sure to have a VG - void *__ptr = StuffsForceVG(); - - DO_EXIT( palm_main(argc, argv); ) - - // be sure to release features memory - FREE_FTR(ftrBufferOverlay) - FREE_FTR(ftrBufferBackup) - FREE_FTR(ftrBufferHotSwap) - - StuffsReleaseVG(__ptr); - GlbClose(); - - PalmRelease(HWR_GET()); - if (HWR_INIT(INIT_VIBRATOR)) RumbleRelease(); - if (HWR_INIT(INIT_PA1LIB)) Pa1libRelease(); - if (HWR_INIT(INIT_GOLCD)) GoLCDRelease(gGoLcdH); - - // close log file - StdioRelease(); - - PalmHRRelease(); - SonyHRRelease(gVars->HRrefNum); - SilkRelease(gVars->slkRefNum); - MathlibRelease(); - - MemPtrFree(gVars); - WinPalette(winPaletteSetToDefault, 0, 256, NULL); -// ArgsFree(argvP); // called in main(...) -} -#endif - static UInt32 ModulesPalmMain(UInt16 cmd, MemPtr cmdPBP, UInt16 launchFlags) { UInt32 result = 0; diff --git a/backends/platform/PalmOS/Src/native/oscalls.cpp b/backends/platform/PalmOS/Src/native/oscalls.cpp index f15a1ef781..68cfb0eef5 100644 --- a/backends/platform/PalmOS/Src/native/oscalls.cpp +++ b/backends/platform/PalmOS/Src/native/oscalls.cpp @@ -60,3 +60,15 @@ PACE_CLASS_WRAPPER(UInt16) PACE_PIN_EXEC_NP(pinSysGetOrientation, UInt16) } +PACE_CLASS_WRAPPER(Err) + __68k_SysSetOrientationTriggerState(UInt16 triggerState) { + PACE_PARAMS_INIT() + PACE_PARAMS_ADD16(triggerState) + PACE_PARAMS_END() + PACE_PIN_EXEC(pinSysSetOrientationTriggerState, Err) +} + +PACE_CLASS_WRAPPER(UInt16) + __68k_SysGetOrientationTriggerState(void) { + PACE_PIN_EXEC_NP(pinSysGetOrientationTriggerState, UInt16) +} diff --git a/backends/platform/PalmOS/Src/native/oscalls.h b/backends/platform/PalmOS/Src/native/oscalls.h index cc35eeaf28..2b4b93488f 100644 --- a/backends/platform/PalmOS/Src/native/oscalls.h +++ b/backends/platform/PalmOS/Src/native/oscalls.h @@ -41,6 +41,8 @@ Err __68k_StatHide(); Err __68k_PINSetInputAreaState(UInt16 state); Err __68k_SysSetOrientation(UInt16 orientation); UInt16 __68k_SysGetOrientation(void); +Err __68k_SysSetOrientationTriggerState(UInt16 triggerState); +UInt16 __68k_SysGetOrientationTriggerState(void); #ifdef __cplusplus } diff --git a/backends/platform/PalmOS/Src/os5_gfx.cpp b/backends/platform/PalmOS/Src/os5_gfx.cpp index be5d28bc56..bd91be628c 100644 --- a/backends/platform/PalmOS/Src/os5_gfx.cpp +++ b/backends/platform/PalmOS/Src/os5_gfx.cpp @@ -72,6 +72,7 @@ void OSystem_PalmOS5::load_gfx_mode() { if (OPTIONS_TST(kOptModeRotatable)) { _sysOldOrientation = __68K(SysGetOrientation()); __68K(SysSetOrientation(sysOrientationLandscape)); + __68K(SysSetOrientationTriggerState(sysOrientationTriggerDisabled)); } gVars->indicator.on = RGBToColor(0,255,0); diff --git a/backends/platform/PalmOS/Src/os5_overlay.cpp b/backends/platform/PalmOS/Src/os5_overlay.cpp index b5225cf573..5555c7ef08 100644 --- a/backends/platform/PalmOS/Src/os5_overlay.cpp +++ b/backends/platform/PalmOS/Src/os5_overlay.cpp @@ -80,9 +80,6 @@ OverlayColor OSystem_PalmOS5::RGBToColor(uint8 r, uint8 g, uint8 b) { } void OSystem_PalmOS5::colorToRGB(OverlayColor color, uint8 &r, uint8 &g, uint8 &b) { -#ifdef PALMOS_68K - color = SWAP_BYTES_16(color); -#endif r = ((color >> 8) & 0xF8); g = ((color >> 3) & 0xFC); b = ((color << 3) & 0xF8); diff --git a/backends/platform/PalmOS/Src/os5_sound.cpp b/backends/platform/PalmOS/Src/os5_sound.cpp index c0421b5541..f34d010bca 100644 --- a/backends/platform/PalmOS/Src/os5_sound.cpp +++ b/backends/platform/PalmOS/Src/os5_sound.cpp @@ -97,18 +97,12 @@ bool OSystem_PalmOS5::setSoundCallback(SoundProc proc, void *param) { sndOutput, sndFormatPCM, _samplesPerSec, -#ifdef PALMOS_68K - sndInt16Big, -#else sndInt16Little, -#endif sndStereo, sound_callback(), &_soundEx, 8192 -#ifdef PALMOS_68K - ,false -#elif defined (COMPILE_OS5) +#ifdef COMPILE_OS5 ,true #endif ); diff --git a/backends/platform/PalmOS/Src/palm-scumm-md5.h b/backends/platform/PalmOS/Src/palm-scumm-md5.h deleted file mode 100644 index bf82c8e93d..0000000000 --- a/backends/platform/PalmOS/Src/palm-scumm-md5.h +++ /dev/null @@ -1,9 +0,0 @@ - -struct MD5Table { - const char md5[32 + 1]; - const char target[16 + 1]; - Common::Language language; - Common::Platform platform; -}; - -static const MD5Table *md5table;
\ No newline at end of file diff --git a/backends/platform/PalmOS/Src/prefixes/68k_agi.h b/backends/platform/PalmOS/Src/prefixes/68k_agi.h deleted file mode 100644 index 154c2d3115..0000000000 --- a/backends/platform/PalmOS/Src/prefixes/68k_agi.h +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef PREFIX_H -#define PREFIX_H - -#include "compile.h" -#undef DISABLE_AGI - -#define PALMOS_68K - -#endif diff --git a/backends/platform/PalmOS/Src/prefixes/68k_agos.h b/backends/platform/PalmOS/Src/prefixes/68k_agos.h deleted file mode 100644 index 92ed72b9d6..0000000000 --- a/backends/platform/PalmOS/Src/prefixes/68k_agos.h +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef PREFIX_H -#define PREFIX_H - -#include "compile.h" -#undef DISABLE_AGOS - -#define PALMOS_68K - -#endif diff --git a/backends/platform/PalmOS/Src/prefixes/68k_cine.h b/backends/platform/PalmOS/Src/prefixes/68k_cine.h deleted file mode 100644 index 621fa0c4e1..0000000000 --- a/backends/platform/PalmOS/Src/prefixes/68k_cine.h +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef PREFIX_H -#define PREFIX_H - -#include "compile.h" -#undef DISABLE_CINE - -#define PALMOS_68K - -#endif diff --git a/backends/platform/PalmOS/Src/prefixes/68k_gob.h b/backends/platform/PalmOS/Src/prefixes/68k_gob.h deleted file mode 100644 index 1eaa2a5e77..0000000000 --- a/backends/platform/PalmOS/Src/prefixes/68k_gob.h +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef PREFIX_H -#define PREFIX_H - -#include "compile.h" -#undef DISABLE_GOB - -#define PALMOS_68K - -#endif diff --git a/backends/platform/PalmOS/Src/prefixes/68k_kyra.h b/backends/platform/PalmOS/Src/prefixes/68k_kyra.h deleted file mode 100644 index 0afb8de061..0000000000 --- a/backends/platform/PalmOS/Src/prefixes/68k_kyra.h +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef PREFIX_H -#define PREFIX_H - -#include "compile.h" -#undef DISABLE_KYRA - -#define PALMOS_68K - -#endif diff --git a/backends/platform/PalmOS/Src/prefixes/68k_lure.h b/backends/platform/PalmOS/Src/prefixes/68k_lure.h deleted file mode 100644 index 1bc7b19edd..0000000000 --- a/backends/platform/PalmOS/Src/prefixes/68k_lure.h +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef PREFIX_H -#define PREFIX_H - -#include "compile.h" -#undef DISABLE_LURE - -#define PALMOS_68K - -#endif diff --git a/backends/platform/PalmOS/Src/prefixes/68k_queen.h b/backends/platform/PalmOS/Src/prefixes/68k_queen.h deleted file mode 100644 index cdf3859966..0000000000 --- a/backends/platform/PalmOS/Src/prefixes/68k_queen.h +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef PREFIX_H -#define PREFIX_H - -#include "compile.h" -#undef DISABLE_QUEEN - -#define PALMOS_68K - -#endif diff --git a/backends/platform/PalmOS/Src/prefixes/68k_saga.h b/backends/platform/PalmOS/Src/prefixes/68k_saga.h deleted file mode 100644 index 0ad4089418..0000000000 --- a/backends/platform/PalmOS/Src/prefixes/68k_saga.h +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef PREFIX_H -#define PREFIX_H - -#include "compile.h" -#undef DISABLE_SAGA - -#define PALMOS_68K - -#endif diff --git a/backends/platform/PalmOS/Src/prefixes/68k_scumm.h b/backends/platform/PalmOS/Src/prefixes/68k_scumm.h deleted file mode 100644 index 8a6e0d85c3..0000000000 --- a/backends/platform/PalmOS/Src/prefixes/68k_scumm.h +++ /dev/null @@ -1,12 +0,0 @@ -#ifndef PREFIX_H -#define PREFIX_H - -#include "compile.h" -#undef DISABLE_SCUMM -//#undef DISABLE_SCUMM_7_8 -//#undef DISABLE_HE - -#define PALMOS_68K -//#define PALMOS_DEBUG - -#endif diff --git a/backends/platform/PalmOS/Src/prefixes/68k_sky.h b/backends/platform/PalmOS/Src/prefixes/68k_sky.h deleted file mode 100644 index 52720f508d..0000000000 --- a/backends/platform/PalmOS/Src/prefixes/68k_sky.h +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef PREFIX_H -#define PREFIX_H - -#include "compile.h" -#undef DISABLE_SKY - -#define PALMOS_68K - -#endif diff --git a/backends/platform/PalmOS/Src/prefixes/68k_sword1.h b/backends/platform/PalmOS/Src/prefixes/68k_sword1.h deleted file mode 100644 index 984e704cc5..0000000000 --- a/backends/platform/PalmOS/Src/prefixes/68k_sword1.h +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef PREFIX_H -#define PREFIX_H - -#include "compile.h" -#undef DISABLE_SWORD1 - -#define PALMOS_68K - -#endif diff --git a/backends/platform/PalmOS/Src/prefixes/68k_sword2.h b/backends/platform/PalmOS/Src/prefixes/68k_sword2.h deleted file mode 100644 index bca68ff4d3..0000000000 --- a/backends/platform/PalmOS/Src/prefixes/68k_sword2.h +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef PREFIX_H -#define PREFIX_H - -#include "compile.h" -#undef DISABLE_SWORD2 - -#define PALMOS_68K - -#endif diff --git a/backends/platform/PalmOS/Src/prefixes/compile.h b/backends/platform/PalmOS/Src/prefixes/compile.h index 28c6cc519f..740253850e 100644 --- a/backends/platform/PalmOS/Src/prefixes/compile.h +++ b/backends/platform/PalmOS/Src/prefixes/compile.h @@ -45,6 +45,7 @@ #define DISABLE_TOUCHE #define DISABLE_PARALLACTION #define DISABLE_CRUISE +#define DISABLE_DRASCULA // ScummVM #define DISABLE_HQ_SCALERS diff --git a/backends/platform/PalmOS/Src/prefixes/native_drascula.h b/backends/platform/PalmOS/Src/prefixes/native_drascula.h new file mode 100755 index 0000000000..3904cc98ba --- /dev/null +++ b/backends/platform/PalmOS/Src/prefixes/native_drascula.h @@ -0,0 +1,7 @@ +#ifndef PREFIX_H +#define PREFIX_H + +#include "native_common.h" +#undef DISABLE_DRASCULA + +#endif diff --git a/backends/platform/PalmOS/Src/prefixes/native_scumm.h b/backends/platform/PalmOS/Src/prefixes/native_scumm.h index 196628909a..5014a8d5ff 100644 --- a/backends/platform/PalmOS/Src/prefixes/native_scumm.h +++ b/backends/platform/PalmOS/Src/prefixes/native_scumm.h @@ -6,4 +6,7 @@ #undef DISABLE_SCUMM_7_8 #undef DISABLE_HE +#define USE_ARM_GFX_ASM +#define USE_ARM_SMUSH_ASM + #endif diff --git a/backends/platform/PalmOS/Src/scumm_globals.cpp b/backends/platform/PalmOS/Src/scumm_globals.cpp deleted file mode 100644 index 9dd706ec58..0000000000 --- a/backends/platform/PalmOS/Src/scumm_globals.cpp +++ /dev/null @@ -1,156 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ - * - */ - -#include <PalmOS.h> - -#include "palmdefs.h" -#include "globals.h" -#include "scumm_globals.h" - -static void GlbInitAll() { - if (gVars->globals[GBVARS_COMMON]) { - CALL_INIT(ScummFont) - } - if (gVars->globals[GBVARS_ENGINE]) { -#ifndef DISABLE_SCUMM -# ifndef DISABLE_SCUMM_7_8 - CALL_INIT(DimuseTables) - CALL_INIT(DimuseCodecs) - CALL_INIT(Codec47) -# endif - CALL_INIT(Akos) - CALL_INIT(Gfx) - CALL_INIT(Dialogs) - CALL_INIT(Charset) - CALL_INIT(Costume) - CALL_INIT(PlayerV2) - CALL_INIT(Scumm_md5table) -#endif -#ifndef DISABLE_AGOS - CALL_INIT(AGOS_AGOS) - CALL_INIT(AGOS_Cursor) - CALL_INIT(AGOS_Charset) -#endif -#ifndef DISABLE_SKY - CALL_INIT(Sky_Hufftext) -#endif -#ifndef DISABLE_SWORD1 - CALL_INIT(Sword1_fxList) -#endif -#ifndef DISABLE_QUEEN - CALL_INIT(Queen_Talk) - CALL_INIT(Queen_Display) - CALL_INIT(Queen_Graphics) - CALL_INIT(Queen_Restables) - CALL_INIT(Queen_Musicdata) -#endif - } -} - -static void GlbReleaseAll() { - if (gVars->globals[GBVARS_COMMON]) { - CALL_RELEASE(ScummFont) - - } - if (gVars->globals[GBVARS_SCUMM]) { -#ifndef DISABLE_SCUMM -# ifndef DISABLE_SCUMM_7_8 - CALL_RELEASE(DimuseTables) - CALL_RELEASE(DimuseCodecs) - CALL_RELEASE(Codec47) -# endif - CALL_RELEASE(Akos) - CALL_RELEASE(Gfx) - CALL_RELEASE(Dialogs) - CALL_RELEASE(Charset) - CALL_RELEASE(Costume) - CALL_RELEASE(PlayerV2) - CALL_RELEASE(Scumm_md5table) -#endif -#ifndef DISABLE_AGOS - CALL_RELEASE(AGOS_AGOS) - CALL_RELEASE(AGOS_AGOS) - CALL_RELEASE(AGOS_AGOS) -#endif -#ifndef DISABLE_SKY - CALL_RELEASE(Sky_Hufftext) -#endif -#ifndef DISABLE_SWORD1 - CALL_RELEASE(Sword1_fxList) -#endif -#ifndef DISABLE_QUEEN - CALL_RELEASE(Queen_Talk) - CALL_RELEASE(Queen_Display) - CALL_RELEASE(Queen_Graphics) - CALL_RELEASE(Queen_Restables) - CALL_RELEASE(Queen_Musicdata) -#endif - } -} - -//TODO : use Boolean instead of void to check err -static DmOpenRef GlbOpenInternal(const Char *nameP) { - LocalID dbID = DmFindDatabase(0, nameP); - if (dbID) { - UInt32 dbType, dbCreator; - Err e = DmDatabaseInfo(0, dbID, 0, 0, 0, 0, 0, 0, 0, 0, 0, &dbType, &dbCreator); - - if (!e && dbType == 'GLBS' && dbCreator == appFileCreator) - return DmOpenDatabase(0, dbID, dmModeReadOnly); - } - return NULL; -} - -void GlbOpen() { - gVars->globals[GBVARS_COMMON] = GlbOpenInternal("Glbs::Common"); - gVars->globals[GBVARS_ENGINE] = GlbOpenInternal("Glbs::Engine"); - GlbInitAll(); -} - -void GlbClose() { - GlbReleaseAll(); - - if (gVars->globals[GBVARS_COMMON]) - DmCloseDatabase(gVars->globals[GBVARS_COMMON]); - if (gVars->globals[GBVARS_ENGINE]) - DmCloseDatabase(gVars->globals[GBVARS_ENGINE]); -} - -void *GlbGetRecord(UInt16 index, UInt16 id) { - if (gVars->globals[id]) { - MemHandle recordH = DmQueryRecord(gVars->globals[id], index); - if (recordH) - return MemHandleLock(recordH); - } - return NULL; -} - -void GlbReleaseRecord(UInt16 index, UInt16 id) { - if (gVars->globals[id]) { - MemHandle recordH = DmQueryRecord(gVars->globals[id], index); - if (recordH) - MemHandleUnlock(recordH); - } -} diff --git a/backends/platform/PalmOS/Src/scumm_globals.h b/backends/platform/PalmOS/Src/scumm_globals.h deleted file mode 100644 index f1837e54d1..0000000000 --- a/backends/platform/PalmOS/Src/scumm_globals.h +++ /dev/null @@ -1,92 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ - * - */ - -#ifndef __SCUMM_GLOBALS_H__ -#define __SCUMM_GLOBALS_H__ - -#include "builder/enum_globals.h" - -void *GlbGetRecord(UInt16 index, UInt16 id); -void GlbReleaseRecord(UInt16 index, UInt16 id); -void GlbOpen(); -void GlbClose(); - - -#define _GINIT(x) void initGlobals_##x() { -#define _GEND } -#define _GRELEASE(x) void releaseGlobals_##x() { - -#define CALL_INIT(x) initGlobals_##x(); -#define CALL_RELEASE(x) releaseGlobals_##x(); - -#define _GSETPTR(var,index,format,id) var = (format *)GlbGetRecord(index,id); -#define _GRELEASEPTR(index,id) GlbReleaseRecord(index,id); - -#define PROTO_GLOBALS(x) void CALL_INIT(x);\ - void CALL_RELEASE(x); - - -// Common stuffs -PROTO_GLOBALS(ScummFont) - -// Scumm stuffs -#ifndef DISABLE_SCUMM -PROTO_GLOBALS(DimuseTables) -PROTO_GLOBALS(Akos) -PROTO_GLOBALS(DimuseCodecs) -PROTO_GLOBALS(Codec47) -PROTO_GLOBALS(Gfx) -PROTO_GLOBALS(Dialogs) -PROTO_GLOBALS(Charset) -PROTO_GLOBALS(Costume) -PROTO_GLOBALS(PlayerV2) -PROTO_GLOBALS(Scumm_md5table) -#endif -// AGOS stuffs -#ifndef DISABLE_AGOS -PROTO_GLOBALS(AGOS_AGOS) -PROTO_GLOBALS(AGOS_Cursor) -PROTO_GLOBALS(AGOS_Charset) -#endif -// Sky stuffs -#ifndef DISABLE_SKY -PROTO_GLOBALS(Sky_Hufftext) -#endif -// Queen stuffs -#ifndef DISABLE_QUEEN -PROTO_GLOBALS(Queen_Talk) -PROTO_GLOBALS(Queen_Display) -PROTO_GLOBALS(Queen_Graphics) -PROTO_GLOBALS(Queen_Restables) -PROTO_GLOBALS(Queen_Musicdata) -#endif -// Sword1 stuffs -#ifndef DISABLE_SWORD1 -PROTO_GLOBALS(Sword1_fxList) -#endif - -#undef PROTO_GLOBALS - -#endif diff --git a/backends/platform/PalmOS/Src/zodiac_event.cpp b/backends/platform/PalmOS/Src/zodiac_event.cpp index 84ecc27097..62abf8019d 100644 --- a/backends/platform/PalmOS/Src/zodiac_event.cpp +++ b/backends/platform/PalmOS/Src/zodiac_event.cpp @@ -74,7 +74,7 @@ bool OSystem_PalmZodiac::check_event(Common::Event &event, EventPtr ev) { // skip text case vchrActionDown: event.type = Common::EVENT_KEYDOWN; - event.kbd.keycode = '.'; + event.kbd.keycode = Common::KEYCODE_PERIOD; event.kbd.ascii = '.'; event.kbd.flags = 0; return true; diff --git a/backends/platform/PalmOS/Src/zodiac_gfx.cpp b/backends/platform/PalmOS/Src/zodiac_gfx.cpp index 23568ba5aa..7b59b1f8d1 100644 --- a/backends/platform/PalmOS/Src/zodiac_gfx.cpp +++ b/backends/platform/PalmOS/Src/zodiac_gfx.cpp @@ -27,9 +27,6 @@ #include "common/config-manager.h" #include "rumble.h" -#ifdef PALMOS_68K -#define _TwGfxOpen(x, y) TwGfxOpen((TwGfxHandle*)x, y); -#else static asm Err _TwGfxOpen(void **aResult, void *aInfoResult) { stmfd sp!, {r4-r11,lr} ldr r9, [r9] @@ -39,7 +36,6 @@ static asm Err _TwGfxOpen(void **aResult, void *aInfoResult) { mov r7, r1 ldr pc, =0x200995F0 } -#endif int OSystem_PalmZodiac::getDefaultGraphicsMode() const { return GFX_WIDE; @@ -71,6 +67,7 @@ void OSystem_PalmZodiac::load_gfx_mode() { _sysOldOrientation = SysGetOrientation(); SysSetOrientation(sysOrientationLandscape); + SysSetOrientationTriggerState(sysOrientationTriggerDisabled); gVars->indicator.on = RGBToColor(0,255,0); gVars->indicator.off = RGBToColor(0,0,0); diff --git a/backends/platform/PalmOS/Src/zodiac_overlay.cpp b/backends/platform/PalmOS/Src/zodiac_overlay.cpp index 3340abe582..33e5da2ac4 100644 --- a/backends/platform/PalmOS/Src/zodiac_overlay.cpp +++ b/backends/platform/PalmOS/Src/zodiac_overlay.cpp @@ -71,9 +71,6 @@ OverlayColor OSystem_PalmZodiac::RGBToColor(uint8 r, uint8 g, uint8 b) { } void OSystem_PalmZodiac::colorToRGB(OverlayColor color, uint8 &r, uint8 &g, uint8 &b) { -#ifdef PALMOS_68K - color = SWAP_BYTES_16(color); -#endif r = ((color >> 8) & 0xF8); g = ((color >> 3) & 0xFC); b = ((color << 3) & 0xF8); diff --git a/backends/platform/PalmOS/arm.bat b/backends/platform/PalmOS/arm.bat new file mode 100755 index 0000000000..539e4767c0 --- /dev/null +++ b/backends/platform/PalmOS/arm.bat @@ -0,0 +1,3 @@ +as.exe ../../../sound/rate_arm_asm.s -o Obj/rate_arm_asm.o +as.exe ../../../engines/scumm/gfxARM.s -o Obj/gfxARM.o +as.exe ../../../engines/scumm/smush/codec47ARM.s -o Obj/codec47ARM.o diff --git a/backends/platform/PalmOS/scummvm.mcp b/backends/platform/PalmOS/scummvm.mcp Binary files differindex 5dca766c86..95b020a677 100644 --- a/backends/platform/PalmOS/scummvm.mcp +++ b/backends/platform/PalmOS/scummvm.mcp diff --git a/backends/platform/ds/arm9/makefile b/backends/platform/ds/arm9/makefile index 7c93cc8b05..bfa0d61527 100644 --- a/backends/platform/ds/arm9/makefile +++ b/backends/platform/ds/arm9/makefile @@ -5,10 +5,12 @@ libndsdir = /home/neil/devkitpro/libnds # Select the build you want by uncommenting one of the following lines: -#DS_BUILD_A = 1 +DS_BUILD_A = 1 #DS_BUILD_B = 1 #DS_BUILD_C = 1 -DS_BUILD_D = 1 +#DS_BUILD_D = 1 +#DS_BUILD_E = 1 +#DS_BUILD_F = 1 #DS_BUILD_E = 1 #DS_BUILD_F = 1 @@ -38,6 +40,7 @@ VPATH = $(srcdir) # Command to build libmad is: # ./configure --host=arm-elf --enable-speed --enable-sso -enable-fpm=arm CFLAGS='-specs=ds_arm9.specs -mthumb-interwork' +USE_ARM_SOUND_ASM = 1 ARM = 1 ifdef DS_BUILD_A @@ -249,7 +252,7 @@ PRE_OBJS_FLAGS = -Wl,--whole-archive POST_OBJS_FLAGS = -Wl,--no-whole-archive endif -PORT_OBJS := $(portdir)/source/blitters.o $(portdir)/source/cdaudio.o $(portdir)/source/dsmain.o \ +PORT_OBJS := $(portdir)/source/blitters_arm.o $(portdir)/source/cdaudio.o $(portdir)/source/dsmain.o \ $(portdir)/../../../fs/ds/ds-fs.o $(portdir)/source/gbampsave.o $(portdir)/source/scummhelp.o\ $(portdir)/source/osystem_ds.o $(portdir)/source/portdefs.o $(portdir)/source/ramsave.o\ $(portdir)/source/scummconsole.o $(portdir)/source/touchkeyboard.o $(portdir)/source/zipreader.o\ @@ -423,8 +426,8 @@ endif #--------------------------------------------------------------------------------- %.nds: %.bin - @echo ndstool -c $@ -9 scummvm.bin $(ARM7BIN) -b ../../$(LOGO) "$(shell basename $@);ScummVM 0.10.0;DS Port" - ndstool -c $@ -9 scummvm.bin $(ARM7BIN) -b ../../$(LOGO) "$(shell basename $@);ScummVM 0.10.0;DS Port" + @echo ndstool -c $@ -9 scummvm.bin $(ARM7BIN) -b ../../$(LOGO) "$(shell basename $@);ScummVM 0.11.0;DS Port" + ndstool -c $@ -9 scummvm.bin $(ARM7BIN) -b ../../$(LOGO) "$(shell basename $@);ScummVM 0.11.0;DS Port" dsbuild $@ -l ../ndsloader.bin padbin 16 $(basename $@).ds.gba diff --git a/backends/platform/ds/arm9/source/blitters.cpp b/backends/platform/ds/arm9/source/blitters.cpp index ec33a5aab4..9af3c5d611 100644 --- a/backends/platform/ds/arm9/source/blitters.cpp +++ b/backends/platform/ds/arm9/source/blitters.cpp @@ -1,6 +1,8 @@ -/* ScummVM - Scumm Interpreter - * Copyright (C) 2005-2006 Neil Millstone - * Copyright (C) 2006 The ScummVM project +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/backends/platform/ds/arm9/source/dsmain.cpp b/backends/platform/ds/arm9/source/dsmain.cpp index aafa54e347..43008a1770 100644 --- a/backends/platform/ds/arm9/source/dsmain.cpp +++ b/backends/platform/ds/arm9/source/dsmain.cpp @@ -21,17 +21,6 @@ */ -// - Turn off when quit - Done -// - Simon and Kyrandia - Done -// - 200% scale option - Done -// - Change zoom range - Done -// - Speed increase! - Done -// - Fixed bugs in Sky - Done -// - Change name of ini file and intro screen for build c - Done -// - Check for existance of zip file in batch file - Done -// - Add new support - Done -// - Fix help screen - // - Remove scummconsole.c // - Delete files // - Fatlib conversion? @@ -39,38 +28,15 @@ // - libcartreset // - Alternative controls - tap for left click, double for right // - Inherit the Earth? -// - New Supercard, M3 drivers? // - Stereo audio? // - Delete saves? // - Software scaler? -// - 100% scale - -// - Arrow keys cause key events when keyboard enabled - Done -// - Mouse cursor display - Done -// - Disable scaler on options menu - Done -// - Fix scale icons on top screen - Done -// - Fseek optimisation? - No need -// - Fix agi hack to be cleaner - done -// - Fix not typing looong words - Done -// - Show keyboard by default in AGI games -// - Fix mouse moving when cursor on keyboard screen - Done -// - Fix 'fit' thingy always appearing - Done -// - check cine backbuffer code - Done -// - Add long filename support - Done -// - New icons -// - Add key config for gob engine: Start:F1, Shift-numbers: F keys - Done -// - Fix [ds] appearing in game menu - -// - Find out what's going wrong when you turn the console off -// - enable console when asserting - -// - AGI: Adding keyboard hack -// - CINE: Framebuffer modification should check if it works without, fix for overwrite crash -// - KYRA: GetFileSize modification - - -//#define USE_LIBCARTRESET -//#define USE_BUILT_IN_DRIVER_SELECTION + +// - Alternative controls? + + + +#define USE_LIBCARTRESET #include <nds.h> @@ -102,7 +68,7 @@ #include "cartreset_nolibfat.h" #include "keys.h" #include "profiler/cyg-profile.h" -//test +#include "blitters.h" namespace DS { @@ -245,7 +211,7 @@ gameListType gameList[NUM_SUPPORTED_GAMES] = { {"sky", CONT_SKY}, {"simon1", CONT_SIMON}, {"simon2", CONT_SIMON}, - {"gob", CONT_GOBLINS}, + {"gob1", CONT_SCUMM_ORIGINAL}, {"queen", CONT_SCUMM_ORIGINAL}, {"cine", CONT_FUTURE_WARS}, {"agi", CONT_AGI} @@ -441,7 +407,7 @@ void initGame() { //strcpy(gameName, ConfMan.getActiveDomain().c_str()); strcpy(gameName, ConfMan.get("gameid").c_str()); - //consolePrintf("\n\n\n\nCurrent game: '%s' %d\n", gameName, gameName[0]); + consolePrintf("\n\n\n\nCurrent game: '%s' %d\n", gameName, gameName[0]); currentGame = &gameList[0]; // Default game @@ -962,25 +928,25 @@ void addIndyFightingKeys() { if ((getKeysChanged() & KEY_UP)) { event.type = getKeyEvent(KEY_UP); - event.kbd.keycode = '8'; + event.kbd.keycode = Common::KEYCODE_8; event.kbd.ascii = '8'; system->addEvent(event); } if ((getKeysChanged() & KEY_LEFT)) { event.type = getKeyEvent(KEY_LEFT); - event.kbd.keycode = '4'; + event.kbd.keycode = Common::KEYCODE_4; event.kbd.ascii = '4'; system->addEvent(event); } if ((getKeysChanged() & KEY_RIGHT)) { event.type = getKeyEvent(KEY_RIGHT); - event.kbd.keycode = '6'; + event.kbd.keycode = Common::KEYCODE_6; event.kbd.ascii = '6'; system->addEvent(event); } if ((getKeysChanged() & KEY_DOWN)) { event.type = getKeyEvent(KEY_DOWN); - event.kbd.keycode = '2'; + event.kbd.keycode = Common::KEYCODE_2; event.kbd.ascii = '2'; system->addEvent(event); } @@ -989,19 +955,19 @@ void addIndyFightingKeys() { if ((getKeysChanged() & KEY_X)) { event.type = getKeyEvent(KEY_X); - event.kbd.keycode = '9'; + event.kbd.keycode = Common::KEYCODE_9; event.kbd.ascii = '9'; system->addEvent(event); } if ((getKeysChanged() & KEY_A)) { event.type = getKeyEvent(KEY_A); - event.kbd.keycode = '6'; + event.kbd.keycode = Common::KEYCODE_6; event.kbd.ascii = '6'; system->addEvent(event); } if ((getKeysChanged() & KEY_B)) { event.type = getKeyEvent(KEY_B); - event.kbd.keycode = '3'; + event.kbd.keycode = Common::KEYCODE_3; event.kbd.ascii = '3'; system->addEvent(event); } @@ -1010,19 +976,19 @@ void addIndyFightingKeys() { if ((getKeysChanged() & KEY_X)) { event.type = getKeyEvent(KEY_X); - event.kbd.keycode = '7'; + event.kbd.keycode = Common::KEYCODE_7; event.kbd.ascii = '7'; system->addEvent(event); } if ((getKeysChanged() & KEY_A)) { event.type = getKeyEvent(KEY_A); - event.kbd.keycode = '4'; + event.kbd.keycode = Common::KEYCODE_4; event.kbd.ascii = '4'; system->addEvent(event); } if ((getKeysChanged() & KEY_B)) { event.type = getKeyEvent(KEY_B); - event.kbd.keycode = '1'; + event.kbd.keycode = Common::KEYCODE_1; event.kbd.ascii = '1'; system->addEvent(event); } @@ -1032,7 +998,7 @@ void addIndyFightingKeys() { if ((getKeysChanged() & KEY_Y)) { event.type = getKeyEvent(KEY_Y); - event.kbd.keycode = '5'; + event.kbd.keycode = Common::KEYCODE_5; event.kbd.ascii = '5'; system->addEvent(event); } @@ -1143,7 +1109,7 @@ void addEventsToQueue() { if (!indyFightState) { if ((!(getKeysHeld() & KEY_L)) && (!(getKeysHeld() & KEY_R)) && (getKeysChanged() & KEY_B)) { - event.kbd.keycode = 27; + event.kbd.keycode = Common::KEYCODE_ESCAPE; event.kbd.ascii = 27; event.kbd.flags = 0; @@ -1168,26 +1134,26 @@ void addEventsToQueue() { event.kbd.flags = 0; if (getKeysChanged() & KEY_LEFT) { - event.kbd.keycode = SDLK_LEFT; - event.kbd.ascii = SDLK_LEFT; + event.kbd.keycode = Common::KEYCODE_LEFT; + event.kbd.ascii = 0; event.type = getKeyEvent(KEY_LEFT); } if (getKeysChanged() & KEY_RIGHT) { - event.kbd.keycode = SDLK_RIGHT; - event.kbd.ascii = SDLK_RIGHT; + event.kbd.keycode = Common::KEYCODE_RIGHT; + event.kbd.ascii = 0; event.type = getKeyEvent(KEY_RIGHT); } if (getKeysChanged() & KEY_UP) { - event.kbd.keycode = SDLK_UP; - event.kbd.ascii = SDLK_UP; + event.kbd.keycode = Common::KEYCODE_UP; + event.kbd.ascii = 0; event.type = getKeyEvent(KEY_UP); } if (getKeysChanged() & KEY_DOWN) { - event.kbd.keycode = SDLK_DOWN; - event.kbd.ascii = SDLK_DOWN; + event.kbd.keycode = Common::KEYCODE_DOWN; + event.kbd.ascii = 0; event.type = getKeyEvent(KEY_DOWN); } @@ -1323,8 +1289,8 @@ void addEventsToQueue() { Common::Event event; event.type = getKeyEvent(KEY_DOWN); - event.kbd.keycode = '#'; // F10 or # - show hotspots - event.kbd.ascii = '#'; + event.kbd.keycode = Common::KEYCODE_F10; // F10 or # - show hotspots + event.kbd.ascii = Common::ASCII_F10; event.kbd.flags = 0; system->addEvent(event); // consolePrintf("F10\n"); @@ -1337,7 +1303,7 @@ void addEventsToQueue() { Common::Event event; event.type = getKeyEvent(KEY_DOWN); - event.kbd.keycode = '.'; // Full stop - skips current dialogue line + event.kbd.keycode = Common::KEYCODE_PERIOD; // Full stop - skips current dialogue line event.kbd.ascii = '.'; event.kbd.flags = 0; system->addEvent(event); @@ -1397,6 +1363,7 @@ void addEventsToQueue() { // consolePrintf("!!!!!F5!!!!!"); } event.kbd.flags = 0; + consolePrintf("!!!!!F5!!!!!"); system->addEvent(event); } diff --git a/backends/platform/ds/arm9/source/dsoptions.cpp b/backends/platform/ds/arm9/source/dsoptions.cpp index b29b1d9fa7..041b1ba0c6 100644 --- a/backends/platform/ds/arm9/source/dsoptions.cpp +++ b/backends/platform/ds/arm9/source/dsoptions.cpp @@ -197,7 +197,7 @@ void togglePause() { OSystem_DS* system = OSystem_DS::instance(); event.type = Common::EVENT_KEYDOWN; - event.kbd.keycode = 'p'; + event.kbd.keycode = Common::KEYCODE_p; event.kbd.ascii = 'p'; event.kbd.flags = 0; system->addEvent(event); diff --git a/backends/platform/ds/arm9/source/osystem_ds.cpp b/backends/platform/ds/arm9/source/osystem_ds.cpp index 32eafe1af7..39413d0723 100644 --- a/backends/platform/ds/arm9/source/osystem_ds.cpp +++ b/backends/platform/ds/arm9/source/osystem_ds.cpp @@ -152,6 +152,24 @@ void OSystem_DS::setPalette(const byte *colors, uint start, uint num) { } } +bool OSystem_DS::grabRawScreen(Graphics::Surface* surf) { + surf->create(DS::getGameWidth(), DS::getGameHeight(), 1); + + // Ensure we copy using 16 bit quantities due to limitation of VRAM addressing + + + u16* image = (u16 *) DS::get8BitBackBuffer(); + for (int y = 0; y < DS::getGameHeight(); y++) + { + DC_FlushRange(image + (y << 8), DS::getGameWidth()); + for (int x = 0; x < DS::getGameWidth() >> 1; x++) + { + *(((u16 *) (surf->pixels)) + y * (DS::getGameWidth() >> 1) + x) = image[y << 8 + x]; + } + } + + return true; +} void OSystem_DS::grabPalette(unsigned char *colors, uint start, uint num) { // consolePrintf("Grabpalette"); @@ -325,7 +343,7 @@ bool OSystem_DS::pollEvent(Common::Event &event) // So we make it something harmless which won't cause any adverse effects. event.type = Common::EVENT_KEYUP; event.kbd.ascii = 0; - event.kbd.keycode = 0; + event.kbd.keycode = Common::KEYCODE_INVALID; event.kbd.flags = 0; // consolePrintf("type: %d\n", event.type); return false; @@ -478,25 +496,36 @@ Common::SaveFileManager* OSystem_DS::getSavefileManager() } } -bool OSystem_DS::grabRawScreen(Graphics::Surface* surf) { - surf->create(DS::getGameWidth(), DS::getGameHeight(), 1); +Graphics::Surface *OSystem_DS::lockScreen() { +/* // For now, we create a full temporary screen surface, to which we copy the + // the screen content. Later unlockScreen will copy everything back. + // Not very nice nor efficient, but at least works, and is not worse + // than in the bad old times where we used grabRawScreen + copyRectToScreen. + + _framebuffer.create(DS::getGameWidth(), DS::getGameHeight(), 1); // Ensure we copy using 16 bit quantities due to limitation of VRAM addressing - size_t imageStrideInBytes = DS::isCpuScalerEnabled()? DS::getGameWidth() : 512; - size_t imageStrideInWords = imageStrideInBytes / 2; u16* image = (u16 *) DS::get8BitBackBuffer(); for (int y = 0; y < DS::getGameHeight(); y++) { - DC_FlushRange(image + (y * imageStrideInWords), DS::getGameWidth()); + DC_FlushRange(image + (y << 8), DS::getGameWidth()); for (int x = 0; x < DS::getGameWidth() >> 1; x++) { - *(((u16 *) (surf->pixels)) + y * (DS::getGameWidth() >> 1) + x) = image[y * imageStrideInWords + x]; + *(((u16 *) (_framebuffer.pixels)) + y * (DS::getGameWidth() >> 1) + x) = image[y << 8 + x]; } } - return true; + return &_framebuffer;*/ +} + +void OSystem_DS::unlockScreen() { +/* // Copy temp framebuffer back to screen + copyRectToScreen((byte *)_framebuffer.pixels, _framebuffer.pitch, 0, 0, _framebuffer.w, _framebuffer.h); + + // Free memory + _framebuffer.free(); */ } void OSystem_DS::setFocusRectangle(const Common::Rect& rect) { @@ -524,3 +553,5 @@ OSystem *OSystem_DS_create() { return new OSystem_DS(); } + + diff --git a/backends/platform/ds/arm9/source/osystem_ds.h b/backends/platform/ds/arm9/source/osystem_ds.h index d943a362ca..512617170b 100644 --- a/backends/platform/ds/arm9/source/osystem_ds.h +++ b/backends/platform/ds/arm9/source/osystem_ds.h @@ -31,6 +31,7 @@ #include "backends/saves/default/default-saves.h" #include "backends/timer/default/default-timer.h" #include "sound/mixer.h" +#include "graphics/surface.h" class DSAudioMixer : public Audio::Mixer { }; @@ -53,9 +54,12 @@ public: GBAMPSaveFileManager mpSaveManager; DSAudioMixer* _mixer; DSTimerManager* _timer; + Graphics::Surface _framebuffer; + static OSystem_DS* _instance; + typedef void (*SoundProc)(void *param, byte *buf, int len); typedef int (*TimerProc)(int interval); @@ -137,6 +141,9 @@ public: virtual void initBackend(); + virtual Graphics::Surface *lockScreen(); + virtual void unlockScreen(); + virtual Audio::Mixer* getMixer() { return _mixer; } virtual Common::TimerManager* getTimerManager() { return _timer; } static int timerHandler(int t); diff --git a/backends/platform/ds/arm9/source/touchkeyboard.cpp b/backends/platform/ds/arm9/source/touchkeyboard.cpp index 26f03ca9d1..26807bfa6a 100644 --- a/backends/platform/ds/arm9/source/touchkeyboard.cpp +++ b/backends/platform/ds/arm9/source/touchkeyboard.cpp @@ -338,7 +338,7 @@ void updateTypeEvents() Common::Event event; OSystem_DS* system = OSystem_DS::instance(); - event.kbd.keycode = autoCompleteBuffer[0]; + event.kbd.keycode = (Common::KeyCode) autoCompleteBuffer[0]; event.kbd.ascii = autoCompleteBuffer[0]; event.type = Common::EVENT_KEYDOWN; event.kbd.flags = 0; @@ -402,9 +402,9 @@ void addKeyboardEvents() { if (!DS::shiftState) { event.kbd.ascii = keys[r].character; - event.kbd.keycode = 0; + event.kbd.keycode = Common::KEYCODE_INVALID; } else { - event.kbd.keycode = SDLK_F1 - (keys[r].character - '1'); + event.kbd.keycode = (Common::KeyCode) (Common::KEYCODE_F1 - (keys[r].character - '1')); event.kbd.ascii = 0; } @@ -416,10 +416,10 @@ void addKeyboardEvents() { event.kbd.ascii = keys[r].character; } - event.kbd.keycode = event.kbd.ascii; + event.kbd.keycode = (Common::KeyCode) event.kbd.ascii; } else { event.kbd.ascii = keys[r].character; - event.kbd.keycode = keys[r].character; + event.kbd.keycode = (Common::KeyCode) keys[r].character; } diff --git a/backends/platform/gp2x/gp2x-common.h b/backends/platform/gp2x/gp2x-common.h index a48239222b..1812fdd8d9 100644 --- a/backends/platform/gp2x/gp2x-common.h +++ b/backends/platform/gp2x/gp2x-common.h @@ -165,7 +165,7 @@ public: void hideOverlay(); void clearOverlay(); void grabOverlay(OverlayColor *buf, int pitch); - void copyRectToOverlay(const OverlayColor *buf, int pitch, int x, int y, int w, int h); // WinCE FIXME + void copyRectToOverlay(const OverlayColor *buf, int pitch, int x, int y, int w, int h); int16 getHeight(); int16 getWidth(); int16 getOverlayHeight() { return _overlayHeight; } diff --git a/backends/platform/gp32/gp32std_file.cpp b/backends/platform/gp32/gp32std_file.cpp index 9269d69617..fcd9acf4da 100644 --- a/backends/platform/gp32/gp32std_file.cpp +++ b/backends/platform/gp32/gp32std_file.cpp @@ -224,6 +224,8 @@ size_t gp_fread(void *ptr, size_t size, size_t n, GPFILE *stream) { stream->filePos += len; #endif + // FIXME: Fingolfin asks: why is there a FIXME here? Please either clarify what + // needs fixing, or remove it! return 1; //readcount / size; //FIXME } diff --git a/backends/platform/morphos/MorphOS.readme b/backends/platform/morphos/MorphOS.readme deleted file mode 100644 index 201c8f32b8..0000000000 --- a/backends/platform/morphos/MorphOS.readme +++ /dev/null @@ -1,13 +0,0 @@ -This directory contains the source for the MorphOS port of ScummVM. To build, you -must have a proper Geek Gadgets installation. If you don't have the includes for -Etude and cdda.library, check my webpage. If they aren't uploaded yet, feel free -to e-mail me. - -You don't have to build ScummVM yourself. The latest official and CVS binaries are -available from my website at: - -http://www.muenster.de/~tomjoad/scummvm.html - -Ruediger Hanke -tomjoad@muenster.de - diff --git a/backends/platform/morphos/morphos.cpp b/backends/platform/morphos/morphos.cpp deleted file mode 100644 index 7375ecbe46..0000000000 --- a/backends/platform/morphos/morphos.cpp +++ /dev/null @@ -1,1649 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * MorphOS interface - * - * $URL$ - * $Id$ - * - */ - -#include "common/stdafx.h" -#include "engines/engine.h" -#include "common/events.h" -#include "common/util.h" -#include "scumm/scumm.h" - -#include <exec/types.h> -#include <exec/memory.h> -#include <exec/libraries.h> -#include <exec/semaphores.h> -#include <devices/ahi.h> -#include <devices/rawkeycodes.h> -#include <dos/dostags.h> -#include <intuition/screens.h> -#include <cybergraphics/cybergraphics.h> -#include <devices/input.h> -#include <devices/inputevent.h> -#include <intuition/intuition.h> - -#include <clib/alib_protos.h> -#include <proto/exec.h> -#include <proto/dos.h> -#include <proto/graphics.h> -#include <proto/intuition.h> -#include <proto/keymap.h> -#include <proto/timer.h> -#include <proto/cdda.h> -#include <proto/cybergraphics.h> - -#include <time.h> - -#include "morphos.h" -#include "morphos_sound.h" -#include "morphos_scaler.h" - -static TagItem PlayTags[] = { { CDPA_StartTrack, 1 }, - { CDPA_StartFrame, 0 }, - { CDPA_EndTrack, 1 }, - { CDPA_EndFrame, 0 }, - { CDPA_Loops, 1 }, - { TAG_DONE, 0 } - }; - -static CONST_STRPTR MonkeyCDIDs[] = { "ID2500496F035CBC", "ID250040360345DB", NULL }; -static CONST_STRPTR LoomCDIDs[] = { NULL }; -static CONST_STRPTR MonkeyNames[] = { "Monkey1CD", "Madness", NULL }; -static CONST_STRPTR LoomNames[] = { "LoomCD", NULL }; - -#define BLOCKSIZE_X 32 -#define BLOCKSIZE_Y 8 - -#define BLOCKS_X (ScummBufferWidth/BLOCKSIZE_X) -#define BLOCKS_Y (ScummBufferHeight/BLOCKSIZE_Y) -#define BLOCK_ID(x, y) ((y/BLOCKSIZE_Y)*BLOCKS_X+(x/BLOCKSIZE_X)) - -OSystem_MorphOS *OSystem_MorphOS::create(SCALERTYPE gfx_scaler, bool full_screen) -{ - OSystem_MorphOS *syst = new OSystem_MorphOS(gfx_scaler, full_screen); - - if (!syst || !syst->Initialise()) - { - delete syst; - error("Failed to create system object. Exiting."); - } - - return syst; -} - -OSystem_MorphOS::OSystem_MorphOS(SCALERTYPE gfx_mode, bool full_screen) -{ - ScummScreen = NULL; - ScummWindow = NULL; - ScummBuffer = NULL; - ScummScreenBuffer[0] = NULL; - ScummScreenBuffer[1] = NULL; - ScummRenderTo = NULL; - ScummNoCursor = NULL; - ScummSoundThread = NULL; - ScummWinX = -1; - ScummWinY = -1; - ScummDefaultMouse = false; - ScummOrigMouse = false; - ScummShakePos = 0; - ScummScaler = gfx_mode; - ScummScale = (gfx_mode == ST_NONE) ? 0 : 1; - ScummDepth = 0; - Scumm16ColFmt16 = false; - ScummScrWidth = 0; - ScummScrHeight = 0; - ScreenChanged = false; - DirtyBlocks = NULL; - BlockColors = NULL; - UpdateRects = 0; - Scaler = NULL; - FullScreenMode = full_screen; - CDrive = NULL; - CDDATrackOffset = 0; - strcpy(ScummWndTitle, "ScummVM MorphOS"); - TimerMsgPort = NULL; - TimerIORequest = NULL; - InputMsgPort = NULL; - InputIORequest = NULL; - ThreadPort = NULL; - OvlCMap = NULL; - OvlBitMap = NULL; - OvlSavedBuffer = NULL; - TimerBase = NULL; - ScummNoCursor = NULL; - UpdateRegion = NULL; - NewUpdateRegion = NULL; - MouseImage = NULL; -} - -bool OSystem_MorphOS::Initialise() -{ - OpenATimer(&TimerMsgPort, (IORequest **) &TimerIORequest, UNIT_MICROHZ); - - if ((InputMsgPort = CreateMsgPort())) - { - if ((InputIORequest = (IOStdReq*) CreateIORequest(InputMsgPort, sizeof (IOStdReq)))) - { - if ((OpenDevice("input.device", NULL, (IORequest *) InputIORequest, NULL))) - { - DeleteIORequest(InputIORequest); - DeleteMsgPort(InputMsgPort); - InputIORequest = NULL; - InputMsgPort = NULL; - } - } - else - { - DeleteMsgPort(InputMsgPort); - InputMsgPort = NULL; - } - } - - if (!InputIORequest) - { - warning("input.device could not be opened"); - return false; - } - - ThreadPort = CreateMsgPort(); - if (!ThreadPort) - { - warning("Unable to create a message port"); - return false; - } - - OvlCMap = GetColorMap(256); - - InitSemaphore(&CritSec); - - TimerBase = (Library*) TimerIORequest->tr_node.io_Device; - ScummNoCursor = (UWORD *) AllocVec(16, MEMF_CLEAR); - UpdateRegion = NewRegion(); - NewUpdateRegion = NewRegion(); - if (!UpdateRegion || !NewUpdateRegion) - { - warning("Could not create region for screen update"); - return false; - } - if (!OvlCMap) - { - warning("Could not allocate overlay color map"); - return false; - } - if (!ScummNoCursor) - { - warning("Could not allocate empty cursor image"); - return false; - } - - return true; -} - -OSystem_MorphOS::~OSystem_MorphOS() -{ - if (DirtyBlocks) - { - FreeVec(DirtyBlocks); - - for (int b = 0; b < BLOCKS_X*BLOCKS_Y; b++) - FreeVec(BlockColors[b]); - FreeVec(BlockColors); - } - - if (OvlCMap) - FreeColorMap(OvlCMap); - - delete Scaler; - - if (UpdateRegion) - DisposeRegion(UpdateRegion); - - if (NewUpdateRegion) - DisposeRegion(NewUpdateRegion); - - if (ThreadPort) - DeleteMsgPort(ThreadPort); - - if (CDrive && CDDABase) - { - CDDA_Stop(CDrive); - CDDA_ReleaseDrive(CDrive); - } - - if (InputIORequest) - { - CloseDevice((IORequest *) InputIORequest); - DeleteIORequest((IORequest *) InputIORequest); - } - - if (InputMsgPort) - DeleteMsgPort(InputMsgPort); - - if (TimerIORequest) - { - CloseDevice((IORequest *) TimerIORequest); - DeleteIORequest((IORequest *) TimerIORequest); - } - - if (TimerMsgPort) - DeleteMsgPort(TimerMsgPort); - - if (ScummNoCursor) - FreeVec(ScummNoCursor); - - if (ScummBuffer) - FreeVec(ScummBuffer); - - if (OvlSavedBuffer) - FreeVec(OvlSavedBuffer); - - if (ScummRenderTo && !ScummScreen) - FreeBitMap(ScummRenderTo); - - if (OvlBitMap) - FreeVec(OvlBitMap); - - if (ScummWindow) - CloseWindow(ScummWindow); - - if (ScummScreen) - { - if (ScummScreenBuffer[0]) - FreeScreenBuffer(ScummScreen, ScummScreenBuffer[0]); - if( ScummScreenBuffer[1] ) - FreeScreenBuffer(ScummScreen, ScummScreenBuffer[1]); - CloseScreen(ScummScreen); - } -} - -bool OSystem_MorphOS::OpenATimer(MsgPort **port, IORequest **req, ULONG unit, bool required) -{ - *req = NULL; - const char *err_msg = NULL; - - *port = CreateMsgPort(); - if (*port) - { - *req = (IORequest *) CreateIORequest(*port, sizeof (timerequest)); - if (*req) - { - if (OpenDevice(TIMERNAME, unit, *req, 0)) - { - DeleteIORequest(*req); - *req = NULL; - err_msg = "Failed to open timer device"; - } - } - else - err_msg = "Failed to create IO request"; - } - else - err_msg = "Failed to create message port"; - - if (err_msg) - { - if (required) - error(err_msg); - warning(err_msg); - } - - return *req != NULL; -} - -uint32 OSystem_MorphOS::getMillis() -{ - int ticks = clock(); - ticks *= (1000/CLOCKS_PER_SEC); - return ticks; -} - -void OSystem_MorphOS::delayMillis(uint msecs) -{ -/* TimerIORequest->tr_node.io_Command = TR_ADDREQUEST; - TimerIORequest->tr_time.tv_secs = 0; - TimerIORequest->tr_time.tv_micro = msecs*1000; - DoIO((IORequest *) TimerIORequest);*/ - TimeDelay(UNIT_MICROHZ, 0, msecs*1000); -} - -void OSystem_MorphOS::setTimerCallback(TimerProc callback, int timer) -{ - warning("setTimerCallback() unexpectedly called"); -} - -OSystem::MutexRef OSystem_MorphOS::createMutex() -{ - SignalSemaphore *sem = (SignalSemaphore *) AllocVec(sizeof (SignalSemaphore), MEMF_PUBLIC); - - if (sem) - InitSemaphore(sem); - - return (MutexRef)sem; -} - -void OSystem_MorphOS::lockMutex(MutexRef mutex) -{ - ObtainSemaphore((SignalSemaphore *) mutex); -} - -void OSystem_MorphOS::unlockMutex(MutexRef mutex) -{ - ReleaseSemaphore((SignalSemaphore *)mutex); -} - -void OSystem_MorphOS::deleteMutex(MutexRef mutex) -{ - FreeVec(mutex); -} - -uint32 OSystem_MorphOS::property(int param, Property *value) -{ - AUTO_LOCK - - switch (param) - { - case PROP_GET_FULLSCREEN: - return ScummScreen != NULL; - - case PROP_TOGGLE_FULLSCREEN: - CreateScreen(CSDSPTYPE_TOGGLE); - return 1; - - case PROP_SET_WINDOW_CAPTION: - sprintf(ScummWndTitle, "ScummVM MorphOS - %s", value->caption); - if (ScummWindow) - SetWindowTitles(ScummWindow, ScummWndTitle, ScummWndTitle); - return 1; - - case PROP_OPEN_CD: - { - CONST_STRPTR *ids = NULL, *names = NULL; - - if (g_scumm) - GameID = g_scumm->_gameId; - - switch (GameID) - { - case GID_MONKEY: - case GID_MONKEY_SEGA: - ids = MonkeyCDIDs; - names = MonkeyNames; - break; - - case GID_LOOM256: - ids = LoomCDIDs; - names = LoomNames; - break; - } - - if (!CDDABase) CDDABase = OpenLibrary("cdda.library", 2); - if (CDDABase) - { - CDrive = NULL; - if (ids) - { - int i = 0; - - while (ids[i] && !CDrive) - { - TagItem FindCDTags[] = { { CDFA_CDID, (ULONG) ids[i] }, - { TAG_DONE, 0 } - }; - CDrive = CDDA_FindNextDriveA(NULL, FindCDTags); - i++; - } - } - - if (!CDrive && names) - { - int i = 0; - - while (names[i] && !CDrive) - { - TagItem FindCDTags[] = { { CDFA_VolumeName, (ULONG) names[i] }, - { TAG_DONE, 0 } - }; - CDrive = CDDA_FindNextDriveA(NULL, FindCDTags); - i++; - } - } - - if (CDrive) - { - if (!CDDA_ObtainDriveA(CDrive, CDDA_SHARED_ACCESS, NULL)) - { - CDrive = NULL; - warning("Failed to obtain CD drive - music will not play"); - } - else if (GameID == GID_LOOM256) - { - // Offset correction *may* be required - CDS_TrackInfo ti = { sizeof (CDS_TrackInfo) }; - - if (CDDA_GetTrackInfo(CDrive, 1, 0, &ti)) - CDDATrackOffset = ti.ti_TrackStart.tm_Format.tm_Frame-22650; - } - } - else - warning( "Could not find game CD inserted in CD-ROM drive - cd audio will not play" ); - } - else - warning( "Failed to open cdda.library - cd audio will not play" ); - break; - } - - case PROP_GET_SAMPLE_RATE: - return SAMPLES_PER_SEC; - } - - return 0; -} - -void OSystem_MorphOS::playCD(int track, int num_loops, int start_frame, int duration) -{ - if (CDrive && start_frame >= 0) - { - if (start_frame > 0) - start_frame -= CDDATrackOffset; - - PlayTags[0].ti_Data = track; - PlayTags[1].ti_Data = start_frame; - PlayTags[2].ti_Data = (duration == 0) ? track+1 : track; - PlayTags[3].ti_Data = duration ? start_frame+duration : 0; - PlayTags[4].ti_Data = (num_loops == 0) ? 1 : num_loops; - CDDA_PlayA(CDrive, PlayTags); - } -} - -void OSystem_MorphOS::stopCD() -{ - if (CDrive) - CDDA_Stop(CDrive); -} - -bool OSystem_MorphOS::pollCD() -{ - ULONG status; - - if (CDrive == NULL) - return false; - - CDDA_GetAttr(CDDA_Status, CDrive, &status); - return status == CDDA_Status_Busy; -} - -void OSystem_MorphOS::updateCD() -{ -} - -void OSystem_MorphOS::quit() -{ - int num_threads = 0; - - if (ScummSoundThread) - { - num_threads++; - Signal((Task *) ScummSoundThread, SIGBREAKF_CTRL_C); - ScummSoundThread = NULL; - } - - // TODO: this code could probably greatly simplified now that there is - // only one thread left... - while (num_threads > 0) - { - Message* msg; - - WaitPort(ThreadPort); - while (msg = GetMsg(ThreadPort)) - num_threads--; - } - - exit(0); -} - -#define CVT8TO32(col) ((col<<24) | (col<<16) | (col<<8) | col) - -void OSystem_MorphOS::setPalette(const byte *colors, uint start, uint num) -{ - const byte *data = colors; - UWORD changed_colors[256]; - UWORD num_changed = 0; - - for (uint i = start; i != start+num; i++) - { - ULONG color32 = (data[0] << 16) | (data[1] << 8) | data[2]; - if (color32 != ScummColors[i]) - { - if (ScummDepth == 8) - SetRGB32(&ScummScreen->ViewPort, i, CVT8TO32(data[0]), CVT8TO32(data[1]), CVT8TO32(data[2])); - ScummColors16[i] = Scumm16ColFmt16 ? (((data[0]*31)/255) << 11) | (((data[1]*63)/255) << 5) | ((data[ 2 ]*31)/255) : (((data[0]*31)/255) << 10) | (((data[1]*31)/255) << 5) | ((data[2]*31)/255); - ScummColors[i] = color32; - changed_colors[num_changed++] = i; - } - data += 4; - } - - if (ScummScale || ScummDepth != 8) - { - if (DirtyBlocks && num_changed < 200) - { - for (int b = 0; b < BLOCKS_X*BLOCKS_Y; b++) - { - UWORD *block_colors = BlockColors[b]; - UWORD *color_ptr = changed_colors; - for (int c = 0; c < num_changed; c++) - { - if (block_colors[*color_ptr++]) - { - UWORD x, y; - x = b % BLOCKS_X; - y = b / BLOCKS_X; - DirtyBlocks[b] = true; - AddUpdateRect(x*BLOCKSIZE_X, y*BLOCKSIZE_Y, BLOCKSIZE_X, BLOCKSIZE_Y); - break; - } - } - } - } - else - AddUpdateRect(0, 0, ScummBufferWidth, ScummBufferHeight); - } -} - -void OSystem_MorphOS::CreateScreen(CS_DSPTYPE dspType) -{ - LONG mode = INVALID_ID; - int depths[] = { 8, 32, 16, 15, 0 }; - int i; - Screen *wb = NULL; - - if (dspType != CSDSPTYPE_KEEP) - FullScreenMode = (dspType == CSDSPTYPE_FULLSCREEN) || (dspType == CSDSPTYPE_TOGGLE && !FullScreenMode); - - if (ScummRenderTo && !ScummScreen) - FreeBitMap(ScummRenderTo); - ScummRenderTo = NULL; - - if (ScummWindow) - { - if (ScummScreen == NULL) - { - ScummWinX = ScummWindow->LeftEdge; - ScummWinY = ScummWindow->TopEdge; - } - CloseWindow (ScummWindow); - ScummWindow = NULL; - } - - if (ScummScreen) - { - if (ScummScreenBuffer[0]) - FreeScreenBuffer(ScummScreen, ScummScreenBuffer[0]); - if (ScummScreenBuffer[1]) - FreeScreenBuffer(ScummScreen, ScummScreenBuffer[1]); - CloseScreen(ScummScreen); - ScummScreen = NULL; - } - - ScummScrWidth = ScummBufferWidth << ScummScale; - ScummScrHeight = ScummBufferHeight << ScummScale; - - if (FullScreenMode) - { - for (i = ScummScale; mode == INVALID_ID && depths[i]; i++) - mode = BestCModeIDTags(CYBRBIDTG_NominalWidth, ScummScrWidth, - CYBRBIDTG_NominalHeight, ScummScrHeight, - CYBRBIDTG_Depth, depths[i], - TAG_DONE - ); - ScummDepth = depths[i-1]; - - if (mode == INVALID_ID) - error("Could not find suitable screenmode"); - - ScummScreen = OpenScreenTags(NULL, SA_AutoScroll, TRUE, - SA_Depth, ScummDepth, - SA_Width, STDSCREENWIDTH, - SA_Height, STDSCREENHEIGHT, - SA_DisplayID, mode, - SA_ShowTitle, FALSE, - SA_Type, CUSTOMSCREEN, - SA_Title, "ScummVM MorphOS", - TAG_DONE - ); - - if (ScummScreen == NULL) - error("Failed to open screen"); - - LONG RealDepth = GetBitMapAttr(&ScummScreen->BitMap, BMA_DEPTH); - if (RealDepth != ScummDepth) - { - warning("Screen did not open in expected depth"); - ScummDepth = RealDepth; - } - ScummScreenBuffer[0] = AllocScreenBuffer(ScummScreen, NULL, SB_SCREEN_BITMAP); - ScummScreenBuffer[1] = AllocScreenBuffer(ScummScreen, NULL, 0); - ScummRenderTo = ScummScreenBuffer[1]->sb_BitMap; - ScummPaintBuffer = 1; - - if (ScummScreenBuffer[0] == NULL || ScummScreenBuffer[1] == NULL) - error("Failed to allocate screen buffer"); - - // Make both buffers black to avoid grey strip on bottom of screen - RastPort rp; - InitRastPort(&rp); - SetRGB32(&ScummScreen->ViewPort, 0, 0, 0, 0); - rp.BitMap = ScummScreenBuffer[0]->sb_BitMap; - FillPixelArray(&ScummScreen->RastPort, 0, 0, ScummScreen->Width, ScummScreen->Height, 0); - rp.BitMap = ScummRenderTo; - FillPixelArray(&rp, 0, 0, ScummScreen->Width, ScummScreen->Height, 0); - - if (ScummDepth == 8) - { - for (int color = 0; color < 256; color++) - { - ULONG r, g, b; - - r = (ScummColors[color] >> 16) & 0xff; - g = (ScummColors[color] >> 8) & 0xff; - b = (ScummColors[color] >> 0) & 0xff; - SetRGB32(&ScummScreen->ViewPort, color, CVT8TO32(r), CVT8TO32(g), CVT8TO32(b)); - } - } - } - else - { - wb = LockPubScreen(NULL); - if (wb == NULL) - error("Could not lock default public screen"); - - ScreenToFront(wb); - } - - ScummWindow = OpenWindowTags(NULL, WA_Left, (wb && ScummWinX >= 0) ? ScummWinX : 0, - WA_Top, wb ? ((ScummWinY >= 0) ? ScummWinY : wb->BarHeight+1) : 0, - WA_InnerWidth, FullScreenMode ? ScummScreen->Width : ScummScrWidth, - WA_InnerHeight, FullScreenMode ? ScummScreen->Height : ScummScrHeight, - WA_Activate, TRUE, - WA_Title, wb ? ScummWndTitle : NULL, - WA_ScreenTitle, wb ? ScummWndTitle : NULL, - WA_Borderless, FullScreenMode, - WA_CloseGadget, !FullScreenMode, - WA_DepthGadget, !FullScreenMode, - WA_DragBar, !FullScreenMode, - WA_ReportMouse, TRUE, - WA_RMBTrap, TRUE, - WA_IDCMP, IDCMP_RAWKEY | - IDCMP_MOUSEMOVE | - IDCMP_CLOSEWINDOW | - IDCMP_MOUSEBUTTONS, - WA_CustomScreen, FullScreenMode ? (ULONG)ScummScreen : (ULONG)wb, - TAG_DONE - ); - - if (wb) - UnlockPubScreen(NULL, wb); - - if (ScummWindow == NULL) - error("Failed to open window"); - - if (!ScummDefaultMouse) - { - SetPointer(ScummWindow, ScummNoCursor, 1, 1, 0, 0); - ScummOrigMouse = false; - } - - if (ScummScreen == NULL) - { - ScummDepth = GetCyberMapAttr(ScummWindow->RPort->BitMap, CYBRMATTR_DEPTH); - if (ScummDepth == 8) - error("Default public screen must be 15 bit or higher if you want to play in window mode"); - - ScummRenderTo = AllocBitMap(ScummScrWidth, ScummScrHeight, ScummDepth, BMF_MINPLANES, ScummWindow->RPort->BitMap); - if (ScummRenderTo == NULL) - error("Failed to allocate bitmap"); - } - - if ((ScummDepth == 15 && Scumm16ColFmt16) || (ScummDepth == 16 && !Scumm16ColFmt16)) - { - for (int col = 0; col < 256; col++) - { - int r = (ScummColors[col] >> 16) & 0xff; - int g = (ScummColors[col] >> 8) & 0xff; - int b = ScummColors[col] & 0xff; - ScummColors16[col] = (Scumm16ColFmt16 == false) ? (((r*31)/255) << 11) | (((g*63)/255) << 5) | ((b*31)/255) : (((r*31)/255) << 10) | (((g*31)/255) << 5) | ((b*31)/255); - } - - Scumm16ColFmt16 = (ScummDepth == 16); - } - - if (OvlBitMap) - FreeVec(OvlBitMap); - - OvlBitMap = AllocVec(ScummBufferWidth*ScummBufferHeight*3, MEMF_PUBLIC | MEMF_CLEAR); - if (OvlBitMap == NULL) - error("Failed to allocated bitmap for overlay"); - - if (Scaler) - { - delete Scaler; - Scaler = NULL; - } - - if (ScummScale) - { - Scaler = MorphOSScaler::Create(ScummScaler, ScummBuffer, ScummBufferWidth, ScummBufferHeight, ScummColors, ScummColors16, ScummRenderTo); - if (Scaler == NULL) - { - warning("Failed to create scaler - scaling will be disabled"); - SwitchScalerTo(ST_NONE); - } - } - - AddUpdateRect(0, 0, ScummBufferWidth, ScummBufferHeight); -} - -void OSystem_MorphOS::SwitchScalerTo(SCALERTYPE newScaler) -{ - if (newScaler == ST_NONE && ScummScale != 0) - { - if (Scaler) - { - delete Scaler; - Scaler = NULL; - } - ScummScale = 0; - ScummScaler = ST_NONE; - CreateScreen(ScummScreen ? CSDSPTYPE_FULLSCREEN : CSDSPTYPE_WINDOWED); - } - else - { - if (ScummScale == 0) - { - ScummScale = 1; - ScummScaler = newScaler; - CreateScreen(ScummScreen ? CSDSPTYPE_FULLSCREEN : CSDSPTYPE_WINDOWED); - } - else if (ScummScaler != newScaler) - { - ScummScaler = newScaler; - if (Scaler) - delete Scaler; - Scaler = MorphOSScaler::Create(ScummScaler, ScummBuffer, ScummBufferWidth, ScummBufferHeight, ScummColors, ScummColors16, ScummRenderTo); - if (Scaler == NULL) - { - warning("Failed to create scaler - scaling will be disabled"); - SwitchScalerTo(ST_NONE); - } - else - AddUpdateRect(0, 0, ScummBufferWidth, ScummBufferHeight); - } - } -} - -bool OSystem_MorphOS::pollEvent(Common::Event &event) -{ - IntuiMessage *ScummMsg; - - ScummMsg = (IntuiMessage *) GetMsg(ScummWindow->UserPort); - if (ScummMsg) - { - switch (ScummMsg->Class) - { - case IDCMP_RAWKEY: - { - InputEvent FakedIEvent; - char charbuf; - int qual = 0; - - memset(&FakedIEvent, 0, sizeof (InputEvent)); - FakedIEvent.ie_Class = IECLASS_RAWKEY; - FakedIEvent.ie_Code = ScummMsg->Code; - - if (ScummMsg->Qualifier & (IEQUALIFIER_LALT | IEQUALIFIER_RALT)) - qual |= Common::KBD_ALT; - if (ScummMsg->Qualifier & (IEQUALIFIER_LSHIFT | IEQUALIFIER_RSHIFT)) - qual |= Common::KBD_SHIFT; - if (ScummMsg->Qualifier & IEQUALIFIER_CONTROL) - qual |= Common::KBD_CTRL; - event.kbd.flags = qual; - - event.type = (ScummMsg->Code & IECODE_UP_PREFIX) ? Common::EVENT_KEYUP : Common::EVENT_KEYDOWN; - ScummMsg->Code &= ~IECODE_UP_PREFIX; - - if (ScummMsg->Code >= RAWKEY_F1 && ScummMsg->Code <= RAWKEY_F10) - { - /* - * Function key - */ - event.kbd.ascii = (ScummMsg->Code-RAWKEY_F1)+Common::ASCII_F1; - event.kbd.keycode = 0; - } - else if (ScummMsg->Code == RAWKEY_F11 || ScummMsg->Code == RAWKEY_F12) - { - /* - * Function key on PC keyboard - */ - event.kbd.ascii = (ScummMsg->Code == RAWKEY_F11) ? 325 : 326; - event.kbd.keycode = 0; - } - else if (ScummMsg->Code == NM_WHEEL_UP || ScummMsg->Code == NM_WHEEL_DOWN) - { - /* - * Wheelmouse event - */ - event.type = (ScummMsg->Code == NM_WHEEL_UP) ? Common::EVENT_WHEELUP : Common::EVENT_WHEELDOWN; - } - else if (MapRawKey(&FakedIEvent, &charbuf, 1, NULL) == 1) - { - if (qual == Common::KBD_CTRL && charbuf == 'z') - { - event.type = Common::EVENT_QUIT; - break; - } - else if (qual == Common::KBD_ALT) - { - if (charbuf >= '0' && charbuf <= '9') - { - SCALERTYPE new_scaler = MorphOSScaler::FindByIndex(charbuf-'0'); - ReplyMsg((Message *) ScummMsg); - if (new_scaler != ST_INVALID) - SwitchScalerTo(new_scaler); - return false; - } - else if (charbuf == 'x') - { - event.type = Common::EVENT_QUIT; - break; - } - else if (charbuf == 0x0d) - { - ReplyMsg((Message *) ScummMsg); - CreateScreen(CSDSPTYPE_TOGGLE); - return false; - } - } - - event.kbd.ascii = charbuf; - event.kbd.keycode = charbuf; - } - break; - } - - case IDCMP_MOUSEMOVE: - { - LONG newx, newy; - - newx = (ScummMsg->MouseX-ScummWindow->BorderLeft) >> ScummScale; - newy = (ScummMsg->MouseY-ScummWindow->BorderTop) >> ScummScale; - - if (!FullScreenMode && !ScummDefaultMouse) - { - if (newx < 0 || newx > (LONG) ScummBufferWidth || - newy < 0 || newy > (LONG) ScummBufferHeight - ) - { - if (!ScummOrigMouse) - { - ScummOrigMouse = true; - ClearPointer(ScummWindow); - } - } - else if (ScummOrigMouse) - { - ScummOrigMouse = false; - SetPointer(ScummWindow, ScummNoCursor, 1, 1, 0, 0); - } - } - else if (FullScreenMode) - newy = newy <? (ScummScrHeight >> ScummScale)-2; - - event.type = Common::EVENT_MOUSEMOVE; - event.mouse.x = newx; - event.mouse.y = newy; - set_mouse_pos(event.mouse.x, event.mouse.y); - break; - } - - case IDCMP_MOUSEBUTTONS: - { - int newx, newy; - - newx = (ScummMsg->MouseX-ScummWindow->BorderLeft) >> ScummScale; - newy = (ScummMsg->MouseY-ScummWindow->BorderTop) >> ScummScale; - - switch (ScummMsg->Code) - { - case SELECTDOWN: - event.type = Common::EVENT_LBUTTONDOWN; - break; - - case SELECTUP: - event.type = Common::EVENT_LBUTTONUP; - break; - - case MENUDOWN: - event.type = Common::EVENT_RBUTTONDOWN; - break; - - case MENUUP: - event.type = Common::EVENT_RBUTTONUP; - break; - - default: - ReplyMsg((Message *)ScummMsg); - return false; - } - event.mouse.x = newx; - event.mouse.y = newy; - break; - } - - case IDCMP_CLOSEWINDOW: - event.type = Common::EVENT_QUIT; - break; - } - - if (ScummMsg) - ReplyMsg((Message *) ScummMsg); - - return true; - } - - return false; -} - -void OSystem_MorphOS::warpMouse(int x, int y) -{ - if (InputIORequest) - { - InputEvent* FakeIE; - IEPointerPixel* NewPixel; - - /* - * Fake a mousemove input event - */ - if ((FakeIE = (InputEvent*) AllocVec(sizeof (InputEvent), MEMF_PUBLIC))) - { - if ((NewPixel = (IEPointerPixel*) AllocVec(sizeof (IEPointerPixel), MEMF_PUBLIC))) - { - NewPixel->iepp_Screen = ScummWindow->WScreen; - NewPixel->iepp_Position.X = (x << ScummScale) + ScummWindow->LeftEdge + ScummWindow->BorderLeft; - NewPixel->iepp_Position.Y = (y << ScummScale) + ScummWindow->TopEdge + ScummWindow->BorderTop; - - FakeIE->ie_EventAddress = NewPixel; - FakeIE->ie_NextEvent = NULL; - FakeIE->ie_Class = IECLASS_NEWPOINTERPOS; - FakeIE->ie_SubClass = IESUBCLASS_PIXEL; - FakeIE->ie_Code = IECODE_NOBUTTON; - FakeIE->ie_Qualifier = NULL; - - InputIORequest->io_Data = FakeIE; - InputIORequest->io_Length = sizeof (InputEvent); - InputIORequest->io_Command = IND_WRITEEVENT; - DoIO((IORequest *) InputIORequest); - - FreeVec(NewPixel); - } - FreeVec(FakeIE); - } - } -} - -void OSystem_MorphOS::setShakePos(int shake_pos) -{ - ScummShakePos = shake_pos; - AddUpdateRect(0, 0, ScummBufferWidth, ScummBufferHeight); -} - -#define MOUSE_INTERSECTS(x, y, w, h) \ - (!((MouseOldX+MouseOldWidth <= x ) || (MouseOldX >= x+w) || \ - (MouseOldY+MouseOldHeight <= y) || (MouseOldY >= y+h))) - -/* Copy part of bitmap */ -void OSystem_MorphOS::copyRectToScreen(const byte *src, int pitch, int x, int y, int w, int h) -{ - byte *dst; - - if (x < 0) { w+=x; src-=x; x = 0; } - if (y < 0) { h+=y; src-=y*pitch; y = 0; } - if (w >= ScummBufferWidth-x) { w = ScummBufferWidth - x; } - if (h >= ScummBufferHeight-y) { h = ScummBufferHeight - y; } - - if (w <= 0 || h <= 0) - return; - - AUTO_LOCK - - if (MouseDrawn) - { - if (MOUSE_INTERSECTS(x, y, w, h)) - UndrawMouse(); - } - - AddUpdateRect(x, y, w, h); - - dst = (byte *)ScummBuffer+y*ScummBufferWidth + x; - if (DirtyBlocks) - { - int cx, cy; - int block = BLOCK_ID(x, y); - int line_block = block; - int start_block = BLOCKSIZE_X-(x % BLOCKSIZE_X); - int start_y_block = BLOCKSIZE_Y-(y % BLOCKSIZE_Y); - int next_block; - int next_y_block; - UWORD *block_cols = BlockColors[block]; - - if (start_block == 0) - start_block = BLOCKSIZE_X; - if (start_y_block == 0) - start_y_block = BLOCKSIZE_Y; - - next_block = start_block; - next_y_block = start_y_block; - for (cy = 0; cy < h; cy++) - { - for (cx = 0; cx < w; cx++) - { - UWORD old_pixel = *dst; - UWORD src_pixel = *src++; - if (old_pixel != src_pixel) - { - *dst++ = src_pixel; - block_cols[old_pixel]--; - block_cols[src_pixel]++; - } - else - dst++; - if (--next_block == 0) - { - block++; - block_cols = BlockColors[block]; - next_block = BLOCKSIZE_X; - } - } - if (--next_y_block == 0) - { - line_block += BLOCKS_X; - next_y_block = BLOCKSIZE_Y; - } - block = line_block; - block_cols = BlockColors[block]; - next_block = start_block; - dst += ScummBufferWidth-w; - src += pitch-w; - } - } - else - { - do - { - memcpy(dst, src, w); - dst += ScummBufferWidth; - src += pitch; - } while (--h); - } -} - -bool OSystem_MorphOS::AddUpdateRect(WORD x, WORD y, WORD w, WORD h) -{ - if (UpdateRects > 25) - return false; - - if (x < 0) { w+=x; x = 0; } - if (y < 0) { h+=y; y = 0; } - if (w >= ScummBufferWidth-x) { w = ScummBufferWidth - x; } - if (h >= ScummBufferHeight-y) { h = ScummBufferHeight - y; } - - if (w <= 0 || h <= 0) - return false; - - if (++UpdateRects > 25) - { - x = 0; y = 0; - w = ScummBufferWidth; h = ScummBufferHeight; - } - - Rectangle update_rect = { x, y, x+w, y+h }; - OrRectRegion(NewUpdateRegion, &update_rect); - ScreenChanged = true; - - return true; -} - -void OSystem_MorphOS::updateScreen() -{ - AUTO_LOCK - - DrawMouse(); - - if (!ScreenChanged) - return; - - OrRegionRegion(NewUpdateRegion, UpdateRegion); - - if (ScummShakePos) - { - RastPort rp; - - InitRastPort(&rp); - rp.BitMap = ScummRenderTo; - - uint32 src_y = 0; - uint32 dest_y = 0; - if (ScummShakePos < 0) - src_y = -ScummShakePos; - else - dest_y = ScummShakePos; - - if (!ScummScale) - { - if (ScummDepth == 8) - WritePixelArray(ScummBuffer, 0, src_y, ScummBufferWidth, &rp, 0, dest_y, ScummBufferWidth, ScummBufferHeight-src_y-dest_y, RECTFMT_LUT8); - else - WriteLUTPixelArray(ScummBuffer, 0, src_y, ScummBufferWidth, &rp, ScummColors, 0, dest_y, ScummBufferWidth, ScummBufferHeight-src_y-dest_y, CTABFMT_XRGB8); - } - else if (Scaler->Prepare(ScummRenderTo)) - { - Scaler->Scale(0, src_y, 0, dest_y, ScummBufferWidth, ScummBufferHeight-src_y-dest_y); - Scaler->Finish(); - } - - if (ScummShakePos < 0) - FillPixelArray(&rp, 0, (ScummBufferHeight-1) << ScummScale, ScummScrWidth, -ScummShakePos << ScummScale, 0); - else - FillPixelArray(&rp, 0, 0, ScummScrWidth, ScummShakePos << ScummScale, 0); - } - else if (!ScummScale) - { - RastPort rp; - - InitRastPort(&rp); - rp.BitMap = ScummRenderTo; - - int32 src_x, src_y; - int32 src_w, src_h; - int32 reg_x, reg_y; - RegionRectangle *update_rect = UpdateRegion->RegionRectangle; - - reg_x = UpdateRegion->bounds.MinX; - reg_y = UpdateRegion->bounds.MinY; - while (update_rect) - { - src_x = update_rect->bounds.MinX; - src_y = update_rect->bounds.MinY; - src_w = update_rect->bounds.MaxX-src_x; - src_h = update_rect->bounds.MaxY-src_y; - src_x += reg_x; - src_y += reg_y; - - if (src_x) src_x--; - if (src_y) src_y--; - src_w += 2; - if (src_x+src_w >= ScummBufferWidth) - src_w = ScummBufferWidth-src_x; - src_h += 2; - if (src_y+src_h >= ScummBufferHeight) - src_h = ScummBufferHeight-src_y; - - if (ScummDepth == 8) - WritePixelArray(ScummBuffer, src_x, src_y, ScummBufferWidth, &rp, src_x, src_y, src_w, src_h, RECTFMT_LUT8); - else - WriteLUTPixelArray(ScummBuffer, src_x, src_y, ScummBufferWidth, &rp, ScummColors, src_x, src_y, src_w, src_h, CTABFMT_XRGB8); - - update_rect = update_rect->Next; - } - } - else - { - int32 src_x, src_y; - int32 src_w, src_h; - int32 reg_x, reg_y; - RegionRectangle *update_rect = UpdateRegion->RegionRectangle; - - reg_x = UpdateRegion->bounds.MinX; - reg_y = UpdateRegion->bounds.MinY; - - if (!Scaler->Prepare(ScummRenderTo)) - update_rect = NULL; - - while (update_rect) - { - src_x = update_rect->bounds.MinX; - src_y = update_rect->bounds.MinY; - src_w = update_rect->bounds.MaxX-src_x; - src_h = update_rect->bounds.MaxY-src_y; - src_x += reg_x; - src_y += reg_y; - - if (src_x) src_x--; - if (src_y) src_y--; - src_w += 2; - if (src_x+src_w >= ScummBufferWidth) - src_w = ScummBufferWidth-src_x; - src_h += 2; - if (src_y+src_h >= ScummBufferHeight) - src_h = ScummBufferHeight-src_y; - - Scaler->Scale(src_x, src_y, src_x, src_y, src_w, src_h); - update_rect = update_rect->Next; - } - Scaler->Finish(); - } - - if (ScummScreen) - { - while (!ChangeScreenBuffer(ScummScreen, ScummScreenBuffer[ScummPaintBuffer])); - ScummPaintBuffer = !ScummPaintBuffer; - ScummRenderTo = ScummScreenBuffer[ScummPaintBuffer]->sb_BitMap; - } - else - { - int32 x = (UpdateRegion->bounds.MinX-1) << ScummScale; - int32 y = (UpdateRegion->bounds.MinY-1) << ScummScale; - if (x < 0) x = 0; - if (y < 0) y = 0; - int32 w = (UpdateRegion->bounds.MaxX << ScummScale)-x+(1 << ScummScale); - int32 h = (UpdateRegion->bounds.MaxY << ScummScale)-y+(1 << ScummScale); - if (x+w > ScummScrWidth) w = ScummScrWidth-x; - if (y+h > ScummScrHeight) h = ScummScrHeight-y; - BltBitMapRastPort(ScummRenderTo, x, y, ScummWindow->RPort, ScummWindow->BorderLeft+x, ScummWindow->BorderTop+y, w, h, ABNC | ABC); - WaitBlit(); - } - - Region *new_region_part = NewUpdateRegion; - NewUpdateRegion = UpdateRegion; - ClearRegion(NewUpdateRegion); - UpdateRegion = new_region_part; - - ScreenChanged = false; - memset(DirtyBlocks, 0, BLOCKS_X*BLOCKS_Y*sizeof (bool)); - UpdateRects = 0; -} - -void OSystem_MorphOS::DrawMouse() -{ - int x,y; - byte *dst,*bak; - byte color; - - if (MouseDrawn || !MouseVisible) - return; - MouseDrawn = true; - - int ydraw = MouseY - MouseHotspotY; - int xdraw = MouseX - MouseHotspotX; - int w = MouseWidth; - int h = MouseHeight; - int x_mouseimg_offs = 0; - int y_mouseimg_offs = 0; - byte *buf; - - if (xdraw < 0) { x_mouseimg_offs = -xdraw; w += xdraw; xdraw = 0; } - if (ydraw < 0) { y_mouseimg_offs = -ydraw; h += ydraw; ydraw = 0; } - - MouseOldX = xdraw; - MouseOldY = ydraw; - MouseOldWidth = w; - MouseOldHeight = h; - - AddUpdateRect(xdraw, ydraw, w, h); - dst = (byte*)ScummBuffer + ydraw*ScummBufferWidth + xdraw; - bak = MouseBackup; - buf = MouseImage + y_mouseimg_offs*MAX_MOUSE_W + x_mouseimg_offs; - - for (y = 0; y < h; y++, dst += ScummBufferWidth, bak += MAX_MOUSE_W, buf += MouseWidth) - { - if (ydraw+y < ScummBufferHeight) - { - for (x = 0; x<w; x++) - { - if (xdraw+x < ScummBufferWidth) - { - bak[x] = dst[x]; - if ((color=buf[x])!=MouseKeycolor) - dst[x] = color; - } - } - } - else - break; - } -} - -void OSystem_MorphOS::UndrawMouse() -{ - int x,y; - byte *dst,*bak; - - if (!MouseDrawn) - return; - MouseDrawn = false; - - dst = (byte*)ScummBuffer + MouseOldY*ScummBufferWidth + MouseOldX; - bak = MouseBackup; - - AddUpdateRect(MouseOldX, MouseOldY, MouseOldWidth, MouseOldHeight); - - for (y = 0; y < MouseOldHeight; y++, bak += MAX_MOUSE_W, dst += ScummBufferWidth) - { - if (MouseOldY + y < ScummBufferHeight) - { - for (x = 0; x < MouseOldWidth; x++) - { - if (MouseOldX + x < ScummBufferWidth) - dst[x] = bak[x]; - } - } - else - break; - } -} - -bool OSystem_MorphOS::showMouse(bool visible) -{ - if (MouseVisible == visible) - return visible; - - bool last = MouseVisible; - MouseVisible = visible; - - if (!visible) - UndrawMouse(); - - return last; -} - -void OSystem_MorphOS::set_mouse_pos(int x, int y) -{ - if (x != MouseX || y != MouseY) - { - MouseX = x; - MouseY = y; - UndrawMouse(); - } -} - -void OSystem_MorphOS::setMouseCursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y, byte keycolor) -{ - MouseWidth = w; - MouseHeight = h; - - MouseHotspotX = hotspot_x; - MouseHotspotY = hotspot_y; - - MouseKeycolor = keycolor; - - if (MouseImage) - free(MouseImage); - - MouseImage = (byte *)malloc(w * h); - memcpy(mouseImage, buf, w * h); - - UndrawMouse(); -} - -bool OSystem_MorphOS::setSoundCallback(OSystem::SoundProc proc, void *param) -{ - if (ScummSoundThread) - { - if (SoundProc == proc) - return true; - clearSoundCallback(); - } - - SoundProc = proc; - SoundParam = param; - - /* - * Create Sound Thread - */ - SoundStartup.mn_Node.ln_Type = NT_MESSAGE; - SoundStartup.mn_ReplyPort = ThreadPort; - SoundStartup.mn_Length = sizeof(SoundStartup); - - ScummSoundThread = CreateNewProcTags(NP_Entry, (ULONG) &morphos_sound_thread, - NP_CodeType, CODETYPE_PPC, - NP_Name, (ULONG) "ScummVM Sound Thread", - NP_StartupMsg, &SoundStartup, - NP_PPC_Arg1, (ULONG) this, - NP_PPC_Arg2, AHIST_S16S, TAG_DONE); - if (!ScummSoundThread) - { - puts("Failed to create sound thread"); - exit(1); - } - - return true; -} - - -void OSystem_MorphOS::fill_sound(byte *stream, int len) -{ - if (SoundProc) - SoundProc(SoundParam, stream, len); - else - memset(stream, 0x0, len); -} - -void OSystem_MorphOS::clearSoundCallback() -{ - if (ScummSoundThread) - { - Signal((Task *) ScummSoundThread, SIGBREAKF_CTRL_C); - ScummSoundThread = NULL; - /* Wait for thread to finish */ - WaitPort(ThreadPort); - } -} - -void OSystem_MorphOS::initSize(uint w, uint h) -{ - if (ScummBuffer) - { - FreeVec(ScummBuffer); - ScummBuffer = NULL; - } - if (DirtyBlocks) - { - FreeVec(DirtyBlocks); - - for (int b = 0; b < BLOCKS_X*BLOCKS_Y; b++) - FreeVec(BlockColors[b]); - FreeVec(BlockColors); - DirtyBlocks = NULL; - } - - /* - * Allocate image buffer - */ - ScummBuffer = AllocVec(w*h, MEMF_CLEAR); - - if (ScummBuffer == NULL) - { - puts("Couldn't allocate image buffer"); - exit(1); - } - - OvlSavedBuffer = AllocVec(w*h, MEMF_CLEAR); - - if (OvlSavedBuffer == NULL) - { - FreeVec(ScummBuffer); - puts("Couldn't allocate overlay backup image buffer"); - exit(1); - } - - memset(ScummColors, 0, 256*sizeof (ULONG)); - - ScummBufferWidth = w; - ScummBufferHeight = h; - - DirtyBlocks = (bool *) AllocVec(BLOCKS_X*BLOCKS_Y*sizeof (bool), MEMF_CLEAR); - if (DirtyBlocks) - { - BlockColors = (UWORD **) AllocVec(BLOCKS_X*BLOCKS_Y*sizeof (UWORD *), MEMF_CLEAR); - if (BlockColors) - { - int b; - - for (b = 0; b < BLOCKS_X*BLOCKS_Y; b++) - { - BlockColors[b] = (UWORD *) AllocVec(256*sizeof (UWORD), MEMF_CLEAR); - if (BlockColors[b] == NULL) - break; - BlockColors[b][0] = BLOCKSIZE_X*BLOCKSIZE_Y; - } - - if (b < BLOCKS_X*BLOCKS_Y) - { - for (--b; b >= 0; --b) - FreeVec(BlockColors[b]); - FreeVec(BlockColors); - BlockColors = NULL; - } - } - - if (!BlockColors) - { - FreeVec(DirtyBlocks); - DirtyBlocks = NULL; - } - } - - CreateScreen(CSDSPTYPE_KEEP); -} - -int16 OSystem_MorphOS::getWidth() -{ - return ScummScrWidth; -} - -int16 OSystem_MorphOS::getHeight() -{ - return ScummScrHeight; -} - -void OSystem_MorphOS::showOverlay() -{ - UndrawMouse(); - memcpy(OvlSavedBuffer, ScummBuffer, ScummBufferWidth*ScummBufferHeight); - clearOverlay(); - for (int c = 0; c < 256; c++) - { - ULONG r, g, b; - r = ScummColors[c] >> 16; - g = (ScummColors[c] >> 8) & 0xff; - b = ScummColors[c] & 0xff; - SetRGB32CM(OvlCMap, c, CVT8TO32(r), CVT8TO32(g), CVT8TO32(b)); - } -} - -void OSystem_MorphOS::hideOverlay() -{ - copyRectToScreen((byte *) OvlSavedBuffer, ScummBufferWidth, 0, 0, ScummBufferWidth, ScummBufferHeight); -} - -void OSystem_MorphOS::clearOverlay() -{ - AUTO_LOCK - - UBYTE *src = (UBYTE *) ScummBuffer; - UBYTE *dest = (UBYTE *) OvlBitMap; - copyRectToScreen((byte *) OvlSavedBuffer, ScummBufferWidth, 0, 0, ScummBufferWidth, ScummBufferHeight); - for (int y = 0; y < ScummBufferHeight; y++) - for (int x = 0; x < ScummBufferWidth; x++) - { - *dest++ = ScummColors[*src] >> 16; - *dest++ = (ScummColors[*src] >> 8) & 0xff; - *dest++ = ScummColors[*src++] & 0xff; - } -} - -void OSystem_MorphOS::grabOverlay(int16 *buf, int pitch) -{ - int h = ScummBufferHeight; - int x; - UBYTE *src = (UBYTE *) OvlBitMap; - - do - { - for (x = 0; x < pitch; x++) - { - *buf++ = (src[0]*31/255 << 11) | (src[1]*63/255 << 5) | src[2]*31/255; - src += 3; - } - src += (ScummBufferWidth-pitch)*3; - } while (--h); -} - -void OSystem_MorphOS::copyRectToOverlay(const int16 *ovl, int pitch, int x, int y, int w, int h) -{ - int x1, y1; - UBYTE *dest; - UBYTE *bmap, *bmap_dest; - LONG last_col[2] = { -1, -1 }; - LONG last_pen[2] = { -1, -1 }; - - if (w > pitch) w = pitch; - bmap = (UBYTE*) AllocVec(w*h, MEMF_ANY); - if (bmap) - { - bmap_dest = bmap; - dest = ((UBYTE *) OvlBitMap)+y*ScummBufferWidth*3+x*3; - for (y1 = 0; y1 < h; y1++) - { - for (x1 = 0; x1 < w; x1++) - { - uint8 r, g, b; - int16 col; - - col = *ovl++; - colorToRGB(col, r, g, b); - *dest++ = r; - *dest++ = g; - *dest++ = b; - if (col == last_col[0]) - *bmap_dest++ = last_pen[0]; - else if (col == last_col[1]) - *bmap_dest++ = last_pen[1]; - else - { - last_col[1] = last_col[0]; - last_pen[1] = last_pen[0]; - last_col[0] = col; - last_pen[0] = FindColor(OvlCMap, CVT8TO32(r), CVT8TO32(g), CVT8TO32(b), -1); - *bmap_dest++ = last_pen[0]; - } - } - dest += (ScummBufferWidth-w)*3; - ovl += pitch-w; - } - copyRectToScreen(bmap, w, x, y, w, h); - FreeVec(bmap); - } -} - diff --git a/backends/platform/morphos/morphos.h b/backends/platform/morphos/morphos.h deleted file mode 100644 index f409b7f950..0000000000 --- a/backends/platform/morphos/morphos.h +++ /dev/null @@ -1,235 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * MorphOS-specific header file - * - * $URL$ - * $Id$ - * - */ - -#ifndef MORPHOS_MORPHOS_H -#define MORPHOS_MORPHOS_H - -#include <dos/dosextens.h> -#include <graphics/regions.h> -#include <intuition/intuition.h> -#include <intuition/screens.h> -#include <libraries/cdda.h> -#include <proto/exec.h> - -#include "backends/intern.h" -#include "morphos_scaler.h" - -class OSystem_MorphOS : public OSystem -{ - public: - OSystem_MorphOS(SCALERTYPE gfx_mode, bool full_screen); - virtual ~OSystem_MorphOS(); - - bool Initialise(); - - // Set colors of the palette - virtual void setPalette(const byte *colors, uint start, uint num); - - // Set the size of the video bitmap. - // Typically, 320x200 - virtual void initSize(uint w, uint h); - - // Draw a bitmap to screen. - // The screen will not be updated to reflect the new bitmap - virtual void copyRectToScreen(const byte *buf, int pitch, int x, int y, int w, int h); - - // Update the dirty areas of the screen - virtual void updateScreen(); - - // Either show or hide the mouse cursor - virtual bool showMouse(bool visible); - - // Set the position of the mouse cursor - virtual void set_mouse_pos(int x, int y); - - // Set the bitmap that's used when drawing the cursor. - virtual void setMouseCursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y, byte keycolor); - - // Shaking is used in SCUMM. Set current shake position. - virtual void setShakePos(int shake_pos); - - // Overlay - virtual void showOverlay(); - virtual void hideOverlay(); - virtual void clearOverlay(); - virtual void grabOverlay(int16 *buf, int pitch); - virtual void copyRectToOverlay(const int16 *buf, int pitch, int x, int y, int w, int h); - virtual int16 getHeight(); - virtual int16 getWidth(); - - // Get the number of milliseconds since the program was started. - virtual uint32 getMillis(); - - // Delay for a specified amount of milliseconds - virtual void delayMillis(uint msecs); - - // Add a new callback timer - virtual void setTimerCallback(TimerProc callback, int timer); - - // Mutex handling - virtual MutexRef createMutex(); - virtual void lockMutex(MutexRef mutex); - virtual void unlockMutex(MutexRef mutex); - virtual void deleteMutex(MutexRef mutex); - - // Get the next event. - // Returns true if an event was retrieved. - virtual bool pollEvent(Common::Event &event); - - // Moves mouse pointer to specified position - virtual void warpMouse(int x, int y); - - // Set the function to be invoked whenever samples need to be generated - virtual bool setSoundCallback(SoundProc proc, void *param); - void fill_sound (byte * stream, int len); - void clearSoundCallback(); - - virtual uint32 property(int param, Property *value); - - // Poll cdrom status - // Returns true if cd audio is playing - virtual bool pollCD(); - - // Play cdrom audio track - virtual void playCD(int track, int num_loops, int start_frame, int duration); - - // Stop cdrom audio track - virtual void stopCD(); - - // Update cdrom audio status - virtual void updateCD(); - - // Quit - virtual void quit(); - - static OSystem_MorphOS *create(SCALERTYPE gfx_scaler, bool full_screen); - - static bool OpenATimer(MsgPort **port, IORequest **req, ULONG unit, bool required = true); - - private: - typedef enum { CSDSPTYPE_WINDOWED, CSDSPTYPE_FULLSCREEN, CSDSPTYPE_TOGGLE, CSDSPTYPE_KEEP } CS_DSPTYPE; - - static const int MAX_MOUSE_W = 80; - static const int MAX_MOUSE_H = 80; - - void CreateScreen(CS_DSPTYPE dspType); - void SwitchScalerTo(SCALERTYPE newScaler); - bool AddUpdateRect(WORD x, WORD y, WORD w, WORD h); - - void DrawMouse(); - void UndrawMouse(); - - /* Display-related attributes */ - Screen *ScummScreen; - Window *ScummWindow; - char ScummWndTitle[125]; - APTR ScummBuffer; - LONG ScummBufferWidth; - LONG ScummBufferHeight; - ScreenBuffer *ScummScreenBuffer[2]; - BitMap *ScummRenderTo; - ULONG ScummPaintBuffer; - int ScummScrWidth; - int ScummScrHeight; - int ScummDepth; - bool Scumm16ColFmt16; - UWORD *ScummNoCursor; - ULONG ScummColors[256]; - USHORT ScummColors16[256]; - WORD ScummWinX; - WORD ScummWinY; - bool ScummDefaultMouse; - bool ScummOrigMouse; - int ScummShakePos; - bool FullScreenMode; - bool ScreenChanged; - UWORD **BlockColors; - bool *DirtyBlocks; - Region *UpdateRegion; - Region *NewUpdateRegion; - ULONG UpdateRects; - SignalSemaphore CritSec; - - /* Overlay-related attributes */ - APTR OvlBitMap; - APTR OvlSavedBuffer; - ColorMap *OvlCMap; - - /* Sound-related attributes */ - Process *ScummSoundThread; - SoundProc SoundProc; - void *SoundParam; - MsgPort *ThreadPort; - Message MusicStartup; - Message SoundStartup; - - /* CD-ROM related attributes */ - CDRIVEPTR CDrive; - ULONG CDDATrackOffset; - - /* Scaling-related attributes */ - SCALERTYPE ScummScaler; - int ScummScale; - MorphOSScaler *Scaler; - - /* Mouse cursor-related attributes */ - bool MouseVisible, MouseDrawn; - int MouseX, MouseY; - int MouseWidth, MouseHeight; - int MouseOldX, MouseOldY; - int MouseOldWidth, MouseOldHeight; - int MouseHotspotX, MouseHotspotY; - byte *MouseImage, MouseBackup[MAX_MOUSE_W*MAX_MOUSE_H]; - byte MouseKeycolor; - MsgPort* InputMsgPort; - IOStdReq*InputIORequest; - - /* Timer-related attributes */ - MsgPort *TimerMsgPort; - timerequest *TimerIORequest; - - /* Game-related attributes */ - int GameID; -}; - -class AutoLock -{ - public: - AutoLock(SignalSemaphore* s) : sem(s) { ObtainSemaphore(sem); } - ~AutoLock() { ReleaseSemaphore(sem); } - - private: - SignalSemaphore* sem; -}; - -#define AUTO_LOCK AutoLock cs(&CritSec); - - -extern OSystem_MorphOS *TheSystem; - -#endif - diff --git a/backends/platform/morphos/morphos_scaler.cpp b/backends/platform/morphos/morphos_scaler.cpp deleted file mode 100644 index 2d66dd961b..0000000000 --- a/backends/platform/morphos/morphos_scaler.cpp +++ /dev/null @@ -1,851 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ - */ - -#include "common/stdafx.h" -#include "engines/engine.h" - -#include <exec/types.h> -#include <cybergraphics/cybergraphics.h> - -#include <proto/cybergraphics.h> - -#include "morphos.h" -#include "morphos_scaler.h" - -#define GET_RESULT(A, B, C, D) ((A != C || A != D) - (B != C || B != D)) -#define INTERPOLATE(A, B) (((A & colorMask) >> 1) + ((B & colorMask) >> 1) + (A & B & lowPixelMask)) -#define Q_INTERPOLATE(A, B, C, D) ((A & qcolorMask) >> 2) + ((B & qcolorMask) >> 2) + ((C & qcolorMask) >> 2) + ((D & qcolorMask) >> 2) + ((((A & qlowpixelMask) + (B & qlowpixelMask) + (C & qlowpixelMask) + (D & qlowpixelMask)) >> 2) & qlowpixelMask) -#define SWAP_WORD(word) word = ((word & 0xff) << 8) | (word >> 8) -#define SWAP_LONG(lng) lng = ((lng & 0xff) << 24) | ((lng & 0xff00) << 8) | ((lng & 0xff0000) >> 8) | (lng >> 24) - -MorphOSScaler::GfxScaler MorphOSScaler::ScummScalers[11] - = { { "none", "normal", ST_NONE }, - { "Point", "2x", ST_POINT }, - { "AdvMame2x", "advmame2x", ST_ADVMAME2X }, - { "SuperEagle", "supereagle", ST_SUPEREAGLE }, - { "Super2xSaI", "super2xsai", ST_SUPER2XSAI }, - { NULL, NULL, ST_INVALID }, - { NULL, NULL, ST_INVALID }, - { NULL, NULL, ST_INVALID }, - { NULL, NULL, ST_INVALID }, - { NULL, NULL, ST_INVALID }, - // This is the end marker ... do not assign a scaler to it! - { NULL, NULL, ST_INVALID } - }; - -MorphOSScaler::MorphOSScaler(APTR buffer, int width, int height, ULONG *col_table, UWORD *col_table16, BitMap *bmap) -{ - dest = NULL; - handle = NULL; - - Buffer = buffer; - BufferWidth = width; - BufferHeight = height; - - ScummColors = col_table; - ScummColors16 = col_table16; - - /* Initialize scaling stuff */ - int minr, ming, minb; - ULONG depth = GetCyberMapAttr(bmap, CYBRMATTR_DEPTH); - - if (depth > 16) - { - minr = 1 << 16; - ming = 1 << 8; - minb = 1; - } - else - { - minr = 1 << ((depth == 15) ? 10 : 11); - ming = 1 << 5; - minb = 1; - } - - int pixfmt = GetCyberMapAttr(bmap, CYBRMATTR_PIXFMT); - - ScummPCMode = false; - if (pixfmt == PIXFMT_RGB15PC || pixfmt == PIXFMT_BGR15PC || - pixfmt == PIXFMT_RGB16PC || pixfmt == PIXFMT_BGR16PC || - pixfmt == PIXFMT_BGRA32) - ScummPCMode = true; - - colorMask = (MakeColor(pixfmt, 255, 0, 0) - minr) | (MakeColor(pixfmt, 0, 255, 0) - ming) | (MakeColor(pixfmt, 0, 0, 255) - minb); - lowPixelMask = minr | ming | minb; - qcolorMask = (MakeColor(pixfmt, 255, 0, 0) - 3*minr) | (MakeColor(pixfmt, 0, 255, 0) - 3*ming) | (MakeColor(pixfmt, 0, 0, 255) - 3*minb); - qlowpixelMask = (minr * 3) | (ming * 3) | (minb * 3); - redblueMask = MakeColor(pixfmt, 255, 0, 255); - greenMask = MakeColor(pixfmt, 0, 255, 0); - - PixelsPerMask = (depth <= 16) ? 2 : 1; - - if (PixelsPerMask == 2) - { - colorMask |= (colorMask << 16); - qcolorMask |= (qcolorMask << 16); - lowPixelMask |= (lowPixelMask << 16); - qlowpixelMask |= (qlowpixelMask << 16); - } -} - -MorphOSScaler::~MorphOSScaler() -{ - Finish(); -} - -MorphOSScaler *MorphOSScaler::Create(SCALERTYPE scaler_type, APTR buffer, int width, int height, ULONG *col_table, UWORD *col_table16, BitMap *bmap) -{ - MorphOSScaler *new_scaler = NULL; - - switch (scaler_type) - { - case ST_POINT: - new_scaler = new PointScaler(buffer, width, height, col_table, col_table16, bmap); - break; - - case ST_ADVMAME2X: - new_scaler = new AdvMame2xScaler(buffer, width, height, col_table, col_table16, bmap); - break; - - case ST_SUPEREAGLE: - new_scaler = new SuperEagleScaler(buffer, width, height, col_table, col_table16, bmap); - break; - - case ST_SUPER2XSAI: - new_scaler = new Super2xSaIScaler(buffer, width, height, col_table, col_table16, bmap); - break; - - default: - warning("Invalid scaler requested - falling back to Super2xSaI"); - new_scaler = new Super2xSaIScaler(buffer, width, height, col_table, col_table16, bmap); - break; - } - - return new_scaler; -} - -bool MorphOSScaler::Prepare(BitMap *render_bmap) -{ - handle = LockBitMapTags(render_bmap, LBMI_BYTESPERPIX, &dest_bpp, - LBMI_BYTESPERROW, &dest_pitch, - LBMI_BASEADDRESS, &dest, - LBMI_PIXFMT, &dest_pixfmt, - TAG_DONE); - - return handle != NULL; -} - -void MorphOSScaler::Finish() -{ - if (handle) - { - UnLockBitMap(handle); - handle = NULL; - } -} - -uint32 MorphOSScaler::MakeColor(int pixfmt, int r, int g, int b) -{ - uint32 col = 0; - - switch (pixfmt) - { - case PIXFMT_RGB15: - case PIXFMT_RGB15PC: - col = (((r*31)/255) << 10) | (((g*31)/255) << 5) | ((b*31)/255); - break; - - case PIXFMT_BGR15: - case PIXFMT_BGR15PC: - col = (((b*31)/255) << 10) | (((g*31)/255) << 5) | ((r*31)/255); - break; - - case PIXFMT_RGB16: - case PIXFMT_RGB16PC: - col = (((r*31)/255) << 11) | (((g*63)/255) << 5) | ((b*31)/255); - break; - - case PIXFMT_BGR16: - case PIXFMT_BGR16PC: - col = (((b*31)/255) << 11) | (((g*63)/255) << 5) | ((r*31)/255); - break; - - case PIXFMT_ARGB32: - case PIXFMT_BGRA32: - col = (r << 16) | (g << 8) | b; - break; - - case PIXFMT_RGBA32: - col = (r << 24) | (g << 16) | (b << 8); - break; - - case PIXFMT_RGB24: - case PIXFMT_BGR24: - error("The scaling engines do not support 24 bit modes at the moment"); - break; - - default: - error("Unsupported pixel format: %d. Please contact author at tomjoad@muenster.de", pixfmt); - } - - return col; -} - -void Super2xSaIScaler::Scale(uint32 src_x, uint32 src_y, uint32 dest_x, uint32 dest_y, uint32 width, uint32 height) -{ - unsigned int x, y; - unsigned long color[16]; - byte *src; - - if (!handle) - return; - - src = ((byte *)Buffer)+src_y*BufferWidth+src_x; - - /* Point to the first 3 lines. */ - src_line[0] = src; - src_line[1] = src; - src_line[2] = src + BufferWidth; - src_line[3] = src + BufferWidth * 2; - - dst_line[0] = dest+dest_y*2*dest_pitch+dest_x*2*dest_bpp; - dst_line[1] = dst_line[0]+dest_pitch; - - if (PixelsPerMask == 2) - { - byte *sbp; - sbp = src_line[0]; - color[0] = ScummColors16[*sbp]; color[1] = color[0]; color[2] = color[0]; color[3] = color[0]; - color[4] = color[0]; color[5] = color[0]; color[6] = ScummColors16[*(sbp+1)]; color[7] = ScummColors16[*(sbp+2)]; - sbp = src_line[2]; - color[8] = ScummColors16[*sbp]; color[9] = color[8]; color[10] = ScummColors16[*(sbp+1)]; color[11] = ScummColors16[*(sbp+2)]; - sbp = src_line[3]; - color[12] = ScummColors16[*sbp]; color[13] = color[12]; color[14] = ScummColors16[*(sbp+1)]; color[15] = ScummColors16[*(sbp+2)]; - } - else - { - byte *lbp; - lbp = src_line[0]; - color[0] = ScummColors[*lbp]; color[1] = color[0]; color[2] = color[0]; color[3] = color[0]; - color[4] = color[0]; color[5] = color[0]; color[6] = ScummColors[*(lbp+1)]; color[7] = ScummColors[*(lbp+2)]; - lbp = src_line[2]; - color[8] = ScummColors[*lbp]; color[9] = color[8]; color[10] = ScummColors[*(lbp+1)]; color[11] = ScummColors[*(lbp+2)]; - lbp = src_line[3]; - color[12] = ScummColors[*lbp]; color[13] = color[12]; color[14] = ScummColors[*(lbp+1)]; color[15] = ScummColors[*(lbp+2)]; - } - - for (y = 0; y < height; y++) - { - for (x = 0; x < width; x++) - { - unsigned long product1a, product1b, product2a, product2b; - -//--------------------------------------- B0 B1 B2 B3 0 1 2 3 -// 4 5* 6 S2 -> 4 5* 6 7 -// 1 2 3 S1 8 9 10 11 -// A0 A1 A2 A3 12 13 14 15 -//-------------------------------------- - if (color[9] == color[6] && color[5] != color[10]) - { - product2b = color[9]; - product1b = product2b; - } - else if (color[5] == color[10] && color[9] != color[6]) - { - product2b = color[5]; - product1b = product2b; - } - else if (color[5] == color[10] && color[9] == color[6]) - { - int r = 0; - - r += GET_RESULT(color[6], color[5], color[8], color[13]); - r += GET_RESULT(color[6], color[5], color[4], color[1]); - r += GET_RESULT(color[6], color[5], color[14], color[11]); - r += GET_RESULT(color[6], color[5], color[2], color[7]); - - if (r > 0) - product1b = color[6]; - else if (r < 0) - product1b = color[5]; - else - product1b = INTERPOLATE(color[5], color[6]); - - product2b = product1b; - - } - else - { - if (color[6] == color[10] && color[10] == color[13] && color[9] != color[14] && color[10] != color[12]) - product2b = Q_INTERPOLATE(color[10], color[10], color[10], color[9]); - else if (color[5] == color[9] && color[9] == color[14] && color[13] != color[10] && color[9] != color[15]) - product2b = Q_INTERPOLATE(color[9], color[9], color[9], color[10]); - else - product2b = INTERPOLATE(color[9], color[10]); - - if (color[6] == color[10] && color[6] == color[1] && color[5] != color[2] && color[6] != color[0]) - product1b = Q_INTERPOLATE(color[6], color[6], color[6], color[5]); - else if (color[5] == color[9] && color[5] == color[2] && color[1] != color[6] && color[5] != color[3]) - product1b = Q_INTERPOLATE(color[6], color[5], color[5], color[5]); - else - product1b = INTERPOLATE(color[5], color[6]); - } - - if (color[5] == color[10] && color[9] != color[6] && color[4] == color[5] && color[5] != color[14]) - product2a = INTERPOLATE(color[9], color[5]); - else if (color[5] == color[8] && color[6] == color[5] && color[4] != color[9] && color[5] != color[12]) - product2a = INTERPOLATE(color[9], color[5]); - else - product2a = color[9]; - - if (color[9] == color[6] && color[5] != color[10] && color[8] == color[9] && color[9] != color[2]) - product1a = INTERPOLATE(color[9], color[5]); - else if (color[4] == color[9] && color[10] == color[9] && color[8] != color[5] && color[9] != color[0]) - product1a = INTERPOLATE(color[9], color[5]); - else - product1a = color[5]; - - if (PixelsPerMask == 2) - { - if (ScummPCMode) - { - SWAP_WORD(product1a); - SWAP_WORD(product1b); - SWAP_WORD(product2a); - SWAP_WORD(product2b); - } - *((unsigned long *) (&dst_line[0][x * 4])) = (product1a << 16) | product1b; - *((unsigned long *) (&dst_line[1][x * 4])) = (product2a << 16) | product2b; - } - else - { - if (ScummPCMode) - { - SWAP_LONG(product1a); - SWAP_LONG(product1b); - SWAP_LONG(product2a); - SWAP_LONG(product2b); - } - *((unsigned long *) (&dst_line[0][x * 8])) = product1a; - *((unsigned long *) (&dst_line[0][x * 8 + 4])) = product1b; - *((unsigned long *) (&dst_line[1][x * 8])) = product2a; - *((unsigned long *) (&dst_line[1][x * 8 + 4])) = product2b; - } - - /* Move color matrix forward */ - color[0] = color[1]; color[4] = color[5]; color[8] = color[9]; color[12] = color[13]; - color[1] = color[2]; color[5] = color[6]; color[9] = color[10]; color[13] = color[14]; - color[2] = color[3]; color[6] = color[7]; color[10] = color[11]; color[14] = color[15]; - - if (src_x+x < BufferWidth-3) - { - x += 3; - if (PixelsPerMask == 2) - { - color[3] = ScummColors16[*(src_line[0] + x) ]; - color[7] = ScummColors16[*(src_line[1] + x) ]; - color[11] = ScummColors16[*(src_line[2] + x) ]; - color[15] = ScummColors16[*(src_line[3] + x) ]; - } - else - { - color[3] = ScummColors[*(src_line[0] + x)]; - color[7] = ScummColors[*(src_line[1] + x)]; - color[11] = ScummColors[*(src_line[2] + x)]; - color[15] = ScummColors[*(src_line[3] + x)]; - } - x -= 3; - } - } - - /* We're done with one line, so we shift the source lines up */ - src_line[0] = src_line[1]; - src_line[1] = src_line[2]; - src_line[2] = src_line[3]; - - /* Read next line */ - if (src_y + y + 3 >= BufferHeight) - src_line[3] = src_line[2]; - else - src_line[3] = src_line[2] + BufferWidth; - - /* Then shift the color matrix up */ - if (PixelsPerMask == 2) - { - byte *sbp; - sbp = src_line[0]; - color[0] = ScummColors16[*sbp]; color[1] = color[0]; color[2] = ScummColors16[ *(sbp + 1) ]; color[3] = ScummColors16[*(sbp + 2)]; - sbp = src_line[1]; - color[4] = ScummColors16[*sbp]; color[5] = color[4]; color[6] = ScummColors16[ *(sbp + 1) ]; color[7] = ScummColors16[*(sbp + 2)]; - sbp = src_line[2]; - color[8] = ScummColors16[*sbp]; color[9] = color[8]; color[10] = ScummColors16[ *(sbp + 1) ]; color[11] = ScummColors16[*(sbp + 2)]; - sbp = src_line[3]; - color[12] = ScummColors16[*sbp]; color[13] = color[12]; color[14] = ScummColors16[ *(sbp + 1) ]; color[15] = ScummColors16[*(sbp + 2)]; - - if (src_x + x > 0) - { - color[0] = ScummColors16[src_line[0][-1]]; - color[4] = ScummColors16[src_line[1][-1]]; - color[8] = ScummColors16[src_line[2][-1]]; - color[12] = ScummColors16[src_line[3][-1]]; - } - } - else - { - byte *lbp; - lbp = src_line[0]; - color[0] = ScummColors[*lbp]; color[1] = color[0]; color[2] = ScummColors[ *(lbp + 1) ]; color[3] = ScummColors[*(lbp+2)]; - lbp = src_line[1]; - color[4] = ScummColors[*lbp]; color[5] = color[4]; color[6] = ScummColors[ *(lbp + 1) ]; color[7] = ScummColors[*(lbp+2)]; - lbp = src_line[2]; - color[8] = ScummColors[*lbp]; color[9] = color[8]; color[10] = ScummColors[ *(lbp + 1) ]; color[11] = ScummColors[*(lbp+2)]; - lbp = src_line[3]; - color[12] = ScummColors[*lbp]; color[13] = color[12]; color[14] = ScummColors[ *(lbp + 1) ]; color[15] = ScummColors[*(lbp+2)]; - } - - if (src_y + y < BufferHeight - 1) - { - dst_line[0] = dst_line[1]+dest_pitch; - dst_line[1] = dst_line[0]+dest_pitch; - } - } -} - -void SuperEagleScaler::Scale(uint32 src_x, uint32 src_y, uint32 dest_x, uint32 dest_y, uint32 width, uint32 height) -{ - unsigned int x, y; - unsigned long color[12]; - byte *src; - - if (!handle) - return; - - src = (byte *)Buffer+src_y*BufferWidth+src_x; - - /* Point to the first 3 lines. */ - src_line[0] = src; - src_line[1] = src; - src_line[2] = src + BufferWidth; - src_line[3] = src + BufferWidth * 2; - - dst_line[0] = dest+dest_y*2*dest_pitch+dest_x*2*dest_bpp; - dst_line[1] = dst_line[0]+dest_pitch; - - x = 0, y = 0; - - if (PixelsPerMask == 2) - { - byte *sbp; - sbp = src_line[0]; - color[0] = ScummColors16[*sbp]; color[1] = color[0]; color[2] = color[0]; color[3] = color[0]; - color[4] = ScummColors16[*(sbp+1)]; color[5] = ScummColors16[*(sbp+2)]; - sbp = src_line[2]; - color[6] = ScummColors16[*sbp]; color[7] = color[6]; color[8] = ScummColors16[*(sbp+1)]; color[9] = ScummColors16[*(sbp+2)]; - sbp = src_line[3]; - color[10] = ScummColors16[*sbp]; color[11] = ScummColors16[*(sbp+1)]; - } - else - { - byte *lbp; - lbp = src_line[0]; - color[0] = ScummColors[*lbp]; color[1] = color[0]; color[2] = color[0]; color[3] = color[0]; - color[4] = ScummColors[*(lbp+1)]; color[5] = ScummColors[*(lbp+2)]; - lbp = src_line[2]; - color[6] = ScummColors[*lbp]; color[7] = color[6]; color[8] = ScummColors[*(lbp+1)]; color[9] = ScummColors[*(lbp+2)]; - lbp = src_line[3]; - color[10] = ScummColors[*lbp]; color[11] = ScummColors[*(lbp+1)]; - } - - for (y = 0; y < height; y++) - { - /* Todo: x = width - 2, x = width - 1 */ - - for (x = 0; x < width; x++) - { - unsigned long product1a, product1b, product2a, product2b; - -//--------------------------------------- B1 B2 0 1 -// 4 5 6 S2 -> 2 3 4 5 -// 1 2 3 S1 6 7 8 9 -// A1 A2 10 11 - - if (color[7] == color[4] && color[3] != color[8]) - { - product1b = product2a = color[7]; - - if ((color[6] == color[7]) || (color[4] == color[1])) - product1a = INTERPOLATE(color[7], INTERPOLATE(color[7], color[3])); - else - product1a = INTERPOLATE(color[3], color[4]); - - if ((color[4] == color[5]) || (color[7] == color[10])) - product2b = INTERPOLATE(color[7], INTERPOLATE(color[7], color[8])); - else - product2b = INTERPOLATE(color[7], color[8]); - } - else if (color[3] == color[8] && color[7] != color[4]) - { - product2b = product1a = color[3]; - - if ((color[0] == color[3]) || (color[5] == color[9])) - product1b = INTERPOLATE(color[3], INTERPOLATE(color[3], color[4])); - else - product1b = INTERPOLATE(color[3], color[1]); - - if ((color[8] == color[11]) || (color[2] == color[3])) - product2a = INTERPOLATE(color[3], INTERPOLATE(color[3], color[2])); - else - product2a = INTERPOLATE(color[7], color[8]); - - } - else if (color[3] == color[8] && color[7] == color[4]) - { - register int r = 0; - - r += GET_RESULT(color[4], color[3], color[6], color[10]); - r += GET_RESULT(color[4], color[3], color[2], color[0]); - r += GET_RESULT(color[4], color[3], color[11], color[9]); - r += GET_RESULT(color[4], color[3], color[1], color[5]); - - if (r > 0) - { - product1b = product2a = color[7]; - product1a = product2b = INTERPOLATE(color[3], color[4]); - } - else if (r < 0) - { - product2b = product1a = color[3]; - product1b = product2a = INTERPOLATE(color[3], color[4]); - } - else - { - product2b = product1a = color[3]; - product1b = product2a = color[7]; - } - } - else - { - product2b = product1a = INTERPOLATE(color[7], color[4]); - product2b = Q_INTERPOLATE(color[8], color[8], color[8], product2b); - product1a = Q_INTERPOLATE(color[3], color[3], color[3], product1a); - - product2a = product1b = INTERPOLATE(color[3], color[8]); - product2a = Q_INTERPOLATE(color[7], color[7], color[7], product2a); - product1b = Q_INTERPOLATE(color[4], color[4], color[4], product1b); - } - - if (PixelsPerMask == 2) - { - if (ScummPCMode) - { - SWAP_WORD(product1a); - SWAP_WORD(product1b); - SWAP_WORD(product2a); - SWAP_WORD(product2b); - } - *((unsigned long *) (&dst_line[0][x * 4])) = (product1a << 16) | product1b; - *((unsigned long *) (&dst_line[1][x * 4])) = (product2a << 16) | product2b; - } - else - { - if (ScummPCMode) - { - SWAP_LONG(product1a); - SWAP_LONG(product1b); - SWAP_LONG(product2a); - SWAP_LONG(product2b); - } - *((unsigned long *) (&dst_line[0][x * 8])) = product1a; - *((unsigned long *) (&dst_line[0][x * 8 + 4])) = product1b; - *((unsigned long *) (&dst_line[1][x * 8])) = product2a; - *((unsigned long *) (&dst_line[1][x * 8 + 4])) = product2b; - } - - /* Move color matrix forward */ - color[0] = color[1]; - color[2] = color[3]; color[3] = color[4]; color[4] = color[5]; - color[6] = color[7]; color[7] = color[8]; color[8] = color[9]; - color[10] = color[11]; - - if (src_x+x < BufferWidth - 2) - { - x += 2; - if (PixelsPerMask == 2) - { - color[1] = ScummColors16[ *(src_line[0] + x) ]; - if (src_x+x < BufferWidth-1) - { - color[5] = ScummColors16[*(src_line[1]+x+1)]; - color[9] = ScummColors16[*(src_line[2]+x+1)]; - } - color[11] = ScummColors16[*(src_line[3]+x)]; - } - else - { - color[1] = ScummColors[*(src_line[0]+x)]; - if (src_x+x < BufferWidth-1) - { - color[5] = ScummColors[*(src_line[1]+x+1)]; - color[9] = ScummColors[ *(src_line[2]+x+1)]; - } - color[11] = ScummColors[*(src_line[3]+x)]; - } - x -= 2; - } - } - - /* We're done with one line, so we shift the source lines up */ - src_line[0] = src_line[1]; - src_line[1] = src_line[2]; - src_line[2] = src_line[3]; - - /* Read next line */ - if (src_y+y+3 >= BufferHeight) - src_line[3] = src_line[2]; - else - src_line[3] = src_line[2] + BufferWidth; - - /* Then shift the color matrix up */ - if (PixelsPerMask == 2) - { - byte *sbp; - sbp = src_line[0]; - color[0] = ScummColors16[*sbp]; color[1] = ScummColors16[*(sbp+1)]; - sbp = src_line[1]; - color[2] = ScummColors16[*sbp]; color[3] = color[2]; color[4] = ScummColors16[*(sbp+1)]; color[5] = ScummColors16[*(sbp+2)]; - sbp = src_line[2]; - color[6] = ScummColors16[*sbp]; color[7] = color[6]; color[8] = ScummColors16[*(sbp+1)]; color[9] = ScummColors16[*(sbp+2)]; - sbp = src_line[3]; - color[10] = ScummColors16[*sbp]; color[11] = ScummColors16[*(sbp+1)]; - } - else - { - byte *lbp; - lbp = src_line[0]; - color[0] = ScummColors[*lbp]; color[1] = ScummColors[*(lbp+1)]; - lbp = src_line[1]; - color[2] = ScummColors[*lbp]; color[3] = color[2]; color[4] = ScummColors[*(lbp+1)]; color[5] = ScummColors[*(lbp+2)]; - lbp = src_line[2]; - color[6] = ScummColors[*lbp]; color[7] = color[6]; color[8] = ScummColors[*(lbp+1)]; color[9] = ScummColors[*(lbp+2)]; - lbp = src_line[3]; - color[10] = ScummColors[*lbp]; color[11] = ScummColors[*(lbp+1)]; - } - - - if (src_y + y < BufferHeight - 1) - { - dst_line[0] = dst_line[1]+dest_pitch; - dst_line[1] = dst_line[0]+dest_pitch; - } - } -} - -void AdvMame2xScaler::Scale(uint32 src_x, uint32 src_y, uint32 dest_x, uint32 dest_y, uint32 width, uint32 height) -{ - if (!handle) - return; - - byte *src = (byte *)Buffer+src_y*BufferWidth+src_x; - - src_line[0] = src; - src_line[1] = src; - src_line[2] = src + BufferWidth; - - dst_line[0] = dest+dest_y*2*dest_pitch+dest_x*2*dest_bpp; - dst_line[1] = dst_line[0]+dest_pitch; - - for (uint32 y = 0; y < height; y++) - { - for (uint32 x = 0; x < width; x++) - { - uint32 B, D, E, F, H; - - if (PixelsPerMask == 2) - { - // short A = *(src + i - nextlineSrc - 1); - B = ScummColors16[src_line[0][x]]; - // short C = *(src + i - nextlineSrc + 1); - D = ScummColors16[src_line[1][x-1]]; - E = ScummColors16[src_line[1][x]]; - F = ScummColors16[src_line[1][x+1]]; - // short G = *(src + i + nextlineSrc - 1); - H = ScummColors16[src_line[2][x]]; - // short I = *(src + i + nextlineSrc + 1); - } - else - { - // short A = *(src + i - nextlineSrc - 1); - B = ScummColors[src_line[0][x]]; - // short C = *(src + i - nextlineSrc + 1); - D = ScummColors[src_line[1][x-1]]; - E = ScummColors[src_line[1][x]]; - F = ScummColors[src_line[1][x+1]]; - // short G = *(src + i + nextlineSrc - 1); - H = ScummColors[src_line[2][x]]; - // short I = *(src + i + nextlineSrc + 1); - } - - - if (PixelsPerMask == 2) - { - if (ScummPCMode) - { - SWAP_WORD(B); - SWAP_WORD(D); - SWAP_WORD(E); - SWAP_WORD(F); - SWAP_WORD(H); - } - *((unsigned long *) (&dst_line[0][x * 4])) = ((D == B && B != F && D != H ? D : E) << 16) | (B == F && B != D && F != H ? F : E); - *((unsigned long *) (&dst_line[1][x * 4])) = ((D == H && D != B && H != F ? D : E) << 16) | (H == F && D != H && B != F ? F : E); - } - else - { - if (ScummPCMode) - { - SWAP_LONG(B); - SWAP_LONG(D); - SWAP_LONG(E); - SWAP_LONG(F); - SWAP_LONG(H); - } - *((unsigned long *) (&dst_line[0][x * 8])) = D == B && B != F && D != H ? D : E; - *((unsigned long *) (&dst_line[0][x * 8 + 4])) = B == F && B != D && F != H ? F : E; - *((unsigned long *) (&dst_line[1][x * 8])) = D == H && D != B && H != F ? D : E; - *((unsigned long *) (&dst_line[1][x * 8 + 4])) = H == F && D != H && B != F ? F : E; - } - } - - src_line[0] = src_line[1]; - src_line[1] = src_line[2]; - if (src_y+y+2 >= BufferHeight) - src_line[2] = src_line[1]; - else - src_line[2] = src_line[1] + BufferWidth; - - if (src_y+y < BufferHeight-1) - { - dst_line[0] = dst_line[1]+dest_pitch; - dst_line[1] = dst_line[0]+dest_pitch; - } - } -} - -void PointScaler::Scale(uint32 src_x, uint32 src_y, uint32 dest_x, uint32 dest_y, uint32 width, uint32 height) -{ - byte *src; - uint32 color; - uint32 r, g, b; - uint32 x, y; - - if (!handle) - return; - - src = (byte *)Buffer+src_y*BufferWidth+src_x; - - dst_line[0] = dest+dest_y*2*dest_pitch+dest_x*2*dest_bpp; - dst_line[1] = dst_line[0]+dest_pitch; - - for (y = 0; y < height; y++) - { - for (x = 0; x < width; x++) - { - r = (ScummColors[*(src+x)] >> 16) & 0xff; - g = (ScummColors[*(src+x)] >> 8) & 0xff; - b = ScummColors[*(src+x)] & 0xff; - - color = MakeColor(dest_pixfmt, r, g, b); - if (PixelsPerMask == 2) - { - if (ScummPCMode) - SWAP_WORD(color); - - *((unsigned long *) (&dst_line[0][x * 4])) = (color << 16) | color; - *((unsigned long *) (&dst_line[1][x * 4])) = (color << 16) | color; - } - else - { - if (ScummPCMode) - SWAP_LONG(color); - - *((unsigned long *) (&dst_line[0][x * 8])) = color; - *((unsigned long *) (&dst_line[0][x * 8 + 4])) = color; - *((unsigned long *) (&dst_line[1][x * 8])) = color; - *((unsigned long *) (&dst_line[1][x * 8 + 4])) = color; - } - } - - src += BufferWidth; - - if (src_y+y < BufferHeight-1) - { - dst_line[0] = dst_line[1]+dest_pitch; - dst_line[1] = dst_line[0]+dest_pitch; - } - } -} - -SCALERTYPE MorphOSScaler::FindByName(const char *ScalerName) -{ - int scaler = 0; - - while (ScummScalers[scaler].gs_Name) - { - if (!stricmp(ScalerName, ScummScalers[scaler].gs_Name)) - return ScummScalers[scaler].gs_Type; - scaler++; - } - - if (ScummScalers[scaler].gs_Name == NULL) - { - puts("Invalid scaler name. Please use one of the following:"); - for (scaler = 0; ScummScalers[scaler].gs_Name != NULL; scaler++) - printf(" %s\n", ScummScalers[scaler].gs_Name); - } - - return ST_INVALID; -} - -SCALERTYPE MorphOSScaler::FindByIndex(int index) -{ - if (index >= 0 && index < 10 && ScummScalers[index].gs_Name) - return ScummScalers[index].gs_Type; - - return ST_INVALID; -} - -const char *MorphOSScaler::GetParamName(SCALERTYPE type) -{ - int scaler = 0; - - while (ScummScalers[scaler].gs_Name) - { - if (ScummScalers[scaler].gs_Type == type) - return ScummScalers[scaler].gs_ParamName; - scaler++; - } - - return NULL; -} - diff --git a/backends/platform/morphos/morphos_scaler.h b/backends/platform/morphos/morphos_scaler.h deleted file mode 100644 index aee5d7e575..0000000000 --- a/backends/platform/morphos/morphos_scaler.h +++ /dev/null @@ -1,97 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ - */ - -#ifndef MORPHOS_MORPHOSSCALER_H -#define MORPHOS_MORPHOSSCALER_H - -#include <graphics/gfx.h> - -typedef enum { ST_INVALID = 0, ST_NONE, ST_POINT, ST_ADVMAME2X, ST_SUPEREAGLE, ST_SUPER2XSAI } SCALERTYPE; - -class MorphOSScaler -{ - public: - MorphOSScaler(APTR buffer, int width, int height, ULONG *col_table, UWORD *col_table16, BitMap *bmap); - virtual ~MorphOSScaler(); - - bool Prepare(BitMap *render_bmap); - void Finish(); - - virtual void Scale(uint32 src_x, uint32 src_y, uint32 dest_x, uint32 dest_y, uint32 width, uint32 height) = 0; - - static MorphOSScaler *Create(SCALERTYPE st, APTR buffer, int width, int height, ULONG *col_table, UWORD *col_table16, BitMap *bmap); - - static SCALERTYPE FindByName(const char *ScalerName); - static SCALERTYPE FindByIndex(int index); - static const char *GetParamName(SCALERTYPE type); - - protected: - struct GfxScaler - { - STRPTR gs_Name; - STRPTR gs_ParamName; - SCALERTYPE gs_Type; - }; - - static GfxScaler ScummScalers[11]; - - static uint32 MakeColor(int pixfmt, int r, int g, int b); - - byte *dest; - uint32 dest_bpp; - uint32 dest_pitch; - uint32 dest_pixfmt; - APTR handle; - - uint32 colorMask; - uint32 lowPixelMask; - uint32 qcolorMask; - uint32 qlowpixelMask; - uint32 redblueMask; - uint32 greenMask; - int PixelsPerMask; - byte *src_line[4]; - byte *dst_line[2]; - bool ScummPCMode; - - APTR Buffer; - ULONG BufferWidth; - ULONG BufferHeight; - ULONG *ScummColors; - USHORT *ScummColors16; -}; - -#define DECLARE_SCALER(scaler_name) class scaler_name ## Scaler : public MorphOSScaler \ - { public: scaler_name ## Scaler(APTR buffer, int width, int height, ULONG *col_table, UWORD *col_table16, BitMap *bmap) : MorphOSScaler(buffer, width, height, col_table, col_table16, bmap) {} \ - void Scale(uint32 src_x, uint32 src_y, uint32 dest_x, uint32 dest_y, uint32 width, uint32 height); \ - }; - - -DECLARE_SCALER(Point) -DECLARE_SCALER(AdvMame2x) -DECLARE_SCALER(SuperEagle) -DECLARE_SCALER(Super2xSaI) - -#endif - diff --git a/backends/platform/morphos/morphos_sound.cpp b/backends/platform/morphos/morphos_sound.cpp deleted file mode 100644 index df166ccde0..0000000000 --- a/backends/platform/morphos/morphos_sound.cpp +++ /dev/null @@ -1,257 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * MorphOS sound support - * - * $URL$ - * $Id$ - * - */ - -#include "common/stdafx.h" -#include "engines/engine.h" - -#include <dos/dos.h> -#include <exec/memory.h> -#include <devices/ahi.h> -#include <devices/etude.h> - -#include <clib/alib_protos.h> -#include <proto/exec.h> -#include <proto/dos.h> -#include <proto/ahi.h> - -#include "morphos.h" -#include "morphos_sound.h" - -#define AHI_BUF_SIZE (8*1024) - -SignalSemaphore ScummMusicThreadRunning; -SignalSemaphore ScummSoundThreadRunning; - -static MsgPort *ahiPort = NULL; -static AHIRequest *ahiReq[2] = { NULL, NULL }; -static UWORD ahiCurBuf = 0; -static bool ahiReqSent[2] = { false, false }; -static BYTE ahiDevice = -1; - UBYTE ahiUnit = AHI_DEFAULT_UNIT; -static char *ahiBuf[2] = { NULL, NULL }; - -static MsgPort *ScummMidiPort = NULL; - IOMidiRequest *ScummMidiRequest = NULL; - - Device *EtudeBase = NULL; - -bool etude_available() -{ - bool avail = init_morphos_music(ScummMidiUnit, ETUDEF_DIRECT); - if (avail) - exit_morphos_music(); - return avail; -} - -bool init_morphos_music(ULONG MidiUnit, ULONG DevFlags) -{ - ScummMidiPort = CreateMsgPort(); - if (ScummMidiPort) - { - ScummMidiRequest = (IOMidiRequest *) CreateIORequest(ScummMidiPort, sizeof (IOMidiRequest)); - if (ScummMidiRequest) - { - ScummMidiRequest->emr_Version = 1; - if (OpenDevice(ETUDENAME, MidiUnit, (IORequest *) ScummMidiRequest, DevFlags)) - { - DeleteIORequest((IORequest *) ScummMidiRequest); - DeleteMsgPort(ScummMidiPort); - ScummMidiRequest = NULL; - ScummMidiPort = NULL; - } - else - EtudeBase = ScummMidiRequest->emr_Std.io_Device; - } - else - { - DeleteMsgPort(ScummMidiPort); - ScummMidiPort = NULL; - } - } - - if (!ScummMidiRequest) - return false; - - return true; -} - - -void exit_morphos_music() -{ - if (ScummMidiRequest) - { - CloseDevice((IORequest *) ScummMidiRequest); - DeleteIORequest((IORequest *) ScummMidiRequest); - DeleteMsgPort(ScummMidiPort); - ScummMidiRequest = NULL; - ScummMidiPort = NULL; - EtudeBase = NULL; - } -} - - -static bool init_morphos_sound() -{ - if (!(ahiPort = CreateMsgPort())) - return false; - - if (!(ahiReq[0] = (AHIRequest *) CreateIORequest(ahiPort, sizeof (AHIRequest)))) - { - DeleteMsgPort(ahiPort); - ahiPort = NULL; - return false; - } - - if (!(ahiReq[1] = (AHIRequest *) AllocVec(sizeof (AHIRequest), MEMF_PUBLIC))) - { - DeleteIORequest(ahiReq[0]); - DeleteMsgPort(ahiPort); - ahiReq[0] = NULL; - ahiPort = NULL; - return false; - } - - if (!(ahiBuf[0] = (char *) AllocVec(2*AHI_BUF_SIZE, MEMF_PUBLIC))) - { - FreeVec(ahiReq[1]); - DeleteIORequest(ahiReq[0]); - DeleteMsgPort(ahiPort); - ahiReq[0] = NULL; - ahiReq[1] = NULL; - ahiPort = NULL; - return false; - } - ahiBuf[1] = &ahiBuf[0][AHI_BUF_SIZE]; - - ahiReq[0]->ahir_Version = 4; - if ((ahiDevice = OpenDevice(AHINAME, 0, (IORequest *) ahiReq[0], 0))) - { - FreeVec(ahiBuf[0]); - FreeVec(ahiReq[1]); - DeleteIORequest(ahiReq[0]); - DeleteMsgPort(ahiPort); - ahiBuf[0] = NULL; - ahiReq[0] = NULL; - ahiReq[1] = NULL; - ahiPort = NULL; - return false; - } - - CopyMem(ahiReq[0], ahiReq[1], sizeof (AHIRequest)); - - ahiCurBuf = 0; - ahiReqSent[0] = FALSE; - ahiReqSent[1] = FALSE; - - return true; -} - - -static void exit_morphos_sound() -{ - if (ahiReq[1]) - FreeVec(ahiReq[1]); - - if (ahiReq[0]) - { - CloseDevice((IORequest *) ahiReq[0]); - DeleteIORequest(ahiReq[0]); - } - - if (ahiBuf[0]) - FreeVec((APTR) ahiBuf[0]); - - if (ahiPort) - DeleteMsgPort(ahiPort); -} - -int morphos_sound_thread(OSystem_MorphOS *syst, ULONG SampleType) -{ - ULONG signals; - bool initialized; - - initialized = init_morphos_sound(); - if (!initialized) - { - warning("Sound could not be initialized. The game may hang at some point (press Ctrl-z then)."); - Wait(SIGBREAKF_CTRL_C); - } - else - { - for (;;) - { - while (!ahiReqSent[ahiCurBuf] || CheckIO((IORequest *) ahiReq[ahiCurBuf])) - { - AHIRequest *req = ahiReq[ahiCurBuf]; - UWORD ahiOtherBuf = !ahiCurBuf; - - if (ahiReqSent[ahiCurBuf]) - WaitIO((IORequest *) req); - - syst->fill_sound((byte *) ahiBuf[ahiCurBuf], AHI_BUF_SIZE); - - req->ahir_Std.io_Message.mn_Node.ln_Pri = 0; - req->ahir_Std.io_Command = CMD_WRITE; - req->ahir_Std.io_Data = ahiBuf[ahiCurBuf]; - req->ahir_Std.io_Length = AHI_BUF_SIZE; - req->ahir_Type = SampleType; - req->ahir_Frequency = SAMPLES_PER_SEC; - req->ahir_Position = 0x8000; - req->ahir_Volume = 0x10000; - req->ahir_Link = (ahiReqSent[ahiOtherBuf] && !CheckIO((IORequest *) ahiReq[ahiOtherBuf])) ? ahiReq[ahiOtherBuf] : NULL; - SendIO((IORequest *)req); - - ahiReqSent[ahiCurBuf] = true; - ahiCurBuf = ahiOtherBuf; - } - - signals = Wait(SIGBREAKF_CTRL_C | (1 << ahiPort->mp_SigBit)); - - if (signals & SIGBREAKF_CTRL_C) - break; - } - - if (ahiReqSent[ahiCurBuf]) - { - AbortIO((IORequest *) ahiReq[ahiCurBuf]); - WaitIO((IORequest *) ahiReq[ahiCurBuf]); - ahiReqSent[ahiCurBuf] = false; - } - - if (ahiReqSent[!ahiCurBuf]) - { - AbortIO((IORequest *) ahiReq[!ahiCurBuf]); - WaitIO((IORequest *) ahiReq[!ahiCurBuf]); - ahiReqSent[!ahiCurBuf] = false; - } - } - - exit_morphos_sound(); - - return 0; -} - diff --git a/backends/platform/morphos/morphos_start.cpp b/backends/platform/morphos/morphos_start.cpp deleted file mode 100644 index 12dd9a9d0a..0000000000 --- a/backends/platform/morphos/morphos_start.cpp +++ /dev/null @@ -1,447 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * MorphOS startup handling - * - * $URL$ - * $Id$ - * - */ - -#include <exec/types.h> -#include <exec/devices.h> -#include <exec/memory.h> -#include <exec/libraries.h> -#include <workbench/startup.h> -#include <workbench/workbench.h> - -#include <proto/exec.h> -#include <proto/dos.h> -#include <proto/cdda.h> -#include <proto/icon.h> - -#include "common/stdafx.h" -#include "scumm/scumm.h" -#include "base/main.h" -#include "common/scaler.h" -#include "sound/mididrv.h" -#include "morphos.h" -#include "morphos_scaler.h" -#include "morphos_sound.h" - -extern "C" WBStartup *_WBenchMsg; - -// For command line parsing -static STRPTR usageTemplate = "STORY,DATAPATH/K,WINDOW/S,SCALER/K,AMIGA/S,MIDIUNIT/K/N,MUSIC/K,MASTERVOL/K/N,MUSICVOL/K/N,SFXVOL/K/N,TEMPO/K/N,TALKSPEED/K/N,LANGUAGE/K,NOSUBTITLES=NST/S, DEBUGLEVEL=DBGLVL/K/N, DUMPSCRIPTS/S"; -typedef enum { USG_STORY = 0, USG_DATAPATH, USG_WINDOW, USG_SCALER, USG_AMIGA, USG_MIDIUNIT, USG_MUSIC, USG_MASTERVOL, USG_MUSICVOL, USG_SFXVOL, USG_TEMPO, USG_TALKSPEED, USG_LANGUAGE, USG_NOSUBTITLES, USG_DEBUGLEVEL, USG_DUMPSCRIPTS, USG_MAX } usageFields; -static LONG args[USG_MAX]; -static RDArgs *ScummArgs = NULL; - -static char*ScummStory = NULL; -static char*ScummPath = NULL; -static char*ScummLang = NULL; - STRPTR ScummMusicDriver = NULL; -MidiDriver* EtudeMidiDriver = NULL; - LONG ScummMidiUnit = 0; -static LONG ScummMasterVolume = 0; -static LONG ScummMidiVolume = 0; -static LONG ScummMidiTempo = 0; -static LONG ScummSfxVolume = 0; -static LONG ScummTalkSpeed = 0; -static LONG ScummDebugLevel = 0; -static SCALERTYPE ScummGfxScaler = ST_INVALID; - -static BPTR OrigDirLock = 0; - -Library *CDDABase = NULL; -Library *TimerBase = NULL; - -OSystem_MorphOS *TheSystem = NULL; - -OSystem *OSystem_MorphOS_create() -{ - if (TheSystem) - delete TheSystem; - - TheSystem = OSystem_MorphOS::create(ST_NONE, ConfMan.getBool("fullscreen")); - - return TheSystem; -} - -void close_resources() -{ - delete TheSystem; - TheSystem = NULL; - - if (ScummPath) - { - FreeVec(ScummPath); - ScummPath = NULL; - } - - if (ScummStory) - { - FreeVec(ScummStory); - ScummStory = NULL; - } - - if (ScummArgs) - { - FreeArgs(ScummArgs); - ScummArgs = NULL; - } - - if (OrigDirLock) - { - CurrentDir(OrigDirLock); - OrigDirLock = NULL; - } - - if (CDDABase) - { - CloseLibrary(CDDABase); - CDDABase = NULL; - } -} - -static STRPTR FindMusicDriver(STRPTR argval) -{ - if (!stricmp(argval, "off")) return "-enull"; - if (!stricmp(argval, "midi")) return "-eetude"; - if (!stricmp(argval, "adlib")) return "-eadlib"; - - error("No such music driver supported. Possible values are off, Midi and Adlib."); - return NULL; -} - -static void ReadToolTypes(WBArg *OfFile) -{ - DiskObject *dobj; - char *ToolValue; - char IconPath[256]; - - NameFromLock(OfFile->wa_Lock, IconPath, 256); - AddPart(IconPath, (STRPTR) OfFile->wa_Name, 256); - - dobj = GetDiskObject(IconPath); - if (dobj == NULL) - return; - - ToolValue = (char *) FindToolType(dobj->do_ToolTypes, "STORY"); - if (ToolValue) - { - if (ScummStory) - FreeVec(ScummStory); - ScummStory = (char *) AllocVec(strlen(ToolValue)+1, MEMF_PUBLIC); - strcpy(ScummStory, ToolValue); - } - - ToolValue = (char *) FindToolType(dobj->do_ToolTypes, "DATAPATH"); - if (ToolValue) - { - if (ScummPath) - FreeVec(ScummPath); - ScummPath = (char *) AllocVec(strlen(ToolValue)+4, MEMF_PUBLIC); - strcpy(ScummPath, "-p"); - strcat(ScummPath, ToolValue); - } - - ToolValue = (char *) FindToolType(dobj->do_ToolTypes, "WINDOW"); - if (ToolValue) - { - if (MatchToolValue(ToolValue, "YES")) - args[USG_WINDOW] = TRUE; - else if (MatchToolValue(ToolValue, "NO")) - args[USG_WINDOW] = FALSE; - } - - ToolValue = (char *) FindToolType(dobj->do_ToolTypes, "SCALER"); - if (ToolValue) - { - if ((ScummGfxScaler = MorphOSScaler::FindByName(ToolValue)) == ST_INVALID) - { - FreeDiskObject(dobj); - exit(1); - } - } - - ToolValue = (char *) FindToolType(dobj->do_ToolTypes, "MUSIC"); - if (ToolValue) - { - if (!(ScummMusicDriver = FindMusicDriver(ToolValue))) - { - FreeDiskObject(dobj); - exit(1); - } - args[USG_MUSIC] = (ULONG) &ScummMusicDriver; - } - - ToolValue = (char *) FindToolType(dobj->do_ToolTypes, "MIDIUNIT"); - if (ToolValue) - ScummMidiUnit = atoi(ToolValue); - - ToolValue = (char *) FindToolType(dobj->do_ToolTypes, "MASTERVOL"); - if (ToolValue) - { - int vol = atoi(ToolValue); - if (vol >= 0 && vol <= 100) - { - ScummMasterVolume = vol; - args[USG_MASTERVOL] = (ULONG) &ScummMasterVolume; - } - } - - ToolValue = (char *) FindToolType(dobj->do_ToolTypes, "MUSICVOL"); - if (ToolValue) - { - int vol = atoi(ToolValue); - if (vol >= 0 && vol <= 100) - { - ScummMidiVolume = vol; - args[USG_MUSICVOL] = (ULONG) &ScummMidiVolume; - } - } - - ToolValue = (char *) FindToolType(dobj->do_ToolTypes, "SFXVOL"); - if (ToolValue) - { - int vol = atoi(ToolValue); - if (vol >= 0 && vol <= 255) - { - ScummSfxVolume = vol; - args[USG_SFXVOL] = (ULONG) &ScummSfxVolume; - } - } - - ToolValue = (char *) FindToolType(dobj->do_ToolTypes, "TEMPO"); - if (ToolValue) - { - ScummMidiTempo = atoi(ToolValue); - args[USG_TEMPO] = (ULONG) &ScummMidiTempo; - } - - ToolValue = (char *) FindToolType(dobj->do_ToolTypes, "TALKSPEED"); - if (ToolValue) - { - ScummTalkSpeed = atoi(ToolValue); - args[USG_TALKSPEED] = (ULONG) &ScummMidiTempo; - } - - ToolValue = (char *) FindToolType(dobj->do_ToolTypes, "LANGUAGE"); - if (ToolValue) - { - if (ScummLang) - FreeVec(ScummLang); - ScummLang = (char *) AllocVec(strlen(ToolValue)+4, MEMF_PUBLIC); - strcpy(ScummLang, "-q"); - strcat(ScummLang, ToolValue); - } - - ToolValue = (char *) FindToolType(dobj->do_ToolTypes, "SUBTITLES"); - if (ToolValue) - { - if (MatchToolValue(ToolValue, "YES")) - args[USG_NOSUBTITLES] = FALSE; - else if (MatchToolValue(ToolValue, "NO")) - args[USG_NOSUBTITLES] = TRUE; - } - - ToolValue = (char *) FindToolType(dobj->do_ToolTypes, "AMIGA"); - if (ToolValue) - { - if (MatchToolValue(ToolValue, "YES")) - args[USG_AMIGA] = FALSE; - else if (MatchToolValue(ToolValue, "NO")) - args[USG_AMIGA] = TRUE; - } - - ToolValue = (char *) FindToolType(dobj->do_ToolTypes, "DEBUGLEVEL"); - if (ToolValue) - ScummDebugLevel = atoi(ToolValue); - - ToolValue = (char *) FindToolType(dobj->do_ToolTypes, "DUMPSCRIPTS"); - if (ToolValue) - { - if (MatchToolValue(ToolValue, "YES")) - args[USG_DUMPSCRIPTS] = TRUE; - else if (MatchToolValue(ToolValue, "NO")) - args[USG_DUMPSCRIPTS] = FALSE; - } - - FreeDiskObject(dobj); -} - -#undef main - -int main() -{ - char *argv[30]; - char mastervol[6], musicvol[6], sfxvol[6], talkspeed[12], tempo[12], scaler[14]; - char dbglvl[6]; - int argc = 0; - - atexit(&close_resources); - - memset(args, '\0', sizeof (args)); - if (_WBenchMsg == NULL) - { - /* Parse the command line here */ - ScummArgs = ReadArgs(usageTemplate, args, NULL); - if (ScummArgs == NULL) - { - puts("Error in command line - type \"ScummVM ?\" for usage."); - exit(1); - } - - if (args[USG_STORY]) - { - ScummStory = (char *) AllocVec(strlen((char *) args[USG_STORY])+1, MEMF_PUBLIC); - strcpy(ScummStory, (char *) args[USG_STORY]); - } - - if (args[USG_DATAPATH]) - { - ScummPath = (char *) AllocVec(strlen((char *) args[USG_DATAPATH])+4, MEMF_PUBLIC); - strcpy(ScummPath, "-p"); - strcat(ScummPath, (char *) args[USG_DATAPATH]); - } - - if (args[USG_SCALER]) - { - if ((ScummGfxScaler = MorphOSScaler::FindByName((char *) args[USG_SCALER])) == ST_INVALID) - exit(1); - } - - if (args[USG_MUSIC]) - { - if (!(ScummMusicDriver = FindMusicDriver((char *) args[USG_MUSIC]))) - exit(1); - } - - if (args[USG_MIDIUNIT]) - ScummMidiUnit = *((LONG *) args[USG_MIDIUNIT]); - - if (args[USG_TEMPO]) - ScummMidiTempo = *((LONG *) args[USG_TEMPO]); - - if (args[USG_MASTERVOL]) - ScummMasterVolume = *((LONG *) args[USG_MASTERVOL]); - - if (args[USG_MUSICVOL]) - ScummMidiVolume = *((LONG *) args[USG_MUSICVOL]); - - if (args[USG_SFXVOL]) - ScummSfxVolume = *((LONG *) args[USG_SFXVOL]); - - if (args[USG_TALKSPEED]) - ScummTalkSpeed = *((LONG *) args[USG_TALKSPEED]); - - if (args[USG_LANGUAGE]) - { - ScummLang = (char *) AllocVec(strlen((char *) args[USG_LANGUAGE])+4, MEMF_PUBLIC); - strcpy(ScummLang, "-q"); - strcat(ScummLang, (char *) args[USG_LANGUAGE]); - } - - if (args[USG_DEBUGLEVEL]) - ScummDebugLevel = *((LONG *) args[USG_DEBUGLEVEL]); - } - else - { - /* We've been started from Workbench */ - ReadToolTypes(&_WBenchMsg->sm_ArgList[0]); - if (_WBenchMsg->sm_NumArgs > 1) - { - ReadToolTypes(&_WBenchMsg->sm_ArgList[1]); - OrigDirLock = CurrentDir(_WBenchMsg->sm_ArgList[1].wa_Lock); - } - } - - if (ScummPath) - { - char c = ScummPath[strlen(ScummPath)-1]; - if (c != '/' && c != ':') - strcat(ScummPath, "/"); - } - - argv[argc++] = "ScummVM"; - if (ScummPath) argv[argc++] = ScummPath; - if (!args[USG_WINDOW]) argv[argc++] = "-f"; - if (args[USG_NOSUBTITLES]) argv[argc++] = "-n"; - if (args[USG_AMIGA]) argv[argc++] = "-a"; - if (args[USG_MUSIC]) argv[argc++] = ScummMusicDriver; - else - { - if (etude_available()) - argv[argc++] = "-eetude"; - else - argv[argc++] = "-eadlib"; - } - if (ScummGfxScaler != ST_INVALID) - { - sprintf(scaler, "-g%s", MorphOSScaler::GetParamName(ScummGfxScaler)); - argv[argc++] = scaler; - } - else - argv[argc++] = "-gsuper2xsai"; - if (args[USG_MASTERVOL] && ScummMasterVolume >= 0 && ScummMasterVolume <= 255) - { - sprintf(mastervol, "-o%ld", ScummMasterVolume); - argv[argc++] = mastervol; - } - if (args[USG_MUSICVOL] && ScummMidiVolume >= 0 && ScummMidiVolume <= 255) - { - sprintf(musicvol, "-m%ld", ScummMidiVolume); - argv[argc++] = musicvol; - } - if (args[USG_SFXVOL] && ScummSfxVolume >= 0 && ScummSfxVolume <= 255) - { - sprintf(sfxvol, "-s%ld", ScummSfxVolume); - argv[argc++] = sfxvol; - } - if (args[USG_TEMPO] && ScummMidiTempo > 0) - { - sprintf(tempo, "-t%lx", ScummMidiTempo); - argv[argc++] = tempo; - } - if (args[USG_TALKSPEED] && ScummTalkSpeed >= 0 && ScummTalkSpeed <= 255) - { - sprintf(talkspeed, "-y%ld", ScummTalkSpeed); - argv[argc++] = talkspeed; - } - if (ScummLang) argv[argc++] = ScummLang; - if (args[USG_DUMPSCRIPTS]) argv[argc++] = "-u"; - if (args[USG_DEBUGLEVEL]) - { - sprintf(dbglvl, "-d%ld", ScummDebugLevel); - argv[argc++] = dbglvl; - } - if (ScummStory) - argv[argc++] = ScummStory; - - g_system = OSystem_MorphOS_create(); - assert(g_system); - - // Invoke the actual ScummVM main entry point: - int res = scummvm_main(argc, argv); - g_system->quit(); // TODO: Consider removing / replacing this! - return res; -} - diff --git a/backends/platform/morphos/morphos_timer.cpp b/backends/platform/morphos/morphos_timer.cpp deleted file mode 100644 index 89391f940e..0000000000 --- a/backends/platform/morphos/morphos_timer.cpp +++ /dev/null @@ -1,237 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ - */ - -#include "common/stdafx.h" -#include "engines/engine.h" - -#include <exec/memory.h> -#include <exec/semaphores.h> -#include <dos/dostags.h> -#include <emul/emulinterface.h> - -#include <proto/exec.h> -#include <proto/dos.h> -#include <proto/timer.h> - -#include "morphos.h" -#include "timer.h" - -Timer::Timer(Engine * engine) -{ - if ((TimerServicePort = CreateMsgPort())) - { - TimerServiceStartup.mn_Node.ln_Type = NT_MESSAGE; - TimerServiceStartup.mn_ReplyPort = TimerServicePort; - TimerServiceStartup.mn_Length = sizeof(TimerServiceStartup); - - TimerServiceThread = CreateNewProcTags(NP_Entry, (ULONG) TimerService, - NP_CodeType, CODETYPE_PPC, - NP_Name, (ULONG) "ScummVM Timer Service", - NP_Priority, 0, - NP_StartupMsg, &TimerServiceStartup, - NP_PPC_Arg1, (ULONG) this, - NP_PPC_Arg2, (ULONG) engine, - TAG_DONE - ); - } -} - -Timer::~Timer() -{ - if (TimerServiceThread) - { - Signal((Task *) TimerServiceThread, SIGBREAKF_CTRL_C); - WaitPort(TimerServicePort); - DeleteMsgPort(TimerServicePort); - TimerServiceThread = NULL; - } -} - -bool Timer::init() -{ - return TimerServiceThread != NULL; -} - -void Timer::release() -{ -} - -bool Timer::installTimerProc(TimerProc procedure, int32 interval) -{ - return SendMsg(TSM_MSGID_ADDTIMER, procedure, interval); -} - -void Timer::removeTimerProc(TimerProc procedure) -{ - SendMsg(TSM_MSGID_REMTIMER, procedure, 0); -} - -bool Timer::SendMsg(ULONG msg_id, TimerProc procedure, LONG interval) -{ - if (TimerServiceThread == NULL) - return false; - - TimerServiceMessage *tmsg = (TimerServiceMessage *) AllocVec(sizeof (TimerServiceMessage), MEMF_PUBLIC | MEMF_CLEAR); - if (tmsg == NULL) - return false; - - tmsg->tsm_Message.mn_Node.ln_Type = NT_MESSAGE; - tmsg->tsm_Message.mn_ReplyPort = NULL; - tmsg->tsm_Message.mn_Length = sizeof (TimerServiceMessage); - tmsg->tsm_MsgID = msg_id; - tmsg->tsm_Callback = procedure; - tmsg->tsm_Interval = interval; - PutMsg(&TimerServiceThread->pr_MsgPort, (Message*) tmsg); - - return true; -} - -void Timer::TimerService(Timer *this_ptr, Engine *engine) -{ - MsgPort *port = &((Process *) FindTask(NULL))->pr_MsgPort; - ULONG port_bit = 1 << port->mp_SigBit; - ULONG signal_mask = SIGBREAKF_CTRL_C | port_bit; - ULONG timer_bits = 0, signals; - ULONG interval, t; - timeval start_callback, end_callback; - - ULONG timers = 0; - TimerSlot timer_slots[MAX_TIMERS]; - - for (;;) - { - signals = Wait(signal_mask); - - GetSysTime(&start_callback); - - if (signals & port_bit) - { - TimerServiceMessage *tmsg; - - while ((tmsg = (TimerServiceMessage *) GetMsg(port))) - { - if (tmsg->tsm_Message.mn_Length == sizeof (TimerServiceMessage)) - { - switch (tmsg->tsm_MsgID) - { - case TSM_MSGID_ADDTIMER: - if (timers < MAX_TIMERS) - { - ULONG unit = UNIT_MICROHZ; - - if (tmsg->tsm_Interval >= 1000000) - unit = UNIT_VBLANK; - if (OSystem_MorphOS::OpenATimer(&timer_slots[timers].ts_Port, (IORequest **) &timer_slots[timers].ts_IORequest, unit)) - { - timer_slots[timers].ts_Callback = tmsg->tsm_Callback; - timer_slots[timers].ts_Interval = tmsg->tsm_Interval; - timer_slots[timers].ts_SignalBit = 1 << timer_slots[timers].ts_Port->mp_SigBit; - - signal_mask |= timer_slots[timers].ts_SignalBit; - timer_bits |= timer_slots[timers].ts_SignalBit; - - timerequest *req = timer_slots[timers].ts_IORequest; - interval = timer_slots[timers].ts_Interval; - req->tr_node.io_Command = TR_ADDREQUEST; - req->tr_time.tv_secs = interval/1000000; - req->tr_time.tv_micro = interval%1000000; - SendIO((IORequest*) req); - - timers++; - } - } - break; - - case TSM_MSGID_REMTIMER: - { - for (t = 0; t < timers; t++) - { - if (timer_slots[t].ts_Callback == tmsg->tsm_Callback) - { - AbortIO((IORequest *) timer_slots[t].ts_IORequest); - WaitIO((IORequest *) timer_slots[t].ts_IORequest); - signal_mask &= ~timer_slots[t].ts_SignalBit; - timer_bits &= ~timer_slots[t].ts_SignalBit; - CloseDevice((IORequest *) timer_slots[t].ts_IORequest); - DeleteIORequest((IORequest *) timer_slots[t].ts_IORequest); - DeleteMsgPort(timer_slots[t].ts_Port); - if (t < timers-1) - memmove(&timer_slots[t], &timer_slots[t+1], sizeof (TimerSlot)*(timers-t-1)); - timers--; - continue; - } - } - break; - } - - default: - warning("MorphOS TimerService received message of unknown type."); - } - } - - if (tmsg->tsm_Message.mn_ReplyPort) - ReplyMsg((Message *) tmsg); - else - FreeVec((Message *) tmsg); - } - } - - if (signals & SIGBREAKF_CTRL_C) - break; - - if (signals & timer_bits) - { - for (t = 0; t < timers; t++) - { - if (signals & timer_slots[t].ts_SignalBit) - { - timerequest *req = timer_slots[t].ts_IORequest; - WaitIO((IORequest *) req); - interval = timer_slots[t].ts_Interval; - (*timer_slots[t].ts_Callback)(engine); - GetSysTime(&end_callback); - SubTime(&end_callback, &start_callback); - interval -= end_callback.tv_sec*1000000+end_callback.tv_micro/1000000+40000; - if (interval < 0) - interval = 0; - - req->tr_node.io_Command = TR_ADDREQUEST; - req->tr_time.tv_secs = interval/1000000; - req->tr_time.tv_micro = interval%1000000; - SendIO((IORequest*) req); - } - } - } - } - - for (t = 0; t < timers; t++) - { - AbortIO((IORequest *) timer_slots[t].ts_IORequest); - WaitIO((IORequest *) timer_slots[t].ts_IORequest); - CloseDevice((IORequest *) timer_slots[t].ts_IORequest); - DeleteIORequest((IORequest *) timer_slots[t].ts_IORequest); - DeleteMsgPort(timer_slots[t].ts_Port); - } -} - diff --git a/backends/platform/morphos/morphos_timer.h b/backends/platform/morphos/morphos_timer.h deleted file mode 100644 index 0eadf8a2de..0000000000 --- a/backends/platform/morphos/morphos_timer.h +++ /dev/null @@ -1,91 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ - */ - -#ifndef MORPHOS_TIMER_H -#define MORPHOS_TIMER_H - -#ifndef TIMER_H -#include "timer.h" // for MAX_TIMER -#endif - -#ifndef EXEC_PORTS_H -#include <exec/ports.h> -#endif - -#ifndef EXEC_IO_H -#include <exec/io.h> -#endif - -#ifndef EXEC_SEMAPHORES_H -#include <exec/semaphores.h> -#endif - -#ifndef DOS_DOSEXTENS_H -#include <dos/dosextens.h> -#endif - -class OSystem; - -#define TSM_MSGID_ADDTIMER 0 -#define TSM_MSGID_REMTIMER 1 - -struct TimerServiceMessage -{ - Message tsm_Message; - ULONG tsm_MsgID; - TimerProc tsm_Callback; - LONG tsm_Interval; -}; - -class Timer -{ - public: - Timer(Engine * engine); - ~Timer(); - - bool init(); - void release(); - bool installTimerProc(TimerProc procedure, int32 interval); - void removeTimerProc(TimerProc procedure); - - protected: - bool SendMsg(ULONG MsgID, TimerProc procedure, LONG interval); - static void TimerService(Timer *, Engine *); - - Process *TimerServiceThread; - MsgPort *TimerServicePort; - Message TimerServiceStartup; - - struct TimerSlot - { - MsgPort *ts_Port; - timerequest *ts_IORequest; - ULONG ts_SignalBit; - TimerProc ts_Callback; - LONG ts_Interval; - }; -}; - -#endif - diff --git a/backends/platform/sdl/events.cpp b/backends/platform/sdl/events.cpp index 19fb2372df..f69d46b4c6 100644 --- a/backends/platform/sdl/events.cpp +++ b/backends/platform/sdl/events.cpp @@ -23,7 +23,7 @@ * */ -#include "backends/platform/sdl/sdl-common.h" +#include "backends/platform/sdl/sdl.h" #include "common/util.h" #include "common/events.h" diff --git a/backends/platform/sdl/graphics.cpp b/backends/platform/sdl/graphics.cpp index f93c806aa8..721a5883a1 100644 --- a/backends/platform/sdl/graphics.cpp +++ b/backends/platform/sdl/graphics.cpp @@ -23,7 +23,7 @@ * */ -#include "backends/platform/sdl/sdl-common.h" +#include "backends/platform/sdl/sdl.h" #include "common/util.h" #include "graphics/font.h" #include "graphics/fontman.h" @@ -310,7 +310,6 @@ void OSystem_SDL::initSize(uint w, uint h) { void OSystem_SDL::loadGFXMode() { assert(_inited); _forceFull = true; - _modeFlags |= DF_UPDATE_EXPAND_1_PIXEL; int hwW, hwH; @@ -606,65 +605,55 @@ void OSystem_SDL::internUpdateScreen() { uint32 srcPitch, dstPitch; SDL_Rect *lastRect = _dirtyRectList + _numDirtyRects; - if (scalerProc == Normal1x && !_adjustAspectRatio && 0) { - for (r = _dirtyRectList; r != lastRect; ++r) { - dst = *r; + for (r = _dirtyRectList; r != lastRect; ++r) { + dst = *r; + dst.x++; // Shift rect by one since 2xSai needs to acces the data around + dst.y++; // any pixel to scale it, and we want to avoid mem access crashes. - dst.y += _currentShakePos; - if (SDL_BlitSurface(origSurf, r, _hwscreen, &dst) != 0) - error("SDL_BlitSurface failed: %s", SDL_GetError()); - } - } else { - for (r = _dirtyRectList; r != lastRect; ++r) { - dst = *r; - dst.x++; // Shift rect by one since 2xSai needs to acces the data around - dst.y++; // any pixel to scale it, and we want to avoid mem access crashes. - - if (SDL_BlitSurface(origSurf, r, srcSurf, &dst) != 0) - error("SDL_BlitSurface failed: %s", SDL_GetError()); - } + if (SDL_BlitSurface(origSurf, r, srcSurf, &dst) != 0) + error("SDL_BlitSurface failed: %s", SDL_GetError()); + } - SDL_LockSurface(srcSurf); - SDL_LockSurface(_hwscreen); + SDL_LockSurface(srcSurf); + SDL_LockSurface(_hwscreen); - srcPitch = srcSurf->pitch; - dstPitch = _hwscreen->pitch; + srcPitch = srcSurf->pitch; + dstPitch = _hwscreen->pitch; - for (r = _dirtyRectList; r != lastRect; ++r) { - register int dst_y = r->y + _currentShakePos; - register int dst_h = 0; - register int orig_dst_y = 0; - register int rx1 = r->x * scale1; + for (r = _dirtyRectList; r != lastRect; ++r) { + register int dst_y = r->y + _currentShakePos; + register int dst_h = 0; + register int orig_dst_y = 0; + register int rx1 = r->x * scale1; - if (dst_y < height) { - dst_h = r->h; - if (dst_h > height - dst_y) - dst_h = height - dst_y; + if (dst_y < height) { + dst_h = r->h; + if (dst_h > height - dst_y) + dst_h = height - dst_y; - orig_dst_y = dst_y; - dst_y = dst_y * scale1; + orig_dst_y = dst_y; + dst_y = dst_y * scale1; - if (_adjustAspectRatio && !_overlayVisible) - dst_y = real2Aspect(dst_y); + if (_adjustAspectRatio && !_overlayVisible) + dst_y = real2Aspect(dst_y); - assert(scalerProc != NULL); - scalerProc((byte *)srcSurf->pixels + (r->x * 2 + 2) + (r->y + 1) * srcPitch, srcPitch, - (byte *)_hwscreen->pixels + rx1 * 2 + dst_y * dstPitch, dstPitch, r->w, dst_h); - } + assert(scalerProc != NULL); + scalerProc((byte *)srcSurf->pixels + (r->x * 2 + 2) + (r->y + 1) * srcPitch, srcPitch, + (byte *)_hwscreen->pixels + rx1 * 2 + dst_y * dstPitch, dstPitch, r->w, dst_h); + } - r->x = rx1; - r->y = dst_y; - r->w = r->w * scale1; - r->h = dst_h * scale1; + r->x = rx1; + r->y = dst_y; + r->w = r->w * scale1; + r->h = dst_h * scale1; #ifndef DISABLE_SCALERS - if (_adjustAspectRatio && orig_dst_y < height && !_overlayVisible) - r->h = stretch200To240((uint8 *) _hwscreen->pixels, dstPitch, r->w, r->h, r->x, r->y, orig_dst_y * scale1); + if (_adjustAspectRatio && orig_dst_y < height && !_overlayVisible) + r->h = stretch200To240((uint8 *) _hwscreen->pixels, dstPitch, r->w, r->h, r->x, r->y, orig_dst_y * scale1); #endif - } - SDL_UnlockSurface(srcSurf); - SDL_UnlockSurface(_hwscreen); } + SDL_UnlockSurface(srcSurf); + SDL_UnlockSurface(_hwscreen); // Readjust the dirty rect list in case we are doing a full update. // This is necessary if shaking is active. @@ -893,7 +882,7 @@ void OSystem_SDL::addDirtyRect(int x, int y, int w, int h, bool realCoordinates) // Extend the dirty region by 1 pixel for scalers // that "smear" the screen, e.g. 2xSAI - if ((_modeFlags & DF_UPDATE_EXPAND_1_PIXEL) && !realCoordinates) { + if (!realCoordinates) { x--; y--; w+=2; diff --git a/backends/platform/sdl/main.cpp b/backends/platform/sdl/main.cpp new file mode 100644 index 0000000000..481f62e5d5 --- /dev/null +++ b/backends/platform/sdl/main.cpp @@ -0,0 +1,113 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * $URL$ + * $Id$ + * + */ + +#if defined(WIN32) +#include <windows.h> +// winnt.h defines ARRAYSIZE, but we want our own one... +#undef ARRAYSIZE +#endif + +#include "backends/platform/sdl/sdl.h" +#include "backends/plugins/sdl/sdl-provider.h" +#include "base/main.h" + +#if defined(__SYMBIAN32__) +#include "SymbianOs.h" +#endif + +#if !defined(__MAEMO__) && !defined(_WIN32_WCE) + +#if defined (WIN32) +int __stdcall WinMain(HINSTANCE /*hInst*/, HINSTANCE /*hPrevInst*/, LPSTR /*lpCmdLine*/, int /*iShowCmd*/) { + SDL_SetModuleHandle(GetModuleHandle(NULL)); + return main(__argc, __argv); +} +#endif + +int main(int argc, char *argv[]) { + +#if defined(__SYMBIAN32__) + // + // Set up redirects for stdout/stderr under Windows and Symbian. + // Code copied from SDL_main. + // + + // Symbian does not like any output to the console through any *print* function + char STDOUT_FILE[256], STDERR_FILE[256]; // shhh, don't tell anybody :) + strcpy(STDOUT_FILE, Symbian::GetExecutablePath()); + strcpy(STDERR_FILE, Symbian::GetExecutablePath()); + strcat(STDOUT_FILE, "scummvm.stdout.txt"); + strcat(STDERR_FILE, "scummvm.stderr.txt"); + + /* Flush the output in case anything is queued */ + fclose(stdout); + fclose(stderr); + + /* Redirect standard input and standard output */ + FILE *newfp = freopen(STDOUT_FILE, "w", stdout); + if (newfp == NULL) { /* This happens on NT */ +#if !defined(stdout) + stdout = fopen(STDOUT_FILE, "w"); +#else + newfp = fopen(STDOUT_FILE, "w"); + if (newfp) { + *stdout = *newfp; + } +#endif + } + newfp = freopen(STDERR_FILE, "w", stderr); + if (newfp == NULL) { /* This happens on NT */ +#if !defined(stderr) + stderr = fopen(STDERR_FILE, "w"); +#else + newfp = fopen(STDERR_FILE, "w"); + if (newfp) { + *stderr = *newfp; + } +#endif + } + setbuf(stderr, NULL); /* No buffering */ + +#endif // defined(__SYMBIAN32__) + + // Create our OSystem instance +#if defined(__SYMBIAN32__) + g_system = new OSystem_SDL_Symbian(); +#else + g_system = new OSystem_SDL(); +#endif + assert(g_system); + +#ifdef DYNAMIC_MODULES + PluginManager::instance().addPluginProvider(new SDLPluginProvider()); +#endif + + // Invoke the actual ScummVM main entry point: + int res = scummvm_main(argc, argv); + g_system->quit(); // TODO: Consider removing / replacing this! + return res; +} + +#endif diff --git a/backends/platform/sdl/module.mk b/backends/platform/sdl/module.mk index 18e56bc4fe..def01345db 100644 --- a/backends/platform/sdl/module.mk +++ b/backends/platform/sdl/module.mk @@ -3,6 +3,7 @@ MODULE := backends/platform/sdl MODULE_OBJS := \ events.o \ graphics.o \ + main.o \ sdl.o MODULE_DIRS += \ diff --git a/backends/platform/sdl/sdl.cpp b/backends/platform/sdl/sdl.cpp index fe78bd4236..c306f110ab 100644 --- a/backends/platform/sdl/sdl.cpp +++ b/backends/platform/sdl/sdl.cpp @@ -23,17 +23,9 @@ * */ -#if defined(WIN32) -#include <windows.h> -// winnt.h defines ARRAYSIZE, but we want our own one... -#undef ARRAYSIZE -#endif - -#include "backends/platform/sdl/sdl-common.h" -#include "backends/plugins/sdl/sdl-provider.h" +#include "backends/platform/sdl/sdl.h" #include "common/config-manager.h" #include "common/util.h" -#include "base/main.h" #include "backends/saves/default/default-saves.h" #include "backends/timer/default/default-timer.h" @@ -41,92 +33,11 @@ #include "icons/scummvm.xpm" -#if defined(__SYMBIAN32__) -#include "SymbianOs.h" -#endif - -#ifndef __MAEMO__ - static Uint32 timer_handler(Uint32 interval, void *param) { ((DefaultTimerManager *)param)->handler(); return interval; } -#ifndef _WIN32_WCE - -#if defined (WIN32) -int __stdcall WinMain(HINSTANCE /*hInst*/, HINSTANCE /*hPrevInst*/, LPSTR /*lpCmdLine*/, int /*iShowCmd*/) { - SDL_SetModuleHandle(GetModuleHandle(NULL)); - return main(__argc, __argv); -} -#endif - -int main(int argc, char *argv[]) { - -#if defined(__SYMBIAN32__) - // - // Set up redirects for stdout/stderr under Windows and Symbian. - // Code copied from SDL_main. - // - - // Symbian does not like any output to the console through any *print* function - char STDOUT_FILE[256], STDERR_FILE[256]; // shhh, don't tell anybody :) - strcpy(STDOUT_FILE, Symbian::GetExecutablePath()); - strcpy(STDERR_FILE, Symbian::GetExecutablePath()); - strcat(STDOUT_FILE, "scummvm.stdout.txt"); - strcat(STDERR_FILE, "scummvm.stderr.txt"); - - /* Flush the output in case anything is queued */ - fclose(stdout); - fclose(stderr); - - /* Redirect standard input and standard output */ - FILE *newfp = freopen(STDOUT_FILE, "w", stdout); - if (newfp == NULL) { /* This happens on NT */ -#if !defined(stdout) - stdout = fopen(STDOUT_FILE, "w"); -#else - newfp = fopen(STDOUT_FILE, "w"); - if (newfp) { - *stdout = *newfp; - } -#endif - } - newfp = freopen(STDERR_FILE, "w", stderr); - if (newfp == NULL) { /* This happens on NT */ -#if !defined(stderr) - stderr = fopen(STDERR_FILE, "w"); -#else - newfp = fopen(STDERR_FILE, "w"); - if (newfp) { - *stderr = *newfp; - } -#endif - } - setbuf(stderr, NULL); /* No buffering */ - -#endif // defined(__SYMBIAN32__) - - // Create our OSystem instance -#if defined(__SYMBIAN32__) - g_system = new OSystem_SDL_Symbian(); -#else - g_system = new OSystem_SDL(); -#endif - assert(g_system); - -#ifdef DYNAMIC_MODULES - PluginManager::instance().addPluginProvider(new SDLPluginProvider()); -#endif - - // Invoke the actual ScummVM main entry point: - int res = scummvm_main(argc, argv); - g_system->quit(); // TODO: Consider removing / replacing this! - return res; -} -#endif // defined(_WIN32_WCE) -#endif // defined(__MAEMO__) - void OSystem_SDL::initBackend() { assert(!_inited); @@ -162,12 +73,15 @@ void OSystem_SDL::initBackend() { _mode = GFX_DOUBLESIZE; _scaleFactor = 2; _scalerProc = Normal2x; - _fullscreen = ConfMan.getBool("fullscreen"); _adjustAspectRatio = ConfMan.getBool("aspect_ratio"); #else // for small screen platforms _mode = GFX_NORMAL; _scaleFactor = 1; _scalerProc = Normal1x; + _adjustAspectRatio = false; +#endif + _scalerType = 0; + _modeFlags = 0; #if !defined(_WIN32_WCE) && !defined(__SYMBIAN32__) _fullscreen = ConfMan.getBool("fullscreen"); @@ -175,13 +89,11 @@ void OSystem_SDL::initBackend() { _fullscreen = true; #endif - _adjustAspectRatio = false; -#endif - _scalerType = 0; - _modeFlags = 0; - -#if !defined(MACOSX) && !defined(__SYMBIAN32__) // Don't set icon on OS X, as we use a nicer external icon there - setupIcon(); // Don't for Symbian: it uses the EScummVM.aif file for the icon +#if !defined(MACOSX) && !defined(__SYMBIAN32__) + // Setup a custom program icon. + // Don't set icon on OS X, as we use a nicer external icon there. + // Don't for Symbian: it uses the EScummVM.aif file for the icon. + setupIcon(); #endif // enable joystick @@ -208,17 +120,18 @@ void OSystem_SDL::initBackend() { // Create and hook up the timer manager, if none exists yet (we check for // this to allow subclasses to provide their own). if (_timer == 0) { - // TODO: We could implement a custom SDLTimerManager by using + // Note: We could implement a custom SDLTimerManager by using // SDL_AddTimer. That might yield better timer resolution, but it would // also change the semantics of a timer: Right now, ScummVM timers // *never* run in parallel, due to the way they are implemented. If we // switched to SDL_AddTimer, each timer might run in a separate thread. - // Unfortunately, not all our code is prepared for that, so we can't just - // switch. But it's a long term goal to do just that! + // However, not all our code is prepared for that, so we can't just + // switch. Still, it's a potential future change to keep in mind. _timer = new DefaultTimerManager(); _timerID = SDL_AddTimer(10, &timer_handler, _timer); } + // Invoke parent implementation of this method OSystem::initBackend(); _inited = true; @@ -427,28 +340,22 @@ bool OSystem_SDL::setSoundCallback(SoundProc proc, void *param) { SDL_AudioSpec desired; SDL_AudioSpec obtained; - memset(&desired, 0, sizeof(desired)); - + // Determine the desired output sampling frequency. _samplesPerSec = 0; - if (ConfMan.hasKey("output_rate")) _samplesPerSec = ConfMan.getInt("output_rate"); - if (_samplesPerSec <= 0) _samplesPerSec = SAMPLES_PER_SEC; - // Originally, we always used 2048 samples. This loop will produce the - // same result at 22050 Hz, and should hopefully produce something - // sensible for other frequencies. Note that it must be a power of two. - - uint32 samples = 0x8000; - - for (;;) { - if ((1000 * samples) / _samplesPerSec < 100) - break; + // Determine the sample buffer size. We want it to store enough data for + // about 1/10th of a second. Note that it must be a power of two. + // So e.g. at 22050 Hz, we request a sample buffer size of 2048. + int samples = 0x8000; + while (10 * samples >= _samplesPerSec) { samples >>= 1; } + memset(&desired, 0, sizeof(desired)); desired.freq = _samplesPerSec; desired.format = AUDIO_S16SYS; desired.channels = 2; diff --git a/backends/platform/sdl/sdl-common.h b/backends/platform/sdl/sdl.h index 4795b22a53..35e6dde1cd 100644 --- a/backends/platform/sdl/sdl-common.h +++ b/backends/platform/sdl/sdl.h @@ -161,11 +161,11 @@ public: void deleteMutex(MutexRef mutex); // Overlay - virtual void showOverlay(); // WinCE FIXME - virtual void hideOverlay(); // WinCE FIXME + virtual void showOverlay(); + virtual void hideOverlay(); virtual void clearOverlay(); virtual void grabOverlay(OverlayColor *buf, int pitch); - virtual void copyRectToOverlay(const OverlayColor *buf, int pitch, int x, int y, int w, int h); // WinCE FIXME + virtual void copyRectToOverlay(const OverlayColor *buf, int pitch, int x, int y, int w, int h); virtual int16 getHeight(); virtual int16 getWidth(); virtual int16 getOverlayHeight() { return _overlayHeight; } @@ -237,8 +237,7 @@ protected: uint32 _cdEndTime, _cdStopTime; enum { - DF_WANT_RECT_OPTIM = 1 << 0, - DF_UPDATE_EXPAND_1_PIXEL = 1 << 1 + DF_WANT_RECT_OPTIM = 1 << 0 }; enum { diff --git a/backends/platform/wince/CELauncherDialog.cpp b/backends/platform/wince/CELauncherDialog.cpp index 994bba6437..aef85ebf6c 100644 --- a/backends/platform/wince/CELauncherDialog.cpp +++ b/backends/platform/wince/CELauncherDialog.cpp @@ -47,6 +47,8 @@ public: : Dialog(10, 60, 300, 77) { char tempo[100]; + // FIXME: Fingolfin asks: why is there a FIXME here? Please either clarify what + // needs fixing, or remove it! addButton(this,(_w - kButtonWidth) / 2, 45, "OK", kCloseCmd, '\r'); // Close dialog - FIXME Common::String videoDriver("Using SDL driver "); diff --git a/backends/platform/wince/README-WinCE.txt b/backends/platform/wince/README-WinCE.txt index 856afd45ab..17371f9c57 100644 --- a/backends/platform/wince/README-WinCE.txt +++ b/backends/platform/wince/README-WinCE.txt @@ -1,5 +1,5 @@ ScummVM Windows CE FAQ -Last updated: $Date: 2007-06-11 02:38:33 -0600 (Mon, 11 Jun 2007) $ +Last updated: $Date$ Release version: 0.10.0 ------------------------------------------------------------------------ diff --git a/backends/platform/wince/wince-sdl.cpp b/backends/platform/wince/wince-sdl.cpp index 2d6e9a4302..3487b1a649 100644 --- a/backends/platform/wince/wince-sdl.cpp +++ b/backends/platform/wince/wince-sdl.cpp @@ -1099,6 +1099,8 @@ bool OSystem_WINCE3::setGraphicsMode(int mode) { update_scalers(); + // FIXME: Fingolfin asks: why is there a FIXME here? Please either clarify what + // needs fixing, or remove it! // FIXME if (isOzone() && (getScreenWidth() >= 640 || getScreenHeight() >= 640) && mode) _scaleFactorXm = -1; @@ -1992,6 +1994,8 @@ void OSystem_WINCE3::hideOverlay() { } void OSystem_WINCE3::drawMouse() { + // FIXME: Fingolfin asks: why is there a FIXME here? Please either clarify what + // needs fixing, or remove it! // FIXME if (!(_toolbarHandler.visible() && _mouseCurState.y >= _toolbarHandler.getOffset() && !_usesEmulatedMouse) && !_forceHideMouse) internDrawMouse(); diff --git a/backends/saves/default/default-saves.cpp b/backends/saves/default/default-saves.cpp index 299c528e46..f4742f15a0 100644 --- a/backends/saves/default/default-saves.cpp +++ b/backends/saves/default/default-saves.cpp @@ -88,7 +88,6 @@ public: } }; - static void join_paths(const char *filename, const char *directory, char *buf, int bufsize) { buf[bufsize-1] = '\0'; @@ -115,6 +114,34 @@ static void join_paths(const char *filename, const char *directory, strncat(buf, filename, bufsize-1); } +Common::StringList DefaultSaveFileManager::listSavefiles(const char *regex) { + FilesystemNode savePath(getSavePath()); + FSList savefiles; + Common::StringList results; + Common::String search(regex); + + if (savePath.lookupFile(savefiles, savePath, search, false, true)) { + for (FSList::const_iterator file = savefiles.begin(); file != savefiles.end(); file++) { + results.push_back(file->getPath()); + } + } + + return results; +} + +Common::InSaveFile *DefaultSaveFileManager::openForLoading(const char *filename) { + char buf[256]; + join_paths(filename, getSavePath(), buf, sizeof(buf)); + + StdioSaveFile *sf = new StdioSaveFile(buf, false); + + if (!sf->isOpen()) { + delete sf; + sf = 0; + } + return wrapInSaveFile(sf); +} + Common::OutSaveFile *DefaultSaveFileManager::openForSaving(const char *filename) { char buf[256]; @@ -202,38 +229,10 @@ Common::OutSaveFile *DefaultSaveFileManager::openForSaving(const char *filename) return wrapOutSaveFile(sf); } -Common::InSaveFile *DefaultSaveFileManager::openForLoading(const char *filename) { - char buf[256]; - join_paths(filename, getSavePath(), buf, sizeof(buf)); - - StdioSaveFile *sf = new StdioSaveFile(buf, false); - - if (!sf->isOpen()) { - delete sf; - sf = 0; - } - return wrapInSaveFile(sf); -} - bool DefaultSaveFileManager::removeSavefile(const char *filename) { Common::File file; FilesystemNode savePath(filename); return file.remove(savePath); } -Common::StringList DefaultSaveFileManager::listSavefiles(const char *regex) { - FilesystemNode savePath(getSavePath()); - FSList savefiles; - Common::StringList results; - Common::String search(regex); - - if(savePath.lookupFile(savefiles, savePath, search, false, true)) { - for(FSList::const_iterator file = savefiles.begin(); file != savefiles.end(); file++) { - results.push_back(file->getPath()); - } - } - - return results; -} - #endif // !defined(DISABLE_DEFAULT_SAVEFILEMANAGER) diff --git a/backends/saves/default/default-saves.h b/backends/saves/default/default-saves.h index 2baddd1335..9346e79700 100644 --- a/backends/saves/default/default-saves.h +++ b/backends/saves/default/default-saves.h @@ -32,10 +32,10 @@ class DefaultSaveFileManager : public Common::SaveFileManager { public: - virtual Common::OutSaveFile *openForSaving(const char *filename); + virtual Common::StringList listSavefiles(const char *regex); virtual Common::InSaveFile *openForLoading(const char *filename); + virtual Common::OutSaveFile *openForSaving(const char *filename); virtual bool removeSavefile(const char *filename); - virtual Common::StringList listSavefiles(const char *regex); }; #endif diff --git a/base/main.cpp b/base/main.cpp index d8239db6e4..7a90c15ec6 100644 --- a/base/main.cpp +++ b/base/main.cpp @@ -52,10 +52,6 @@ #include "gui/launcher.h" #endif -#ifdef PALMOS_68K -#include "args.h" -#endif - static bool launcherDialog(OSystem &system) { @@ -105,7 +101,7 @@ static const Plugin *detectPlugin() { // FIXME: Do we really need this one? printf("Trying to start game '%s'\n", game.description().c_str()); - + return plugin; } @@ -249,9 +245,6 @@ extern "C" int scummvm_main(int argc, char *argv[]) { // Parse the command line Common::StringMap settings; command = Base::parseCommandLine(settings, argc, argv); -#ifdef PALMOS_68K - ArgsFree(argv); -#endif // Load the config file (possibly overriden via command line): if (settings.contains("config")) { diff --git a/common/advancedDetector.h b/common/advancedDetector.h index 5066ba71e9..1817f634a6 100644 --- a/common/advancedDetector.h +++ b/common/advancedDetector.h @@ -252,7 +252,7 @@ PluginError detectGameForEngineCreation(const Common::ADParams ¶ms); } // End of namespace AdvancedDetector -#define ADVANCED_DETECTOR_DEFINE_PLUGIN_WITH_FUNC(engine,factoryFunc,params) \ +#define _ADVANCED_DETECTOR_DEFINE_PLUGIN_HEAD(engine,params) \ GameList Engine_##engine##_gameIDList() { \ return Common::AdvancedDetector::gameIDList(params); \ } \ @@ -262,6 +262,10 @@ PluginError detectGameForEngineCreation(const Common::ADParams ¶ms); GameList Engine_##engine##_detectGames(const FSList &fslist) { \ return Common::AdvancedDetector::detectAllGames(fslist, params); \ } \ + void dummyFuncToAllowTrailingSemicolon() + +#define _ADVANCED_DETECTOR_DEFINE_PLUGIN_WITH_PREDEFINED_FUNC(engine,factoryFunc,params) \ + _ADVANCED_DETECTOR_DEFINE_PLUGIN_HEAD(engine,params); \ PluginError Engine_##engine##_create(OSystem *syst, Engine **engine) { \ assert(syst); \ assert(engine); \ @@ -272,11 +276,26 @@ PluginError detectGameForEngineCreation(const Common::ADParams ¶ms); } \ void dummyFuncToAllowTrailingSemicolon() +#define ADVANCED_DETECTOR_DEFINE_PLUGIN_WITH_COMPLEX_CREATION(engine,factoryFunc,params) \ + _ADVANCED_DETECTOR_DEFINE_PLUGIN_HEAD(engine,params); \ + PluginError Engine_##engine##_create(OSystem *syst, Engine **engine) { \ + assert(engine); \ + Common::EncapsulatedADGameDesc encapsulatedDesc = Common::AdvancedDetector::detectBestMatchingGame(params); \ + if (encapsulatedDesc.realDesc == 0) { \ + return kNoGameDataFoundError; \ + } \ + if (!factoryFunc(syst,engine,encapsulatedDesc)) { \ + return kNoGameDataFoundError; \ + } \ + return kNoError; \ + } \ + void dummyFuncToAllowTrailingSemicolon() + #define ADVANCED_DETECTOR_DEFINE_PLUGIN(engine,className,params) \ static Engine *engine##_createInstance(OSystem *syst) { \ return new className(syst); \ } \ - ADVANCED_DETECTOR_DEFINE_PLUGIN_WITH_FUNC(engine,engine##_createInstance,params); \ + _ADVANCED_DETECTOR_DEFINE_PLUGIN_WITH_PREDEFINED_FUNC(engine,engine##_createInstance,params); \ void dummyFuncToAllowTrailingSemicolon() diff --git a/engines/parallaction/commands.h b/common/error.h index 64510afc13..0ac84df5c3 100644 --- a/engines/parallaction/commands.h +++ b/common/error.h @@ -23,61 +23,25 @@ * */ -#ifndef PARALLACTION_COMMANDS_H -#define PARALLACTION_COMMANDS_H +#ifndef COMMON_ERROR_H +#define COMMON_ERROR_H +/** + * This file contains enums with error codes commonly used. + */ -#include "common/stdafx.h" -#include "common/scummsys.h" - -#include "parallaction/defs.h" - -namespace Parallaction { - -enum CommandFlags { - kFlagsVisited = 1, - kFlagsExit = 0x10000000, - kFlagsEnter = 0x20000000, - kFlagsGlobal = 0x40000000 -}; - -struct Zone; -struct Animation; - - -// TODO: turn this into a struct -union CommandData { - uint32 _flags; - Animation * _animation; - Zone* _zone; - char* _string; - uint16 _callable; - uint16 _object; - struct { - int16 _x; - int16 _y; - } _move; - - CommandData() { - _flags = 0; - } - - ~CommandData() { - } -}; - -struct Command { - uint16 _id; - CommandData u; - uint32 _flagsOn; - uint32 _flagsOff; - - Command(); - ~Command(); +/** + * Errors used in the SaveFileManager class. + */ +enum SFMError { + SFM_NO_ERROR, //Default state, indicates no error has been recorded + SFM_DIR_ACCESS, //stat(), mkdir()::EACCES: Search or write permission denied + SFM_DIR_LINKMAX, //mkdir()::EMLINK: The link count of the parent directory would exceed {LINK_MAX} + SFM_DIR_LOOP, //stat(), mkdir()::ELOOP: Too many symbolic links encountered while traversing the path + SFM_DIR_NAMETOOLONG, //stat(), mkdir()::ENAMETOOLONG: The path name is too long + SFM_DIR_NOENT, //stat(), mkdir()::ENOENT: A component of the path path does not exist, or the path is an empty string + SFM_DIR_NOTDIR, //stat(), mkdir()::ENOTDIR: A component of the path prefix is not a directory + SFM_DIR_ROFS //mkdir()::EROFS: The parent directory resides on a read-only file system }; -typedef ManagedList<Command*> CommandList; - -} // namespace Parallaction - -#endif +#endif //COMMON_ERROR_H diff --git a/common/file.cpp b/common/file.cpp index e70a9328cb..880383d220 100644 --- a/common/file.cpp +++ b/common/file.cpp @@ -24,6 +24,7 @@ */ #include "common/file.h" +#include "common/fs.h" #include "common/hashmap.h" #include "common/util.h" #include "common/hash-str.h" diff --git a/common/file.h b/common/file.h index 19b1d45144..416ca75ec7 100644 --- a/common/file.h +++ b/common/file.h @@ -30,9 +30,6 @@ #include "common/scummsys.h" #include "common/str.h" #include "common/stream.h" -#include "common/fs.h" -#include "backends/file/base-file.h" -//#include "backends/factories/fs-factory-maker.h" class FilesystemNode; @@ -41,9 +38,6 @@ namespace Common { class File : public SeekableReadStream, public WriteStream { protected: /** File handle to the actual file; 0 if no file is open. */ - BaseFile *_test; - - /** File handle to the actual file; 0 if no file is open. */ void *_handle; /** Status flag which tells about recent I/O failures. */ diff --git a/common/fs.cpp b/common/fs.cpp index 442e3ed4d7..3e0959b232 100644 --- a/common/fs.cpp +++ b/common/fs.cpp @@ -24,9 +24,8 @@ #include "common/stdafx.h" #include "common/util.h" -#include "common/fs.h" #include "backends/fs/abstract-fs.h" -#include "backends/factories/fs-factory-maker.cpp" +#include "backends/fs/fs-factory-maker.cpp" /* * Simple DOS-style pattern matching function (understands * and ? like used in DOS). @@ -83,7 +82,7 @@ FilesystemNode::FilesystemNode(const FilesystemNode &node) { } FilesystemNode::FilesystemNode(const Common::String &p) { - AbstractFilesystemFactory *factory = FilesystemFactoryMaker::makeFactory(); + AbstractFilesystemFactory *factory = makeFSFactory(); if (p.empty() || p == ".") _realNode = factory->makeCurrentDirectoryFileNode(); @@ -250,7 +249,7 @@ int FilesystemNode::lookupFileRec(FSList &results, FilesystemNode &dir, Common:: //TODO: here we assume all backends implement the lastPathComponent method. It is currently static, // so it might be a good idea to include it inside the backend class. This would enforce its // implementation by all ports. - if(matchString(_realNode->getLastPathComponent(entry->getPath()), filename.c_str())) { + if (matchString(lastPathComponent(entry->getPath()), filename.c_str())) { results.push_back(*entry); matches++; diff --git a/common/fs.h b/common/fs.h index 7f634791d6..38e5c64a10 100644 --- a/common/fs.h +++ b/common/fs.h @@ -120,7 +120,7 @@ public: */ bool operator<(const FilesystemNode& node) const; - /* + /** * Indicates whether the object referred by this path exists in the filesystem or not. * * @return bool true if the path exists, false otherwise. diff --git a/common/iff_container.h b/common/iff_container.h index 0d07b5bd57..cc55970591 100644 --- a/common/iff_container.h +++ b/common/iff_container.h @@ -18,8 +18,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL:https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/branches/gsoc2007-fsnode/common/iff_container.h $ - * $Id:iff_container.h 26949 2007-05-26 20:23:24Z david_corrales $ + * $URL$ + * $Id$ */ #ifndef COMMON_IFF_CONTAINER_H diff --git a/common/keyboard.h b/common/keyboard.h index dfc47af1ce..d0d0e43f00 100644 --- a/common/keyboard.h +++ b/common/keyboard.h @@ -18,8 +18,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL: https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/branches/gsoc2007-fsnode/common/keyboard.h $ - * $Id: keyboard.h 27654 2007-06-23 10:06:39Z fingolfin $ + * $URL$ + * $Id$ * */ diff --git a/common/savefile.h b/common/savefile.h index 3e1b9ffaaa..9fdd76ae15 100644 --- a/common/savefile.h +++ b/common/savefile.h @@ -31,6 +31,7 @@ #include "common/scummsys.h" #include "common/stream.h" #include "common/str.h" +#include "common/error.h" namespace Common { @@ -76,18 +77,6 @@ public: * returning the single SaveFileManager instances to be used. */ class SaveFileManager : NonCopyable { - -public: - enum SFMError { - SFM_NO_ERROR, //Default state, indicates no error has been recorded - SFM_DIR_ACCESS, //stat(), mkdir()::EACCES: Search or write permission denied - SFM_DIR_LINKMAX, //mkdir()::EMLINK: The link count of the parent directory would exceed {LINK_MAX} - SFM_DIR_LOOP, //stat(), mkdir()::ELOOP: Too many symbolic links encountered while traversing the path - SFM_DIR_NAMETOOLONG, //stat(), mkdir()::ENAMETOOLONG: The path name is too long - SFM_DIR_NOENT, //stat(), mkdir()::ENOENT: A component of the path path does not exist, or the path is an empty string - SFM_DIR_NOTDIR, //stat(), mkdir()::ENOTDIR: A component of the path prefix is not a directory - SFM_DIR_ROFS //mkdir()::EROFS: The parent directory resides on a read-only file system - }; protected: SFMError _error; diff --git a/common/scummsys.h b/common/scummsys.h index fb81bcb25a..25c5c166e3 100644 --- a/common/scummsys.h +++ b/common/scummsys.h @@ -200,21 +200,11 @@ #elif defined(__PALMOS_TRAPS__) || defined (__PALMOS_ARMLET__) - #ifdef PALMOS_68K - # include "globals.h" - # define SCUMM_BIG_ENDIAN - - # define scumm_stricmp StrCaselessCompare - # define scumm_strnicmp StrNCaselessCompare - - #else - - # include <extras_string.h> - # define SCUMM_LITTLE_ENDIAN + #include <extras_string.h> + #define SCUMM_LITTLE_ENDIAN - # define scumm_stricmp stricmp - # define scumm_strnicmp strnicmp - #endif + #define scumm_stricmp stricmp + #define scumm_strnicmp strnicmp #define SCUMM_NEED_ALIGNMENT #define STRINGBUFLEN 256 diff --git a/common/system.cpp b/common/system.cpp index f8068d41f5..a1bdb4cdcc 100644 --- a/common/system.cpp +++ b/common/system.cpp @@ -28,13 +28,13 @@ #include "backends/intern.h" #include "backends/events/default/default-events.h" -#include "gui/message.h" - #include "common/config-manager.h" #include "common/system.h" #include "common/timer.h" #include "common/util.h" +#include "graphics/colormasks.h" +#include "gui/message.h" #include "sound/mixer.h" OSystem *g_system = 0; @@ -66,6 +66,23 @@ bool OSystem::setGraphicsMode(const char *name) { return false; } +OverlayColor OSystem::RGBToColor(uint8 r, uint8 g, uint8 b) { + return ::RGBToColor<ColorMasks<565> >(r, g, b); +} + +void OSystem::colorToRGB(OverlayColor color, uint8 &r, uint8 &g, uint8 &b) { + ::colorToRGB<ColorMasks<565> >(color, r, g, b); +} + +OverlayColor OSystem::ARGBToColor(uint8 a, uint8 r, uint8 g, uint8 b) { + return RGBToColor(r, g, b); +} + +void OSystem::colorToARGB(OverlayColor color, uint8 &a, uint8 &r, uint8 &g, uint8 &b) { + colorToRGB(color, r, g, b); + a = 255; +} + void OSystem::displayMessageOnOSD(const char *msg) { // Display the message for 1.5 seconds GUI::TimedMessageDialog dialog(msg, 1500); diff --git a/common/system.h b/common/system.h index 79680c4655..a1df855449 100644 --- a/common/system.h +++ b/common/system.h @@ -495,17 +495,16 @@ public: virtual void updateScreen() = 0; /** - * Set current shake position, a feature needed for some SCUMM screen effects. - * The effect causes the displayed graphics to be shifted upwards by the specified - * (always positive) offset. The area at the bottom of the screen which is moved - * into view by this is filled by black. This does not cause any graphic data to - * be lost - that is, to restore the original view, the game engine only has to - * call this method again with a 0 offset. No calls to copyRectToScreen are necessary. + * Set current shake position, a feature needed for some SCUMM screen + * effects. The effect causes the displayed graphics to be shifted upwards + * by the specified (always positive) offset. The area at the bottom of the + * screen which is moved into view by this is filled with black. This does + * not cause any graphic data to be lost - that is, to restore the original + * view, the game engine only has to call this method again with offset + * equal to zero. No calls to copyRectToScreen are necessary. * @param shakeOffset the shake offset * - * @todo This is a rather special screen effect, only used by the SCUMM - * frontend - we should consider removing it from the backend API - * and instead implement the functionality in the frontend. + * @note This is currently used in the SCUMM, QUEEN and KYRA engines. */ virtual void setShakePos(int shakeOffset) = 0; @@ -549,8 +548,10 @@ public: * 8bpp), this needs some trickery. * * Essentially, we fake (alpha) blending on these systems by copying the - * game graphics into the overlay buffer, then manually compose whatever - * graphics we want to show in the overlay. + * current game graphics into the overlay buffer when activating the overlay, + * then manually compose whatever graphics we want to show in the overlay. + * This works because we assume the game to be "paused" whenever an overlay + * is active. */ //@{ @@ -607,9 +608,7 @@ public: * @see colorToRGB * @see ARGBToColor */ - virtual OverlayColor RGBToColor(uint8 r, uint8 g, uint8 b) { - return ((((r >> 3) & 0x1F) << 11) | (((g >> 2) & 0x3F) << 5) | ((b >> 3) & 0x1F)); - } + virtual OverlayColor RGBToColor(uint8 r, uint8 g, uint8 b); /** * Convert the given OverlayColor into a RGB triplet. An OverlayColor can @@ -619,14 +618,10 @@ public: * @see RGBToColor * @see colorToARGB */ - virtual void colorToRGB(OverlayColor color, uint8 &r, uint8 &g, uint8 &b) { - r = (((color >> 11) & 0x1F) << 3); - g = (((color >> 5) & 0x3F) << 2); - b = ((color&0x1F) << 3); - } + virtual void colorToRGB(OverlayColor color, uint8 &r, uint8 &g, uint8 &b); /** - * Convert the given ARGB quadruplet into an OverlayColor. A OverlayColor can + * Convert the given ARGB quadruplet into an OverlayColor. A OverlayColor can * be 8bit, 16bit or 32bit, depending on the target system. The default * implementation generates a 16 bit color value, in the 565 format * (that is, 5 bits red, 6 bits green, 5 bits blue). @@ -634,9 +629,7 @@ public: * @see colorToRGB * @see RGBToColor */ - virtual OverlayColor ARGBToColor(uint8 a, uint8 r, uint8 g, uint8 b) { - return RGBToColor(r, g, b); - } + virtual OverlayColor ARGBToColor(uint8 a, uint8 r, uint8 g, uint8 b); /** * Convert the given OverlayColor into an ARGB quadruplet. An OverlayColor can @@ -647,10 +640,7 @@ public: * @see ARGBToColor * @see colorToRGB */ - virtual void colorToARGB(OverlayColor color, uint8 &a, uint8 &r, uint8 &g, uint8 &b) { - colorToRGB(color, r, g, b); - a = 255; - } + virtual void colorToARGB(OverlayColor color, uint8 &a, uint8 &r, uint8 &g, uint8 &b); //@} diff --git a/common/util.cpp b/common/util.cpp index b38dfa6664..389e229a78 100644 --- a/common/util.cpp +++ b/common/util.cpp @@ -212,6 +212,7 @@ const PlatformDescription g_platforms[] = { {"atari", "atari-st", "st", "Atari ST", kPlatformAtariST}, {"c64", "c64", "c64", "Commodore 64", kPlatformC64}, {"pc", "dos", "ibm", "DOS", kPlatformPC}, + {"pc98", "pc98", "pc98", "PC-98", kPlatformPC98}, // The 'official' spelling seems to be "FM-TOWNS" (e.g. in the Indy4 demo). // However, on the net many variations can be seen, like "FMTOWNS", @@ -481,8 +482,9 @@ void CDECL debugC(int level, uint32 engine_level, const char *s, ...) { char buf[STRINGBUFLEN]; va_list va; - if (level > gDebugLevel || !(Common::gDebugLevelsEnabled & engine_level)) - return; + if (gDebugLevel != 11) + if (level > gDebugLevel || !(Common::gDebugLevelsEnabled & engine_level)) + return; va_start(va, s); vsnprintf(buf, STRINGBUFLEN, s, va); diff --git a/common/util.h b/common/util.h index 0d63af0878..6d1814280b 100644 --- a/common/util.h +++ b/common/util.h @@ -150,6 +150,7 @@ enum Platform { kPlatformPCEngine, kPlatformApple2GS, + kPlatformPC98, kPlatformUnknown = -1 }; diff --git a/dists/msvc8/agi.vcproj b/dists/msvc8/agi.vcproj index a90932df70..93929d9251 100644 --- a/dists/msvc8/agi.vcproj +++ b/dists/msvc8/agi.vcproj @@ -169,14 +169,6 @@ > </File> <File - RelativePath="..\..\engines\agi\agi_v2.cpp" - > - </File> - <File - RelativePath="..\..\engines\agi\agi_v3.cpp" - > - </File> - <File RelativePath="..\..\engines\agi\checks.cpp" > </File> @@ -229,6 +221,14 @@ > </File> <File + RelativePath="..\..\engines\agi\loader_v2.cpp" + > + </File> + <File + RelativePath="..\..\engines\agi\loader_v3.cpp" + > + </File> + <File RelativePath="..\..\engines\agi\logic.cpp" > </File> @@ -285,6 +285,30 @@ > </File> <File + RelativePath="..\..\engines\agi\preagi.cpp" + > + </File> + <File + RelativePath="..\..\engines\agi\preagi_common.cpp" + > + </File> + <File + RelativePath="..\..\engines\agi\preagi_mickey.cpp" + > + </File> + <File + RelativePath="..\..\engines\agi\preagi_mickey.h" + > + </File> + <File + RelativePath="..\..\engines\agi\preagi_winnie.cpp" + > + </File> + <File + RelativePath="..\..\engines\agi\preagi_winnie.h" + > + </File> + <File RelativePath="..\..\engines\agi\predictive.cpp" > </File> diff --git a/dists/msvc8/gob.vcproj b/dists/msvc8/gob.vcproj index 54b193f557..3a0f442d4a 100644 --- a/dists/msvc8/gob.vcproj +++ b/dists/msvc8/gob.vcproj @@ -333,6 +333,10 @@ > </File> <File + RelativePath="..\..\engines\gob\map_v4.cpp" + > + </File> + <File RelativePath="..\..\engines\gob\mult.cpp" > </File> diff --git a/dists/msvc8/parallaction.vcproj b/dists/msvc8/parallaction.vcproj index ec6d2bbacc..2c86f8fd69 100644 --- a/dists/msvc8/parallaction.vcproj +++ b/dists/msvc8/parallaction.vcproj @@ -161,10 +161,6 @@ </References> <Files> <File - RelativePath="..\..\engines\parallaction\animation.cpp" - > - </File> - <File RelativePath="..\..\engines\parallaction\callables_br.cpp" > </File> @@ -173,14 +169,6 @@ > </File> <File - RelativePath="..\..\engines\parallaction\commands.cpp" - > - </File> - <File - RelativePath="..\..\engines\parallaction\commands.h" - > - </File> - <File RelativePath="..\..\engines\parallaction\debug.cpp" > </File> @@ -213,6 +201,14 @@ > </File> <File + RelativePath="..\..\engines\parallaction\exec_br.cpp" + > + </File> + <File + RelativePath="..\..\engines\parallaction\exec_ns.cpp" + > + </File> + <File RelativePath="..\..\engines\parallaction\font.cpp" > </File> @@ -233,15 +229,19 @@ > </File> <File - RelativePath="..\..\engines\parallaction\location.cpp" + RelativePath="..\..\engines\parallaction\menu.cpp" > </File> <File - RelativePath="..\..\engines\parallaction\menu.cpp" + RelativePath="..\..\engines\parallaction\menu.h" > </File> <File - RelativePath="..\..\engines\parallaction\menu.h" + RelativePath="..\..\engines\parallaction\objects.cpp" + > + </File> + <File + RelativePath="..\..\engines\parallaction\objects.h" > </File> <File @@ -269,35 +269,35 @@ > </File> <File - RelativePath="..\..\engines\parallaction\saveload.cpp" + RelativePath="..\..\engines\parallaction\parser_br.cpp" > </File> <File - RelativePath="..\..\engines\parallaction\sound.cpp" + RelativePath="..\..\engines\parallaction\parser_ns.cpp" > </File> <File - RelativePath="..\..\engines\parallaction\sound.h" + RelativePath="..\..\engines\parallaction\saveload.cpp" > </File> <File - RelativePath="..\..\engines\parallaction\staticres.cpp" + RelativePath="..\..\engines\parallaction\sound.cpp" > </File> <File - RelativePath="..\..\engines\parallaction\walk.cpp" + RelativePath="..\..\engines\parallaction\sound.h" > </File> <File - RelativePath="..\..\engines\parallaction\walk.h" + RelativePath="..\..\engines\parallaction\staticres.cpp" > </File> <File - RelativePath="..\..\engines\parallaction\zone.cpp" + RelativePath="..\..\engines\parallaction\walk.cpp" > </File> <File - RelativePath="..\..\engines\parallaction\zone.h" + RelativePath="..\..\engines\parallaction\walk.h" > </File> </Files> diff --git a/dists/msvc8/saga.vcproj b/dists/msvc8/saga.vcproj index 7f31f781a6..e805916a1e 100644 --- a/dists/msvc8/saga.vcproj +++ b/dists/msvc8/saga.vcproj @@ -169,6 +169,10 @@ > </File> <File + RelativePath="..\..\engines\saga\actor_walk.cpp" + > + </File> + <File RelativePath="..\..\engines\saga\animation.cpp" > </File> diff --git a/dists/msvc8/scumm.vcproj b/dists/msvc8/scumm.vcproj index 324b5173df..b07c13f77e 100644 --- a/dists/msvc8/scumm.vcproj +++ b/dists/msvc8/scumm.vcproj @@ -558,6 +558,14 @@ > </File> <File + RelativePath="..\..\engines\scumm\file_nes.cpp" + > + </File> + <File + RelativePath="..\..\engines\scumm\file_nes.h" + > + </File> + <File RelativePath="..\..\engines\scumm\gfx.cpp" > </File> diff --git a/dists/msvc8/scummvm.vcproj b/dists/msvc8/scummvm.vcproj index 978e6ddc3f..981ca40e0f 100644 --- a/dists/msvc8/scummvm.vcproj +++ b/dists/msvc8/scummvm.vcproj @@ -859,13 +859,35 @@ > </File> <File - RelativePath="..\..\backends\platform\sdl\sdl-common.h" + RelativePath="..\..\backends\platform\sdl\main.cpp" > + <FileConfiguration + Name="Debug|Win32" + > + <Tool + Name="VCCLCompilerTool" + ObjectFile="$(IntDir)\$(InputName)1.obj" + XMLDocumentationFileName="$(IntDir)\$(InputName)1.xdc" + /> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32" + > + <Tool + Name="VCCLCompilerTool" + ObjectFile="$(IntDir)\$(InputName)1.obj" + XMLDocumentationFileName="$(IntDir)\$(InputName)1.xdc" + /> + </FileConfiguration> </File> <File RelativePath="..\..\backends\platform\sdl\sdl.cpp" > </File> + <File + RelativePath="..\..\backends\platform\sdl\sdl.h" + > + </File> </Filter> <Filter Name="fs" diff --git a/engines/agi/agi.cpp b/engines/agi/agi.cpp index 1c1c53dee7..bc3cd86e7c 100644 --- a/engines/agi/agi.cpp +++ b/engines/agi/agi.cpp @@ -46,8 +46,6 @@ #include "agi/menu.h" #include "agi/sound.h" - - namespace Agi { static uint32 g_tickTimer; @@ -370,7 +368,7 @@ int AgiEngine::agiInit() { memset(&_game.views[i], 0, sizeof(struct AgiView)); memset(&_game.pictures[i], 0, sizeof(struct AgiPicture)); memset(&_game.logics[i], 0, sizeof(struct AgiLogic)); - memset(&_game.sounds[i], 0, sizeof(struct AgiSound)); + memset(&_game.sounds[i], 0, sizeof(class AgiSound *)); // _game.sounds contains pointers now memset(&_game.dirView[i], 0, sizeof(struct AgiDir)); memset(&_game.dirPic[i], 0, sizeof(struct AgiDir)); memset(&_game.dirLogic[i], 0, sizeof(struct AgiDir)); @@ -495,7 +493,7 @@ int AgiEngine::agiDetectGame() { assert(_gameDescription != NULL); - if(getVersion() <= 0x2999) { + if (getVersion() <= 0x2999) { _loader = new AgiLoader_v2(this); } else { _loader = new AgiLoader_v3(this); @@ -521,6 +519,7 @@ int AgiEngine::agiLoadResource(int r, int n) { int i; i = _loader->loadResource(r, n); + return i; } @@ -602,7 +601,11 @@ AgiButtonStyle::AgiButtonStyle(Common::RenderMode renderMode) { setAmigaStyle(renderMode == Common::kRenderAmiga); } -AgiEngine::AgiEngine(OSystem *syst) : Engine(syst) { +AgiBase::AgiBase(OSystem *syst) : Engine(syst) { + +} + +AgiEngine::AgiEngine(OSystem *syst) : AgiBase(syst) { // Setup mixer if (!_mixer->isReady()) { @@ -677,13 +680,20 @@ void AgiEngine::initialize() { // drivers, and I'm not sure what they are. For now, they might // as well be called "PC Speaker" and "Not PC Speaker". - switch (MidiDriver::detectMusicDriver(MDT_PCSPK)) { - case MD_PCSPK: - _soundemu = SOUND_EMU_PC; - break; - default: - _soundemu = SOUND_EMU_NONE; - break; + // If used platform is Apple IIGS then we must use Apple IIGS sound emulation + // because Apple IIGS AGI games use only Apple IIGS specific sound resources. + if (ConfMan.hasKey("platform") && + Common::parsePlatform(ConfMan.get("platform")) == Common::kPlatformApple2GS) { + _soundemu = SOUND_EMU_APPLE2GS; + } else { + switch (MidiDriver::detectMusicDriver(MDT_PCSPK)) { + case MD_PCSPK: + _soundemu = SOUND_EMU_PC; + break; + default: + _soundemu = SOUND_EMU_NONE; + break; + } } if (ConfMan.hasKey("render_mode")) { diff --git a/engines/agi/agi.h b/engines/agi/agi.h index f37b61478e..dfe149de4f 100644 --- a/engines/agi/agi.h +++ b/engines/agi/agi.h @@ -45,8 +45,6 @@ typedef signed int Err; * Version and other definitions */ -#define USE_IIGS_SOUND - #define TITLE "AGI engine" #define DIR_ "dir" @@ -88,6 +86,29 @@ typedef signed int Err; #define ADD_PIC 1 #define ADD_VIEW 2 +enum AgiGameID { + GID_AGIDEMO, + GID_BC, + GID_DDP, + GID_GOLDRUSH, + GID_KQ1, + GID_KQ2, + GID_KQ3, + GID_KQ4, + GID_LSL1, + GID_MH1, + GID_MH2, + GID_MIXEDUP, + GID_PQ1, + GID_SQ1, + GID_SQ2, + GID_XMASCARD, + GID_FANMADE, + GID_MICKEY, // PreAGI + GID_WINNIE, // PreAGI + GID_TROLL // PreAGI +}; + } // End of namespace Agi /* AGI resources */ @@ -100,8 +121,9 @@ typedef signed int Err; namespace Agi { enum AgiGameType { + GType_PreAGI = 0, GType_V2 = 1, - GType_V3 + GType_V3 = 2 }; enum AgiGameFeatures { @@ -116,26 +138,6 @@ enum AgiGameFeatures { GF_ESCPAUSE = (1 << 8) }; -enum AgiGameID { - GID_AGIDEMO, - GID_BC, - GID_DDP, - GID_GOLDRUSH, - GID_KQ1, - GID_KQ2, - GID_KQ3, - GID_KQ4, - GID_LSL1, - GID_MH1, - GID_MH2, - GID_MIXEDUP, - GID_PQ1, - GID_SQ1, - GID_SQ2, - GID_XMASCARD, - GID_FANMADE // TODO: Should this be extended to include all fanmade games? -}; - struct AGIGameDescription; enum { @@ -527,7 +529,7 @@ struct AgiGame { AgiPicture pictures[MAX_DIRS]; /**< AGI picture resources */ AgiLogic logics[MAX_DIRS]; /**< AGI logic resources */ AgiView views[MAX_DIRS]; /**< AGI view resources */ - AgiSound sounds[MAX_DIRS]; /**< AGI sound resources */ + AgiSound *sounds[MAX_DIRS]; /**< Pointers to AGI sound resources */ /* view table */ VtEntry viewTable[MAX_VIEWTABLE]; @@ -538,10 +540,6 @@ struct AgiGame { }; class AgiLoader { -private: - int intVersion; - AgiEngine *_vm; - public: AgiLoader() {} @@ -644,7 +642,50 @@ struct StringData { #define KEY_QUEUE_SIZE 16 -class AgiEngine : public ::Engine { +class AgiBase : public ::Engine { +public: + AgiButtonStyle _defaultButtonStyle; + AgiButtonStyle _buttonStyle; + Common::RenderMode _renderMode; + volatile uint32 _clockCount; + AgiDebug _debug; + AgiGame _game; + Common::RandomSource *_rnd; + + virtual void agiTimerLow() = 0; + virtual int agiGetKeypressLow() = 0; + virtual int agiIsKeypressLow() = 0; + + AgiBase(OSystem *syst); + + #define INITIAL_IMAGE_STACK_SIZE 32 + + int _stackSize; + ImageStackElement *_imageStack; + int _imageStackPointer; + + virtual void clearImageStack() = 0; + virtual void recordImageStackCall(uint8 type, int16 p1, int16 p2, int16 p3, + int16 p4, int16 p5, int16 p6, int16 p7) = 0; + virtual void replayImageStackCall(uint8 type, int16 p1, int16 p2, int16 p3, + int16 p4, int16 p5, int16 p6, int16 p7) = 0; + virtual void releaseImageStack() = 0; + + int _soundemu; + + int getflag(int); + void setflag(int, int); + void flipflag(int); + + const AGIGameDescription *_gameDescription; + uint32 getGameID() const; + uint32 getFeatures() const; + uint16 getVersion() const; + uint16 getGameType() const; + Common::Platform getPlatform() const; +}; + +class AgiEngine : public AgiBase { int _gameId; protected: @@ -662,12 +703,6 @@ public: return _gameId; } - const AGIGameDescription *_gameDescription; - uint32 getGameID() const; - uint32 getFeatures() const; - uint16 getVersion() const; - Common::Platform getPlatform() const; - private: int _keyQueue[KEY_QUEUE_SIZE]; @@ -685,15 +720,10 @@ private: int _firstSlot; public: - AgiGame _game; AgiObject *_objects; /* objects in the game */ StringData _stringdata; - AgiLoader *_loader; /* loader */ - - Common::RandomSource *_rnd; - const char *getSavegameFilename(int num); void getSavegameDescription(int num, char *buf, bool showEmpty = true); int selectSlot(); @@ -704,14 +734,10 @@ public: int loadGameDialog(); int loadGameSimple(); - volatile uint32 _clockCount; - uint8 *_intobj; int _oldMode; Menu* _menu; - AgiButtonStyle _buttonStyle; - AgiButtonStyle _defaultButtonStyle; char _lastSentence[40]; @@ -719,12 +745,7 @@ public: GfxMgr *_gfx; SoundMgr *_sound; PictureMgr *_picture; - - #define INITIAL_IMAGE_STACK_SIZE 32 - - int _stackSize; - ImageStackElement *_imageStack; - int _imageStackPointer; + AgiLoader *_loader; /* loader */ void clearImageStack(); void recordImageStackCall(uint8 type, int16 p1, int16 p2, int16 p3, @@ -733,10 +754,6 @@ public: int16 p4, int16 p5, int16 p6, int16 p7); void releaseImageStack(); - AgiDebug _debug; - Common::RenderMode _renderMode; - int _soundemu; - int _keyControl; int _keyAlt; @@ -752,18 +769,15 @@ public: int agiUnloadResource(int, int); void agiUnloadResources(); - void agiTimerLow(); - int agiGetKeypressLow(); - int agiIsKeypressLow(); + virtual void agiTimerLow(); + virtual int agiGetKeypressLow(); + virtual int agiIsKeypressLow(); static void agiTimerFunctionLow(void *refCon); void initPriTable(); void newInputMode(int); void oldInputMode(); - int getflag(int); - void setflag(int, int); - void flipflag(int); int getvar(int); void setvar(int, int); void decrypt(uint8 * mem, int len); @@ -811,7 +825,6 @@ public: int decodeLogic(int); void unloadLogic(int); int runLogic(int); - void debugConsole(int, int, const char *); int testIfCode(int); void executeAgiCommand(uint8, uint8 *); diff --git a/engines/agi/console.h b/engines/agi/console.h index ad955d51ae..a6994ce922 100644 --- a/engines/agi/console.h +++ b/engines/agi/console.h @@ -31,6 +31,7 @@ namespace Agi { class AgiEngine; +class PreAgiEngine; struct AgiDebug { int enabled; diff --git a/engines/agi/detection.cpp b/engines/agi/detection.cpp index 79e3be3238..afd61ae765 100644 --- a/engines/agi/detection.cpp +++ b/engines/agi/detection.cpp @@ -28,9 +28,11 @@ #include "base/plugins.h" #include "common/advancedDetector.h" +#include "common/config-manager.h" #include "common/file.h" #include "agi/agi.h" +#include "agi/preagi.h" #include "agi/wagparser.h" @@ -45,22 +47,26 @@ struct AGIGameDescription { uint16 version; }; -uint32 AgiEngine::getGameID() const { +uint32 AgiBase::getGameID() const { return _gameDescription->gameID; } -uint32 AgiEngine::getFeatures() const { +uint32 AgiBase::getFeatures() const { return _gameDescription->features; } -Common::Platform AgiEngine::getPlatform() const { +Common::Platform AgiBase::getPlatform() const { return _gameDescription->desc.platform; } -uint16 AgiEngine::getVersion() const { +uint16 AgiBase::getVersion() const { return _gameDescription->version; } +uint16 AgiBase::getGameType() const { + return _gameDescription->gameType; +} + } static const PlainGameDescriptor agiGames[] = { @@ -76,6 +82,7 @@ static const PlainGameDescriptor agiGames[] = { {"kq3", "King's Quest III: To Heir Is Human"}, {"kq4", "King's Quest IV: The Perils of Rosella"}, {"lsl1", "Leisure Suit Larry in the Land of the Lounge Lizards"}, + {"mickey", "Mickey\'s Space Adventure"}, {"mixedup", "Mixed-Up Mother Goose"}, {"mh1", "Manhunter 1: New York"}, {"mh2", "Manhunter 2: San Francisco"}, @@ -87,6 +94,8 @@ static const PlainGameDescriptor agiGames[] = { {"sq2", "Space Quest II: Vohaul's Revenge"}, {"sqx", "Space Quest X: The Lost Chapter"}, {"tetris", "AGI Tetris"}, + {"troll", "Troll\'s Tale"}, + {"winnie", "Winnie the Pooh in the Hundred Acre Wood"}, {"xmascard", "Xmas Card"}, {0, 0} @@ -1114,6 +1123,23 @@ static const AGIGameDescription gameDescriptions[] = { 0x3149, }, + { + // Mickey's Space Adventure + // Preagi game + { + "mickey", + "", + AD_ENTRY1("1.pic", "b6ec04c91a05df374792872c4d4ce66d"), + Common::EN_ANY, + Common::kPlatformPC, + Common::ADGF_NO_FLAGS + }, + GID_MICKEY, + GType_PreAGI, + 0, + 0x0000, + }, + #if 0 { // Mixed-Up Mother Goose (Amiga) 1.1 @@ -1590,6 +1616,39 @@ static const AGIGameDescription gameDescriptions[] = { 0x2936, }, + { + // Troll's Tale + // preagi game + { + "troll", + "", + AD_ENTRY1s("troll.exe", "c594b4d6791e9580d8d5dc9d71760027", 59120), + Common::EN_ANY, + Common::kPlatformPC, + Common::ADGF_NO_FLAGS + }, + GID_TROLL, + GType_PreAGI, + 0, + 0x0000, + }, + + { + // Winnie the Pooh in the Hundred Acre Wood + // preagi game + { + "winnie", + "", + AD_ENTRY1("title.pic", "2e7900c1ccaa7671d65405f6d1efed30"), + Common::EN_ANY, + Common::kPlatformPC, + Common::ADGF_NO_FLAGS + }, + GID_WINNIE, + GType_PreAGI, + 0, + 0x0000, + }, { // Xmas Card 1986 (PC) [AGI 2.272] @@ -1865,8 +1924,13 @@ Common::EncapsulatedADGameDesc fallbackDetector(const FSList *fslist) { // Use the current directory for searching if fslist == NULL if (fslist == NULL) { - FilesystemNode fsCurrentDir("."); - fslistCurrentDir.push_back(fsCurrentDir); + Common::String path = ConfMan.get("path").c_str(); + + if (path.empty()) + path = "."; + + FilesystemNode fsCurrentDir(path); + fsCurrentDir.getChildren(fslistCurrentDir, FilesystemNode::kListFilesOnly); fslist = &fslistCurrentDir; } @@ -2027,9 +2091,31 @@ static const Common::ADParams detectionParams = { Common::kADFlagAugmentPreferredTarget }; -ADVANCED_DETECTOR_DEFINE_PLUGIN(AGI, Agi::AgiEngine, detectionParams); +bool engineCreateAgi(OSystem *syst, Engine **engine, Common::EncapsulatedADGameDesc encapsulatedDesc) { + const Agi::AGIGameDescription *gd = (const Agi::AGIGameDescription *)(encapsulatedDesc.realDesc); + bool res = true; + + switch (gd->gameType) { + case Agi::GType_PreAGI: + *engine = new Agi::PreAgiEngine(syst); + break; + case Agi::GType_V2: + *engine = new Agi::AgiEngine(syst); + break; + case Agi::GType_V3: + *engine = new Agi::AgiEngine(syst); + break; + default: + res = false; + error("AGI engine: unknown gameType"); + } + + return res; +} -REGISTER_PLUGIN(AGI, "AGI v2 + v3 Engine", "Sierra AGI Engine (C) Sierra On-Line Software"); +ADVANCED_DETECTOR_DEFINE_PLUGIN_WITH_COMPLEX_CREATION(AGI, engineCreateAgi, detectionParams); + +REGISTER_PLUGIN(AGI, "AGI preAGI + v2 + v3 Engine", "Sierra AGI Engine (C) Sierra On-Line Software"); namespace Agi { @@ -2040,5 +2126,12 @@ bool AgiEngine::initGame() { return (_gameDescription != 0); } +bool PreAgiEngine::initGame() { + Common::EncapsulatedADGameDesc encapsulatedDesc = Common::AdvancedDetector::detectBestMatchingGame(detectionParams); + _gameDescription = (const AGIGameDescription *)(encapsulatedDesc.realDesc); + + return (_gameDescription != 0); +} + } // End of namespace Agi diff --git a/engines/agi/font.h b/engines/agi/font.h index 12b36f2520..1bf61878ec 100644 --- a/engines/agi/font.h +++ b/engines/agi/font.h @@ -294,6 +294,524 @@ static const uint8 curFont[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x42, 0x7E, 0x00 }; +static const uint8 mickey_fontdata[] = { + 0x00, 0x36, 0x7F, 0x7F, 0x3E, 0x1C, 0x08, 0x00, + 0x00, 0x00, 0x3F, 0x20, 0x2F, 0x28, 0x28, 0x28, + 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, + 0x28, 0x28, 0x2F, 0x20, 0x2F, 0x28, 0x28, 0x28, + 0x28, 0x28, 0x2F, 0x20, 0x3F, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xFF, 0x00, 0xEF, 0x28, 0x28, 0x28, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x28, 0x28, 0xEF, 0x00, 0xEF, 0x28, 0x28, 0x28, + 0x28, 0x28, 0xEF, 0x00, 0xFF, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xF8, 0x08, 0xE8, 0x28, 0x28, 0x28, + 0x28, 0x28, 0xE8, 0x08, 0xE8, 0x28, 0x28, 0x28, + 0x28, 0x28, 0xE8, 0x08, 0xF8, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x10, 0x10, 0x10, + 0x10, 0x10, 0xFF, 0x00, 0xFF, 0x10, 0x10, 0x10, + 0x10, 0x10, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0x00, + 0x10, 0x10, 0x10, 0xFF, 0x10, 0x10, 0x10, 0x10, + 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, + 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, + 0x18, 0x18, 0x18, 0x1F, 0x1F, 0x00, 0x00, 0x00, + 0x78, 0x60, 0x78, 0x60, 0x7E, 0x18, 0x1E, 0x00, + 0x00, 0x18, 0x3C, 0x7E, 0x18, 0x18, 0x18, 0x00, + 0x00, 0x18, 0x18, 0x18, 0x7E, 0x3C, 0x18, 0x00, + 0x00, 0x18, 0x30, 0x7E, 0x30, 0x18, 0x00, 0x00, + 0x00, 0x18, 0x0C, 0x7E, 0x0C, 0x18, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x18, 0x18, 0x18, 0x18, 0x00, 0x18, 0x18, 0x00, + 0x66, 0x66, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x66, 0xFF, 0x66, 0x66, 0xFF, 0x66, 0x00, + 0x18, 0x3E, 0x60, 0x3C, 0x06, 0x7C, 0x18, 0x00, + 0x00, 0x66, 0x6C, 0x18, 0x30, 0x66, 0x46, 0x00, + 0x1C, 0x36, 0x1C, 0x38, 0x6F, 0x66, 0x3B, 0x00, + 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x0E, 0x1C, 0x18, 0x18, 0x18, 0x1C, 0x0E, 0x00, + 0x70, 0x38, 0x18, 0x18, 0x18, 0x38, 0x70, 0x00, + 0x00, 0x66, 0x3C, 0xFF, 0x3C, 0x66, 0x00, 0x00, + 0x00, 0x18, 0x18, 0x7E, 0x18, 0x18, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x30, + 0x00, 0x00, 0x00, 0x7E, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, + 0x02, 0x06, 0x0C, 0x18, 0x30, 0x60, 0x40, 0x00, + 0x3C, 0x66, 0x6E, 0x7E, 0x76, 0x66, 0x3C, 0x00, + 0x18, 0x38, 0x18, 0x18, 0x18, 0x18, 0x7E, 0x00, + 0x3C, 0x66, 0x06, 0x0C, 0x18, 0x30, 0x7E, 0x00, + 0x7E, 0x0C, 0x18, 0x0C, 0x06, 0x66, 0x3C, 0x00, + 0x0C, 0x1C, 0x3C, 0x6C, 0x6C, 0x7E, 0x0C, 0x00, + 0x7E, 0x60, 0x7C, 0x06, 0x06, 0x66, 0x3C, 0x00, + 0x3C, 0x60, 0x60, 0x7C, 0x66, 0x66, 0x3C, 0x00, + 0x7E, 0x06, 0x0C, 0x18, 0x30, 0x30, 0x30, 0x00, + 0x3C, 0x66, 0x66, 0x3C, 0x66, 0x66, 0x3C, 0x00, + 0x3C, 0x66, 0x66, 0x3E, 0x06, 0x0C, 0x38, 0x00, + 0x00, 0x18, 0x18, 0x00, 0x00, 0x18, 0x18, 0x00, + 0x00, 0x18, 0x18, 0x00, 0x00, 0x18, 0x18, 0x30, + 0x06, 0x0C, 0x18, 0x30, 0x18, 0x0C, 0x06, 0x00, + 0x00, 0x00, 0x7E, 0x00, 0x00, 0x7E, 0x00, 0x00, + 0x60, 0x30, 0x18, 0x0C, 0x18, 0x30, 0x60, 0x00, + 0x3C, 0x66, 0x04, 0x0C, 0x18, 0x00, 0x18, 0x00, + 0x66, 0x66, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x18, 0x3C, 0x66, 0x66, 0x7E, 0x66, 0x66, 0x00, + 0x7C, 0x66, 0x66, 0x7C, 0x66, 0x66, 0x7C, 0x00, + 0x3C, 0x66, 0x60, 0x60, 0x60, 0x66, 0x3C, 0x00, + 0x78, 0x6C, 0x66, 0x66, 0x66, 0x6C, 0x78, 0x00, + 0x7E, 0x60, 0x60, 0x7C, 0x60, 0x60, 0x7E, 0x00, + 0x7E, 0x60, 0x60, 0x7C, 0x60, 0x60, 0x60, 0x00, + 0x3E, 0x60, 0x60, 0x6E, 0x66, 0x66, 0x3E, 0x00, + 0x66, 0x66, 0x66, 0x7E, 0x66, 0x66, 0x66, 0x00, + 0x7E, 0x18, 0x18, 0x18, 0x18, 0x18, 0x7E, 0x00, + 0x06, 0x06, 0x06, 0x06, 0x06, 0x66, 0x3C, 0x00, + 0x66, 0x6C, 0x78, 0x78, 0x6C, 0x66, 0x66, 0x00, + 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x7E, 0x00, + 0x63, 0x77, 0x7F, 0x6B, 0x63, 0x63, 0x63, 0x00, + 0x66, 0x76, 0x7E, 0x7E, 0x6E, 0x66, 0x66, 0x00, + 0x3C, 0x66, 0x66, 0x66, 0x66, 0x66, 0x3C, 0x00, + 0x7C, 0x66, 0x66, 0x66, 0x7C, 0x60, 0x60, 0x00, + 0x3C, 0x66, 0x66, 0x66, 0x66, 0x6C, 0x36, 0x00, + 0x7C, 0x66, 0x66, 0x7C, 0x6C, 0x66, 0x66, 0x00, + 0x3C, 0x60, 0x60, 0x3C, 0x06, 0x06, 0x3C, 0x00, + 0x7E, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x00, + 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x7E, 0x00, + 0x66, 0x66, 0x66, 0x66, 0x66, 0x3C, 0x18, 0x00, + 0x63, 0x63, 0x63, 0x6B, 0x7F, 0x77, 0x63, 0x00, + 0x66, 0x66, 0x3C, 0x3C, 0x66, 0x66, 0x66, 0x00, + 0x66, 0x66, 0x66, 0x3C, 0x18, 0x18, 0x18, 0x00, + 0x7E, 0x0C, 0x18, 0x30, 0x60, 0x60, 0x7E, 0x00, + 0x1E, 0x18, 0x18, 0x18, 0x18, 0x18, 0x1E, 0x00, + 0x00, 0x40, 0x60, 0x30, 0x18, 0x0C, 0x06, 0x00, + 0x78, 0x18, 0x18, 0x18, 0x18, 0x18, 0x78, 0x00, + 0x00, 0x08, 0x1C, 0x36, 0x63, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0x18, 0x3C, 0x7E, 0x7E, 0x3C, 0x18, 0x00, + 0x00, 0x00, 0x3C, 0x06, 0x3E, 0x66, 0x3E, 0x00, + 0x60, 0x60, 0x7C, 0x66, 0x66, 0x66, 0x7C, 0x00, + 0x00, 0x00, 0x3C, 0x60, 0x60, 0x60, 0x3C, 0x00, + 0x06, 0x06, 0x3E, 0x66, 0x66, 0x66, 0x3E, 0x00, + 0x00, 0x00, 0x3C, 0x66, 0x7E, 0x60, 0x3C, 0x00, + 0x0E, 0x18, 0x18, 0x3E, 0x18, 0x18, 0x18, 0x00, + 0x00, 0x00, 0x3E, 0x66, 0x66, 0x3E, 0x06, 0x7C, + 0x60, 0x60, 0x7C, 0x66, 0x66, 0x66, 0x66, 0x00, + 0x18, 0x00, 0x38, 0x18, 0x18, 0x18, 0x3C, 0x00, + 0x06, 0x00, 0x06, 0x06, 0x06, 0x06, 0x06, 0x3C, + 0x60, 0x60, 0x6C, 0x78, 0x6C, 0x66, 0x66, 0x00, + 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3C, 0x00, + 0x00, 0x00, 0x66, 0x7F, 0x7F, 0x6B, 0x63, 0x00, + 0x00, 0x00, 0x7C, 0x66, 0x66, 0x66, 0x66, 0x00, + 0x00, 0x00, 0x3C, 0x66, 0x66, 0x66, 0x3C, 0x00, + 0x00, 0x00, 0x7C, 0x66, 0x66, 0x7C, 0x60, 0x60, + 0x00, 0x00, 0x3E, 0x66, 0x66, 0x3E, 0x06, 0x06, + 0x00, 0x00, 0x7C, 0x66, 0x60, 0x60, 0x60, 0x00, + 0x00, 0x00, 0x3E, 0x60, 0x3C, 0x06, 0x7C, 0x00, + 0x18, 0x18, 0x7E, 0x18, 0x18, 0x18, 0x0E, 0x00, + 0x00, 0x00, 0x66, 0x66, 0x66, 0x66, 0x3E, 0x00, + 0x00, 0x00, 0x66, 0x66, 0x66, 0x3C, 0x18, 0x00, + 0x00, 0x00, 0x63, 0x6B, 0x7F, 0x3E, 0x36, 0x00, + 0x00, 0x00, 0x66, 0x3C, 0x18, 0x3C, 0x66, 0x00, + 0x00, 0x00, 0x66, 0x66, 0x66, 0x3E, 0x0C, 0x78, + 0x00, 0x00, 0x7E, 0x0C, 0x18, 0x30, 0x7E, 0x00, + 0x00, 0x18, 0x3C, 0x7E, 0x7E, 0x18, 0x3C, 0x00, + 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, + 0x00, 0x7E, 0x78, 0x7C, 0x6E, 0x66, 0x06, 0x00, + 0x08, 0x18, 0x38, 0x78, 0x38, 0x18, 0x08, 0x00, + 0x10, 0x18, 0x1C, 0x1E, 0x1C, 0x18, 0x10, 0x00, + 0xFF, 0xC9, 0x80, 0x80, 0xC1, 0xE3, 0xF7, 0xFF, + 0xFF, 0xFF, 0xC0, 0xDF, 0xD0, 0xD7, 0xD7, 0xD7, + 0xD7, 0xD7, 0xD7, 0xD7, 0xD7, 0xD7, 0xD7, 0xD7, + 0xD7, 0xD7, 0xD0, 0xDF, 0xD0, 0xD7, 0xD7, 0xD7, + 0xD7, 0xD7, 0xD0, 0xDF, 0xC0, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0x00, 0xFF, 0x10, 0xD7, 0xD7, 0xD7, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xD7, 0xD7, 0x10, 0xFF, 0x10, 0xD7, 0xD7, 0xD7, + 0xD7, 0xD7, 0x10, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0x07, 0xF7, 0x17, 0xD7, 0xD7, 0xD7, + 0xD7, 0xD7, 0x17, 0xF7, 0x17, 0xD7, 0xD7, 0xD7, + 0xD7, 0xD7, 0x17, 0xF7, 0x07, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0x00, 0xFF, 0x00, 0xEF, 0xEF, 0xEF, + 0xEF, 0xEF, 0x00, 0xFF, 0x00, 0xEF, 0xEF, 0xEF, + 0xEF, 0xEF, 0x00, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, + 0xEF, 0xEF, 0xEF, 0x00, 0xEF, 0xEF, 0xEF, 0xEF, + 0xEF, 0xEF, 0xEF, 0xEF, 0xEF, 0xEF, 0xEF, 0xEF, + 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, + 0x18, 0x18, 0x18, 0x1F, 0x1F, 0x00, 0x00, 0x00, + 0x78, 0x60, 0x78, 0x60, 0x7E, 0x18, 0x1E, 0x00, + 0x00, 0x18, 0x3C, 0x7E, 0x18, 0x18, 0x18, 0x00, + 0x00, 0x18, 0x18, 0x18, 0x7E, 0x3C, 0x18, 0x00, + 0x00, 0x18, 0x30, 0x7E, 0x30, 0x18, 0x00, 0x00, + 0x00, 0x18, 0x0C, 0x7E, 0x0C, 0x18, 0x00, 0x00, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xE7, 0xE7, 0xE7, 0xE7, 0xFF, 0xE7, 0xE7, 0xFF, + 0x99, 0x99, 0x99, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0x99, 0x00, 0x99, 0x99, 0x00, 0x99, 0xFF, + 0xE7, 0xC1, 0x9F, 0xC3, 0xF9, 0x83, 0xE7, 0xFF, + 0xFF, 0x99, 0x93, 0xE7, 0xCF, 0x99, 0xB9, 0xFF, + 0xE3, 0xC9, 0xE3, 0xC7, 0x90, 0x99, 0xC4, 0xFF, + 0xE7, 0xE7, 0xE7, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xF1, 0xE3, 0xE7, 0xE7, 0xE7, 0xE3, 0xF1, 0xFF, + 0x8F, 0xC7, 0xE7, 0xE7, 0xE7, 0xC7, 0x8F, 0xFF, + 0xFF, 0x99, 0xC3, 0x00, 0xC3, 0x99, 0xFF, 0xFF, + 0xFF, 0xE7, 0xE7, 0x81, 0xE7, 0xE7, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xE7, 0xE7, 0xCF, + 0xFF, 0xFF, 0xFF, 0x81, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xE7, 0xE7, 0xFF, + 0xFD, 0xF9, 0xF3, 0xE7, 0xCF, 0x9F, 0xBF, 0xFF, + 0xC3, 0x99, 0x91, 0x81, 0x89, 0x99, 0xC3, 0xFF, + 0xE7, 0xC7, 0xE7, 0xE7, 0xE7, 0xE7, 0x81, 0xFF, + 0xC3, 0x99, 0xF9, 0xF3, 0xE7, 0xCF, 0x81, 0xFF, + 0x81, 0xF3, 0xE7, 0xF3, 0xF9, 0x99, 0xC3, 0xFF, + 0xF3, 0xE3, 0xC3, 0x93, 0x93, 0x81, 0xF3, 0xFF, + 0x81, 0x9F, 0x83, 0xF9, 0xF9, 0x99, 0xC3, 0xFF, + 0xC3, 0x9F, 0x9F, 0x83, 0x99, 0x99, 0xC3, 0xFF, + 0x81, 0xF9, 0xF3, 0xE7, 0xCF, 0xCF, 0xCF, 0xFF, + 0xC3, 0x99, 0x99, 0xC3, 0x99, 0x99, 0xC3, 0xFF, + 0xC3, 0x99, 0x99, 0xC1, 0xF9, 0xF3, 0xC7, 0xFF, + 0xFF, 0xE7, 0xE7, 0xFF, 0xFF, 0xE7, 0xE7, 0xFF, + 0xFF, 0xE7, 0xE7, 0xFF, 0xFF, 0xE7, 0xE7, 0xCF, + 0xF9, 0xF3, 0xE7, 0xCF, 0xE7, 0xF3, 0xF9, 0xFF, + 0xFF, 0xFF, 0x81, 0xFF, 0xFF, 0x81, 0xFF, 0xFF, + 0x9F, 0xCF, 0xE7, 0xF3, 0xE7, 0xCF, 0x9F, 0xFF, + 0xC3, 0x99, 0xFB, 0xF3, 0xE7, 0xFF, 0xE7, 0xFF, + 0xC3, 0x99, 0x99, 0x91, 0x91, 0x9F, 0xC1, 0xFF, + 0xE7, 0xC3, 0x99, 0x99, 0x81, 0x99, 0x99, 0xFF, + 0x83, 0x99, 0x99, 0x83, 0x99, 0x99, 0x83, 0xFF, + 0xC3, 0x99, 0x9F, 0x9F, 0x9F, 0x99, 0xC3, 0xFF, + 0x87, 0x93, 0x99, 0x99, 0x99, 0x93, 0x87, 0xFF, + 0x81, 0x9F, 0x9F, 0x83, 0x9F, 0x9F, 0x81, 0xFF, + 0x81, 0x9F, 0x9F, 0x83, 0x9F, 0x9F, 0x9F, 0xFF, + 0xC1, 0x9F, 0x9F, 0x91, 0x99, 0x99, 0xC1, 0xFF, + 0x99, 0x99, 0x99, 0x81, 0x99, 0x99, 0x99, 0xFF, + 0x81, 0xE7, 0xE7, 0xE7, 0xE7, 0xE7, 0x81, 0xFF, + 0xF9, 0xF9, 0xF9, 0xF9, 0xF9, 0x99, 0xC3, 0xFF, + 0x99, 0x93, 0x87, 0x87, 0x93, 0x99, 0x99, 0xFF, + 0x9F, 0x9F, 0x9F, 0x9F, 0x9F, 0x9F, 0x81, 0xFF, + 0x9C, 0x88, 0x80, 0x94, 0x9C, 0x9C, 0x9C, 0xFF, + 0x99, 0x89, 0x81, 0x81, 0x91, 0x99, 0x99, 0xFF, + 0xC3, 0x99, 0x99, 0x99, 0x99, 0x99, 0xC3, 0xFF, + 0x83, 0x99, 0x99, 0x99, 0x83, 0x9F, 0x9F, 0xFF, + 0xC3, 0x99, 0x99, 0x99, 0x99, 0x93, 0xC9, 0xFF, + 0x83, 0x99, 0x99, 0x83, 0x93, 0x99, 0x99, 0xFF, + 0xC3, 0x9F, 0x9F, 0xC3, 0xF9, 0xF9, 0xC3, 0xFF, + 0x81, 0xE7, 0xE7, 0xE7, 0xE7, 0xE7, 0xE7, 0xFF, + 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x81, 0xFF, + 0x99, 0x99, 0x99, 0x99, 0x99, 0xC3, 0xE7, 0xFF, + 0x9C, 0x9C, 0x9C, 0x94, 0x80, 0x88, 0x9C, 0xFF, + 0x99, 0x99, 0xC3, 0xC3, 0x99, 0x99, 0x99, 0xFF, + 0x99, 0x99, 0x99, 0xC3, 0xE7, 0xE7, 0xE7, 0xFF, + 0x81, 0xF3, 0xE7, 0xCF, 0x9F, 0x9F, 0x81, 0xFF, + 0xE1, 0xE7, 0xE7, 0xE7, 0xE7, 0xE7, 0xE1, 0xFF, + 0xFF, 0xBF, 0x9F, 0xCF, 0xE7, 0xF3, 0xF9, 0xFF, + 0x87, 0xE7, 0xE7, 0xE7, 0xE7, 0xE7, 0x87, 0xFF, + 0xFF, 0xF7, 0xE3, 0xC9, 0x9C, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, + 0x00, 0x18, 0x3C, 0x7E, 0x7E, 0x3C, 0x18, 0x00, + 0xFF, 0xFF, 0xC3, 0xF9, 0xC1, 0x99, 0xC1, 0xFF, + 0x9F, 0x9F, 0x83, 0x99, 0x99, 0x99, 0x83, 0xFF, + 0xFF, 0xFF, 0xC3, 0x9F, 0x9F, 0x9F, 0xC3, 0xFF, + 0xF9, 0xF9, 0xC1, 0x99, 0x99, 0x99, 0xC1, 0xFF, + 0xFF, 0xFF, 0xC3, 0x99, 0x81, 0x9F, 0xC3, 0xFF, + 0xF1, 0xE7, 0xE7, 0xC1, 0xE7, 0xE7, 0xE7, 0xFF, + 0xFF, 0xFF, 0xC1, 0x99, 0x99, 0xC1, 0xF9, 0x83, + 0x9F, 0x9F, 0x83, 0x99, 0x99, 0x99, 0x99, 0xFF, + 0xE7, 0xFF, 0xC7, 0xE7, 0xE7, 0xE7, 0xC3, 0xFF, + 0xF9, 0xFF, 0xF9, 0xF9, 0xF9, 0xF9, 0xF9, 0xC3, + 0x9F, 0x9F, 0x93, 0x87, 0x93, 0x99, 0x99, 0xFF, + 0xC7, 0xE7, 0xE7, 0xE7, 0xE7, 0xE7, 0xC3, 0xFF, + 0xFF, 0xFF, 0x99, 0x80, 0x80, 0x94, 0x9C, 0xFF, + 0xFF, 0xFF, 0x83, 0x99, 0x99, 0x99, 0x99, 0xFF, + 0xFF, 0xFF, 0xC3, 0x99, 0x99, 0x99, 0xC3, 0xFF, + 0xFF, 0xFF, 0x83, 0x99, 0x99, 0x83, 0x9F, 0x9F, + 0xFF, 0xFF, 0xC1, 0x99, 0x99, 0xC1, 0xF9, 0xF9, + 0xFF, 0xFF, 0x83, 0x99, 0x9F, 0x9F, 0x9F, 0xFF, + 0xFF, 0xFF, 0xC1, 0x9F, 0xC3, 0xF9, 0x83, 0xFF, + 0xE7, 0xE7, 0x81, 0xE7, 0xE7, 0xE7, 0xF1, 0xFF, + 0xFF, 0xFF, 0x99, 0x99, 0x99, 0x99, 0xC1, 0xFF, + 0xFF, 0xFF, 0x99, 0x99, 0x99, 0xC3, 0xE7, 0xFF, + 0xFF, 0xFF, 0x9C, 0x94, 0x80, 0xC1, 0xC9, 0xFF, + 0xFF, 0xFF, 0x99, 0xC3, 0xE7, 0xC3, 0x99, 0xFF, + 0xFF, 0xFF, 0x99, 0x99, 0x99, 0xC1, 0xF3, 0x87, + 0xFF, 0xFF, 0x81, 0xF3, 0xE7, 0xCF, 0x81, 0xFF, + 0x00, 0x18, 0x3C, 0x7E, 0x7E, 0x18, 0x3C, 0x00, + 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, + 0x00, 0x7E, 0x78, 0x7C, 0x6E, 0x66, 0x06, 0x00, + 0x08, 0x18, 0x38, 0x78, 0x38, 0x18, 0x08, 0x00, + 0x10, 0x18, 0x1C, 0x1E, 0x1C, 0x18, 0x10, 0x00, +}; + +static const uint8 ibm_fontdata[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x7E, 0x81, 0xA5, 0x81, 0xBD, 0x99, 0x81, 0x7E, + 0x7E, 0xFF, 0xDB, 0xFF, 0xC3, 0xE7, 0xFF, 0x7E, + 0x6C, 0xFE, 0xFE, 0xFE, 0x7C, 0x38, 0x10, 0x00, + 0x10, 0x38, 0x7C, 0xFE, 0x7C, 0x38, 0x10, 0x00, + 0x38, 0x7C, 0x38, 0xFE, 0xFE, 0x7C, 0x38, 0x7C, + 0x10, 0x10, 0x38, 0x7C, 0xFE, 0x7C, 0x38, 0x7C, + 0x00, 0x00, 0x18, 0x3C, 0x3C, 0x18, 0x00, 0x00, + 0xFF, 0xFF, 0xE7, 0xC3, 0xC3, 0xE7, 0xFF, 0xFF, + 0x00, 0x3C, 0x66, 0x42, 0x42, 0x66, 0x3C, 0x00, + 0xFF, 0xC3, 0x99, 0xBD, 0xBD, 0x99, 0xC3, 0xFF, + 0x0F, 0x07, 0x0F, 0x7D, 0xCC, 0xCC, 0xCC, 0x78, + 0x3C, 0x66, 0x66, 0x66, 0x3C, 0x18, 0x7E, 0x18, + 0x3F, 0x33, 0x3F, 0x30, 0x30, 0x70, 0xF0, 0xE0, + 0x7F, 0x63, 0x7F, 0x63, 0x63, 0x67, 0xE6, 0xC0, + 0x99, 0x5A, 0x3C, 0xE7, 0xE7, 0x3C, 0x5A, 0x99, + 0x80, 0xE0, 0xF8, 0xFE, 0xF8, 0xE0, 0x80, 0x00, + 0x02, 0x0E, 0x3E, 0xFE, 0x3E, 0x0E, 0x02, 0x00, + 0x18, 0x3C, 0x7E, 0x18, 0x18, 0x7E, 0x3C, 0x18, + 0x66, 0x66, 0x66, 0x66, 0x66, 0x00, 0x66, 0x00, + 0x7F, 0xDB, 0xDB, 0x7B, 0x1B, 0x1B, 0x1B, 0x00, + 0x3E, 0x63, 0x38, 0x6C, 0x6C, 0x38, 0xCC, 0x78, + 0x00, 0x00, 0x00, 0x00, 0x7E, 0x7E, 0x7E, 0x00, + 0x18, 0x3C, 0x7E, 0x18, 0x7E, 0x3C, 0x18, 0xFF, + 0x18, 0x3C, 0x7E, 0x18, 0x18, 0x18, 0x18, 0x00, + 0x18, 0x18, 0x18, 0x18, 0x7E, 0x3C, 0x18, 0x00, + 0x00, 0x18, 0x0C, 0xFE, 0x0C, 0x18, 0x00, 0x00, + 0x00, 0x30, 0x60, 0xFE, 0x60, 0x30, 0x00, 0x00, + 0x00, 0x00, 0xC0, 0xC0, 0xC0, 0xFE, 0x00, 0x00, + 0x00, 0x24, 0x66, 0xFF, 0x66, 0x24, 0x00, 0x00, + 0x00, 0x18, 0x3C, 0x7E, 0xFF, 0xFF, 0x00, 0x00, + 0x00, 0xFF, 0xFF, 0x7E, 0x3C, 0x18, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x30, 0x78, 0x78, 0x30, 0x30, 0x00, 0x30, 0x00, + 0x6C, 0x6C, 0x6C, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x6C, 0x6C, 0xFE, 0x6C, 0xFE, 0x6C, 0x6C, 0x00, + 0x30, 0x7C, 0xC0, 0x78, 0x0C, 0xF8, 0x30, 0x00, + 0x00, 0xC6, 0xCC, 0x18, 0x30, 0x66, 0xC6, 0x00, + 0x38, 0x6C, 0x38, 0x76, 0xDC, 0xCC, 0x76, 0x00, + 0x60, 0x60, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x18, 0x30, 0x60, 0x60, 0x60, 0x30, 0x18, 0x00, + 0x60, 0x30, 0x18, 0x18, 0x18, 0x30, 0x60, 0x00, + 0x00, 0x66, 0x3C, 0xFF, 0x3C, 0x66, 0x00, 0x00, + 0x00, 0x30, 0x30, 0xFC, 0x30, 0x30, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x30, 0x60, + 0x00, 0x00, 0x00, 0xFC, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x30, 0x00, + 0x06, 0x0C, 0x18, 0x30, 0x60, 0xC0, 0x80, 0x00, + 0x7C, 0xC6, 0xCE, 0xDE, 0xF6, 0xE6, 0x7C, 0x00, + 0x30, 0x70, 0x30, 0x30, 0x30, 0x30, 0xFC, 0x00, + 0x78, 0xCC, 0x0C, 0x38, 0x60, 0xCC, 0xFC, 0x00, + 0x78, 0xCC, 0x0C, 0x38, 0x0C, 0xCC, 0x78, 0x00, + 0x1C, 0x3C, 0x6C, 0xCC, 0xFE, 0x0C, 0x1E, 0x00, + 0xFC, 0xC0, 0xF8, 0x0C, 0x0C, 0xCC, 0x78, 0x00, + 0x38, 0x60, 0xC0, 0xF8, 0xCC, 0xCC, 0x78, 0x00, + 0xFC, 0xCC, 0x0C, 0x18, 0x30, 0x30, 0x30, 0x00, + 0x78, 0xCC, 0xCC, 0x78, 0xCC, 0xCC, 0x78, 0x00, + 0x78, 0xCC, 0xCC, 0x7C, 0x0C, 0x18, 0x70, 0x00, + 0x00, 0x30, 0x30, 0x00, 0x00, 0x30, 0x30, 0x00, + 0x00, 0x30, 0x30, 0x00, 0x00, 0x30, 0x30, 0x60, + 0x18, 0x30, 0x60, 0xC0, 0x60, 0x30, 0x18, 0x00, + 0x00, 0x00, 0xFC, 0x00, 0x00, 0xFC, 0x00, 0x00, + 0x60, 0x30, 0x18, 0x0C, 0x18, 0x30, 0x60, 0x00, + 0x78, 0xCC, 0x0C, 0x18, 0x30, 0x00, 0x30, 0x00, + 0x7C, 0xC6, 0xDE, 0xDE, 0xDE, 0xC0, 0x78, 0x00, + 0x30, 0x78, 0xCC, 0xCC, 0xFC, 0xCC, 0xCC, 0x00, + 0xFC, 0x66, 0x66, 0x7C, 0x66, 0x66, 0xFC, 0x00, + 0x3C, 0x66, 0xC0, 0xC0, 0xC0, 0x66, 0x3C, 0x00, + 0xF8, 0x6C, 0x66, 0x66, 0x66, 0x6C, 0xF8, 0x00, + 0xFE, 0x62, 0x68, 0x78, 0x68, 0x62, 0xFE, 0x00, + 0xFE, 0x62, 0x68, 0x78, 0x68, 0x60, 0xF0, 0x00, + 0x3C, 0x66, 0xC0, 0xC0, 0xCE, 0x66, 0x3E, 0x00, + 0xCC, 0xCC, 0xCC, 0xFC, 0xCC, 0xCC, 0xCC, 0x00, + 0x78, 0x30, 0x30, 0x30, 0x30, 0x30, 0x78, 0x00, + 0x1E, 0x0C, 0x0C, 0x0C, 0xCC, 0xCC, 0x78, 0x00, + 0xE6, 0x66, 0x6C, 0x78, 0x6C, 0x66, 0xE6, 0x00, + 0xF0, 0x60, 0x60, 0x60, 0x62, 0x66, 0xFE, 0x00, + 0xC6, 0xEE, 0xFE, 0xFE, 0xD6, 0xC6, 0xC6, 0x00, + 0xC6, 0xE6, 0xF6, 0xDE, 0xCE, 0xC6, 0xC6, 0x00, + 0x38, 0x6C, 0xC6, 0xC6, 0xC6, 0x6C, 0x38, 0x00, + 0xFC, 0x66, 0x66, 0x7C, 0x60, 0x60, 0xF0, 0x00, + 0x78, 0xCC, 0xCC, 0xCC, 0xDC, 0x78, 0x1C, 0x00, + 0xFC, 0x66, 0x66, 0x7C, 0x6C, 0x66, 0xE6, 0x00, + 0x78, 0xCC, 0xE0, 0x70, 0x1C, 0xCC, 0x78, 0x00, + 0xFC, 0xB4, 0x30, 0x30, 0x30, 0x30, 0x78, 0x00, + 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xFC, 0x00, + 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0x78, 0x30, 0x00, + 0xC6, 0xC6, 0xC6, 0xD6, 0xFE, 0xEE, 0xC6, 0x00, + 0xC6, 0xC6, 0x6C, 0x38, 0x38, 0x6C, 0xC6, 0x00, + 0xCC, 0xCC, 0xCC, 0x78, 0x30, 0x30, 0x78, 0x00, + 0xFE, 0xC6, 0x8C, 0x18, 0x32, 0x66, 0xFE, 0x00, + 0x78, 0x60, 0x60, 0x60, 0x60, 0x60, 0x78, 0x00, + 0xC0, 0x60, 0x30, 0x18, 0x0C, 0x06, 0x02, 0x00, + 0x78, 0x18, 0x18, 0x18, 0x18, 0x18, 0x78, 0x00, + 0x10, 0x38, 0x6C, 0xC6, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, + 0x30, 0x30, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x78, 0x0C, 0x7C, 0xCC, 0x76, 0x00, + 0xE0, 0x60, 0x60, 0x7C, 0x66, 0x66, 0xDC, 0x00, + 0x00, 0x00, 0x78, 0xCC, 0xC0, 0xCC, 0x78, 0x00, + 0x1C, 0x0C, 0x0C, 0x7C, 0xCC, 0xCC, 0x76, 0x00, + 0x00, 0x00, 0x78, 0xCC, 0xFC, 0xC0, 0x78, 0x00, + 0x38, 0x6C, 0x60, 0xF0, 0x60, 0x60, 0xF0, 0x00, + 0x00, 0x00, 0x76, 0xCC, 0xCC, 0x7C, 0x0C, 0xF8, + 0xE0, 0x60, 0x6C, 0x76, 0x66, 0x66, 0xE6, 0x00, + 0x30, 0x00, 0x70, 0x30, 0x30, 0x30, 0x78, 0x00, + 0x0C, 0x00, 0x0C, 0x0C, 0x0C, 0xCC, 0xCC, 0x78, + 0xE0, 0x60, 0x66, 0x6C, 0x78, 0x6C, 0xE6, 0x00, + 0x70, 0x30, 0x30, 0x30, 0x30, 0x30, 0x78, 0x00, + 0x00, 0x00, 0xCC, 0xFE, 0xFE, 0xD6, 0xC6, 0x00, + 0x00, 0x00, 0xF8, 0xCC, 0xCC, 0xCC, 0xCC, 0x00, + 0x00, 0x00, 0x78, 0xCC, 0xCC, 0xCC, 0x78, 0x00, + 0x00, 0x00, 0xDC, 0x66, 0x66, 0x7C, 0x60, 0xF0, + 0x00, 0x00, 0x76, 0xCC, 0xCC, 0x7C, 0x0C, 0x1E, + 0x00, 0x00, 0xDC, 0x76, 0x66, 0x60, 0xF0, 0x00, + 0x00, 0x00, 0x7C, 0xC0, 0x78, 0x0C, 0xF8, 0x00, + 0x10, 0x30, 0x7C, 0x30, 0x30, 0x34, 0x18, 0x00, + 0x00, 0x00, 0xCC, 0xCC, 0xCC, 0xCC, 0x76, 0x00, + 0x00, 0x00, 0xCC, 0xCC, 0xCC, 0x78, 0x30, 0x00, + 0x00, 0x00, 0xC6, 0xD6, 0xFE, 0xFE, 0x6C, 0x00, + 0x00, 0x00, 0xC6, 0x6C, 0x38, 0x6C, 0xC6, 0x00, + 0x00, 0x00, 0xCC, 0xCC, 0xCC, 0x7C, 0x0C, 0xF8, + 0x00, 0x00, 0xFC, 0x98, 0x30, 0x64, 0xFC, 0x00, + 0x1C, 0x30, 0x30, 0xE0, 0x30, 0x30, 0x1C, 0x00, + 0x18, 0x18, 0x18, 0x00, 0x18, 0x18, 0x18, 0x00, + 0xE0, 0x30, 0x30, 0x1C, 0x30, 0x30, 0xE0, 0x00, + 0x76, 0xDC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x10, 0x38, 0x6C, 0xC6, 0xC6, 0xFE, 0x00, + 0x78, 0xCC, 0xC0, 0xCC, 0x78, 0x18, 0x0C, 0x78, + 0x00, 0xCC, 0x00, 0xCC, 0xCC, 0xCC, 0x7E, 0x00, + 0x1C, 0x00, 0x78, 0xCC, 0xFC, 0xC0, 0x78, 0x00, + 0x7E, 0xC3, 0x3C, 0x06, 0x3E, 0x66, 0x3F, 0x00, + 0xCC, 0x00, 0x78, 0x0C, 0x7C, 0xCC, 0x7E, 0x00, + 0xE0, 0x00, 0x78, 0x0C, 0x7C, 0xCC, 0x7E, 0x00, + 0x30, 0x30, 0x78, 0x0C, 0x7C, 0xCC, 0x7E, 0x00, + 0x00, 0x00, 0x78, 0xC0, 0xC0, 0x78, 0x0C, 0x38, + 0x7E, 0xC3, 0x3C, 0x66, 0x7E, 0x60, 0x3C, 0x00, + 0xCC, 0x00, 0x78, 0xCC, 0xFC, 0xC0, 0x78, 0x00, + 0xE0, 0x00, 0x78, 0xCC, 0xFC, 0xC0, 0x78, 0x00, + 0xCC, 0x00, 0x70, 0x30, 0x30, 0x30, 0x78, 0x00, + 0x7C, 0xC6, 0x38, 0x18, 0x18, 0x18, 0x3C, 0x00, + 0xE0, 0x00, 0x70, 0x30, 0x30, 0x30, 0x78, 0x00, + 0xC6, 0x38, 0x6C, 0xC6, 0xFE, 0xC6, 0xC6, 0x00, + 0x30, 0x30, 0x00, 0x78, 0xCC, 0xFC, 0xCC, 0x00, + 0x1C, 0x00, 0xFC, 0x60, 0x78, 0x60, 0xFC, 0x00, + 0x00, 0x00, 0x7F, 0x0C, 0x7F, 0xCC, 0x7F, 0x00, + 0x3E, 0x6C, 0xCC, 0xFE, 0xCC, 0xCC, 0xCE, 0x00, + 0x78, 0xCC, 0x00, 0x78, 0xCC, 0xCC, 0x78, 0x00, + 0x00, 0xCC, 0x00, 0x78, 0xCC, 0xCC, 0x78, 0x00, + 0x00, 0xE0, 0x00, 0x78, 0xCC, 0xCC, 0x78, 0x00, + 0x78, 0xCC, 0x00, 0xCC, 0xCC, 0xCC, 0x7E, 0x00, + 0x00, 0xE0, 0x00, 0xCC, 0xCC, 0xCC, 0x7E, 0x00, + 0x00, 0xCC, 0x00, 0xCC, 0xCC, 0x7C, 0x0C, 0xF8, + 0xC3, 0x18, 0x3C, 0x66, 0x66, 0x3C, 0x18, 0x00, + 0xCC, 0x00, 0xCC, 0xCC, 0xCC, 0xCC, 0x78, 0x00, + 0x18, 0x18, 0x7E, 0xC0, 0xC0, 0x7E, 0x18, 0x18, + 0x38, 0x6C, 0x64, 0xF0, 0x60, 0xE6, 0xFC, 0x00, + 0xCC, 0xCC, 0x78, 0xFC, 0x30, 0xFC, 0x30, 0x30, + 0xF8, 0xCC, 0xCC, 0xFA, 0xC6, 0xCF, 0xC6, 0xC7, + 0x0E, 0x1B, 0x18, 0x3C, 0x18, 0x18, 0xD8, 0x70, + 0x1C, 0x00, 0x78, 0x0C, 0x7C, 0xCC, 0x7E, 0x00, + 0x38, 0x00, 0x70, 0x30, 0x30, 0x30, 0x78, 0x00, + 0x00, 0x1C, 0x00, 0x78, 0xCC, 0xCC, 0x78, 0x00, + 0x00, 0x1C, 0x00, 0xCC, 0xCC, 0xCC, 0x7E, 0x00, + 0x00, 0xF8, 0x00, 0xF8, 0xCC, 0xCC, 0xCC, 0x00, + 0xFC, 0x00, 0xCC, 0xEC, 0xFC, 0xDC, 0xCC, 0x00, + 0x3C, 0x6C, 0x6C, 0x3E, 0x00, 0x7E, 0x00, 0x00, + 0x38, 0x6C, 0x6C, 0x38, 0x00, 0x7C, 0x00, 0x00, + 0x30, 0x00, 0x30, 0x60, 0xC0, 0xCC, 0x78, 0x00, + 0x00, 0x00, 0x00, 0xFC, 0xC0, 0xC0, 0x00, 0x00, + 0x00, 0x00, 0x00, 0xFC, 0x0C, 0x0C, 0x00, 0x00, + 0xC3, 0xC6, 0xCC, 0xDE, 0x33, 0x66, 0xCC, 0x0F, + 0xC3, 0xC6, 0xCC, 0xDB, 0x37, 0x6F, 0xCF, 0x03, + 0x18, 0x18, 0x00, 0x18, 0x18, 0x18, 0x18, 0x00, + 0x00, 0x33, 0x66, 0xCC, 0x66, 0x33, 0x00, 0x00, + 0x00, 0xCC, 0x66, 0x33, 0x66, 0xCC, 0x00, 0x00, + 0x22, 0x88, 0x22, 0x88, 0x22, 0x88, 0x22, 0x88, + 0x55, 0xAA, 0x55, 0xAA, 0x55, 0xAA, 0x55, 0xAA, + 0xDB, 0x77, 0xDB, 0xEE, 0xDB, 0x77, 0xDB, 0xEE, + 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, + 0x18, 0x18, 0x18, 0x18, 0xF8, 0x18, 0x18, 0x18, + 0x18, 0x18, 0xF8, 0x18, 0xF8, 0x18, 0x18, 0x18, + 0x36, 0x36, 0x36, 0x36, 0xF6, 0x36, 0x36, 0x36, + 0x00, 0x00, 0x00, 0x00, 0xFE, 0x36, 0x36, 0x36, + 0x00, 0x00, 0xF8, 0x18, 0xF8, 0x18, 0x18, 0x18, + 0x36, 0x36, 0xF6, 0x06, 0xF6, 0x36, 0x36, 0x36, + 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, + 0x00, 0x00, 0xFE, 0x06, 0xF6, 0x36, 0x36, 0x36, + 0x36, 0x36, 0xF6, 0x06, 0xFE, 0x00, 0x00, 0x00, + 0x36, 0x36, 0x36, 0x36, 0xFE, 0x00, 0x00, 0x00, + 0x18, 0x18, 0xF8, 0x18, 0xF8, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xF8, 0x18, 0x18, 0x18, + 0x18, 0x18, 0x18, 0x18, 0x1F, 0x00, 0x00, 0x00, + 0x18, 0x18, 0x18, 0x18, 0xFF, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xFF, 0x18, 0x18, 0x18, + 0x18, 0x18, 0x18, 0x18, 0x1F, 0x18, 0x18, 0x18, + 0x00, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, + 0x18, 0x18, 0x18, 0x18, 0xFF, 0x18, 0x18, 0x18, + 0x18, 0x18, 0x1F, 0x18, 0x1F, 0x18, 0x18, 0x18, + 0x36, 0x36, 0x36, 0x36, 0x37, 0x36, 0x36, 0x36, + 0x36, 0x36, 0x37, 0x30, 0x3F, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x3F, 0x30, 0x37, 0x36, 0x36, 0x36, + 0x36, 0x36, 0xF7, 0x00, 0xFF, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xFF, 0x00, 0xF7, 0x36, 0x36, 0x36, + 0x36, 0x36, 0x37, 0x30, 0x37, 0x36, 0x36, 0x36, + 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0x00, + 0x36, 0x36, 0xF7, 0x00, 0xF7, 0x36, 0x36, 0x36, + 0x18, 0x18, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0x00, + 0x36, 0x36, 0x36, 0x36, 0xFF, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x18, 0x18, 0x18, + 0x00, 0x00, 0x00, 0x00, 0xFF, 0x36, 0x36, 0x36, + 0x36, 0x36, 0x36, 0x36, 0x3F, 0x00, 0x00, 0x00, + 0x18, 0x18, 0x1F, 0x18, 0x1F, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x1F, 0x18, 0x1F, 0x18, 0x18, 0x18, + 0x00, 0x00, 0x00, 0x00, 0x3F, 0x36, 0x36, 0x36, + 0x36, 0x36, 0x36, 0x36, 0xFF, 0x36, 0x36, 0x36, + 0x18, 0x18, 0xFF, 0x18, 0xFF, 0x18, 0x18, 0x18, + 0x18, 0x18, 0x18, 0x18, 0xF8, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x1F, 0x18, 0x18, 0x18, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, + 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, + 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, + 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x76, 0xDC, 0xC8, 0xDC, 0x76, 0x00, + 0x00, 0x78, 0xCC, 0xF8, 0xCC, 0xF8, 0xC0, 0xC0, + 0x00, 0xFC, 0xCC, 0xC0, 0xC0, 0xC0, 0xC0, 0x00, + 0x00, 0xFE, 0x6C, 0x6C, 0x6C, 0x6C, 0x6C, 0x00, + 0xFC, 0xCC, 0x60, 0x30, 0x60, 0xCC, 0xFC, 0x00, + 0x00, 0x00, 0x7E, 0xD8, 0xD8, 0xD8, 0x70, 0x00, + 0x00, 0x66, 0x66, 0x66, 0x66, 0x7C, 0x60, 0xC0, + 0x00, 0x76, 0xDC, 0x18, 0x18, 0x18, 0x18, 0x00, + 0xFC, 0x30, 0x78, 0xCC, 0xCC, 0x78, 0x30, 0xFC, + 0x38, 0x6C, 0xC6, 0xFE, 0xC6, 0x6C, 0x38, 0x00, + 0x38, 0x6C, 0xC6, 0xC6, 0x6C, 0x6C, 0xEE, 0x00, + 0x1C, 0x30, 0x18, 0x7C, 0xCC, 0xCC, 0x78, 0x00, + 0x00, 0x00, 0x7E, 0xDB, 0xDB, 0x7E, 0x00, 0x00, + 0x06, 0x0C, 0x7E, 0xDB, 0xDB, 0x7E, 0x60, 0xC0, + 0x38, 0x60, 0xC0, 0xF8, 0xC0, 0x60, 0x38, 0x00, + 0x78, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0x00, + 0x00, 0xFC, 0x00, 0xFC, 0x00, 0xFC, 0x00, 0x00, + 0x30, 0x30, 0xFC, 0x30, 0x30, 0x00, 0xFC, 0x00, + 0x60, 0x30, 0x18, 0x30, 0x60, 0x00, 0xFC, 0x00, + 0x18, 0x30, 0x60, 0x30, 0x18, 0x00, 0xFC, 0x00, + 0x0E, 0x1B, 0x1B, 0x18, 0x18, 0x18, 0x18, 0x18, + 0x18, 0x18, 0x18, 0x18, 0x18, 0xD8, 0xD8, 0x70, + 0x30, 0x30, 0x00, 0xFC, 0x00, 0x30, 0x30, 0x00, + 0x00, 0x76, 0xDC, 0x00, 0x76, 0xDC, 0x00, 0x00, + 0x38, 0x6C, 0x6C, 0x38, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, + 0x0F, 0x0C, 0x0C, 0x0C, 0xEC, 0x6C, 0x3C, 0x1C, + 0x78, 0x6C, 0x6C, 0x6C, 0x6C, 0x00, 0x00, 0x00, + 0x70, 0x18, 0x30, 0x60, 0x78, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x3C, 0x3C, 0x3C, 0x3C, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +}; + } // End of namespace Agi #endif /* AGI_FONT_H */ diff --git a/engines/agi/global.cpp b/engines/agi/global.cpp index 0baf8c259c..36cc547a8d 100644 --- a/engines/agi/global.cpp +++ b/engines/agi/global.cpp @@ -29,14 +29,14 @@ namespace Agi { -int AgiEngine::getflag(int n) { +int AgiBase::getflag(int n) { uint8 *set = (uint8 *)&_game.flags; set += n >> 3; return (*set & (1 << (n & 0x07))) != 0; } -void AgiEngine::setflag(int n, int v) { +void AgiBase::setflag(int n, int v) { uint8 *set = (uint8 *)&_game.flags; set += n >> 3; @@ -46,7 +46,7 @@ void AgiEngine::setflag(int n, int v) { *set &= ~(1 << (n & 0x07)); /* clear bit */ } -void AgiEngine::flipflag(int n) { +void AgiBase::flipflag(int n) { uint8 *set = (uint8 *)&_game.flags; set += n >> 3; diff --git a/engines/agi/graphics.cpp b/engines/agi/graphics.cpp index b6430e0f81..5af68e9b5e 100644 --- a/engines/agi/graphics.cpp +++ b/engines/agi/graphics.cpp @@ -532,7 +532,7 @@ static struct UpdateBlock update = { MAX_INT, MAX_INT, 0, 0 }; -GfxMgr::GfxMgr(AgiEngine *vm) : _vm(vm) { +GfxMgr::GfxMgr(AgiBase *vm) : _vm(vm) { _shakeH = NULL; _shakeV = NULL; _agipalFileNum = 0; @@ -612,11 +612,11 @@ void GfxMgr::shakeEnd() { free(_shakeH); } -void GfxMgr::putTextCharacter(int l, int x, int y, unsigned int c, int fg, int bg, bool checkerboard) { +void GfxMgr::putTextCharacter(int l, int x, int y, unsigned int c, int fg, int bg, bool checkerboard, const uint8 *font) { int x1, y1, xx, yy, cc; const uint8 *p; - p = Agi::curFont + ((unsigned int)c * CHAR_LINES); + p = font + ((unsigned int)c * CHAR_LINES); for (y1 = 0; y1 < CHAR_LINES; y1++) { for (x1 = 0; x1 < CHAR_COLS; x1++) { xx = x + x1; @@ -1005,6 +1005,14 @@ void GfxMgr::setCursor(bool amigaStyleCursor) { } } +void GfxMgr::setCursorPalette(bool amigaStyleCursor) { + if (!amigaStyleCursor) { + CursorMan.replaceCursorPalette(sciMouseCursorPalette, 1, ARRAYSIZE(sciMouseCursorPalette) / 4); + } else { // amigaStyleCursor + CursorMan.replaceCursorPalette(amigaMouseCursorPalette, 1, ARRAYSIZE(amigaMouseCursorPalette) / 4); + } +} + /** * Initialize graphics device. * @@ -1078,7 +1086,7 @@ void GfxMgr::putPixelsA(int x, int y, int n, uint8 *p) { } else { const uint16 mask = _vm->getFeatures() & (GF_AGI256 | GF_AGI256_2) && !_vm->_debug.priority ? 0xffff : 0x0f0f; for (x *= 2; n--; p++, x += 2) { - register uint16 q = ((uint16) * p << 8) | *p; + register uint16 q = ((uint16)*p << 8) | *p; *(uint16 *)&_agiScreen[x + y * GFX_WIDTH] = (q >> rShift) & mask; } } diff --git a/engines/agi/graphics.h b/engines/agi/graphics.h index e06af90f5d..96b6247aeb 100644 --- a/engines/agi/graphics.h +++ b/engines/agi/graphics.h @@ -27,6 +27,7 @@ #define AGI_GRAPHICS_H #include "common/stdafx.h" +#include "agi/font.h" namespace Agi { @@ -39,7 +40,7 @@ class AgiEngine; class GfxMgr { private: - AgiEngine *_vm; + AgiBase *_vm; uint8 _palette[256 * 4]; uint8 *_agiScreen; @@ -54,11 +55,11 @@ private: void rawDrawButton(int x, int y, const char *s, int fgcolor, int bgcolor, bool border, int textOffset); public: - GfxMgr(AgiEngine *vm); + GfxMgr(AgiBase *vm); void gfxPutBlock(int x1, int y1, int x2, int y2); - void putTextCharacter(int, int, int, unsigned int, int, int, bool checkerboard = false); + void putTextCharacter(int, int, int, unsigned int, int, int, bool checkerboard = false, const uint8 *font = curFont); void shakeScreen(int); void shakeStart(); void shakeEnd(); @@ -88,10 +89,10 @@ public: int getAGIPalFileNum(); void drawFrame(int x1, int y1, int x2, int y2, int c1, int c2); - void putPixel(int, int, int); void putBlock(int x1, int y1, int x2, int y2); void gfxSetPalette(); void setCursor(bool amigaStyleCursor = false); + void setCursorPalette(bool amigaStylePalette = false); int keypress(); int getKey(); diff --git a/engines/agi/agi_v2.cpp b/engines/agi/loader_v2.cpp index 375bbec411..c0c6df2fcb 100644 --- a/engines/agi/agi_v2.cpp +++ b/engines/agi/loader_v2.cpp @@ -173,12 +173,6 @@ uint8 *AgiLoader_v2::loadVolRes(struct AgiDir *agid) { abort(); } } else { -#if 0 - /* FIXME: call some panic handler instead of - * deiniting directly - */ - deinitVideoMode(); -#endif report("Error: bad signature %04x\n", sig); // fprintf (stderr, "ACK! BAD RESOURCE!!!\n"); return 0; @@ -254,9 +248,9 @@ int AgiLoader_v2::loadResource(int t, int n) { data = loadVolRes(&_vm->_game.dirSound[n]); if (data != NULL) { - _vm->_game.sounds[n].rdata = data; + // Freeing of the raw resource from memory is delegated to the createFromRawResource-function + _vm->_game.sounds[n] = AgiSound::createFromRawResource(data, _vm->_game.dirSound[n].len, n, *_vm->_sound); _vm->_game.dirSound[n].flags |= RES_LOADED; - _vm->_sound->decodeSound(n); } else { ec = errBadResource; } diff --git a/engines/agi/agi_v3.cpp b/engines/agi/loader_v3.cpp index 69a8698ecb..362d778c66 100644 --- a/engines/agi/agi_v3.cpp +++ b/engines/agi/loader_v3.cpp @@ -228,10 +228,6 @@ uint8 *AgiLoader_v3::loadVolRes(AgiDir *agid) { fp.read(&x, 7); if (READ_BE_UINT16((uint8 *) x) != 0x1234) { -#if 0 - /* FIXME */ - deinitVideoMode(); -#endif debugC(3, kDebugLevelResources, "path = %s", path.c_str()); debugC(3, kDebugLevelResources, "offset = %d", agid->offset); debugC(3, kDebugLevelResources, "x = %x %x", x[0], x[1]); @@ -345,9 +341,9 @@ int AgiLoader_v3::loadResource(int t, int n) { data = loadVolRes(&_vm->_game.dirSound[n]); if (data != NULL) { - _vm->_game.sounds[n].rdata = data; + // Freeing of the raw resource from memory is delegated to the createFromRawResource-function + _vm->_game.sounds[n] = AgiSound::createFromRawResource(data, _vm->_game.dirSound[n].len, n, *_vm->_sound); _vm->_game.dirSound[n].flags |= RES_LOADED; - _vm->_sound->decodeSound(n); } else { ec = errBadResource; } diff --git a/engines/agi/module.mk b/engines/agi/module.mk index d74eba034a..e5e8555ba2 100644 --- a/engines/agi/module.mk +++ b/engines/agi/module.mk @@ -2,8 +2,6 @@ MODULE := engines/agi MODULE_OBJS = \ agi.o \ - agi_v2.o \ - agi_v3.o \ checks.o \ console.o \ cycle.o \ @@ -13,6 +11,8 @@ MODULE_OBJS = \ id.o \ inv.o \ keyboard.o \ + loader_v2.o \ + loader_v3.o \ logic.o \ lzw.o \ menu.o \ @@ -22,6 +22,11 @@ MODULE_OBJS = \ op_dbg.o \ op_test.o \ picture.o \ + preagi.o \ + preagi_common.o \ + preagi_mickey.o \ + preagi_troll.o \ + preagi_winnie.o \ predictive.o \ saveload.o \ sound.o \ diff --git a/engines/agi/picture.cpp b/engines/agi/picture.cpp index 144e965465..006348f433 100644 --- a/engines/agi/picture.cpp +++ b/engines/agi/picture.cpp @@ -28,75 +28,45 @@ #include "agi/agi.h" #include "agi/graphics.h" + namespace Agi { -#define nextByte data[foffs++] - -static uint8 *data; -static uint32 flen; -static uint32 foffs; - -static uint8 patCode; -static uint8 patNum; -static uint8 priOn; -static uint8 scrOn; -static uint8 scrColour; -static uint8 priColour; - -static uint8 circles[][15] = { /* agi circle bitmaps */ - {0x80}, - /* {0xfc}, */ - { 3 << 4 }, /* pattern data different from specs. fixes gold rush. does not seem to break any other v3 games */ - {0x5f, 0xf4}, - {0x66, 0xff, 0xf6, 0x60}, - {0x23, 0xbf, 0xff, 0xff, 0xee, 0x20}, - {0x31, 0xe7, 0x9e, 0xff, 0xff, 0xde, 0x79, 0xe3, 0x00}, - {0x38, 0xf9, 0xf3, 0xef, 0xff, 0xff, 0xff, 0xfe, 0xf9, 0xf3, 0xe3, 0x80}, - {0x18, 0x3c, 0x7e, 0x7e, 0x7e, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7e, 0x7e, 0x7e, 0x3c, 0x18} -}; - -static uint8 splatterMap[32] = { /* splatter brush bitmaps */ - 0x20, 0x94, 0x02, 0x24, 0x90, 0x82, 0xa4, 0xa2, - 0x82, 0x09, 0x0a, 0x22, 0x12, 0x10, 0x42, 0x14, - 0x91, 0x4a, 0x91, 0x11, 0x08, 0x12, 0x25, 0x10, - 0x22, 0xa8, 0x14, 0x24, 0x00, 0x50, 0x24, 0x04 -}; - -static uint8 splatterStart[128] = { /* starting bit position */ - 0x00, 0x18, 0x30, 0xc4, 0xdc, 0x65, 0xeb, 0x48, - 0x60, 0xbd, 0x89, 0x05, 0x0a, 0xf4, 0x7d, 0x7d, - 0x85, 0xb0, 0x8e, 0x95, 0x1f, 0x22, 0x0d, 0xdf, - 0x2a, 0x78, 0xd5, 0x73, 0x1c, 0xb4, 0x40, 0xa1, - 0xb9, 0x3c, 0xca, 0x58, 0x92, 0x34, 0xcc, 0xce, - 0xd7, 0x42, 0x90, 0x0f, 0x8b, 0x7f, 0x32, 0xed, - 0x5c, 0x9d, 0xc8, 0x99, 0xad, 0x4e, 0x56, 0xa6, - 0xf7, 0x68, 0xb7, 0x25, 0x82, 0x37, 0x3a, 0x51, - 0x69, 0x26, 0x38, 0x52, 0x9e, 0x9a, 0x4f, 0xa7, - 0x43, 0x10, 0x80, 0xee, 0x3d, 0x59, 0x35, 0xcf, - 0x79, 0x74, 0xb5, 0xa2, 0xb1, 0x96, 0x23, 0xe0, - 0xbe, 0x05, 0xf5, 0x6e, 0x19, 0xc5, 0x66, 0x49, - 0xf0, 0xd1, 0x54, 0xa9, 0x70, 0x4b, 0xa4, 0xe2, - 0xe6, 0xe5, 0xab, 0xe4, 0xd2, 0xaa, 0x4c, 0xe3, - 0x06, 0x6f, 0xc6, 0x4a, 0xa4, 0x75, 0x97, 0xe1 -}; +PictureMgr::PictureMgr(AgiBase *agi, GfxMgr *gfx) { + _vm = agi; + _gfx = gfx; + + _data = NULL; + _flen = _foffs = 0; + + _patCode = _patNum = _priOn = _scrOn = _scrColor = _priColor = 0; + _xOffset = _yOffset = 0; + + _pictureVersion = AGIPIC_V2; + _minCommand = 0xf0; + _flags = 0; +} void PictureMgr::putVirtPixel(int x, int y) { uint8 *p; - if (x < 0 || y < 0 || x >= _WIDTH || y >= _HEIGHT) + x += _xOffset; + y += _yOffset; + + if (x < 0 || y < 0 || x >= _width || y >= _height) return; - p = &_vm->_game.sbuf16c[y * _WIDTH + x]; + p = &_vm->_game.sbuf16c[y * _width + x]; - if (priOn) - *p = (priColour << 4) | (*p & 0x0f); - if (scrOn) - *p = scrColour | (*p & 0xf0); + if (_priOn) + *p = (_priColor << 4) | (*p & 0x0f); + if (_scrOn) + *p = _scrColor | (*p & 0xf0); } /* For the flood fill routines */ /* MH2 needs stack size > 300 */ +// FIXME: Consider using FixedStack<> or Stack<> from common/stack.h here #define STACK_SIZE 512 static unsigned int stackPtr; static uint16 stack[STACK_SIZE]; @@ -130,10 +100,10 @@ void PictureMgr::drawLine(int x1, int y1, int x2, int y2) { /* CM: Do clipping */ #define clip(x, y) if((x)>=(y)) (x)=(y) - clip(x1, _WIDTH - 1); - clip(x2, _WIDTH - 1); - clip(y1, _HEIGHT - 1); - clip(y2, _HEIGHT - 1); + clip(x1, _width - 1); + clip(x2, _width - 1); + clip(y1, _height - 1); + clip(y2, _height - 1); /* Vertical line */ @@ -219,13 +189,13 @@ void PictureMgr::drawLine(int x1, int y1, int x2, int y2) { void PictureMgr::dynamicDrawLine() { int x1, y1, disp, dx, dy; - x1 = nextByte; - y1 = nextByte; + x1 = nextByte(); + y1 = nextByte(); putVirtPixel(x1, y1); for (;;) { - if ((disp = nextByte) >= 0xf0) + if ((disp = nextByte()) >= _minCommand) break; dx = ((disp & 0xf0) >> 4) & 0x0f; @@ -240,7 +210,7 @@ void PictureMgr::dynamicDrawLine() { x1 += dx; y1 += dy; } - foffs--; + _foffs--; } /************************************************************************** @@ -251,22 +221,22 @@ void PictureMgr::dynamicDrawLine() { void PictureMgr::absoluteDrawLine() { int x1, y1, x2, y2; - x1 = nextByte; - y1 = nextByte; + x1 = nextByte(); + y1 = nextByte(); putVirtPixel(x1, y1); for (;;) { - if ((x2 = nextByte) >= 0xf0) + if ((x2 = nextByte()) >= _minCommand) break; - if ((y2 = nextByte) >= 0xf0) + if ((y2 = nextByte()) >= _minCommand) break; drawLine(x1, y1, x2, y2); x1 = x2; y1 = y2; } - foffs--; + _foffs--; } /************************************************************************** @@ -275,21 +245,26 @@ void PictureMgr::absoluteDrawLine() { INLINE int PictureMgr::isOkFillHere(int x, int y) { uint8 p; - if (x < 0 || x >= _WIDTH || y < 0 || y >= _HEIGHT) + if (x < 0 || x >= _width || y < 0 || y >= _height) return false; - if (!scrOn && !priOn) + if (!_scrOn && !_priOn) return false; - p = _vm->_game.sbuf16c[y * _WIDTH + x]; + p = _vm->_game.sbuf16c[y * _width + x]; + + // FIXME: This overflows stack, but otherwise is a wild guess + // original has some checks against color 11 (0xB) + if (_pictureVersion == AGIPIC_V15 && 0) + return (p & 0x0f) == 0; - if (!priOn && scrOn && scrColour != 15) + if (!_priOn && _scrOn && _scrColor != 15) return (p & 0x0f) == 15; - if (priOn && !scrOn && priColour != 4) + if (_priOn && !_scrOn && _priColor != 4) return (p >> 4) == 4; - return (scrOn && (p & 0x0f) == 15 && scrColour != 15); + return (_scrOn && (p & 0x0f) == 15 && _scrColor != 15); } /************************************************************************** @@ -352,30 +327,39 @@ void PictureMgr::agiFill(unsigned int x, unsigned int y) { ** ** Draws an xCorner (drawing action 0xF5) **************************************************************************/ -void PictureMgr::xCorner() { +void PictureMgr::xCorner(bool skipOtherCoords) { int x1, x2, y1, y2; - x1 = nextByte; - y1 = nextByte; + x1 = nextByte(); + y1 = nextByte(); putVirtPixel(x1, y1); for (;;) { - x2 = nextByte; + x2 = nextByte(); - if (x2 >= 0xf0) + if (skipOtherCoords) + if (nextByte() >= _minCommand) + break; + + if (x2 >= _minCommand) break; drawLine(x1, y1, x2, y1); x1 = x2; - y2 = nextByte; - if (y2 >= 0xf0) + if (skipOtherCoords) + if (nextByte() >= _minCommand) + break; + + y2 = nextByte(); + + if (y2 >= _minCommand) break; drawLine(x1, y1, x1, y2); y1 = y2; } - foffs--; + _foffs--; } /************************************************************************** @@ -383,31 +367,39 @@ void PictureMgr::xCorner() { ** ** Draws an yCorner (drawing action 0xF4) **************************************************************************/ -void PictureMgr::yCorner() { +void PictureMgr::yCorner(bool skipOtherCoords) { int x1, x2, y1, y2; - x1 = nextByte; - y1 = nextByte; + x1 = nextByte(); + y1 = nextByte(); putVirtPixel(x1, y1); for (;;) { - y2 = nextByte; + if (skipOtherCoords) + if (nextByte() >= _minCommand) + break; + + y2 = nextByte(); - if (y2 >= 0xF0) + if (y2 >= _minCommand) break; drawLine(x1, y1, x1, y2); y1 = y2; - x2 = nextByte; + x2 = nextByte(); - if (x2 >= 0xf0) + if (x2 >= _minCommand) break; + if (skipOtherCoords) + if (nextByte() >= _minCommand) + break; + drawLine(x1, y1, x2, y1); x1 = x2; } - foffs--; + _foffs--; } /************************************************************************** @@ -418,10 +410,14 @@ void PictureMgr::yCorner() { void PictureMgr::fill() { int x1, y1; - while ((x1 = nextByte) < 0xF0 && (y1 = nextByte) < 0xf0) + if (_pictureVersion == AGIPIC_V15 && 0) + if (_scrColor == 0xf && !(_flags & kPicFTrollMode)) + return; + + while ((x1 = nextByte()) < _minCommand && (y1 = nextByte()) < _minCommand) agiFill(x1, y1); - foffs--; + _foffs--; } /************************************************************************** @@ -431,43 +427,111 @@ void PictureMgr::fill() { ** on the pattern code. **************************************************************************/ -int PictureMgr::plotPatternPoint(int x, int y, int bitpos) { - if (patCode & 0x20) { - if ((splatterMap[bitpos >> 3] >> (7 - (bitpos & 7))) & 1) { - putVirtPixel(x, y); - } - bitpos++; - if (bitpos == 0xff) - bitpos = 0; - } else - putVirtPixel(x, y); - - return bitpos; -} - void PictureMgr::plotPattern(int x, int y) { - int32 circlePos = 0; - uint32 x1, y1, pensize, bitpos = splatterStart[patNum]; - - pensize = (patCode & 7); - - if (x < (int)pensize) - x = pensize - 1; - if (y < (int)pensize) - y = pensize; - - for (y1 = y - pensize; y1 <= y + pensize; y1++) { - for (x1 = x - (pensize + 1) / 2; x1 <= x + pensize / 2; x1++) { - if (patCode & 0x10) { /* Square */ - bitpos = plotPatternPoint (x1, y1, bitpos); - } else { /* Circle */ - if ((circles[patCode & 7][circlePos >> 3] >> (7 - (circlePos & 7))) & 1) { - bitpos = plotPatternPoint(x1, y1, bitpos); - } - circlePos++; + static const uint16 binary_list[] = {0x8000, 0x4000, 0x2000, 0x1000, 0x800, 0x400, 0x200, 0x100, + 0x80, 0x40, 0x20, 0x10, 0x8, 0x4, 0x2, 0x1}; + + static const uint8 circle_list[] = {0, 1, 4, 9, 16, 25, 37, 50}; + + static const uint16 circle_data[] = + {0x8000, + 0xE000, 0xE000, 0xE000, + 0x7000, 0xF800, 0x0F800, 0x0F800, 0x7000, + 0x3800, 0x7C00, 0x0FE00, 0x0FE00, 0x0FE00, 0x7C00, 0x3800, + 0x1C00, 0x7F00, 0x0FF80, 0x0FF80, 0x0FF80, 0x0FF80, 0x0FF80, 0x7F00, 0x1C00, + 0x0E00, 0x3F80, 0x7FC0, 0x7FC0, 0x0FFE0, 0x0FFE0, 0x0FFE0, 0x7FC0, 0x7FC0, 0x3F80, 0x1F00, 0x0E00, + 0x0F80, 0x3FE0, 0x7FF0, 0x7FF0, 0x0FFF8, 0x0FFF8, 0x0FFF8, 0x0FFF8, 0x0FFF8, 0x7FF0, 0x7FF0, 0x3FE0, 0x0F80, + 0x07C0, 0x1FF0, 0x3FF8, 0x7FFC, 0x7FFC, 0x0FFFE, 0x0FFFE, 0x0FFFE, 0x0FFFE, 0x0FFFE, 0x7FFC, 0x7FFC, 0x3FF8, 0x1FF0, 0x07C0}; + + uint16 circle_word; + const uint16 *circle_ptr; + uint16 counter; + uint16 pen_width = 0; + int pen_final_x = 0; + int pen_final_y = 0; + + uint8 t = 0; + uint8 temp8; + uint16 temp16; + + int pen_x = x; + int pen_y = y; + uint16 texture_num = 0; + uint16 pen_size = (_patCode & 0x07); + + circle_ptr = &circle_data[circle_list[pen_size]]; + + // setup the X position + // = pen_x - pen.size/2 + + pen_x = (pen_x * 2) - pen_size; + if (pen_x < 0) pen_x = 0; + + temp16 = 320 - (2 * pen_size); + if (pen_x >= temp16) + pen_x = temp16; + + pen_x /= 2; + pen_final_x = pen_x; // original starting point?? -> used in plotrelated + + // Setup the Y Position + // = pen_y - pen.size + pen_y = pen_y - pen_size; + if (pen_y < 0) pen_y = 0; + + temp16 = 167 - (2 * pen_size); + if (pen_y >= temp16) + pen_y = temp16; + + pen_final_y = pen_y; // used in plotrelated + + t = (uint8)(texture_num | 0x01); // even + + // new purpose for temp16 + + temp16 =( pen_size<<1) +1; // pen size + pen_final_y += temp16; // the last row of this shape + temp16 = temp16 << 1; + pen_width = temp16; // width of shape? + + bool circleCond; + int counterStep; + int ditherCond; + + if (_flags & kPicFCircle) + _patCode |= 0x10; + + if (_vm->getGameType() == GType_PreAGI) { + circleCond = ((_patCode & 0x10) == 0); + counterStep = 3; + ditherCond = 0x03; + } else { + circleCond = ((_patCode & 0x10) != 0); + counterStep = 4; + ditherCond = 0x02; + } + + for (; pen_y < pen_final_y; pen_y++) { + circle_word = *circle_ptr++; + + for (counter = 0; counter <= pen_width; counter += counterStep) { + if (circleCond || ((binary_list[counter>>1] & circle_word) != 0)) { + temp8 = t % 2; + t = t >> 1; + if (temp8 != 0) + t = t ^ 0xB8; + + // == box plot, != circle plot + if ((_patCode & 0x20) == 0 || (t & 0x03) == ditherCond) + putVirtPixel(pen_x, pen_y); } + pen_x++; } + + pen_x = pen_final_x; } + + return; } /************************************************************************** @@ -479,97 +543,223 @@ void PictureMgr::plotBrush() { int x1, y1; for (;;) { - if (patCode & 0x20) { - if ((patNum = nextByte) >= 0xF0) + if (_patCode & 0x20) { + if ((_patNum = nextByte()) >= _minCommand) break; - patNum = (patNum >> 1) & 0x7f; + _patNum = (_patNum >> 1) & 0x7f; } - if ((x1 = nextByte) >= 0xf0) + if ((x1 = nextByte()) >= _minCommand) break; - if ((y1 = nextByte) >= 0xf0) + if ((y1 = nextByte()) >= _minCommand) break; plotPattern(x1, y1); } - foffs--; + _foffs--; } /************************************************************************** -** fill -** -** AGI flood fill. (drawing action 0xF8) +** Draw AGI picture **************************************************************************/ void PictureMgr::drawPicture() { uint8 act; int drawing; - patCode = 0; - patNum = 0; - priOn = scrOn = false; - scrColour = 0xf; - priColour = 0x4; + _patCode = 0; + _patNum = 0; + _priOn = _scrOn = false; + _scrColor = 0xf; + _priColor = 0x4; drawing = 1; - debugC(8, kDebugLevelMain, "Drawing picture"); - for (drawing = 1; drawing && foffs < flen;) { - act = nextByte; + debugC(8, kDebugLevelMain, "Drawing v2 picture"); + for (drawing = 1; drawing && _foffs < _flen;) { + act = nextByte(); + + if (_pictureVersion == AGIPIC_C64 && act >= 0xf0 && act <= 0xfe) { + _scrColor = act - 0xf0; + continue; + } + switch (act) { - case 0xf0: /* set colour on screen */ - scrColour = nextByte; - scrColour &= 0xF; /* for v3 drawing diff */ - scrOn = true; + case 0xe0: // x-corner (C64) + xCorner(); + break; + case 0xe1: // y-corner (C64) + yCorner(); + break; + case 0xe2: // dynamic draw lines (C64) + dynamicDrawLine(); + break; + case 0xe3: // absolute draw lines (C64) + absoluteDrawLine(); break; - case 0xf1: /* disable screen drawing */ - scrOn = false; + case 0xe4: // fill (C64) + _scrColor = nextByte(); + _scrColor &= 0xF; /* for v3 drawing diff */ + fill(); + break; + case 0xe5: // enable screen drawing (C64) + _scrOn = true; break; - case 0xf2: /* set colour on priority */ - priColour = nextByte; - priColour &= 0xf; /* for v3 drawing diff */ - priOn = true; + case 0xe6: // plot brush (C64) + _patCode = nextByte(); + plotBrush(); break; - case 0xf3: /* disable priority screen */ - priOn = false; + case 0xf0: // set colour on screen (AGI pic v2) + if (_pictureVersion == AGIPIC_V15) + break; + + _scrColor = nextByte(); + _scrColor &= 0xF; // for v3 drawing diff + _scrOn = true; + break; + case 0xf1: + if (_pictureVersion == AGIPIC_V1) { + _scrColor = nextByte(); + _scrColor &= 0xF; // for v3 drawing diff + _scrOn = true; + _priOn = false; + } else if (_pictureVersion == AGIPIC_V15) { // set colour on screen + _scrColor = nextByte(); + _scrColor &= 0xF; + _scrOn = true; + } else if (_pictureVersion == AGIPIC_V2) { // disable screen drawing + _scrOn = false; + } + break; + case 0xf2: // set colour on priority (AGI pic v2) + if (_pictureVersion == AGIPIC_V15) + break; + + _priColor = nextByte(); + _priColor &= 0xf; // for v3 drawing diff + _priOn = true; + break; + case 0xf3: + if (_pictureVersion == AGIPIC_V1) { + _scrColor = nextByte(); + _scrColor &= 0xF; // for v3 drawing diff + _scrOn = true; + _priColor = nextByte(); + _priColor &= 0xf; // for v3 drawing diff + _priOn = true; + } + + if (_pictureVersion == AGIPIC_V15 && (_flags & kPicFf3Stop)) + drawing = 0; + + if (_pictureVersion == AGIPIC_V2) // disable priority screen + _priOn = false; break; - case 0xf4: /* y-corner */ + case 0xf4: // y-corner + if (_pictureVersion == AGIPIC_V15) + break; + yCorner(); break; - case 0xf5: /* x-corner */ + case 0xf5: // x-corner + if (_pictureVersion == AGIPIC_V15) + break; + xCorner(); break; - case 0xf6: /* absolute draw lines */ + case 0xf6: // absolute draw lines + if (_pictureVersion == AGIPIC_V15) + break; + absoluteDrawLine(); break; - case 0xf7: /* dynamic draw lines */ + case 0xf7: // dynamic draw lines + if (_pictureVersion == AGIPIC_V15) + break; + dynamicDrawLine(); break; - case 0xf8: /* fill */ - fill(); + case 0xf8: // fill + if (_pictureVersion == AGIPIC_V15) { + yCorner(true); + } else if (_pictureVersion == AGIPIC_V2) { + fill(); + } break; - case 0xf9: /* set pattern */ - patCode = nextByte; + case 0xf9: // set pattern + if (_pictureVersion == AGIPIC_V15) { + xCorner(true); + } else if (_pictureVersion == AGIPIC_V2) { + _patCode = nextByte(); + + if (_vm->getGameType() == GType_PreAGI) + plotBrush(); + } break; - case 0xfA: /* plot brush */ - plotBrush(); + case 0xfa: // plot brush + if (_pictureVersion == AGIPIC_V1) { + _scrOn = false; + _priOn = true; + absoluteDrawLine(); + _scrOn = true; + _priOn = false; + } else if (_pictureVersion == AGIPIC_V15) { + absoluteDrawLine(); + } else if (_pictureVersion == AGIPIC_V2) { + plotBrush(); + } break; - case 0xFF: /* end of pic data */ - default: + case 0xfb: + if (_pictureVersion == AGIPIC_V1) { + dynamicDrawLine(); + } else if (_pictureVersion == AGIPIC_V15) { + absoluteDrawLine(); + } + break; + case 0xfc: // fill (AGI pic v1) + if (_pictureVersion == AGIPIC_V15) + break; + + _scrColor = nextByte(); + _scrColor &= 0xF; + _priColor = nextByte(); + _priColor &= 0xf; + fill(); + break; + case 0xfe: // fill (AGI pic v1.5) + _scrColor = nextByte(); + _scrColor &= 0xF; + _scrOn = true; + fill(); + break; + case 0xff: // end of pic data drawing = 0; break; + default: + warning("Unknown picture opcode (%x) at (%x)", act, _foffs - 1); + } + if ((_flags & kPicFStep) && _vm->getGameType() == GType_PreAGI) { + // FIXME: This is used by Mickey for the crystal animation, but + // currently it's very very very slow + /* + int storedXOffset = _xOffset; + int storedYOffset = _yOffset; + // FIXME: picture coordinates are correct for Mickey only + showPic(10, 0, _width, _height); + _gfx->doUpdate(); + g_system->updateScreen(); + _xOffset = storedXOffset; + _yOffset = storedYOffset; + g_system->delayMillis(25); + */ } } } -/* - * Public functions - */ - /** - * + * convert AGI v3 format picture to AGI v2 format */ uint8 *PictureMgr::convertV3Pic(uint8 *src, uint32 len) { uint8 d, old = 0, x, *in, *xdata, *out, mode = 0; @@ -621,33 +811,36 @@ uint8 *PictureMgr::convertV3Pic(uint8 *src, uint32 len) { * @param clear clear AGI screen before drawing * @param agi256 load an AGI256 picture resource */ -int PictureMgr::decodePicture(int n, int clear, bool agi256) { +int PictureMgr::decodePicture(int n, int clear, bool agi256, int pic_width, int pic_height) { debugC(8, kDebugLevelResources, "(%d)", n); - patCode = 0; - patNum = 0; - priOn = scrOn = false; - scrColour = 0xF; - priColour = 0x4; + _patCode = 0; + _patNum = 0; + _priOn = _scrOn = false; + _scrColor = 0xF; + _priColor = 0x4; - data = _vm->_game.pictures[n].rdata; - flen = _vm->_game.dirPic[n].len; - foffs = 0; + _data = _vm->_game.pictures[n].rdata; + _flen = _vm->_game.dirPic[n].len; + _foffs = 0; + + _width = pic_width; + _height = pic_height; if (clear && !agi256) // 256 color pictures should always fill the whole screen, so no clearing for them. - memset(_vm->_game.sbuf16c, 0x4f, _WIDTH * _HEIGHT); // Clear 16 color AGI screen (Priority 4, color white). + memset(_vm->_game.sbuf16c, 0x4f, _width * _height); // Clear 16 color AGI screen (Priority 4, color white). if (!agi256) { drawPicture(); // Draw 16 color picture. } else { - const uint32 maxFlen = _WIDTH * _HEIGHT; - memcpy(_vm->_game.sbuf256c, data, MIN(flen, maxFlen)); // Draw 256 color picture. + const uint32 maxFlen = _width * _height; + memcpy(_vm->_game.sbuf256c, _data, MIN(_flen, maxFlen)); // Draw 256 color picture. - if (flen < maxFlen) { + if (_flen < maxFlen) { warning("Undersized AGI256 picture resource %d, using it anyway. Filling rest with white.", n); - memset(_vm->_game.sbuf256c + flen, 0x0f, maxFlen - flen); // Fill missing area with white. - } else if (flen > maxFlen) - warning("Oversized AGI256 picture resource %d, decoding only %ux%u part of it", n, _WIDTH, _HEIGHT); + memset(_vm->_game.sbuf256c + _flen, 0x0f, maxFlen - _flen); // Fill missing area with white. + } else if (_flen > maxFlen) + warning("Oversized AGI256 picture resource %d, decoding only %ux%u part of it", n, _width, _height); } if (clear) @@ -658,6 +851,40 @@ int PictureMgr::decodePicture(int n, int clear, bool agi256) { } /** + * Decode an AGI picture resource. + * This function decodes an AGI picture resource into the correct slot + * and draws it on the AGI screen, optionally clearing the screen before + * drawing. + * @param data the AGI Picture data + * @param length the size of the picture data buffer + * @param clear clear AGI screen before drawing + */ +int PictureMgr::decodePicture(byte* data, uint32 length, int clear, int pic_width, int pic_height) { + _patCode = 0; + _patNum = 0; + _priOn = _scrOn = false; + _scrColor = 0xF; + _priColor = 0x4; + + _data = data; + _flen = length; + _foffs = 0; + + _width = pic_width; + _height = pic_height; + + if (clear) // 256 color pictures should always fill the whole screen, so no clearing for them. + memset(_vm->_game.sbuf16c, 0x4f, _width * _height); // Clear 16 color AGI screen (Priority 4, color white). + + drawPicture(); // Draw 16 color picture. + + free(_data); + _data = 0; + + return errOK; +} + +/** * Unload an AGI picture resource. * This function unloads an AGI picture resource and deallocates * resource data. @@ -677,20 +904,44 @@ int PictureMgr::unloadPicture(int n) { * Show AGI picture. * This function copies a ``hidden'' AGI picture to the output device. */ -void PictureMgr::showPic() { - int i, y; +void PictureMgr::showPic(int x, int y, int pic_width, int pic_height) { + int i, y1; int offset; + _width = pic_width; + _height = pic_height; debugC(8, kDebugLevelMain, "Show picture!"); i = 0; offset = _vm->_game.lineMinPrint * CHAR_LINES; - for (y = 0; y < _HEIGHT; y++) { - _gfx->putPixelsA(0, y + offset, _WIDTH, &_vm->_game.sbuf16c[i]); - i += _WIDTH; + for (y1 = y; y1 < y + _height; y1++) { + _gfx->putPixelsA(x, y1 + offset, _width, &_vm->_game.sbuf16c[i]); + i += _width; } _gfx->flushScreen(); } +// preagi needed functions (for plotPattern) +void PictureMgr::setPattern(uint8 code, uint8 num) { + _patCode = code; + _patNum = num; +} + +void PictureMgr::setPictureVersion(AgiPictureVersion version) { + _pictureVersion = version; + + if (version == AGIPIC_C64) + _minCommand = 0xe0; + else + _minCommand = 0xf0; +} + +void PictureMgr::setPictureData(uint8 *data, int len) { + _data = data; + _flen = len; + _foffs = 0; + _flags = 0; +} + } // End of namespace Agi diff --git a/engines/agi/picture.h b/engines/agi/picture.h index 0f8584f3b2..50689b5b3a 100644 --- a/engines/agi/picture.h +++ b/engines/agi/picture.h @@ -30,6 +30,9 @@ namespace Agi { +#define _DEFAULT_WIDTH 160 +#define _DEFAULT_HEIGHT 168 + /** * AGI picture resource. */ @@ -38,11 +41,28 @@ struct AgiPicture { uint8 *rdata; /**< raw vector image data */ }; -class AgiEngine; +// AGI picture version +enum AgiPictureVersion { + AGIPIC_C64, + AGIPIC_V1, + AGIPIC_V15, + AGIPIC_V2 +}; + +enum AgiPictureFlags { + kPicFNone = (1 >> 0), + kPicFCircle = (1 >> 1), + kPicFStep = (1 >> 2), + kPicFf3Stop = (1 >> 3), + kPicFf3Cont = (1 >> 4), + kPicFTrollMode = (1 >> 5) +}; + +class AgiBase; class GfxMgr; class PictureMgr { - AgiEngine *_vm; + AgiBase *_vm; GfxMgr *_gfx; private: @@ -54,24 +74,69 @@ private: INLINE int isOkFillHere(int x, int y); void fillScanline(int x, int y); void agiFill(unsigned int x, unsigned int y); - void xCorner(); - void yCorner(); + void xCorner(bool skipOtherCoords = false); + void yCorner(bool skipOtherCoords = false); void fill(); int plotPatternPoint(int x, int y, int bitpos); - void plotPattern(int x, int y); void plotBrush(); - void drawPicture(); + + uint8 nextByte() { return _data[_foffs++]; } public: - PictureMgr(AgiEngine *agi, GfxMgr *gfx) { - _vm = agi; - _gfx = gfx; - } + PictureMgr(AgiBase *agi, GfxMgr *gfx); - int decodePicture(int n, int clear, bool agi256 = false); + int decodePicture(int n, int clear, bool agi256 = false, int pic_width = _DEFAULT_WIDTH, int pic_height = _DEFAULT_HEIGHT); + int decodePicture(byte* data, uint32 length, int clear, int pic_width = _DEFAULT_WIDTH, int pic_height = _DEFAULT_HEIGHT); int unloadPicture(int); - void showPic(); + void drawPicture(); + void showPic(int x = 0, int y = 0, int pic_width = _DEFAULT_WIDTH, int pic_height = _DEFAULT_HEIGHT); uint8 *convertV3Pic(uint8 *src, uint32 len); + + void plotPattern(int x, int y); // public because it's used directly by preagi + + void setPattern(uint8 code, uint8 num); + + void setPictureVersion(AgiPictureVersion version); + void setPictureData(uint8 *data, int len); + + void setPictureFlags(int flags) { _flags = flags; } + + void setOffset(int offX, int offY) { + _xOffset = offX; + _yOffset = offY; + } + + void setDimensions(int w, int h) { + _width = w; + _height = h; + } + + void putPixel(int x, int y, uint8 color) { + _scrColor = color; + _priOn = false; + _scrOn = true; + putVirtPixel(x, y); + } + +private: + uint8 *_data; + uint32 _flen; + uint32 _foffs; + + uint8 _patCode; + uint8 _patNum; + uint8 _priOn; + uint8 _scrOn; + uint8 _scrColor; + uint8 _priColor; + + uint8 _minCommand; + + AgiPictureVersion _pictureVersion; + int _width, _height; + int _xOffset, _yOffset; + + int _flags; }; } // End of namespace Agi diff --git a/engines/agi/preagi.cpp b/engines/agi/preagi.cpp new file mode 100644 index 0000000000..b42948ccdb --- /dev/null +++ b/engines/agi/preagi.cpp @@ -0,0 +1,253 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * $URL$ + * $Id$ + * + */ + +#include "common/stdafx.h" + +#include "common/events.h" +#include "common/file.h" +#include "common/savefile.h" +#include "common/config-manager.h" + +#include "base/plugins.h" +#include "base/version.h" + +#include "graphics/cursorman.h" + +#include "sound/mididrv.h" +#include "sound/mixer.h" + +#include "agi/preagi.h" +#include "agi/graphics.h" +#include "agi/sprite.h" +#include "agi/opcodes.h" +#include "agi/keyboard.h" +#include "agi/menu.h" +#include "agi/sound.h" + +// preagi engines +#include "agi/preagi_mickey.h" +#include "agi/preagi_troll.h" +#include "agi/preagi_winnie.h" + +namespace Agi { + +PreAgiEngine::PreAgiEngine(OSystem *syst) : AgiBase(syst) { + + // Setup mixer + if (!_mixer->isReady()) { + warning("Sound initialization failed."); + } + + _mixer->setVolumeForSoundType(Audio::Mixer::kSFXSoundType, ConfMan.getInt("sfx_volume")); + _mixer->setVolumeForSoundType(Audio::Mixer::kMusicSoundType, ConfMan.getInt("music_volume")); + + /* + const GameSettings *g; + + const char *gameid = ConfMan.get("gameid").c_str(); + for (g = agiSettings; g->gameid; ++g) + if (!scumm_stricmp(g->gameid, gameid)) + _gameId = g->id; + */ + + _rnd = new Common::RandomSource(); + + Common::addSpecialDebugLevel(kDebugLevelMain, "Main", "Generic debug level"); + Common::addSpecialDebugLevel(kDebugLevelResources, "Resources", "Resources debugging"); + Common::addSpecialDebugLevel(kDebugLevelSprites, "Sprites", "Sprites debugging"); + Common::addSpecialDebugLevel(kDebugLevelInventory, "Inventory", "Inventory debugging"); + Common::addSpecialDebugLevel(kDebugLevelInput, "Input", "Input events debugging"); + Common::addSpecialDebugLevel(kDebugLevelMenu, "Menu", "Menu debugging"); + Common::addSpecialDebugLevel(kDebugLevelScripts, "Scripts", "Scripts debugging"); + Common::addSpecialDebugLevel(kDebugLevelSound, "Sound", "Sound debugging"); + Common::addSpecialDebugLevel(kDebugLevelText, "Text", "Text output debugging"); + Common::addSpecialDebugLevel(kDebugLevelSavegame, "Savegame", "Saving & restoring game debugging"); + + memset(&_game, 0, sizeof(struct AgiGame)); + memset(&_debug, 0, sizeof(struct AgiDebug)); + memset(&g_mouse, 0, sizeof(struct Mouse)); + +/* + _game.clockEnabled = false; + _game.state = STATE_INIT; + + _keyQueueStart = 0; + _keyQueueEnd = 0; + + _keyControl = 0; + _keyAlt = 0; + + _allowSynthetic = false; + + g_tickTimer = 0; + + _intobj = NULL; + + _stackSize = 0; + _imageStack = NULL; + _imageStackPointer = 0; + + _lastSentence[0] = 0; + memset(&_stringdata, 0, sizeof(struct StringData)); + + _objects = NULL; + + _oldMode = -1; + + _firstSlot = 0; +*/ +} + +void PreAgiEngine::initialize() { + // TODO: Some sound emulation modes do not fit our current music + // drivers, and I'm not sure what they are. For now, they might + // as well be called "PC Speaker" and "Not PC Speaker". + + switch (MidiDriver::detectMusicDriver(MDT_PCSPK)) { + case MD_PCSPK: + _soundemu = SOUND_EMU_PC; + break; + default: + _soundemu = SOUND_EMU_NONE; + break; + } + + if (ConfMan.hasKey("render_mode")) { + _renderMode = Common::parseRenderMode(ConfMan.get("render_mode").c_str()); + } else if (ConfMan.hasKey("platform")) { + switch (Common::parsePlatform(ConfMan.get("platform"))) { + case Common::kPlatformAmiga: + _renderMode = Common::kRenderAmiga; + break; + case Common::kPlatformPC: + _renderMode = Common::kRenderEGA; + break; + default: + _renderMode = Common::kRenderEGA; + break; + } + } + + _gfx = new GfxMgr(this); + _sound = new SoundMgr(this, _mixer); + _picture = new PictureMgr(this, _gfx); + //_sprites = new SpritesMgr(this, _gfx); + + _gfx->initMachine(); + + _game.gameFlags = 0; + + _game.colorFg = 15; + _game.colorBg = 0; + + _defaultColor = 0xF; + + _game.name[0] = '\0'; + + _game.sbufOrig = (uint8 *)calloc(_WIDTH, _HEIGHT * 2); // Allocate space for two AGI screens vertically + _game.sbuf16c = _game.sbufOrig + SBUF16_OFFSET; // Make sbuf16c point to the 16 color (+control line & priority info) AGI screen + _game.sbuf = _game.sbuf16c; // Make sbuf point to the 16 color (+control line & priority info) AGI screen by default + + _game.lineMinPrint = 0; // hardcoded + + _gfx->initVideo(); + _sound->initSound(); + + //_timer->installTimerProc(agiTimerFunctionLow, 10 * 1000, NULL); + + _game.ver = -1; // Don't display the conf file warning + + debugC(2, kDebugLevelMain, "Detect game"); + + /* clear all resources and events */ + for (int i = 0; i < MAX_DIRS; i++) { + memset(&_game.pictures[i], 0, sizeof(struct AgiPicture)); + memset(&_game.sounds[i], 0, sizeof(class AgiSound *)); // _game.sounds contains pointers now + memset(&_game.dirPic[i], 0, sizeof(struct AgiDir)); + memset(&_game.dirSound[i], 0, sizeof(struct AgiDir)); + } + + debugC(2, kDebugLevelMain, "Init sound"); +} + +PreAgiEngine::~PreAgiEngine() { + +} + +int PreAgiEngine::init() { + + // Detect game + if (!initGame()) { + GUIErrorMessage("No valid games were found in the specified directory."); + return -1; + } + + // Initialize backend + _system->beginGFXTransaction(); + initCommonGFX(false); + _system->initSize(320, 200); + _system->endGFXTransaction(); + + initialize(); + + _gfx->gfxSetPalette(); + + return 0; +} + +int PreAgiEngine::go() { + setflag(fSoundOn, true); // enable sound + + // run preagi engine main loop + switch (getGameID()) { + case GID_MICKEY: + { + Mickey *mickey = new Mickey(this); + mickey->init(); + mickey->run(); + } + break; + case GID_WINNIE: + { + Winnie *winnie = new Winnie(this); + winnie->init(); + winnie->run(); + } + break; + case GID_TROLL: + { + Troll *troll = new Troll(this); + troll->init(); + troll->run(); + } + break; + default: + error("Unknown preagi engine"); + break; + } + return 0; +} + +} // End of namespace Agi diff --git a/engines/agi/preagi.h b/engines/agi/preagi.h new file mode 100644 index 0000000000..50c68991c9 --- /dev/null +++ b/engines/agi/preagi.h @@ -0,0 +1,99 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * $URL$ + * $Id$ + * + */ + +#ifndef AGI_PREAGI_H +#define AGI_PREAGI_H + +#include "agi/agi.h" +#include "agi/preagi_common.h" + +namespace Agi { + +class PreAgiEngine : public AgiBase { + int _gameId; + +protected: + int init(); + int go(); + void shutdown(); + void initialize(); + + bool initGame(); + +public: + void agiTimerLow() {} + int agiGetKeypressLow() { return 0; } + int agiIsKeypressLow() { return 0; } + + PreAgiEngine(OSystem *syst); + virtual ~PreAgiEngine(); + int getGameId() { + return _gameId; + } + + GfxMgr *_gfx; + SoundMgr *_sound; + PictureMgr *_picture; + + void clearImageStack() {} + void recordImageStackCall(uint8 type, int16 p1, int16 p2, int16 p3, + int16 p4, int16 p5, int16 p6, int16 p7) {} + void replayImageStackCall(uint8 type, int16 p1, int16 p2, int16 p3, + int16 p4, int16 p5, int16 p6, int16 p7) {} + void releaseImageStack() {} + + // Game + Common::String getTargetName() { return _targetName; } + + // Screen + void clearScreen(int attr, bool overrideDefault = true); + void clearGfxScreen(int attr); + void setDefaultTextColor(int attr) { _defaultColor = attr; } + + // Keyboard + int getSelection(SelectionTypes type); + bool waitAnyKeyChoice(); + int rnd(int hi) { return (_rnd->getRandomNumber(hi) + 1); } + + // Text + void drawStr(int row, int col, int attr, const char *buffer); + void drawStrMiddle(int row, int attr, const char *buffer); + void clearTextArea(); + void clearRow(int row); + void XOR80(char *buffer); + void printStr(const char *szMsg); + void printStrXOR(char *szMsg); + + // Saved Games + Common::SaveFileManager* getSaveFileMan() { return _saveFileMan; } + +private: + int _defaultColor; +}; + +} // End of namespace Agi + + +#endif diff --git a/engines/agi/preagi_common.cpp b/engines/agi/preagi_common.cpp new file mode 100644 index 0000000000..9ad494e410 --- /dev/null +++ b/engines/agi/preagi_common.cpp @@ -0,0 +1,211 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * $URL$ + * $Id$ + * + */ + +#include "common/stdafx.h" +#include "common/events.h" + +#include "agi/preagi.h" +#include "agi/font.h" +#include "agi/graphics.h" +#include "agi/keyboard.h" + +#include "agi/preagi_common.h" + +namespace Agi { + +// Screen functions +void PreAgiEngine::clearScreen(int attr, bool overrideDefault) { + if (overrideDefault) + _defaultColor = attr; + + _gfx->clearScreen((attr & 0xF0) / 0x10); +} + +void PreAgiEngine::clearGfxScreen(int attr) { + _gfx->drawRectangle(0, 0, GFX_WIDTH - 1, IDI_MAX_ROW_PIC * 8 -1, (attr & 0xF0) / 0x10); +} + +// String functions + +void PreAgiEngine::drawStr(int row, int col, int attr, const char *buffer) { + int code; + + if (attr == kColorDefault) + attr = _defaultColor; + + for (int iChar = 0; iChar < (int)strlen(buffer); iChar++) { + code = buffer[iChar]; + + switch (code) { + case '\n': + case 0x8D: + if (++row == 200 / 8) return; + col = 0; + break; + + case '|': + // swap attribute nibbles + break; + + default: + _gfx->putTextCharacter(1, col * 8 , row * 8, static_cast<char>(code), attr & 0x0f, (attr & 0xf0) / 0x10, false, getGameID() == GID_MICKEY ? mickey_fontdata : ibm_fontdata); + + if (++col == 320 / 8) { + col = 0; + if (++row == 200 / 8) return; + } + } + } +} + +void PreAgiEngine::drawStrMiddle(int row, int attr, const char *buffer) { + int col = (25 / 2) - (strlen(buffer) / 2); // 25 = 320 / 8 (maximum column) + drawStr(row, col, attr, buffer); +} + +void PreAgiEngine::clearTextArea() { + int start = IDI_MAX_ROW_PIC; + + if (getGameID() == GID_TROLL) + start = 21; + + for (int row = start; row < 200 / 8; row++) { + clearRow(row); + } +} + +void PreAgiEngine::clearRow(int row) { + drawStr(row, 0, IDA_DEFAULT, " "); // 40 spaces +} + +void PreAgiEngine::printStr(const char* szMsg) { + clearTextArea(); + drawStr(21, 0, IDA_DEFAULT, szMsg); + _gfx->doUpdate(); + _system->updateScreen(); +} + +void PreAgiEngine::XOR80(char *buffer) { + for (size_t i = 0; i < strlen(buffer); i++) + if (buffer[i] & 0x80) + buffer[i] ^= 0x80; +} + +void PreAgiEngine::printStrXOR(char *szMsg) { + XOR80(szMsg); + printStr(szMsg); +} + +// Input functions + +int PreAgiEngine::getSelection(SelectionTypes type) { + Common::Event event; + + // Selection types: + // 0: Y/N + // 1: 1-9 + for (;;) { + while (_eventMan->pollEvent(event)) { + switch(event.type) { + case Common::EVENT_QUIT: + _system->quit(); + case Common::EVENT_LBUTTONUP: + if (type == kSelYesNo) + return 1; + case Common::EVENT_RBUTTONUP: + return 0; + case Common::EVENT_KEYDOWN: + switch (event.kbd.keycode) { + case Common::KEYCODE_y: + if (type == kSelYesNo) + return 1; + case Common::KEYCODE_n: + if (type == kSelYesNo) + return 0; + case Common::KEYCODE_ESCAPE: + if (type == kSelNumber) + return 0; + case Common::KEYCODE_1: + case Common::KEYCODE_2: + case Common::KEYCODE_3: + case Common::KEYCODE_4: + case Common::KEYCODE_5: + case Common::KEYCODE_6: + case Common::KEYCODE_7: + case Common::KEYCODE_8: + case Common::KEYCODE_9: + if (type == kSelNumber) + return event.kbd.keycode - Common::KEYCODE_1 + 1; + case Common::KEYCODE_SPACE: + if (type == kSelSpace) + return 1; + default: + if (type == kSelYesNo) { + return 2; + } else if (type == kSelNumber) { + return 10; + } + } + break; + default: + break; + } + } + _system->updateScreen(); + _system->delayMillis(10); + } + return 0; +} + +bool PreAgiEngine::waitAnyKeyChoice() { + Common::Event event; + + for (;;) { + while (_eventMan->pollEvent(event)) { + switch(event.type) { + case Common::EVENT_QUIT: + _system->quit(); + case Common::EVENT_LBUTTONUP: + return true; + case Common::EVENT_RBUTTONUP: + return false; + case Common::EVENT_KEYDOWN: + switch (event.kbd.keycode) { + case Common::KEYCODE_ESCAPE: //Escape + return false; + default: + return true; + } + break; + default: + break; + } + } + _system->updateScreen(); + _system->delayMillis(10); + } +} + +} diff --git a/backends/platform/morphos/morphos_sound.h b/engines/agi/preagi_common.h index 0c5ca7096f..434bb685a6 100644 --- a/backends/platform/morphos/morphos_sound.h +++ b/engines/agi/preagi_common.h @@ -18,29 +18,32 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * MorphOS-specific header file - * * $URL$ * $Id$ * */ -#ifndef MORPHOS_SOUND_H -#define MORPHOS_SOUND_H -#include <exec/semaphores.h> -#include <devices/etude.h> -class OSystem_MorphOS; +#ifndef AGI_PREAGI_COMMON_H +#define AGI_PREAGI_COMMON_H -int morphos_sound_thread(OSystem_MorphOS *syst, ULONG SampleType); -bool init_morphos_music(ULONG MidiUnit, ULONG DevFlags); -void exit_morphos_music(); -bool etude_available(); +namespace Agi { -extern STRPTR ScummMusicDriver; -extern LONG ScummMidiUnit; -extern IOMidiRequest *ScummMidiRequest; +// default attributes +#define IDA_DEFAULT 0x0F +#define IDA_DEFAULT_REV 0xF0 -#endif +#define kColorDefault 0x1337 + +#define IDI_MAX_ROW_PIC 20 +enum SelectionTypes { + kSelYesNo, + kSelNumber, + kSelSpace +}; + +} // End of namespace Agi + +#endif diff --git a/engines/agi/preagi_mickey.cpp b/engines/agi/preagi_mickey.cpp new file mode 100644 index 0000000000..5215d90c21 --- /dev/null +++ b/engines/agi/preagi_mickey.cpp @@ -0,0 +1,2215 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * $URL$ + * $Id$ + * + */ + +#include "common/stdafx.h" +#include "common/events.h" +#include "common/savefile.h" + +#include "graphics/cursorman.h" + +#include "agi/preagi.h" +#include "agi/preagi_common.h" +#include "agi/preagi_mickey.h" +#include "agi/graphics.h" + +#define IDI_SND_OSCILLATOR_FREQUENCY 1193180 + +namespace Agi { + +int Mickey::getDat(int iRoom) { + if (((iRoom > 0) && (iRoom < 24)) || iRoom == 154 || iRoom == 155) return IDI_MSA_PLANET_EARTH; + if ((iRoom >= 30) && (iRoom <= 39)) return IDI_MSA_PLANET_VENUS; + if ((iRoom >= 40) && (iRoom <= 69)) return IDI_MSA_PLANET_NEPTUNE; + if ((iRoom >= 70) && (iRoom <= 82)) return IDI_MSA_PLANET_MERCURY; + if ((iRoom >= 83) && (iRoom <= 92)) return IDI_MSA_PLANET_SATURN; + if ((iRoom >= 93) && (iRoom <= 103)) return IDI_MSA_PLANET_PLUTO; + if ((iRoom >= 106) && (iRoom <= 120)) return IDI_MSA_PLANET_JUPITER; + if ((iRoom >= 121) && (iRoom <= 132)) return IDI_MSA_PLANET_MARS; + if ((iRoom >= 133) && (iRoom <= 145)) return IDI_MSA_PLANET_URANUS; + return IDI_MSA_PLANET_SPACESHIP; +} + +void Mickey::readExe(int ofs, uint8 *buffer, long buflen) { + Common::File infile; + if (!infile.open(IDS_MSA_PATH_EXE)) + return; + infile.seek(ofs, SEEK_SET); + infile.read(buffer, buflen); + infile.close(); +} + +void Mickey::getDatFileName(int iRoom, char *szFile) { + sprintf(szFile, IDS_MSA_PATH_DAT, IDS_MSA_NAME_DAT[getDat(iRoom)]); +} + +void Mickey::readDatHdr(char *szFile, MSA_DAT_HEADER *hdr) { + Common::File infile; + + if (!infile.open(szFile)) + return; + + hdr->filelen = infile.readByte(); + hdr->filelen += infile.readByte() * 0x100; + for (int i = 0; i < IDI_MSA_MAX_ROOM; i++) { + hdr->ofsRoom[i] = infile.readByte(); + hdr->ofsRoom[i] += infile.readByte() * 0x100; + } + for (int i = 0; i < IDI_MSA_MAX_ROOM; i++) { + hdr->ofsDesc[i] = infile.readByte(); + hdr->ofsDesc[i] += infile.readByte() * 0x100; + } + for (int i = 0; i < IDI_MSA_MAX_ROOM; i++) { + hdr->ofsStr[i] = infile.readByte(); + hdr->ofsStr[i] += infile.readByte() * 0x100; + } + + infile.close(); +} + +void Mickey::readDesc(int iRoom, char *buffer, long buflen) { + MSA_DAT_HEADER hdr; + char szFile[256] = {0}; + + getDatFileName(iRoom, szFile); + readDatHdr(szFile, &hdr); + + Common::File infile; + + if (!infile.open(szFile)) + return; + + memset(buffer, 0, buflen); + + infile.seek(hdr.ofsDesc[iRoom - 1] + IDI_MSA_OFS_DAT, SEEK_SET); + infile.read(buffer, buflen); + infile.close(); +} + +void Mickey::readMenu(int iRoom, char *buffer) { + MSA_DAT_HEADER hdr; + char szFile[256] = {0}; + + getDatFileName(iRoom, szFile); + readDatHdr(szFile, &hdr); + + Common::File infile; + + if (!infile.open(szFile)) + return; + + infile.seek(hdr.ofsRoom[iRoom - 1] + IDI_MSA_OFS_DAT, SEEK_SET); + infile.read((uint8 *)buffer, sizeof(MSA_MENU)); + infile.close(); +} + +void Mickey::readDatStr(int iDat, int iStr, char *buffer, long buflen) { + MSA_DAT_HEADER hdr; + char szFile[256] = {0}; + + sprintf(szFile, IDS_MSA_PATH_DAT, IDS_MSA_NAME_DAT[iDat]); + readDatHdr(szFile, &hdr); + + Common::File infile; + + if (!infile.open(szFile)) + return; + + infile.seek(hdr.ofsStr[iStr] + IDI_MSA_OFS_DAT, SEEK_SET); + infile.read((uint8 *)buffer, buflen); + infile.close(); +} + +void Mickey::readOfsData(int offset, int iItem, uint8 *buffer, long buflen) { + uint16 ofs[256]; + + readExe(offset, buffer, buflen); + memcpy(ofs, buffer, sizeof(ofs)); + for (int i = 0; i < 256; i++) + ofs[i] = buffer[i*2] + 256 * buffer[i*2+1]; + readExe(ofs[iItem] + IDI_MSA_OFS_EXE, buffer, buflen); +} + +// User Interface + +bool Mickey::chooseY_N(int ofsPrompt, bool fErrorMsg) { + printExeStr(ofsPrompt); + + _vm->_gfx->doUpdate(); + _vm->_system->updateScreen(); // TODO: this should go in the game's main loop + + int a = _vm->getSelection(kSelYesNo); + for (;;) { + switch (a) { + case 0: return false; + case 1: return true; + default: if (fErrorMsg) { + printExeStr(IDO_MSA_PRESS_YES_OR_NO); + waitAnyKey(); + printExeStr(ofsPrompt); + } + break; + } + a = _vm->getSelection(kSelYesNo); + } +} + +int Mickey::choose1to9(int ofsPrompt) { + printExeStr(ofsPrompt); + + _vm->_gfx->doUpdate(); + _vm->_system->updateScreen(); // TODO: this should go in the game's main loop + + int a = _vm->getSelection(kSelNumber); + for (;;) { + if (a == 10) { + printExeStr(IDO_MSA_PRESS_1_TO_9); + if (!_vm->waitAnyKeyChoice()) + return 0; + printExeStr(ofsPrompt); + } else return a; + a = _vm->getSelection(kSelNumber); + } + +} + +void Mickey::printStr(char *buffer) { + int pc = 1; + int nRows, iCol, iRow; + + nRows = *buffer + IDI_MSA_ROW_MENU_0; + + _vm->clearTextArea(); + + for (iRow = IDI_MSA_ROW_MENU_0; iRow < nRows; iRow++) { + iCol = *(buffer + pc++); + _vm->drawStr(iRow, iCol, IDA_DEFAULT, buffer + pc); + pc += strlen(buffer + pc) + 1; + } +} + +void Mickey::printExeStr(int ofs) { + uint8 buffer[256] = {0}; + + if (!ofs) + return; + + readExe(ofs, buffer, sizeof(buffer)); + printStr((char *)buffer); + //_vm->_gfx->doUpdate(); + //_vm->_system->updateScreen(); // TODO: this should go in the game's main loop +} + +void Mickey::printExeMsg(int ofs) { + if (!ofs) + return; + printExeStr(ofs); + waitAnyKeyAnim(); +} + +void Mickey::printDatStr(int iDat, int iStr) { + char *buffer = (char *)malloc(256); + readDatStr(iDat, iStr, buffer, 256); + printStr(buffer); + free(buffer); +} + +void Mickey::printDesc(int iRoom) { + char *buffer = (char *)malloc(256); + readDesc(iRoom, buffer, 256); + printStr(buffer); + //_vm->_gfx->doUpdate(); + //_vm->_system->updateScreen(); // TODO: this should go in the game's main loop + free(buffer); +} + +void Mickey::drawMenu(MSA_MENU menu, int sel0, int sel1) { + int iWord; + int iRow; + int sel; + uint8 attr; + + // draw menu + + _vm->clearTextArea(); + + for (iRow = 0; iRow < 2; iRow++) { + for (iWord = 0; iWord < menu.row[iRow].count; iWord++) { + if (iRow) + sel = sel1; + else + sel = sel0; + + if (iWord == sel) + attr = IDA_DEFAULT_REV; + else + attr = IDA_DEFAULT; + + _vm->drawStr(IDI_MSA_ROW_MENU_0 + iRow, menu.row[iRow].entry[iWord].x0, + attr, (char *)menu.row[iRow].entry[iWord].szText); + } + } + + _vm->_gfx->doUpdate(); + _vm->_system->updateScreen(); // TODO: this should go in the game's main loop +} + +void Mickey::getMouseMenuSelRow(MSA_MENU menu, int *sel0, int *sel1, int iRow, int x, int y) { + int iWord; + int *sel = 0; + + switch(iRow) { + case 0: + if (y != IDI_MSA_ROW_MENU_0) return; + sel = sel0; + break; + case 1: + if (y != IDI_MSA_ROW_MENU_1) return; + sel = sel1; + break; + } + + for (iWord = 0; iWord < menu.row[iRow].count; iWord++) { + if ((x >= menu.row[iRow].entry[iWord].x0) && + (x < (int)(menu.row[iRow].entry[iWord].x0 + + strlen((char *)menu.row[iRow].entry[iWord].szText)))) { + *sel = iWord; + break; + } + } +} + +bool Mickey::getMenuSelRow(MSA_MENU menu, int *sel0, int *sel1, int iRow) { + Common::Event event; + int *sel = 0; + int nWords; + int x, y; + int goIndex = -1, northIndex = -1, southIndex = -1, eastIndex = -1, westIndex = -1; + + switch(iRow) { + case 0: + sel = sel0; + break; + case 1: + sel = sel1; + break; + } + nWords = menu.row[iRow].count; + clickToMove = false; + + for (int i = 0; i <= menu.row[0].count; i++) + if (menu.row[0].entry[i].szText[0] == 71 && menu.row[0].entry[i].szText[1] == 79) // GO + goIndex = i; + + if (goIndex >= 0) { + for (int j = 0; j <= menu.row[1].count; j++) { + if (menu.row[1].entry[j].szText[0] == 78 && menu.row[1].entry[j].szText[1] == 79 && + menu.row[1].entry[j].szText[2] == 82 && menu.row[1].entry[j].szText[3] == 84 && + menu.row[1].entry[j].szText[4] == 72) + northIndex = j; + if (menu.row[1].entry[j].szText[0] == 83 && menu.row[1].entry[j].szText[1] == 79 && + menu.row[1].entry[j].szText[2] == 85 && menu.row[1].entry[j].szText[3] == 84 && + menu.row[1].entry[j].szText[4] == 72) + southIndex = j; + if (menu.row[1].entry[j].szText[0] == 69 && menu.row[1].entry[j].szText[1] == 65 && + menu.row[1].entry[j].szText[2] == 83 && menu.row[1].entry[j].szText[3] == 84) + eastIndex = j; + if (menu.row[1].entry[j].szText[0] == 87 && menu.row[1].entry[j].szText[1] == 69 && + menu.row[1].entry[j].szText[2] == 83 && menu.row[1].entry[j].szText[3] == 84) + westIndex = j; + } + } + + drawMenu(menu, *sel0, *sel1); + + for (;;) { + while (_vm->_system->getEventManager()->pollEvent(event)) { + switch(event.type) { + case Common::EVENT_QUIT: + exit(0); + case Common::EVENT_MOUSEMOVE: + if (iRow < 2) { + x = event.mouse.x / 8; + y = event.mouse.y / 8; + // If the mouse hovers over the menu, refresh the menu + if ((iRow == 0 && y == IDI_MSA_ROW_MENU_0) || (iRow == 1 && y == IDI_MSA_ROW_MENU_1)) { + getMouseMenuSelRow(menu, sel0, sel1, iRow, x, y); + drawMenu(menu, *sel0, *sel1); + } + + // Change cursor + if (northIndex >= 0 && (event.mouse.x >= 20 && event.mouse.x <= (IDI_MSA_PIC_WIDTH + 10) * 2) && + (event.mouse.y >= 0 && event.mouse.y <= 10)) { + _vm->_gfx->setCursorPalette(true); + } else if (southIndex >= 0 && (event.mouse.x >= 20 && event.mouse.x <= (IDI_MSA_PIC_WIDTH + 10) * 2) && + (event.mouse.y >= IDI_MSA_PIC_HEIGHT - 10 && event.mouse.y <= IDI_MSA_PIC_HEIGHT)) { + _vm->_gfx->setCursorPalette(true); + } else if (westIndex >= 0 && (event.mouse.y >= 0 && event.mouse.y <= IDI_MSA_PIC_HEIGHT) && + (event.mouse.x >= 20 && event.mouse.x <= 30)) { + _vm->_gfx->setCursorPalette(true); + } else if (eastIndex >= 0 && (event.mouse.y >= 0 && event.mouse.y <= IDI_MSA_PIC_HEIGHT) && + (event.mouse.x >= IDI_MSA_PIC_WIDTH * 2 && event.mouse.x <= (IDI_MSA_PIC_WIDTH + 10) * 2)) { + _vm->_gfx->setCursorPalette(true); + } else { + _vm->_gfx->setCursorPalette(false); + } + } + break; + case Common::EVENT_LBUTTONUP: + // Click to move + if (northIndex >= 0 && (event.mouse.x >= 20 && event.mouse.x <= (IDI_MSA_PIC_WIDTH + 10) * 2) && + (event.mouse.y >= 0 && event.mouse.y <= 10)) { + *sel0 = goIndex; *sel1 = northIndex; + drawMenu(menu, *sel0, *sel1); + _vm->_gfx->setCursorPalette(false); + clickToMove = true; + } else if (southIndex >= 0 && (event.mouse.x >= 20 && event.mouse.x <= (IDI_MSA_PIC_WIDTH + 10) * 2) && + (event.mouse.y >= IDI_MSA_PIC_HEIGHT - 10 && event.mouse.y <= IDI_MSA_PIC_HEIGHT)) { + *sel0 = goIndex; *sel1 = southIndex; + drawMenu(menu, *sel0, *sel1); + _vm->_gfx->setCursorPalette(false); + clickToMove = true; + } else if (westIndex >= 0 && (event.mouse.y >= 0 && event.mouse.y <= IDI_MSA_PIC_HEIGHT) && + (event.mouse.x >= 20 && event.mouse.x <= 30)) { + *sel0 = goIndex; *sel1 = westIndex; + drawMenu(menu, *sel0, *sel1); + _vm->_gfx->setCursorPalette(false); + clickToMove = true; + } else if (eastIndex >= 0 && (event.mouse.y >= 0 && event.mouse.y <= IDI_MSA_PIC_HEIGHT) && + (event.mouse.x >= IDI_MSA_PIC_WIDTH * 2 && event.mouse.x <= (IDI_MSA_PIC_WIDTH + 10) * 2)) { + *sel0 = goIndex; *sel1 = eastIndex; + drawMenu(menu, *sel0, *sel1); + _vm->_gfx->setCursorPalette(false); + clickToMove = true; + } else { + _vm->_gfx->setCursorPalette(false); + } + return true; + case Common::EVENT_RBUTTONUP: + *sel0 = 0; *sel1 = -1; + return false; + case Common::EVENT_WHEELUP: + if (iRow < 2) { + *sel -= 1; + if (*sel < 0) *sel = nWords - 1; + drawMenu(menu, *sel0, *sel1); + } + break; + case Common::EVENT_WHEELDOWN: + if (iRow < 2) { + *sel += 1; + if (*sel == nWords) *sel = 0; + drawMenu(menu, *sel0, *sel1); + } + break; + case Common::EVENT_KEYDOWN: + switch (event.kbd.keycode) { + case Common::KEYCODE_2: + hidden(); + break; + case Common::KEYCODE_8: + if (event.kbd.flags & Common::KBD_CTRL) { + *sel0 = 0; *sel1 = -1; return false; + } + break; + case Common::KEYCODE_ESCAPE: + *sel0 = 0; *sel1 = -1; return false; + case Common::KEYCODE_s: + _vm->flipflag(fSoundOn); + break; + case Common::KEYCODE_c: + inventory(); + drawRoom(); + *sel0 = 0; *sel1 = -1; return false; + case Common::KEYCODE_b: + printRoomDesc(); + drawMenu(menu, *sel0, *sel1); + *sel0 = 0; *sel1 = -1; return false; + case Common::KEYCODE_LEFT: + case Common::KEYCODE_KP4: + case Common::KEYCODE_4: + if (iRow < 2) { + *sel -= 1; + if (*sel < 0) *sel = nWords - 1; + drawMenu(menu, *sel0, *sel1); + } + break; + case Common::KEYCODE_RIGHT: + case Common::KEYCODE_SPACE: + case Common::KEYCODE_KP6: + case Common::KEYCODE_6: + if (iRow < 2) { + *sel += 1; + if (*sel == nWords) *sel = 0; + drawMenu(menu, *sel0, *sel1); + } + break; + case Common::KEYCODE_RETURN: + case Common::KEYCODE_KP_ENTER: + return true; + default: + break; + } + break; + default: + break; + } + animate(); + drawMenu(menu, *sel0, *sel1); + } + animate(); + drawMenu(menu, *sel0, *sel1); + } +} + +void Mickey::getMenuSel(char *buffer, int *sel0, int *sel1) { + MSA_MENU menu; + + memcpy(&menu, buffer, sizeof(MSA_MENU)); + + *sel0 = 0; + *sel1 = -1; + + // Show the mouse cursor for the menu + CursorMan.showMouse(true); + + for (;;) { + for (;;) { + if (getMenuSelRow(menu, sel0, sel1, 0)) { + if (clickToMove) + break; + *sel1 = 0; + if (getMenuSelRow(menu, sel0, sel1, 1)) { + break; + } + } + } + if (clickToMove || getMenuSelRow(menu, sel0, sel1, 2)) { + break; + } + } + + // Menu selection made, hide the mouse cursor + CursorMan.showMouse(false); +} + +void Mickey::centerMenu(MSA_MENU *menu) { + int iWord; + int iRow; + int w, x; + + for (iRow = 0; iRow < 2; iRow++) { + w = 0; + for (iWord = 0; iWord < menu->row[iRow].count; iWord++) { + w += strlen((char *)menu->row[iRow].entry[iWord].szText); + } + w += menu->row[iRow].count - 1; + x = (40 - w) / 2; // FIX + for (iWord = 0; iWord < menu->row[iRow].count; iWord++) { + menu->row[iRow].entry[iWord].x0 = x; + x += strlen((char *)menu->row[iRow].entry[iWord].szText) + 1; + } + } +} + +void Mickey::patchMenu(MSA_MENU *menu) { + uint8 buffer[512]; + uint8 menubuf[sizeof(MSA_MENU)]; + int nPatches; + int pBuf = 0; + + // change planet name in ship airlock menu + if (game.iRoom == IDI_MSA_PIC_SHIP_AIRLOCK) { + strcpy((char *)menu->row[1].entry[2].szText, IDS_MSA_NAME_PLANET[game.iPlanet]); + } + + // exit if fix unnecessary + if (!game.iRmMenu[game.iRoom]) { + centerMenu(menu); + return; + } + + // copy menu to menubuf + memcpy(menubuf, menu, sizeof(menubuf)); + + // read patches + readOfsData( + IDOFS_MSA_MENU_PATCHES, + game.nRmMenu[game.iRoom] + game.iRmMenu[game.iRoom] - 1, + buffer, sizeof(buffer) + ); + + // get number of patches + nPatches = buffer[pBuf++]; + + // patch menubuf + for (int iPatch = 0; iPatch < nPatches; iPatch++) { + if (buffer[pBuf] > sizeof(menubuf)) { + // patch address out of bounds + } + menubuf[buffer[pBuf]] = buffer[pBuf + 1]; + pBuf += 2; + } + + // copy menubuf back to menu + memcpy(menu, menubuf, sizeof(MSA_MENU)); + + // center menu + centerMenu(menu); +} + +void Mickey::printDatString(int iStr) { + printDatStr(getDat(game.iRoom), iStr); +} + +void Mickey::printDatMessage(int iStr) { + printDatString(iStr); + //_vm->_gfx->doUpdate(); + //_vm->_system->updateScreen(); // TODO: this should go in the game's main loop + waitAnyKeyAnim(); +} + +// Sound + +void Mickey::playNote(MSA_SND_NOTE note) { + // TODO + if (!note.counter) { + //_vm->_sound->playNote(1, 0, 160); // ScummVM + //playNote(1, 0, note.length / IDI_SND_TIMER_RESOLUTION); // TrollVM + } else { + //_vm->_sound->playNote(1, IDI_SND_OSCILLATOR_FREQUENCY / note.counter, 160); // ScummVM + //playNote(1, IDI_SND_OSCILLATOR_FREQUENCY / note.counter, + // note.length / IDI_SND_TIMER_RESOLUTION / IDI_SND_PITCH); // TrollVM + } +} + +void Mickey::playSound(ENUM_MSA_SOUND iSound) { + if (!_vm->getflag(fSoundOn)) + return; + + Common::Event event; + MSA_SND_NOTE note; + uint8 *buffer = new uint8[1024]; + int pBuf = 1; + + switch(iSound) { + case IDI_MSA_SND_XL30: + for (int iNote = 0; iNote < 6; iNote++) { + note.counter = _vm->rnd(59600) + 59; + note.length = 4; + playNote(note); + } + break; + default: + readOfsData(IDOFS_MSA_SOUND_DATA, iSound, buffer, 1024); + + for (;;) { + memcpy(¬e, buffer + pBuf, sizeof(note)); + if (!note.counter && !note.length) + break; + + playNote(note); + + pBuf += 3; + + if (iSound == IDI_MSA_SND_THEME) { + while (_vm->_system->getEventManager()->pollEvent(event)) { + switch(event.type) { + case Common::EVENT_QUIT: + _vm->_system->quit(); + case Common::EVENT_LBUTTONUP: + case Common::EVENT_RBUTTONUP: + case Common::EVENT_KEYDOWN: + delete [] buffer; + return; + default: + break; + } + } + } + } + + break; + } + + delete [] buffer; +} + +void Mickey::debug() { + char szLine[41] = {0}; + + _vm->clearScreen(IDA_DEFAULT); + + sprintf(szLine, IDS_MSA_DEBUG_ROOM, game.iRoom); + _vm->drawStr(5, 10, IDA_DEFAULT, szLine); + + if (game.iRoom < IDI_MSA_MAX_PIC_ROOM) { + if (game.iRmObj[game.iRoom] != IDI_MSA_OBJECT_NONE) { + sprintf(szLine, IDS_MSA_DEBUG_OBJ, game.iRmObj[game.iRoom]); + _vm->drawStr(7, 10, IDA_DEFAULT, szLine); + } + } else { + sprintf(szLine, IDS_MSA_DEBUG_OBJ, 32); + _vm->drawStr(7, 10, IDA_DEFAULT, szLine); + } + _vm->_gfx->doUpdate(); + _vm->_system->updateScreen(); // TODO: this should go in the game's main loop +} + +// Graphics + +void Mickey::drawObj(ENUM_MSA_OBJECT iObj, int x0, int y0) { + uint8* buffer = new uint8[4096]; + char szFile[255] = {0}; + sprintf(szFile, IDS_MSA_PATH_OBJ, IDS_MSA_NAME_OBJ[iObj]); + + Common::File file; + if (!file.open(szFile)) + return; + uint32 size = file.size(); + file.read(buffer, size); + file.close(); + + if (iObj == IDI_MSA_OBJECT_CRYSTAL) + _vm->_picture->setPictureFlags(kPicFStep); + + _vm->_picture->setOffset(x0, y0); + _vm->_picture->decodePicture(buffer, size, false, IDI_MSA_PIC_WIDTH, IDI_MSA_PIC_HEIGHT); + _vm->_picture->setOffset(0, 0); + _vm->_picture->showPic(10, 0, IDI_MSA_PIC_WIDTH, IDI_MSA_PIC_HEIGHT); +} + +void Mickey::drawPic(int iPic) { + uint8* buffer = new uint8[4096]; + char szFile[255] = {0}; + sprintf(szFile, IDS_MSA_PATH_PIC, iPic); + + Common::File file; + if (!file.open(szFile)) + return; + uint32 size = file.size(); + file.read(buffer, size); + file.close(); + + // Note that decodePicture clears the screen + _vm->_picture->decodePicture(buffer, size, true, IDI_MSA_PIC_WIDTH, IDI_MSA_PIC_HEIGHT); + _vm->_picture->showPic(10, 0, IDI_MSA_PIC_WIDTH, IDI_MSA_PIC_HEIGHT); + //_vm->_gfx->doUpdate(); + //_vm->_system->updateScreen(); // TODO: this should go in the game's main loop +} + +void Mickey::drawRoomPicture() { + if (false) { // (getDebug()) { // TODO + drawPic(0); + debug(); + } else { + if (game.iRoom == IDI_MSA_PIC_TITLE) { + drawPic(IDI_MSA_PIC_TITLE); + } else { + drawPic(game.iRmPic[game.iRoom]); + } + } +} + +void Mickey::drawRoomObjects() { + if (game.iRoom >= IDI_MSA_MAX_PIC_ROOM) + return; + + uint8 buffer[256]; + int pBuf = 0; + int nObjs; + + // draw ship control room window + + if (game.iRoom == IDI_MSA_PIC_SHIP_CONTROLS) { + if (game.fFlying) { + drawObj(IDI_MSA_OBJECT_W_SPACE, 0, 0); + } else { + drawObj((ENUM_MSA_OBJECT)(IDI_MSA_OBJECT_W_EARTH + game.iPlanet), 0, 1); + } + } + + // draw objects + + if (game.iRmObj[game.iRoom] != IDI_MSA_OBJECT_NONE) { + readOfsData(IDO_MSA_ROOM_OBJECT_XY_OFFSETS, + game.iRmObj[game.iRoom], buffer, sizeof(buffer)); + + nObjs = buffer[pBuf++]; + + for (int iObj = 0; iObj < nObjs; iObj++) { + drawObj((ENUM_MSA_OBJECT)buffer[pBuf], buffer[pBuf + 1], buffer[pBuf + 2]); + pBuf += 3; + } + } +} + +void Mickey::drawRoomAnimation() { + uint8 objLight[] = { + 0xF0, 1, 0xF9, 2, 43, 45, 0xFF + }; + + switch(game.iRoom) { + case IDI_MSA_PIC_EARTH_SHIP: + case IDI_MSA_PIC_VENUS_SHIP: + case IDI_MSA_PIC_NEPTUNE_SHIP: + case IDI_MSA_PIC_MERCURY_SHIP: + case IDI_MSA_PIC_SATURN_SHIP: + case IDI_MSA_PIC_PLUTO_SHIP: + case IDI_MSA_PIC_JUPITER_SHIP: + case IDI_MSA_PIC_MARS_SHIP: + case IDI_MSA_PIC_URANUS_SHIP: + case IDI_MSA_PIC_SHIP_VENUS: + case IDI_MSA_PIC_SHIP_NEPTUNE: + case IDI_MSA_PIC_SHIP_MERCURY: + case IDI_MSA_PIC_SHIP_SATURN: + case IDI_MSA_PIC_SHIP_PLUTO: + case IDI_MSA_PIC_SHIP_JUPITER: + case IDI_MSA_PIC_SHIP_MARS: + case IDI_MSA_PIC_SHIP_URANUS: + { + // draw blinking ship lights + + uint8 iColor = 0; + + _vm->_picture->setPattern(2, 0); + + for (int i = 0; i < 12; i++) { + iColor = game.nFrame + i; + if (iColor > 15) iColor -= 15; + + objLight[1] = iColor; + objLight[4] += 7; + + _vm->_picture->setPictureData(objLight, ARRAYSIZE(objLight)); + _vm->_picture->setPictureFlags(kPicFCircle); + _vm->_picture->drawPicture(); + } + _vm->_picture->showPic(10, 0, IDI_MSA_PIC_WIDTH, IDI_MSA_PIC_HEIGHT); + + + game.nFrame--; + if (game.nFrame < 0) game.nFrame = 15; + + playSound(IDI_MSA_SND_PRESS_BLUE); + } + break; + + case IDI_MSA_PIC_SHIP_CONTROLS: + + // draw XL30 screen + + if (game.fAnimXL30) { + if (game.nFrame > 5) game.nFrame = 0; + drawObj((ENUM_MSA_OBJECT)(IDI_MSA_OBJECT_XL31 + game.nFrame), 0, 4); + game.nFrame++; + }; + + break; + + default: + + // draw crystal + + if (game.iRoom == IDI_MSA_XTAL_ROOM_XY[game.iPlanet][0]) { + if (!game.fHasXtal) { + switch(game.iPlanet) { + case IDI_MSA_PLANET_VENUS: + if (game.iRmMenu[game.iRoom] != 2) break; + default: + drawObj( + IDI_MSA_OBJECT_CRYSTAL, + IDI_MSA_XTAL_ROOM_XY[game.iPlanet][1], + IDI_MSA_XTAL_ROOM_XY[game.iPlanet][2] + ); + break; + } + } + } + + break; + } +} + +void Mickey::drawRoom() { + drawRoomPicture(); + drawRoomObjects(); + drawRoomAnimation(); +} + +const uint8 colorBCG[16][2] = { + { 0x00, 0x00 }, // 0 (black, black) + { 0, 0 }, + { 0x00, 0x0D }, // 2 (black, purple) + { 0x00, 0xFF }, // 3 (black, white) + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { 0x0D, 0x00 }, // 8 (purple, black) + { 0, 0 }, + { 0x0D, 0x0D }, // A (purple, purple) + { 0, 0 }, + { 0xFF, 0x00 }, // C (white, black) + { 0, 0 }, + { 0, 0 }, + { 0xFF, 0xFF } // F (white, white) +}; + +void Mickey::drawLogo() { + char szFile[256] = {0}; + uint8 *buffer = new uint8[16384]; + const int w = 80; + const int h = 170; + uint8 bitmap[h][w]; + + // read in logos.bcg + sprintf(szFile, IDS_MSA_PATH_LOGO); + Common::File infile; + if (!infile.open(szFile)) + return; + infile.read(buffer, infile.size()); + infile.close(); + + // draw logo bitmap + memcpy(bitmap, buffer, sizeof(bitmap)); + + /* + // TODO: Show BCG picture + for (int y = 0; y < h; y++) { + for (int x = 0; x < w; x++) { + uint8 color = colorBCG[(bitmap[y][x] & 0xf0) / 0x10][0]; // background + uint8 color2 = colorBCG[(bitmap[y][x] & 0xf0) / 0x10][1]; // background + uint8 color3 = colorBCG[ bitmap[y][x] & 0x0f][0]; // foreground + uint8 color4 = colorBCG[ bitmap[y][x] & 0x0f][1]; // foreground + + _vm->_picture->putPixel(x * 4, y, color); + _vm->_picture->putPixel(x * 4 + 1, y, color2); + _vm->_picture->putPixel(x * 4 + 2, y, color3); + _vm->_picture->putPixel(x * 4 + 3, y, color4); + _vm->_picture->putPixel(x * 4, y + 1, color); + _vm->_picture->putPixel(x * 4 + 1, y + 1, color2); + _vm->_picture->putPixel(x * 4 + 2, y + 1, color3); + _vm->_picture->putPixel(x * 4 + 3, y + 1, color4); + } + } + + _vm->_picture->showPic(10, 0, IDI_MSA_PIC_WIDTH, IDI_MSA_PIC_HEIGHT); + */ + + //_vm->_gfx->doUpdate(); + //_vm->_system->updateScreen(); // TODO: this should go in the game's main loop + + delete [] buffer; +} + +void Mickey::animate() { + _vm->_system->delayMillis(IDI_MSA_ANIM_DELAY); + drawRoomAnimation(); +} + +void Mickey::printRoomDesc() { + // print room description + + printDesc(game.iRoom); + waitAnyKeyAnim(); + + // print extended room description + + if (game.fRmTxt[game.iRoom]) { + printExeMsg(game.oRmTxt[game.iRoom] + IDI_MSA_OFS_EXE); + } +} + +bool Mickey::loadGame() { + Common::InSaveFile *infile; + char szFile[256] = {0}; + bool diskerror = true; + int sel; + + while (diskerror) { + sel = choose1to9(IDO_MSA_LOAD_GAME[1]); + if (!sel) + return false; + + // load game + sprintf(szFile, "%s.s%2d", _vm->getTargetName().c_str(), sel); + if (!(infile = _vm->getSaveFileMan()->openForLoading(szFile))) { + printExeStr(IDO_MSA_CHECK_DISK_DRIVE); + if (!_vm->waitAnyKeyChoice()) + return false; + } else { + infile->read(&game, sizeof(MSA_GAME)); + diskerror = false; + delete infile; + } + } + + printExeMsg(IDO_MSA_LOAD_GAME[2]); + return true; +} + +void Mickey::saveGame() { + Common::OutSaveFile* outfile; + char szFile[256] = {0}; + bool diskerror = true; + int sel; + + bool fOldDisk = chooseY_N(IDO_MSA_SAVE_GAME[0], false); + + if (fOldDisk) + printExeStr(IDO_MSA_SAVE_GAME[1]); + else + printExeStr(IDO_MSA_SAVE_GAME[2]); + + if (!_vm->waitAnyKeyChoice()) + return; + + while (diskerror) { + sel = choose1to9(IDO_MSA_SAVE_GAME[3]); + if (!sel) + return; + + if (fOldDisk) + printExeStr(IDO_MSA_SAVE_GAME[5]); + else + printExeStr(IDO_MSA_SAVE_GAME[4]); + + if (!_vm->waitAnyKeyChoice()) + return; + + // save game + sprintf(szFile, "%s.s%2d", _vm->getTargetName().c_str(), sel); + if (!(outfile = _vm->getSaveFileMan()->openForSaving(szFile))) { + printExeStr(IDO_MSA_CHECK_DISK_DRIVE); + if (!_vm->waitAnyKeyChoice()) + return; + } else { + outfile->write(&game, sizeof(MSA_GAME)); + diskerror = false; + delete outfile; + } + } + + printExeMsg(IDO_MSA_SAVE_GAME[6]); +} + +void Mickey::showPlanetInfo() { + for (int i = 0; i < IDI_MSA_MAX_PLANET_INFO; i++) { + printExeStr(IDO_MSA_PLANET_INFO[game.iPlanet][i]); + waitAnyKey(); + } +} + +void Mickey::printStory() { + char buffer[IDI_MSA_LEN_STORY] = {0}; + char szLine[41] = {0}; + int iRow; + int pBuf = 0; + + readExe(IDO_MSA_GAME_STORY, (uint8 *)buffer, sizeof(buffer)); + + _vm->clearScreen(IDA_DEFAULT); + for (iRow = 0; iRow < 25; iRow++) { + strcpy(szLine, buffer + pBuf); + _vm->drawStr(iRow, 0, IDA_DEFAULT, szLine); + pBuf += strlen(szLine) + 1; + } + //_vm->_gfx->doUpdate(); + //_vm->_system->updateScreen(); // TODO: this should go in the game's main loop + waitAnyKey(); + + _vm->clearScreen(IDA_DEFAULT); + for (iRow = 0; iRow < 21; iRow++) { + strcpy(szLine, buffer + pBuf); + _vm->drawStr(iRow, 0, IDA_DEFAULT, szLine); + pBuf += strlen(szLine) + 1; + } + //_vm->_gfx->doUpdate(); + //_vm->_system->updateScreen(); // TODO: this should go in the game's main loop + waitAnyKey(); + + //Set back to black + _vm->_gfx->clearScreen(0); + //_vm->_gfx->doUpdate(); + //_vm->_system->updateScreen(); // TODO: this should go in the game's main loop + + drawRoom(); + //_vm->_gfx->doUpdate(); + //_vm->_system->updateScreen(); // TODO: this should go in the game's main loop + + game.fStoryShown = true; +} + +void Mickey::hidden() { + if (game.iRoom == IDI_MSA_PIC_MERCURY_CAVE_0) { + for (int i = 0; i < 5; i++) { + printExeMsg(IDO_MSA_HIDDEN_MSG[i]); + } + _vm->clearTextArea(); + //_vm->_gfx->doUpdate(); + //_vm->_system->updateScreen(); // TODO: this should go in the game's main loop + waitAnyKey(); + } +} + +int Mickey::getPlanet() { + if (!game.nButtons) + return -1; + + for (int iPlanet = 0; iPlanet < IDI_MSA_MAX_DAT; iPlanet++) { + if (!strcmp(IDS_MSA_ADDR_PLANET[iPlanet], game.szAddr)) { + return iPlanet; + } + } + + return -1; +} + +void Mickey::pressOB(int iButton) { + char szButtons[12] = {0}; + + // check if too many buttons pressed + if (game.nButtons == IDI_MSA_MAX_BUTTON) { + game.nButtons = 0; + memset(game.szAddr, 0, sizeof(game.szAddr)); + printExeMsg(IDO_MSA_TOO_MANY_BUTTONS_PRESSED); + return; + } + + // add button press to address + game.nButtons++; + game.szAddr[game.nButtons - 1] = (char)iButton; + + // format buttons string + for (int i = 0; i < IDI_MSA_MAX_BUTTON; i++) { + szButtons[i * 2] = game.szAddr[i]; + if (game.szAddr[i + 1]) szButtons[(i * 2) + 1] = ','; + } + + // print pressed buttons + printExeStr(IDO_MSA_MICKEY_HAS_PRESSED); + _vm->drawStr(IDI_MSA_ROW_BUTTONS, IDI_MSA_COL_BUTTONS, IDA_DEFAULT, szButtons); + //_vm->_gfx->doUpdate(); + //_vm->_system->updateScreen(); // TODO: this should go in the game's main loop + waitAnyKey(); +} + +void Mickey::checkAirSupply(bool fSuit, int *iSupply) { + if (fSuit) { + *iSupply -= 1; + for (int i = 0; i < 4; i++) { + if (*iSupply == IDI_MSA_AIR_SUPPLY[i]) { + playSound(IDI_MSA_SND_XL30); + printExeMsg(IDO_MSA_XL30_SPEAKING); + printExeMsg(IDO_MSA_AIR_SUPPLY[i]); + if (i == 3) { + exit(0); + } + } + } + } else { + *iSupply = IDI_MSA_MAX_AIR_SUPPLY; + } +} + +void Mickey::insertDisk(int iDisk) { + _vm->clearTextArea(); + _vm->drawStr(IDI_MSA_ROW_INSERT_DISK, IDI_MSA_COL_INSERT_DISK, IDA_DEFAULT, (const char *)IDS_MSA_INSERT_DISK[iDisk]); + //_vm->_gfx->doUpdate(); + //_vm->_system->updateScreen(); // TODO: this should go in the game's main loop + waitAnyKey(); +} + +void Mickey::gameOver() { + drawPic(IDI_MSA_PIC_EARTH_SHIP_LEAVING); + printExeMsg(IDO_MSA_GAME_OVER[3]); + playSound(IDI_MSA_SND_GAME_OVER); + + if (game.fItemUsed[IDI_MSA_ITEM_LETTER]) { + drawPic(IDI_MSA_PIC_EARTH_MINNIE); + printExeMsg(IDO_MSA_GAME_OVER[4]); + printExeMsg(IDO_MSA_GAME_OVER[5]); + } else { + printExeMsg(IDO_MSA_GAME_OVER[6]); + printExeMsg(IDO_MSA_GAME_OVER[7]); + } + + waitAnyKey(); + exit(0); +} + +void Mickey::flipSwitch() { + if (game.fHasXtal || game.nXtals) { + if (!game.fStoryShown) { + printStory(); + randomize(); + } + + // activate screen animation + game.fAnimXL30 = true; + + _vm->clearTextArea(); + //_vm->_gfx->doUpdate(); + //_vm->_system->updateScreen(); // TODO: this should go in the game's main loop + playSound(IDI_MSA_SND_XL30); + printExeMsg(IDO_MSA_XL30_SPEAKING); + + if (game.fHasXtal) { + game.fHasXtal = false; + printExeMsg(IDO_MSA_CRYSTAL_PIECE_FOUND); + } + + if (game.nXtals == IDI_MSA_MAX_PLANET) { + printExeMsg(IDO_MSA_GAME_OVER[0]); + printExeMsg(IDO_MSA_GAME_OVER[1]); + printExeMsg(IDO_MSA_GAME_OVER[2]); + +#if 0 + // DEBUG + strcpy(game.szAddr, (char *)IDS_MSA_ADDR_PLANET[IDI_MSA_PLANET_EARTH]); + game.nButtons = strlen(game.szAddr); +#endif + + } else { + printExeStr(game.iClue[game.nXtals]); + +#if 0 + // DEBUG + _vm->drawStr(24, 12, IDA_DEFAULT, (char *)IDS_MSA_NAME_PLANET_2[game.iPlanetXtal[game.nXtals]]); + _vm->drawStr(24, 22, IDA_DEFAULT, (char *)IDS_MSA_ADDR_PLANET[game.iPlanetXtal[game.nXtals]]); + strcpy(game.szAddr, (char *)IDS_MSA_ADDR_PLANET[game.iPlanetXtal[game.nXtals]]); + game.nButtons = strlen(game.szAddr); + _vm->_gfx->doUpdate(); + _vm->_system->updateScreen(); // TODO: this should go in the game's main loop +#endif + + waitAnyKeyAnim(); + } + } else { + printStory(); + } +} + +void Mickey::inventory() { + int iRow = IDI_MSA_ROW_INV_ITEMS; + char szCrystals[12] = {0}; + + sprintf(szCrystals, IDS_MSA_CRYSTALS, IDS_MSA_CRYSTAL_NO[game.nXtals]); + + CursorMan.showMouse(false); + + _vm->clearScreen(IDA_DEFAULT); + _vm->drawStr(IDI_MSA_ROW_INV_TITLE, IDI_MSA_COL_INV_TITLE, IDA_DEFAULT, IDS_MSA_INVENTORY); + _vm->drawStr(IDI_MSA_ROW_INV_CRYSTALS, IDI_MSA_COL_INV_ITEMS, IDA_DEFAULT, szCrystals); + + for (int iItem = 0; iItem < IDI_MSA_MAX_ITEM; iItem++) { + if (game.fItem[game.iItem[iItem]] && (game.iItem[iItem] != IDI_MSA_OBJECT_NONE)) { + _vm->drawStr(iRow++, IDI_MSA_COL_INV_ITEMS, IDA_DEFAULT, (const char *)IDS_MSA_NAME_ITEM[game.iItem[iItem]]); + } + } + + //_vm->_gfx->doUpdate(); + //_vm->_system->updateScreen(); // TODO: this should go in the game's main loop + waitAnyKey(); + + _vm->clearScreen(IDA_DEFAULT); + + CursorMan.showMouse(true); +} + +void Mickey::randomize() { + int iPlanet = 0; + int iHint = 0; + bool done; + + memset(game.iPlanetXtal, 0, sizeof(game.iPlanetXtal)); + memset(game.iClue, 0, sizeof(game.iClue)); + + game.iPlanetXtal[0] = IDI_MSA_PLANET_EARTH; + game.iPlanetXtal[8] = IDI_MSA_PLANET_URANUS; + + for (int i = 1; i < 9; i++) { + if (i == 8) { + iPlanet = IDI_MSA_PLANET_URANUS; + } else { + done = false; + while (!done) { + iPlanet = _vm->rnd(IDI_MSA_MAX_PLANET); + done = true; + for (int j = 0; j < IDI_MSA_MAX_PLANET; j++) { + if (game.iPlanetXtal[j] == iPlanet) { + done = false; + break; + } + } + } + } + + game.iPlanetXtal[i] = iPlanet; + + done = false; + while (!done) { + iHint = _vm->rnd(5); + done = true; + } + + game.iClue[i] = IDO_MSA_NEXT_PIECE[iPlanet][iHint]; + } +} + +void Mickey::flashScreen() { + playSound(IDI_MSA_SND_PRESS_BLUE); + + //Set screen to white + _vm->_gfx->clearScreen(15); + _vm->_gfx->doUpdate(); + _vm->_system->updateScreen(); // TODO: this should go in the game's main loop + + _vm->_system->delayMillis(IDI_MSA_ANIM_DELAY); + + //Set back to black + _vm->_gfx->clearScreen(0); + _vm->_gfx->doUpdate(); + _vm->_system->updateScreen(); // TODO: this should go in the game's main loop + + drawRoom(); + printDesc(game.iRoom); + _vm->_gfx->doUpdate(); + _vm->_system->updateScreen(); // TODO: this should go in the game's main loop +} + +void Mickey::intro() { + // draw sierra logo + drawLogo(); + //waitAnyKey(); // Not in the original, but needed so that the logo is visible + + // draw title picture + game.iRoom = IDI_MSA_PIC_TITLE; + drawRoom(); + + // show copyright and play theme + printExeMsg(IDO_MSA_COPYRIGHT); + playSound(IDI_MSA_SND_THEME); + + // load game + game.fIntro = true; + if (chooseY_N(IDO_MSA_LOAD_GAME[0], true)) { + if (loadGame()) { + game.iPlanet = IDI_MSA_PLANET_EARTH; + game.fIntro = false; + game.iRoom = IDI_MSA_PIC_SHIP_CORRIDOR; + return; + } + } + + // play spaceship landing scene + game.iPlanet = IDI_MSA_PLANET_EARTH; + game.iRoom = IDI_MSA_PIC_EARTH_ROAD_4; + + drawRoom(); + printRoomDesc(); + + playSound(IDI_MSA_SND_SHIP_LAND); + + flashScreen(); + flashScreen(); + flashScreen(); + + printExeMsg(IDO_MSA_INTRO); +} + +void Mickey::getItem(ENUM_MSA_ITEM iItem) { + game.fItem[iItem] = true; + game.iItem[game.nItems++] = iItem; + game.fRmTxt[game.iRoom] = 0; + playSound(IDI_MSA_SND_TAKE); + drawRoom(); +} + +void Mickey::getXtal(int iStr) { + game.fRmTxt[game.iRoom] = 0; + game.fHasXtal = true; + game.nXtals++; + playSound(IDI_MSA_SND_CRYSTAL); + drawRoom(); + printDatMessage(iStr); +} + +bool Mickey::parse(int cmd, int arg) { + switch(cmd) { + + // BASIC + + case IDI_MSA_ACTION_GOTO_ROOM: + game.iRoom = arg; + return true; + case IDI_MSA_ACTION_SHOW_INT_STR: + printExeMsg(IDO_MSA_ERROR[arg]); + break; + case IDI_MSA_ACTION_SHOW_DAT_STR: + printDatMessage(arg); + break; + + // GENERAL + + case IDI_MSA_ACTION_PLANET_INFO: + showPlanetInfo(); + break; + case IDI_MSA_ACTION_SAVE_GAME: + saveGame(); + break; + case IDI_MSA_ACTION_LOOK_MICKEY: + printExeMsg(IDO_MSA_YOU_CAN_SEE_MICKEY_ALREADY); + break; + + // EARTH + + case IDI_MSA_ACTION_GET_ROPE: + if (game.iRmMenu[game.iRoom] == 2) { + game.iRmObj[game.iRoom] = IDI_MSA_OBJECT_NONE; + game.iRmMenu[game.iRoom] = 3; + getItem(IDI_MSA_ITEM_ROPE); + printExeMsg(IDO_MSA_ERROR[7]); + } else { + game.iRmMenu[game.iRoom] = 1; + printDatMessage(11); + } + break; + case IDI_MSA_ACTION_UNTIE_ROPE: + game.iRmPic[game.iRoom] = IDI_MSA_PIC_EARTH_TIRE_SWING_1; + game.iRmObj[game.iRoom] = 0; + game.iRmMenu[game.iRoom] = 2; + drawRoom(); + printDatMessage(12); + break; + case IDI_MSA_ACTION_GET_BONE: + game.iRmObj[game.iRoom] = IDI_MSA_OBJECT_NONE; + game.iRmMenu[game.iRoom] = 1; + getItem(IDI_MSA_ITEM_BONE); + printDatMessage(arg); + break; + case IDI_MSA_ACTION_GET_XTAL_EARTH: + game.iRmMenu[game.iRoom] = 1; + getXtal(arg); + break; + case IDI_MSA_ACTION_LOOK_DESK: + game.iRmMenu[game.iRoom] = 1; + game.iRmObj[game.iRoom] = 2; + drawRoom(); + printDatMessage(arg); + break; + case IDI_MSA_ACTION_WRITE_LETTER: + game.iRmMenu[game.iRoom] = 3; + game.iRmMenu[IDI_MSA_PIC_EARTH_MAILBOX] = 1; + game.iRmObj[game.iRoom] = IDI_MSA_OBJECT_NONE; + getItem(IDI_MSA_ITEM_LETTER); + printDatMessage(arg); + break; + case IDI_MSA_ACTION_MAIL_LETTER: + game.fItemUsed[IDI_MSA_ITEM_LETTER] = true; + game.fItem[IDI_MSA_ITEM_LETTER] = false; + game.iRmMenu[game.iRoom] = 0; + printDatMessage(arg); + break; + case IDI_MSA_ACTION_OPEN_MAILBOX: + if (game.fItemUsed[IDI_MSA_ITEM_LETTER]) { + printDatMessage(110); + } else { + printDatMessage(arg); + } + break; + case IDI_MSA_ACTION_OPEN_CUPBOARD: + if (game.iRmMenu[game.iRoom]) { + if (game.iRmObj[game.iRoom] == IDI_MSA_OBJECT_NONE) { + printDatMessage(78); + } else { + printDatMessage(arg); + } + } else { + game.iRmMenu[game.iRoom] = 1; + game.iRmPic[game.iRoom] = IDI_MSA_PIC_EARTH_KITCHEN_1; + game.iRmObj[game.iRoom] = 3; + drawRoom(); + printDatMessage(arg); + } + break; + case IDI_MSA_ACTION_GET_FLASHLIGHT: + if (game.fItem[IDI_MSA_ITEM_FLASHLIGHT]) { + printDatMessage(90); + } else { + game.iRmObj[game.iRoom] = IDI_MSA_OBJECT_NONE; + getItem(IDI_MSA_ITEM_FLASHLIGHT); + drawRoom(); + printDatMessage(arg); + } + break; + case IDI_MSA_ACTION_OPEN_CABINET: + if (game.iRmMenu[game.iRoom]) { + printDatMessage(109); + } else { + game.iRmMenu[game.iRoom] = 1; + game.iRmPic[game.iRoom] = IDI_MSA_PIC_EARTH_GARAGE_1; + game.iRmObj[game.iRoom] = 15; + drawRoom(); + printDatMessage(arg); + } + break; + case IDI_MSA_ACTION_GET_CROWBAR: + if (game.fItem[IDI_MSA_ITEM_CROWBAR]) { + printDatMessage(90); + } else { + game.iRmObj[game.iRoom]--; + getItem(IDI_MSA_ITEM_CROWBAR); + printDatMessage(arg); + } + break; + case IDI_MSA_ACTION_GET_WRENCH: + if (game.fItem[IDI_MSA_ITEM_WRENCH]) { + printDatMessage(90); + } else { + game.iRmObj[game.iRoom] -= 2; + getItem(IDI_MSA_ITEM_WRENCH); + printDatMessage(arg); + } + break; + case IDI_MSA_ACTION_OPEN_CLOSET: + if (game.iRmMenu[game.iRoom]) { + printDatMessage(99); + } else { + game.iRmMenu[game.iRoom] = 1; + game.iRmPic[game.iRoom] = IDI_MSA_PIC_EARTH_BEDROOM_1; + game.iRmObj[game.iRoom] = 7; + drawRoom(); + printDatMessage(arg); + } + break; + case IDI_MSA_ACTION_GET_MATTRESS: + if (game.fItem[IDI_MSA_ITEM_MATTRESS]) { + printDatMessage(90); + } else { + game.iRmObj[game.iRoom]--; + getItem(IDI_MSA_ITEM_MATTRESS); + printDatMessage(arg); + } + break; + case IDI_MSA_ACTION_GET_SCARF: + if (game.fItem[IDI_MSA_ITEM_SCARF]) { + printDatMessage(90); + } else { + game.iRmObj[game.iRoom] -= 2; + getItem(IDI_MSA_ITEM_SCARF); + printDatMessage(arg); + } + break; + case IDI_MSA_ACTION_GET_SUNGLASSES: + if (game.fItem[IDI_MSA_ITEM_SUNGLASSES]) { + printDatMessage(90); + } else { + game.iRmObj[game.iRoom]--; + getItem(IDI_MSA_ITEM_SUNGLASSES); + printDatMessage(arg); + } + break; + case IDI_MSA_ACTION_GET_SCALE: + if (game.fItem[IDI_MSA_ITEM_SCALE]) { + printDatMessage(90); + } else { + game.iRmMenu[IDI_MSA_PIC_VENUS_WEIGH] = 1; + game.iRmMenu[IDI_MSA_PIC_NEPTUNE_WEIGH] = 1; + game.iRmMenu[IDI_MSA_PIC_MERCURY_WEIGH] = 1; + game.iRmMenu[IDI_MSA_PIC_SATURN_WEIGH] = 1; + game.iRmMenu[IDI_MSA_PIC_PLUTO_WEIGH] = 1; + game.iRmMenu[IDI_MSA_PIC_JUPITER_WEIGH] = 1; + game.iRmMenu[IDI_MSA_PIC_MARS_WEIGH] = 1; + game.iRmMenu[IDI_MSA_PIC_URANUS_WEIGH] = 1; + game.iRmObj[game.iRoom] -= 2; + getItem(IDI_MSA_ITEM_SCALE); + printDatMessage(arg); + } + break; + case IDI_MSA_ACTION_GOTO_SPACESHIP: + game.iRoom = IDI_MSA_PIC_SHIP_AIRLOCK; + if (game.iPlanet != IDI_MSA_PLANET_EARTH) + insertDisk(0); + return true; + + // VENUS + + case IDI_MSA_ACTION_DOWN_CHASM: + if (game.fItem[IDI_MSA_ITEM_ROPE]) { + game.iRmMenu[game.iRoom] = 1; + } + printDatMessage(arg); + break; + case IDI_MSA_ACTION_DOWN_ROPE: + if (game.fItemUsed[IDI_MSA_ITEM_ROPE]) { + game.iRoom = IDI_MSA_PIC_VENUS_PROBE; + return true; + } else { + printDatMessage(arg); + } + break; + case IDI_MSA_ACTION_USE_ROPE: + if (game.fItemUsed[IDI_MSA_ITEM_ROPE]) { + printDatMessage(22); + } else { + game.fItemUsed[IDI_MSA_ITEM_ROPE] = true; + game.fItem[IDI_MSA_ITEM_ROPE] = false; + game.iRmPic[game.iRoom] = IDI_MSA_PIC_VENUS_CHASM_1; + drawRoom(); + printDatMessage(arg); + } + break; + case IDI_MSA_ACTION_OPEN_HATCH: + if (game.fItemUsed[IDI_MSA_ITEM_WRENCH]) { + if ((game.iRmMenu[game.iRoom] == 3) || (game.iRmPic[game.iRoom] == IDI_MSA_PIC_VENUS_PROBE_1)) + printDatMessage(39); + else { + game.iRmMenu[game.iRoom] = 2; + game.iRmPic[game.iRoom] = IDI_MSA_PIC_VENUS_PROBE_1; + drawRoom(); + printDatMessage(24); + } + } else { + if (game.fItem[IDI_MSA_ITEM_WRENCH]) { + game.iRmMenu[game.iRoom] = 1; + } + printDatMessage(arg); + } + break; + case IDI_MSA_ACTION_USE_WRENCH: + game.fItemUsed[IDI_MSA_ITEM_WRENCH] = true; + printDatString(arg); + if (game.iRmPic[game.iRoom] == IDI_MSA_PIC_VENUS_PROBE_1) { + _vm->clearRow(22); + } + //_vm->_gfx->doUpdate(); + //_vm->_system->updateScreen(); // TODO: this should go in the game's main loop + waitAnyKey(); + break; + case IDI_MSA_ACTION_GET_XTAL_VENUS: + game.iRmMenu[game.iRoom] = 3; + getXtal(arg); + break; + + // TRITON (NEPTUNE) + + case IDI_MSA_ACTION_LOOK_CASTLE: + if (!game.iRmMenu[game.iRoom]) { + game.iRmMenu[game.iRoom] = 1; + } + printDatMessage(arg); + break; + case IDI_MSA_ACTION_ENTER_OPENING: + if (game.fItemUsed[IDI_MSA_ITEM_CROWBAR]) { + game.iRoom = IDI_MSA_PIC_NEPTUNE_CASTLE_4; + return true; + } else { + if (game.fItem[IDI_MSA_ITEM_CROWBAR]) { + game.iRmMenu[game.iRoom] = 2; + } + printDatMessage(arg); + } + break; + case IDI_MSA_ACTION_USE_CROWBAR: + game.fItemUsed[IDI_MSA_ITEM_CROWBAR] = true; + game.iRmMenu[game.iRoom] = 1; + game.iRmPic[game.iRoom] = IDI_MSA_PIC_NEPTUNE_ENTRANCE_1; + drawRoom(); + printDatMessage(arg); + break; + case IDI_MSA_ACTION_GET_XTAL_NEPTUNE: + if (game.fHasXtal) { + printDatMessage(71); + } else { + if (game.fItem[IDI_MSA_ITEM_SCARF]) { + game.iRmMenu[game.iRoom] = 1; + } + printDatMessage(arg); + } + break; + case IDI_MSA_ACTION_TALK_LEADER: + game.iRoom = IDI_MSA_PIC_NEPTUNE_ENTRYWAY; + printDatMessage(arg); + return true; + case IDI_MSA_ACTION_GIVE_SCARF: + game.iRmObj[game.iRoom] = 18; + getXtal(arg); + game.fItem[IDI_MSA_ITEM_SCARF] = false; + game.iRmMenu[game.iRoom] = 0; + game.iRmMenu[IDI_MSA_PIC_EARTH_BEDROOM] = 2; + game.iRoom = IDI_MSA_PIC_NEPTUNE_ENTRYWAY; + return true; + + // MERCURY + + case IDI_MSA_ACTION_GET_XTAL_MERCURY: + if (game.fHasXtal) { + game.iRmMenu[game.iRoom] = 2; + printDatMessage(32); + } else { + if (game.fItem[IDI_MSA_ITEM_SUNGLASSES]) { + game.iRmMenu[game.iRoom] = 1; + } + printDatMessage(arg); + } + break; + case IDI_MSA_ACTION_GIVE_SUNGLASSES: + game.iRmObj[game.iRoom] = 17; + game.iRmMenu[game.iRoom] = 2; + game.fItem[IDI_MSA_ITEM_SUNGLASSES] = false; + getXtal(arg); + break; + + // TITAN (SATURN) + + case IDI_MSA_ACTION_CROSS_LAKE: + if (game.fItem[IDI_MSA_ITEM_MATTRESS]) { + game.iRmMenu[IDI_MSA_PIC_SATURN_LAKE_0] = 1; + game.iRmMenu[IDI_MSA_PIC_SATURN_LAKE_1] = 1; + game.iRmMenu[IDI_MSA_PIC_SATURN_LAKE_2] = 1; + } + printDatMessage(arg); + break; + case IDI_MSA_ACTION_USE_MATTRESS: + game.iRoom = IDI_MSA_PIC_SATURN_ISLAND; + printDatMessage(arg); + return true; + case IDI_MSA_ACTION_GET_XTAL_SATURN: + if (game.fHasXtal) { + printDatMessage(29); + } else { + getXtal(arg); + } + break; + case IDI_MSA_ACTION_LEAVE_ISLAND: + game.iRoom = IDI_MSA_PIC_SATURN_LAKE_1; + printDatMessage(arg); + return true; + + // PLUTO + + case IDI_MSA_ACTION_GET_XTAL_PLUTO: + if (game.fHasXtal) { + printDatMessage(19); + } else { + if (game.fItem[IDI_MSA_ITEM_BONE]) { + game.iRmMenu[game.iRoom] = 1; + } + printDatMessage(arg); + } + break; + case IDI_MSA_ACTION_GIVE_BONE: + game.fItem[IDI_MSA_ITEM_BONE] = false; + game.iRmMenu[game.iRoom] = 0; + game.iRmObj[game.iRoom] = 16; + getXtal(arg); + break; + + // IO (JUPITER) + + case IDI_MSA_ACTION_GET_ROCK_0: + if (game.fItem[IDI_MSA_ITEM_ROCK]) { + printDatMessage(38); + } else { + game.iRmMenu[game.iRoom] = 1; + game.iRmObj[game.iRoom] = IDI_MSA_OBJECT_NONE; + getItem(IDI_MSA_ITEM_ROCK); + printDatMessage(arg); + } + break; + case IDI_MSA_ACTION_GET_ROCK_1: + if (game.fItem[IDI_MSA_ITEM_ROCK]) { + printDatMessage(38); + } else { + game.iRmMenu[game.iRoom] = 1; + game.iRmObj[game.iRoom] = IDI_MSA_OBJECT_NONE; + getItem(IDI_MSA_ITEM_ROCK); + printDatMessage(arg); + } + break; + case IDI_MSA_ACTION_GET_XTAL_JUPITER: + if (game.fHasXtal) { + printDatMessage(15); + } else { + switch (game.nRocks) { + case 0: + if (game.fItem[IDI_MSA_ITEM_ROCK]) { + game.iRmMenu[game.iRoom] = 1; + } + printDatMessage(arg); + break; + case 1: + if (game.fItem[IDI_MSA_ITEM_ROCK]) { + game.iRmMenu[game.iRoom] = 1; + } + printDatMessage(34); + break; + case 2: + getXtal(35); + break; + } + } + break; + case IDI_MSA_ACTION_THROW_ROCK: + game.fItem[IDI_MSA_ITEM_ROCK] = false; + game.nItems--; + game.iRmObj[game.iRoom]++; + game.iRmMenu[game.iRoom] = 0; + drawRoom(); + if (game.nRocks) { + printDatMessage(37); + } else { + printDatMessage(arg); + } + game.nRocks++; + break; + + // MARS + + case IDI_MSA_ACTION_GO_TUBE: + if (game.fItem[IDI_MSA_ITEM_FLASHLIGHT]) { + game.iRmMenu[game.iRoom] = 1; + } + printDatMessage(arg); + break; + case IDI_MSA_ACTION_USE_FLASHLIGHT: + game.iRoom = IDI_MSA_PIC_MARS_TUBE_1; + printDatMessage(15); + return true; + case IDI_MSA_ACTION_PLUTO_DIG: + if (game.fHasXtal) { + printDatMessage(21); + } else { + getXtal(arg); + } + break; + case IDI_MSA_ACTION_GET_XTAL_MARS: + if (game.fHasXtal) { + printDatMessage(23); + } else { + printDatMessage(arg); + } + break; + + // OBERON (URANUS) + + case IDI_MSA_ACTION_ENTER_TEMPLE: + game.iRoom = IDI_MSA_PIC_URANUS_TEMPLE; + return true; + case IDI_MSA_ACTION_USE_CRYSTAL: + if (game.iRmMenu[game.iRoom]) { + printDatMessage(25); + } else { + game.iRmMenu[game.iRoom] = 1; + game.iRmPic[game.iRoom] = IDI_MSA_PIC_URANUS_TEMPLE_1; + drawRoom(); + game.iRmPic[game.iRoom] = IDI_MSA_PIC_URANUS_TEMPLE; + printDatMessage(arg); + } + break; + case IDI_MSA_ACTION_OPEN_DOOR: + if (game.fTempleDoorOpen) { + printDatMessage(36); + } else { + game.fTempleDoorOpen = 1; + game.iRmPic[game.iRoom] = IDI_MSA_PIC_URANUS_TEMPLE_2; + drawRoom(); + printDatMessage(arg); + } + break; + case IDI_MSA_ACTION_ENTER_DOOR: + if (game.fTempleDoorOpen) { + game.iRoom = IDI_MSA_PIC_URANUS_STEPS; + return true; + } else { + printDatMessage(arg); + } + break; + case IDI_MSA_ACTION_GET_XTAL_URANUS: + if (game.fHasXtal) { + printDatMessage(34); + } else { + if (game.fItem[IDI_MSA_ITEM_CROWBAR]) { + game.iRmMenu[game.iRoom] = 1; + } + printDatMessage(arg); + } + break; + case IDI_MSA_ACTION_USE_CROWBAR_1: + game.iRmMenu[game.iRoom] = 0; + getXtal(arg); + break; + + // SPACESHIP + + case IDI_MSA_ACTION_GO_NORTH: + if (game.fShipDoorOpen) { + if (game.fSuit) { + printDatMessage(45); + } else { + game.iRoom = IDI_MSA_PIC_SHIP_CORRIDOR; + return true; + } + } else { + printDatMessage(arg); + } + break; + case IDI_MSA_ACTION_GO_PLANET: + if (!game.fShipDoorOpen) { + if ((game.nXtals == IDI_MSA_MAX_PLANET) && (game.iPlanet == IDI_MSA_PLANET_EARTH)) + gameOver(); + if ((game.iPlanet == game.iPlanetXtal[game.nXtals]) || (game.iPlanet == IDI_MSA_PLANET_EARTH)) { + game.fHasXtal = false; + game.iRoom = IDI_MSA_HOME_PLANET[game.iPlanet]; + if (game.iPlanet != IDI_MSA_PLANET_EARTH) + insertDisk(1); + return true; + } else { + game.iRoom = IDI_MSA_SHIP_PLANET[game.iPlanet]; + return true; + } + } else { + printDatMessage(arg); + } + break; + case IDI_MSA_ACTION_PRESS_BUTTON: + if (game.fShipDoorOpen) { // inner door open + if (game.iPlanet && !game.fSuit) { + printDatMessage(arg); + } else { + game.fShipDoorOpen = false; + game.iRmPic[game.iRoom]--; + drawRoom(); + printDatMessage(2); + } + } else { + game.fShipDoorOpen = true; + game.iRmPic[game.iRoom]++; + drawRoom(); + printDatMessage(14); + } + break; + case IDI_MSA_ACTION_WEAR_SPACESUIT: + if (game.fSuit) { + if (game.fShipDoorOpen) { + game.fSuit = false; + game.iRmMenu[game.iRoom] = 0; + game.iRmPic[game.iRoom] -= 2; + drawRoom(); + printDatMessage(13); + } else { + printDatMessage(3); + } + } else { + if (game.iPlanet) { + game.fSuit = true; + game.iRmMenu[game.iRoom] = 1; + game.iRmPic[game.iRoom] += 2; + drawRoom(); + printDatMessage(arg); + } else { + printDatMessage(12); + } + } + break; + case IDI_MSA_ACTION_READ_GAUGE: + printDatString(arg); + _vm->drawStr(IDI_MSA_ROW_TEMPERATURE, IDI_MSA_COL_TEMPERATURE_C, IDA_DEFAULT, + (const char *)IDS_MSA_TEMP_C[game.iPlanet]); + _vm->drawStr(IDI_MSA_ROW_TEMPERATURE, IDI_MSA_COL_TEMPERATURE_F, IDA_DEFAULT, + (const char *)IDS_MSA_TEMP_F[game.iPlanet]); + //_vm->_gfx->doUpdate(); + //_vm->_system->updateScreen(); // TODO: this should go in the game's main loop + waitAnyKey(); + break; + case IDI_MSA_ACTION_PRESS_ORANGE: + if (game.fFlying) { + printDatMessage(4); + } else { + playSound(IDI_MSA_SND_PRESS_ORANGE); + printDatMessage(arg); + pressOB(IDI_MSA_BUTTON_ORANGE); + } + break; + case IDI_MSA_ACTION_PRESS_BLUE: + if (game.fFlying) { + printDatMessage(4); + } else { + playSound(IDI_MSA_SND_PRESS_BLUE); + printDatMessage(arg); + pressOB(IDI_MSA_BUTTON_BLUE); + } + break; + case IDI_MSA_ACTION_FLIP_SWITCH: + flipSwitch(); + break; + case IDI_MSA_ACTION_PUSH_THROTTLE: + if (game.fFlying) { + game.fFlying = false; + game.nButtons = 0; + memset(game.szAddr, 0, sizeof(game.szAddr)); + drawRoom(); + printDatString(22); + _vm->drawStr(IDI_MSA_ROW_PLANET, IDI_MSA_COL_PLANET, IDA_DEFAULT, + (const char *)IDS_MSA_PLANETS[game.iPlanet]); + //_vm->_gfx->doUpdate(); + //_vm->_system->updateScreen(); // TODO: this should go in the game's main loop + waitAnyKeyAnim(); + showPlanetInfo(); + } else { + printDatMessage(arg); + } + break; + case IDI_MSA_ACTION_PULL_THROTTLE: + if (game.fFlying) { + printDatMessage(18); + } else { + if (getPlanet() != -1) { + game.fFlying = true; + game.iPlanet = getPlanet(); + drawRoom(); + printDatMessage(16); + } else { + game.nButtons = 0; + memset(game.szAddr, 0, sizeof(game.szAddr)); + printDatMessage(17); + } + } + break; + case IDI_MSA_ACTION_LEAVE_ROOM: + if (game.fFlying) { + printDatMessage(24); + } else { + game.iRoom = arg; + return true; + } + break; + case IDI_MSA_ACTION_OPEN_CABINET_1: + if (game.iRmMenu[game.iRoom]) { + printExeMsg(IDO_MSA_THE_CABINET_IS_ALREADY_OPEN); + } else { + game.iRmMenu[game.iRoom] = 1; + game.iRmPic[game.iRoom] = IDI_MSA_PIC_SHIP_KITCHEN_1; + drawRoom(); + printDatMessage(arg); + } + break; + case IDI_MSA_ACTION_READ_MAP: + game.iRmPic[game.iRoom] = IDI_MSA_PIC_STAR_MAP; + drawRoom(); + printDatMessage(46); + printDatMessage(47); + printDatMessage(48); + game.iRmPic[game.iRoom] = IDI_MSA_PIC_SHIP_BEDROOM; + drawRoom(); + break; + case IDI_MSA_ACTION_GO_WEST: + game.nButtons = 0; + memset(game.szAddr, 0, sizeof(game.szAddr)); + game.iRoom = arg; + return true; + } + + return false; +} + +void Mickey::gameLoop() { + char *buffer = new char[sizeof(MSA_MENU)]; + MSA_MENU menu; + int iSel0, iSel1; + bool done; + + for (;;) { + drawRoom(); + + if (game.fIntro) { + game.fIntro = false; + } else { + printRoomDesc(); + } + + if (game.iRoom == IDI_MSA_PIC_NEPTUNE_GUARD) { + game.iRoom = IDI_MSA_PIC_NEPTUNE_LEADER; + done = true; + } else { + done = false; + } + + while (!done) { + checkAirSupply(game.fSuit, &game.nAir); + readMenu(game.iRoom, buffer); + memcpy(&menu, buffer, sizeof(MSA_MENU)); + patchMenu(&menu); + memcpy(buffer, &menu, sizeof(MSA_MENU)); + getMenuSel(buffer, &iSel0, &iSel1); + done = parse(menu.cmd[iSel0].data[iSel1], menu.arg[iSel0].data[iSel1]); + } + + game.nFrame = 0; + } + + delete [] buffer; +} + +// Keyboard + +void Mickey::waitAnyKeyAnim() { + waitAnyKey(true); +} + +void Mickey::waitAnyKey(bool anim) { + Common::Event event; + + if (!anim) { + _vm->_gfx->doUpdate(); + _vm->_system->updateScreen(); // TODO: this should go in the game's main loop + } + + for (;;) { + while (_vm->_system->getEventManager()->pollEvent(event)) { + switch(event.type) { + case Common::EVENT_QUIT: + _vm->_system->quit(); + case Common::EVENT_KEYDOWN: + case Common::EVENT_LBUTTONUP: + case Common::EVENT_RBUTTONUP: + return; + default: + break; + } + } + if (anim) { + animate(); + _vm->_gfx->doUpdate(); + _vm->_system->updateScreen(); // TODO: this should go in the game's main loop + } + } +} + +// Debug + +void Mickey::debug_DrawObjs() { + char szTitle[14] = {0}; + + for (int iObj = 0; iObj < IDI_MSA_MAX_OBJ; iObj++) { + drawPic(0); + drawObj((ENUM_MSA_OBJECT)iObj, 0, 0); + + _vm->clearTextArea(); + sprintf(szTitle, "Object %d", iObj); + _vm->drawStrMiddle(22, IDA_DEFAULT, szTitle); + _vm->drawStrMiddle(23, IDA_DEFAULT, (const char *)IDS_MSA_NAME_OBJ[iObj]); + //_vm->_gfx->doUpdate(); + //_vm->_system->updateScreen(); // TODO: this should go in the game's main loop + waitAnyKey(); + } +} + +void Mickey::debug_DrawPics(){ + char szTitle[14] = {0}; + + for (int iPic = 1; iPic <= IDI_MSA_MAX_PIC; iPic++) { + drawPic(iPic); + + _vm->clearTextArea(); + sprintf(szTitle, "Picture %d", iPic); + _vm->drawStrMiddle(22, IDA_DEFAULT, szTitle); + //_vm->_gfx->doUpdate(); + //_vm->_system->updateScreen(); // TODO: this should go in the game's main loop + waitAnyKey(); + } +} + +// Init + +void Mickey::initVars() { + uint8 buffer[512]; + + // clear game struct + memset(&game, 0, sizeof(game)); + memset(&game.iItem, IDI_MSA_OBJECT_NONE, sizeof(game.iItem)); + // read room extended desc flags + readExe(IDO_MSA_ROOM_TEXT, buffer, sizeof(buffer)); + memcpy(game.fRmTxt, buffer, sizeof(game.fRmTxt)); + + // read room extended desc offsets + readExe(IDO_MSA_ROOM_TEXT_OFFSETS, buffer, sizeof(buffer)); + memcpy(game.oRmTxt, buffer, sizeof(game.oRmTxt)); + for (int i = 0; i < IDI_MSA_MAX_ROOM; i++) + game.oRmTxt[i] = buffer[i*2] + 256 * buffer[i*2+1]; + + // read room object indices + readExe(IDO_MSA_ROOM_OBJECT, buffer, sizeof(buffer)); + memcpy(game.iRmObj, buffer, sizeof(game.iRmObj)); + + // read room picture indices + //readExe(IDO_MSA_ROOM_PICTURE, buffer, sizeof(buffer)); + //memcpy(game.iRmPic, buffer, sizeof(game.iRmPic)); + + // read room menu patch indices + readExe(IDO_MSA_ROOM_MENU_FIX, buffer, sizeof(buffer)); + memcpy(game.nRmMenu, buffer, sizeof(game.nRmMenu)); + + // set room picture indices + for (int i = 0; i < IDI_MSA_MAX_ROOM; i++) { + game.iRmPic[i] = i; + } + game.iRmPic[IDI_MSA_PIC_SHIP_AIRLOCK] = IDI_MSA_PIC_SHIP_AIRLOCK_0; + +#if 0 + // DEBUG + game.iPlanet = IDI_MSA_PLANET_EARTH; + game.iRoom = IDI_MSA_PIC_SHIP_CONTROLS; + game.fHasXtal = true; + game.nXtals = 9; + game.fItemUsed[IDI_MSA_ITEM_LETTER] = true; + +#endif + +} + +void Mickey::initEngine() { + // PreAGI sets the screen params here, but we've already done that in the preagi class +} + +Mickey::Mickey(PreAgiEngine *vm) : _vm(vm) { +} + +Mickey::~Mickey() { +} + +void Mickey::init() { + initEngine(); + initVars(); +} + +void Mickey::run() { + intro(); + gameLoop(); + gameOver(); +} + +} diff --git a/engines/agi/preagi_mickey.h b/engines/agi/preagi_mickey.h new file mode 100644 index 0000000000..3b45fb8630 --- /dev/null +++ b/engines/agi/preagi_mickey.h @@ -0,0 +1,809 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * $URL$ + * $Id$ + * + */ + +#ifndef AGI_PREAGI_MICKEY_H +#define AGI_PREAGI_MICKEY_H + +#include "agi/agi.h" + +namespace Agi { + +// strings + +#define IDS_MSA_PATH_DAT "dat/%s" +#define IDS_MSA_PATH_OBJ "obj/%s.ooo" +#define IDS_MSA_PATH_PIC "%d.pic" +#define IDS_MSA_PATH_LOGO "logos.bcg" +#define IDS_MSA_PATH_EXE "mickey.exe" + +#define IDS_MSA_INVENTORY "MICKEY IS CARRYING THE FOLLOWING:" +#define IDS_MSA_CRYSTALS "%s CRYSTALS" + +const char IDS_MSA_CRYSTAL_NO[][3] = { + "NO", " 1", " 2", " 3", " 4", " 5", " 6", " 7", " 8", " 9" +}; +const char IDS_MSA_TEMP_C[][5] = { + " 20 ", " 480", "-200", " 430", "-185", "-230", "-130", "-150", "-215" +}; +const char IDS_MSA_TEMP_F[][5] = { + " 68 ", " 897", "-328", " 807", "-301", "-382", "-202", "-238", "-355" +}; +const char IDS_MSA_PLANETS[][10] = { + "EARTH. ", "VENUS. ", "TRITON. ", "MERCURY.", "TITAN. ", + "PLUTO. ", "IO. ", "MARS. ", "OBERON. " +}; + +#define IDS_MSA_DEBUG_ROOM "Now in room #%d " +#define IDS_MSA_DEBUG_OBJ "There is object #%d " + +// patch Mickey.exe offset 0x21E to value 0x01 to enable debug mode + +const char IDS_MSA_INSERT_DISK[][40] = { + "Please insert disk 1 and press any key", "Please insert disk 2 and press any key" +}; + +#define IDS_MSA_ERROR_EXE_NOT_FOUND "File 'mickey.exe' not found in folder 'mickey\'." + +// max values + +#define IDI_MSA_MAX_PLANET 9 +#define IDI_MSA_MAX_DAT 10 +#define IDI_MSA_MAX_OBJ 32 +#define IDI_MSA_MAX_PIC 240 +#define IDI_MSA_MAX_PIC_ROOM 224 +#define IDI_MSA_MAX_SOUND 8 +#define IDI_MSA_MAX_ROOM 160 +#define IDI_MSA_MAX_STR 160 + +#define IDI_MSA_MAX_BUTTON 6 +#define IDI_MSA_MAX_ITEM 11 +#define IDI_MSA_MAX_HINT 20 +#define IDI_MSA_MAX_PLANET_INFO 4 +#define IDI_MSA_MAX_AIR_SUPPLY 50 + +#define IDI_MSA_ANIM_DELAY 25 + +#define IDI_MSA_LEN_STORY 1372 + +// rows + +#define IDI_MSA_ROW_MENU_0 20 +#define IDI_MSA_ROW_MENU_1 21 +#define IDI_MSA_ROW_INV_TITLE 2 +#define IDI_MSA_ROW_INV_CRYSTALS 4 +#define IDI_MSA_ROW_INV_ITEMS 5 +#define IDI_MSA_ROW_TEMPERATURE 21 +#define IDI_MSA_ROW_PLANET 22 +#define IDI_MSA_ROW_BUTTONS 20 +#define IDI_MSA_ROW_INSERT_DISK 23 + +#define IDI_MSA_COL_INV_TITLE 4 +#define IDI_MSA_COL_INV_ITEMS 15 +#define IDI_MSA_COL_TEMPERATURE_C 15 +#define IDI_MSA_COL_TEMPERATURE_F 23 +#define IDI_MSA_COL_PLANET 28 +#define IDI_MSA_COL_BUTTONS 22 +#define IDI_MSA_COL_INSERT_DISK 1 + +// messages + +#define IDI_MSA_MSG_STAR_MAP_0 46 +#define IDI_MSA_MSG_STAR_MAP_1 47 +#define IDI_MSA_MSG_STAR_MAP_2 48 +#define IDI_MSA_MSG_SPACESUIT_WEAR 11 +#define IDI_MSA_MSG_SPACESUIT_REMOVE 13 +#define IDI_MSA_MSG_SPACESUIT_0 3 +#define IDI_MSA_MSG_SPACESUIT_CANT_WEAR_ON_EARTH 12 +#define IDI_MSA_MSG_SHIP_LAUNCH 16 +#define IDI_MSA_MSG_SHIP_LAND 22 + +// screen + +#define IDI_MSA_PIC_WIDTH 140 +#define IDI_MSA_PIC_HEIGHT 159 +#define IDI_MSA_PIC_X0 10 +#define IDI_MSA_PIC_Y0 0 +#define IDI_MSA_PIC_FLAGS IDF_AGI_PIC_V2 + +// pictures + +#define IDI_MSA_PIC_EARTH_TIRE_SWING 1 +#define IDI_MSA_PIC_EARTH_TIRE_SWING_1 200 // rope taken, swing on ground +#define IDI_MSA_PIC_EARTH_DOGHOUSE 2 +#define IDI_MSA_PIC_EARTH_IN_DOGHOUSE 154 +#define IDI_MSA_PIC_EARTH_TREE 3 +#define IDI_MSA_PIC_EARTH_GARDEN 4 +#define IDI_MSA_PIC_EARTH_FRONT_HOUSE 5 +#define IDI_MSA_PIC_EARTH_HAMMOCK 6 +#define IDI_MSA_PIC_EARTH_BUTTERFLY 7 +#define IDI_MSA_PIC_EARTH_MAILBOX 8 +#define IDI_MSA_PIC_EARTH_ROAD_0 9 +#define IDI_MSA_PIC_EARTH_ROAD_1 10 +#define IDI_MSA_PIC_EARTH_ROAD_2 11 +#define IDI_MSA_PIC_EARTH_ROAD_3 12 +#define IDI_MSA_PIC_EARTH_ROAD_4 13 // starting room +#define IDI_MSA_PIC_EARTH_ROAD_5 14 +#define IDI_MSA_PIC_EARTH_ROAD_6 15 +#define IDI_MSA_PIC_EARTH_ROAD_7 18 +#define IDI_MSA_PIC_EARTH_UNDER_TREE 16 +#define IDI_MSA_PIC_EARTH_UP_IN_TREE 155 // CRYSTAL +#define IDI_MSA_PIC_EARTH_SHIP 17 +#define IDI_MSA_PIC_EARTH_LIVING_ROOM 19 +#define IDI_MSA_PIC_EARTH_KITCHEN 20 +#define IDI_MSA_PIC_EARTH_KITCHEN_1 159 // cupboard open +#define IDI_MSA_PIC_EARTH_GARAGE 21 +#define IDI_MSA_PIC_EARTH_GARAGE_1 160 // cabinet open +#define IDI_MSA_PIC_EARTH_BEDROOM 22 +#define IDI_MSA_PIC_EARTH_BEDROOM_1 161 // closet open +#define IDI_MSA_PIC_EARTH_BATHROOM 23 // WEIGH MICKEY +#define IDI_MSA_PIC_EARTH_SHIP_LEAVING 24 +#define IDI_MSA_PIC_EARTH_MINNIE 25 + +#define IDI_MSA_PIC_SHIP_AIRLOCK 25 +#define IDI_MSA_PIC_SHIP_AIRLOCK_0 201 // door closed +#define IDI_MSA_PIC_SHIP_AIRLOCK_1 202 // door open +#define IDI_MSA_PIC_SHIP_AIRLOCK_2 203 // door closed, spacesuits on +#define IDI_MSA_PIC_SHIP_AIRLOCK_3 204 // door open, spacesuits on +#define IDI_MSA_PIC_SHIP_BEDROOM 29 +#define IDI_MSA_PIC_SHIP_CONTROLS 26 +#define IDI_MSA_PIC_SHIP_CORRIDOR 27 +#define IDI_MSA_PIC_SHIP_KITCHEN 28 +#define IDI_MSA_PIC_SHIP_KITCHEN_1 172 // cabinet open + +#define IDI_MSA_PIC_SHIP_VENUS 146 +#define IDI_MSA_PIC_SHIP_NEPTUNE 147 +#define IDI_MSA_PIC_SHIP_MERCURY 148 +#define IDI_MSA_PIC_SHIP_SATURN 149 +#define IDI_MSA_PIC_SHIP_PLUTO 150 +#define IDI_MSA_PIC_SHIP_JUPITER 151 +#define IDI_MSA_PIC_SHIP_MARS 152 +#define IDI_MSA_PIC_SHIP_URANUS 153 + +#define IDI_MSA_PIC_VENUS_0 30 +#define IDI_MSA_PIC_VENUS_1 31 +#define IDI_MSA_PIC_VENUS_2 32 +#define IDI_MSA_PIC_VENUS_3 34 +#define IDI_MSA_PIC_VENUS_4 36 +#define IDI_MSA_PIC_VENUS_5 38 +#define IDI_MSA_PIC_VENUS_CHASM 35 +#define IDI_MSA_PIC_VENUS_CHASM_1 183 // rope lowered +#define IDI_MSA_PIC_VENUS_PROBE 39 // CRYSTAL, USE WRENCH +#define IDI_MSA_PIC_VENUS_PROBE_1 184 // hatch open +#define IDI_MSA_PIC_VENUS_SHIP 33 +#define IDI_MSA_PIC_VENUS_WEIGH 37 // WEIGH MICKEY + +#define IDI_MSA_PIC_NEPTUNE_0 40 +#define IDI_MSA_PIC_NEPTUNE_1 42 +#define IDI_MSA_PIC_NEPTUNE_2 43 +#define IDI_MSA_PIC_NEPTUNE_3 44 +#define IDI_MSA_PIC_NEPTUNE_4 45 +#define IDI_MSA_PIC_NEPTUNE_5 48 +#define IDI_MSA_PIC_NEPTUNE_6 50 +#define IDI_MSA_PIC_NEPTUNE_7 52 +#define IDI_MSA_PIC_NEPTUNE_8 53 +#define IDI_MSA_PIC_NEPTUNE_9 54 +#define IDI_MSA_PIC_NEPTUNE_10 55 +#define IDI_MSA_PIC_NEPTUNE_11 56 +#define IDI_MSA_PIC_NEPTUNE_BABIES 61 +#define IDI_MSA_PIC_NEPTUNE_CASTLE_0 46 +#define IDI_MSA_PIC_NEPTUNE_CASTLE_1 51 +#define IDI_MSA_PIC_NEPTUNE_CASTLE_2 57 +#define IDI_MSA_PIC_NEPTUNE_CASTLE_3 58 +#define IDI_MSA_PIC_NEPTUNE_CASTLE_4 59 +#define IDI_MSA_PIC_NEPTUNE_CASTLE_5 60 +#define IDI_MSA_PIC_NEPTUNE_CASTLE_6 66 +#define IDI_MSA_PIC_NEPTUNE_CASTLE_7 67 +#define IDI_MSA_PIC_NEPTUNE_CASTLE_8 68 +#define IDI_MSA_PIC_NEPTUNE_EATING_AREA 62 +#define IDI_MSA_PIC_NEPTUNE_ENTRANCE 47 +#define IDI_MSA_PIC_NEPTUNE_ENTRANCE_1 185 // entrance open +#define IDI_MSA_PIC_NEPTUNE_ENTRYWAY 63 +#define IDI_MSA_PIC_NEPTUNE_GUARD 69 +#define IDI_MSA_PIC_NEPTUNE_LEADER 64 // CRYSTAL, GIVE SCARF +#define IDI_MSA_PIC_NEPTUNE_SHIP 49 +#define IDI_MSA_PIC_NEPTUNE_SLEEP_AREA 65 +#define IDI_MSA_PIC_NEPTUNE_WEIGH 41 + +#define IDI_MSA_PIC_MERCURY_0 71 +#define IDI_MSA_PIC_MERCURY_1 73 +#define IDI_MSA_PIC_MERCURY_2 75 +#define IDI_MSA_PIC_MERCURY_3 77 +#define IDI_MSA_PIC_MERCURY_4 80 +#define IDI_MSA_PIC_MERCURY_ALIEN_0 72 // CRYSTAL, GIVE SUNGLASSES +#define IDI_MSA_PIC_MERCURY_ALIEN_1 74 +#define IDI_MSA_PIC_MERCURY_ALIEN_2 81 +#define IDI_MSA_PIC_MERCURY_CAVE_0 70 // hidden feature, press '2' here +#define IDI_MSA_PIC_MERCURY_CAVE_1 78 +#define IDI_MSA_PIC_MERCURY_CAVE_2 79 +#define IDI_MSA_PIC_MERCURY_SHIP 76 +#define IDI_MSA_PIC_MERCURY_WEIGH 82 + +#define IDI_MSA_PIC_SATURN_0 84 +#define IDI_MSA_PIC_SATURN_1 86 +#define IDI_MSA_PIC_SATURN_2 90 +#define IDI_MSA_PIC_SATURN_3 91 +#define IDI_MSA_PIC_SATURN_ISLAND 89 // CRYSTAL +#define IDI_MSA_PIC_SATURN_LAKE_0 85 // USE MATTRESS +#define IDI_MSA_PIC_SATURN_LAKE_1 88 // USE MATTRESS +#define IDI_MSA_PIC_SATURN_LAKE_2 92 // USE MATTRESS +#define IDI_MSA_PIC_SATURN_SHIP 87 +#define IDI_MSA_PIC_SATURN_WEIGH 83 // WEIGH MICKEY + +#define IDI_MSA_PIC_PLUTO_0 93 +#define IDI_MSA_PIC_PLUTO_1 96 +#define IDI_MSA_PIC_PLUTO_2 97 +#define IDI_MSA_PIC_PLUTO_3 98 +#define IDI_MSA_PIC_PLUTO_4 101 +#define IDI_MSA_PIC_PLUTO_ALIENS 100 // CRYSTAL, GIVE BONE +#define IDI_MSA_PIC_PLUTO_CAVE_0 99 +#define IDI_MSA_PIC_PLUTO_CAVE_1 103 +#define IDI_MSA_PIC_PLUTO_CRATER 102 +#define IDI_MSA_PIC_PLUTO_SHIP 95 +#define IDI_MSA_PIC_PLUTO_WEIGH 94 // WEIGH MICKEY + +#define IDI_MSA_PIC_JUPITER_0 106 +#define IDI_MSA_PIC_JUPITER_1 107 +#define IDI_MSA_PIC_JUPITER_2 108 +#define IDI_MSA_PIC_JUPITER_3 109 +#define IDI_MSA_PIC_JUPITER_4 113 +#define IDI_MSA_PIC_JUPITER_5 116 +#define IDI_MSA_PIC_JUPITER_6 117 +#define IDI_MSA_PIC_JUPITER_7 120 +#define IDI_MSA_PIC_JUPITER_CRACK 114 +#define IDI_MSA_PIC_JUPITER_LAVA 110 // CRYSTAL, THROW ROCK +#define IDI_MSA_PIC_JUPITER_ROCK_0 112 // GET ROCK +#define IDI_MSA_PIC_JUPITER_ROCK_1 119 // GET ROCK +#define IDI_MSA_PIC_JUPITER_SHIP 115 +#define IDI_MSA_PIC_JUPITER_WEIGH 118 // WEIGH MICKEY + +#define IDI_MSA_PIC_MARS_0 121 +#define IDI_MSA_PIC_MARS_1 124 +#define IDI_MSA_PIC_MARS_2 125 +#define IDI_MSA_PIC_MARS_3 126 +#define IDI_MSA_PIC_MARS_4 127 +#define IDI_MSA_PIC_MARS_5 128 +#define IDI_MSA_PIC_MARS_6 130 +#define IDI_MSA_PIC_MARS_SHIP 123 +#define IDI_MSA_PIC_MARS_TUBE_0 129 +#define IDI_MSA_PIC_MARS_TUBE_1 131 +#define IDI_MSA_PIC_MARS_VOLCANO 132 // CRYSTAL, DIG PLUTO +#define IDI_MSA_PIC_MARS_WEIGH 122 // WEIGH MICKEY + +#define IDI_MSA_PIC_URANUS_0 133 +#define IDI_MSA_PIC_URANUS_1 134 +#define IDI_MSA_PIC_URANUS_2 135 +#define IDI_MSA_PIC_URANUS_3 138 +#define IDI_MSA_PIC_URANUS_4 139 +#define IDI_MSA_PIC_URANUS_5 140 +#define IDI_MSA_PIC_URANUS_6 142 +#define IDI_MSA_PIC_URANUS_CHAMBER 145 // CRYSTAL, USE CROWBAR +#define IDI_MSA_PIC_URANUS_SHIP 137 +#define IDI_MSA_PIC_URANUS_STEPS 144 +#define IDI_MSA_PIC_URANUS_ENTRANCE 141 // ENTER TEMPLE +#define IDI_MSA_PIC_URANUS_TEMPLE 143 // USE CRYSTAL, ENTER DOOR +#define IDI_MSA_PIC_URANUS_TEMPLE_1 206 // crystal used +#define IDI_MSA_PIC_URANUS_TEMPLE_2 207 // door open +#define IDI_MSA_PIC_URANUS_WEIGH 136 // WEIGH MICKEY + +#define IDI_MSA_PIC_STAR_MAP 165 +#define IDI_MSA_PIC_TITLE 240 + +// objects + +enum ENUM_MSA_OBJECT { + IDI_MSA_OBJECT_NONE = -1, + IDI_MSA_OBJECT_ROCK_0, + IDI_MSA_OBJECT_WRENCH, + IDI_MSA_OBJECT_SCALE, + IDI_MSA_OBJECT_CROWBAR, + IDI_MSA_OBJECT_BONE, + IDI_MSA_OBJECT_SUNGLASSES, + IDI_MSA_OBJECT_DESK_STUFF, + IDI_MSA_OBJECT_MATTRESS, + IDI_MSA_OBJECT_SCARF, + IDI_MSA_OBJECT_FLASHLIGHT, + IDI_MSA_OBJECT_ROPE, + IDI_MSA_OBJECT_ROCK_1, + IDI_MSA_OBJECT_SCARF_C64, + IDI_MSA_OBJECT_ROCK_2, + IDI_MSA_OBJECT_ROCK_3, + IDI_MSA_OBJECT_W_EARTH, + IDI_MSA_OBJECT_W_VENUS, + IDI_MSA_OBJECT_W_TRITON, + IDI_MSA_OBJECT_W_MERCURY, + IDI_MSA_OBJECT_W_TITAN, + IDI_MSA_OBJECT_W_PLUTO, + IDI_MSA_OBJECT_W_IO, + IDI_MSA_OBJECT_W_MARS, + IDI_MSA_OBJECT_W_OBERON, + IDI_MSA_OBJECT_W_SPACE, + IDI_MSA_OBJECT_XL31, + IDI_MSA_OBJECT_XL31E, + IDI_MSA_OBJECT_XL32, + IDI_MSA_OBJECT_XL32E, + IDI_MSA_OBJECT_XL33, + IDI_MSA_OBJECT_XL33E, + IDI_MSA_OBJECT_CRYSTAL +}; + +const char IDS_MSA_NAME_OBJ[][9] = { + "rok1", "wrench", "scale", "cbar", "bone", "glasses", "deskstuf", "raft", + "scarf", "flashlit", "rope", "rok1", "scarfc64", "rok2", "rock35", "earthw", + "venw", "trw", "merw", "titw", "plw", "iow", "mrw", "obw", "spw", "xl31", + "xl31e", "xl32", "xl32e", "xl33", "xl33e", "crys1" +}; + +const int IDI_MSA_XTAL_ROOM_XY[IDI_MSA_MAX_PLANET][3] = { + // room x y + {IDI_MSA_PIC_EARTH_UP_IN_TREE, 14, 76}, + {IDI_MSA_PIC_VENUS_PROBE, 74, 80}, + {IDI_MSA_PIC_NEPTUNE_LEADER, 70, 27}, + {IDI_MSA_PIC_MERCURY_ALIEN_0, 123, 64}, + {IDI_MSA_PIC_SATURN_ISLAND, 110, 115}, + {IDI_MSA_PIC_PLUTO_ALIENS, 60, 104}, + {IDI_MSA_PIC_JUPITER_LAVA, 56, 54}, + {IDI_MSA_PIC_MARS_VOLCANO, 107, 100}, + {IDI_MSA_PIC_URANUS_CHAMBER, 90, 4} +}; + +// planets + +enum ENUM_MSA_PLANET { + IDI_MSA_PLANET_EARTH = 0, + IDI_MSA_PLANET_VENUS, + IDI_MSA_PLANET_NEPTUNE, + IDI_MSA_PLANET_MERCURY, + IDI_MSA_PLANET_SATURN, + IDI_MSA_PLANET_PLUTO, + IDI_MSA_PLANET_JUPITER, + IDI_MSA_PLANET_MARS, + IDI_MSA_PLANET_URANUS, + IDI_MSA_PLANET_SPACESHIP +}; + +const char IDS_MSA_NAME_DAT[][13] = { + "earth.dat", "venus.dat", "neptune.dat", "mercury.dat", "saturn.dat", + "pluto.dat", "jupiter.dat", "mars.dat", "uranus.dat", "spacship.dat" +}; + +const char IDS_MSA_NAME_PLANET[][10] = { + "EARTH", "VENUS", "TRITON", "MERCURY", "TITAN", + "PLUTO", "IO", "MARS", "OBERON" +}; + +const char IDS_MSA_NAME_PLANET_2[][10] = { + "EARTH", "VENUS", "NEPTUNE", "MERCURY", "SATURN", + "PLUTO", "JUPITER", "MARS", "URANUS" +}; + +const char IDS_MSA_ADDR_PLANET[][7] = { + "OB", "B", "OOBBB", "O", "OOBB", + "OOOBBB", "OBB", "OOB", "OOOBB" +}; + +const int IDI_MSA_HOME_PLANET[] = { + IDI_MSA_PIC_EARTH_SHIP, IDI_MSA_PIC_VENUS_SHIP, IDI_MSA_PIC_NEPTUNE_SHIP, IDI_MSA_PIC_MERCURY_SHIP, + IDI_MSA_PIC_SATURN_SHIP, IDI_MSA_PIC_PLUTO_SHIP, IDI_MSA_PIC_JUPITER_SHIP, IDI_MSA_PIC_MARS_SHIP, + IDI_MSA_PIC_URANUS_SHIP +}; + +const int IDI_MSA_SHIP_PLANET[] = { + 0, IDI_MSA_PIC_SHIP_VENUS, IDI_MSA_PIC_SHIP_NEPTUNE, IDI_MSA_PIC_SHIP_MERCURY, IDI_MSA_PIC_SHIP_SATURN, + IDI_MSA_PIC_SHIP_PLUTO, IDI_MSA_PIC_SHIP_JUPITER, IDI_MSA_PIC_SHIP_MARS, IDI_MSA_PIC_SHIP_URANUS +}; + +// items + +enum ENUM_MSA_ITEM { + IDI_MSA_ITEM_FLASHLIGHT = 0, + IDI_MSA_ITEM_ROPE, + IDI_MSA_ITEM_BONE, + IDI_MSA_ITEM_LETTER, + IDI_MSA_ITEM_CROWBAR, + IDI_MSA_ITEM_WRENCH, + IDI_MSA_ITEM_MATTRESS, + IDI_MSA_ITEM_SCARF, + IDI_MSA_ITEM_SUNGLASSES, + IDI_MSA_ITEM_SCALE, + IDI_MSA_ITEM_ROCK +}; + +const char IDS_MSA_NAME_ITEM[][15] = { + "A FLASHLIGHT", "A ROPE ", "A BONE ", "A LETTER", "A CROWBAR", "A WRENCH", + "A MATTRESS", "A SCARF", "SUNGLASSES", "A SCALE ", "A ROCK " +}; + +// buttons + +#define IDI_MSA_BUTTON_ORANGE 0x4F // 'O' +#define IDI_MSA_BUTTON_BLUE 0x42 // 'B' + +// file structures + +struct MSA_TEXT_ENTRY { + uint8 x0; + uint8 szText[11]; +}; + +struct MSA_TEXT_BLOCK { + uint8 count; + MSA_TEXT_ENTRY entry[5]; +}; + +struct MSA_MSG_BLOCK { + uint8 data[5]; +}; + +struct MSA_MENU { + MSA_TEXT_BLOCK row[2]; + MSA_MSG_BLOCK cmd[5]; + MSA_MSG_BLOCK arg[5]; +}; + +struct MSA_DAT_HEADER { + uint16 filelen; + uint16 ofsRoom[IDI_MSA_MAX_ROOM]; + uint16 ofsDesc[IDI_MSA_MAX_ROOM]; + uint16 ofsStr[IDI_MSA_MAX_STR]; +}; + +struct MSA_SND_NOTE { + uint16 counter; // freq = 1193180 / counter + uint8 length; // msec = length / 0.0182 +}; + +// file offset modifiers + +#define IDI_MSA_OFS_INVALID 0xFE9A +#define IDI_MSA_OFS_DAT 0x0002 +#define IDI_MSA_OFS_EXE 0x35C0 +#define IDI_MSA_OFS_OBJECT_DATA 0x58E8 + +// actions + +#define IDI_MSA_ACTION_GOTO_ROOM 0x00 +#define IDI_MSA_ACTION_SHOW_INT_STR 0x01 +#define IDI_MSA_ACTION_UNUSED 0x02 +#define IDI_MSA_ACTION_SHOW_DAT_STR 0x03 + +#define IDI_MSA_ACTION_GET_ROPE 0x7F +#define IDI_MSA_ACTION_UNTIE_ROPE 0x80 +#define IDI_MSA_ACTION_GET_BONE 0x81 +#define IDI_MSA_ACTION_GET_XTAL_EARTH 0x82 +#define IDI_MSA_ACTION_LOOK_DESK 0x83 +#define IDI_MSA_ACTION_WRITE_LETTER 0x84 +#define IDI_MSA_ACTION_MAIL_LETTER 0x85 +#define IDI_MSA_ACTION_OPEN_CUPBOARD 0x86 +#define IDI_MSA_ACTION_GET_FLASHLIGHT 0x87 +#define IDI_MSA_ACTION_OPEN_CABINET 0x88 +#define IDI_MSA_ACTION_GET_CROWBAR 0x89 +#define IDI_MSA_ACTION_GET_WRENCH 0x8A +#define IDI_MSA_ACTION_OPEN_CLOSET 0x8B +#define IDI_MSA_ACTION_GET_MATTRESS 0x8C +#define IDI_MSA_ACTION_GET_SCARF 0x8D +#define IDI_MSA_ACTION_GET_SUNGLASSES 0x8E +#define IDI_MSA_ACTION_GET_SCALE 0x8F +#define IDI_MSA_ACTION_GOTO_SPACESHIP 0x90 + +#define IDI_MSA_ACTION_DOWN_CHASM 0x91 +#define IDI_MSA_ACTION_DOWN_ROPE 0x92 +#define IDI_MSA_ACTION_USE_ROPE 0x93 +#define IDI_MSA_ACTION_OPEN_HATCH 0x94 +#define IDI_MSA_ACTION_USE_WRENCH 0x95 +#define IDI_MSA_ACTION_GET_XTAL_VENUS 0x96 + +#define IDI_MSA_ACTION_LOOK_CASTLE 0x97 +#define IDI_MSA_ACTION_ENTER_OPENING 0x98 +#define IDI_MSA_ACTION_USE_CROWBAR 0x99 +#define IDI_MSA_ACTION_GET_XTAL_NEPTUNE 0x9A +#define IDI_MSA_ACTION_TALK_LEADER 0x9B +#define IDI_MSA_ACTION_GIVE_SCARF 0x9C + +#define IDI_MSA_ACTION_GET_XTAL_MERCURY 0x9D +#define IDI_MSA_ACTION_GIVE_SUNGLASSES 0x9E +#define IDI_MSA_ACTION_CROSS_LAKE 0x9F +#define IDI_MSA_ACTION_USE_MATTRESS 0xA0 +#define IDI_MSA_ACTION_GET_XTAL_SATURN 0xA1 +#define IDI_MSA_ACTION_LEAVE_ISLAND 0xA2 + +#define IDI_MSA_ACTION_GET_XTAL_PLUTO 0xA3 +#define IDI_MSA_ACTION_GIVE_BONE 0xA4 + +#define IDI_MSA_ACTION_GET_ROCK_0 0xA5 +#define IDI_MSA_ACTION_GET_ROCK_1 0xA6 +#define IDI_MSA_ACTION_GET_XTAL_JUPITER 0xA7 +#define IDI_MSA_ACTION_THROW_ROCK 0xA8 + +#define IDI_MSA_ACTION_GO_TUBE 0xA9 +#define IDI_MSA_ACTION_USE_FLASHLIGHT 0xAA +#define IDI_MSA_ACTION_PLUTO_DIG 0xAB +#define IDI_MSA_ACTION_GET_XTAL_MARS 0xAC + +#define IDI_MSA_ACTION_USE_CRYSTAL 0xAD +#define IDI_MSA_ACTION_OPEN_DOOR 0xAE +#define IDI_MSA_ACTION_ENTER_DOOR 0xAF +#define IDI_MSA_ACTION_GET_XTAL_URANUS 0xB0 +#define IDI_MSA_ACTION_USE_CROWBAR_1 0xB1 + +#define IDI_MSA_ACTION_GO_NORTH 0xB2 +#define IDI_MSA_ACTION_GO_PLANET 0xB3 +#define IDI_MSA_ACTION_PRESS_BUTTON 0xB4 +#define IDI_MSA_ACTION_WEAR_SPACESUIT 0xB5 +#define IDI_MSA_ACTION_READ_GAUGE 0xB6 +#define IDI_MSA_ACTION_PRESS_ORANGE 0xB7 +#define IDI_MSA_ACTION_PRESS_BLUE 0xB8 +#define IDI_MSA_ACTION_FLIP_SWITCH 0xB9 +#define IDI_MSA_ACTION_PUSH_THROTTLE 0xBA +#define IDI_MSA_ACTION_PULL_THROTTLE 0xBB +#define IDI_MSA_ACTION_LEAVE_ROOM 0xBC +#define IDI_MSA_ACTION_OPEN_CABINET_1 0xBD +#define IDI_MSA_ACTION_READ_MAP 0xBE +#define IDI_MSA_ACTION_GO_WEST 0xBF + +#define IDI_MSA_ACTION_PLANET_INFO 0xC0 +#define IDI_MSA_ACTION_ENTER_TEMPLE 0xC1 +#define IDI_MSA_ACTION_OPEN_MAILBOX 0xC2 +#define IDI_MSA_ACTION_SAVE_GAME 0xC3 +#define IDI_MSA_ACTION_LOOK_MICKEY 0xC4 + +// sounds + +enum ENUM_MSA_SOUND { + IDI_MSA_SND_THEME, + IDI_MSA_SND_CRYSTAL, + IDI_MSA_SND_TAKE, + IDI_MSA_SND_GAME_OVER, + IDI_MSA_SND_PRESS_BLUE, + IDI_MSA_SND_PRESS_ORANGE, + IDI_MSA_SND_SHIP_LAND, + IDI_MSA_SND_XL30 +}; + +// message offsets within mickey.exe + +const int IDO_MSA_ERROR[] = { + 0x4C9C, 0x4CB9, 0x4CD4, 0x4CEA, 0x4D0D, 0x4D20, 0x4D3B, 0x4D5E +}; + +const int IDO_MSA_HIDDEN_MSG[] = { + 0x8C44, 0x8C83, 0x8D23, 0x8D97, 0x8E2A +}; + +const int IDO_MSA_GAME_OVER[] = { + 0x7914, 0x7978, 0x7A17, 0x7A94, 0x7B04, 0x7B8F, 0x7BEB, 0x7C79 +}; + +const int IDO_MSA_SAVE_GAME[] = { + 0x73FA, 0x7436, 0x746C, 0x74E9, 0x75F6, 0x766A, 0x758B + // do you have a formatted disk, insert disk, insert disk 2, save by number + // everything will be lost, previous game will be lost, game saved +}; + +const int IDO_MSA_LOAD_GAME[] = { + 0x76CE, 0x770B, 0x7777 + // do you want to load game, insert game save disk, game restored +}; + +const int IDO_MSA_AIR_SUPPLY[] = { + 0x7D10, 0x7D31, 0x7D51, 0x7D9B + // be aware, low, dangerously low, out of air + // 30, 20, 10, 0 +}; + +const int IDI_MSA_AIR_SUPPLY[] = { 30, 20, 10, 0 }; + +// planet information + +const int IDO_MSA_PLANET_INFO[IDI_MSA_MAX_PLANET][4] = { + {0x6313, 0x63B2, 0x6449, 0}, // EARTH + {0x61EB, 0x6288, 0, 0}, // VENUS + {0x6B64, 0x6C06, 0x6CA3, 0}, // NEPTUNE + {0x609B, 0x612C, 0x61CA, 0}, // MERCURY + {0x6879, 0x6916, 0x6984, 0}, // SATURN + {0x6CCF, 0x6D72, 0x6E10, 0}, // PLUTO + {0x667C, 0x6714, 0x67B1, 0x684E}, // JUPITER + {0x6471, 0x650F, 0x65AD, 0x6651}, // MARS + {0x69C3, 0x6A62, 0x6B00, 0} // URANUS +}; + +// next crystal piece hints + +const int IDO_MSA_NEXT_PIECE[IDI_MSA_MAX_PLANET][5] = { + {0, 0, 0, 0, 0}, // earth + {0x4DCC, 0x4E20, 0x4E64, 0x4E9E, 0x4F0B}, // venus + {0x5900, 0x599B, 0x5A07, 0x5A8E, 0x5B07}, // neptune + {0x4F57, 0x4FA3, 0x4FF1, 0x5056, 0x50BD}, // mercury + {0x5471, 0x54DF, 0x5548, 0x55C2, 0x562A}, // saturn + {0x5B78, 0x5BB6, 0x5C29, 0x5C76, 0x5CE1}, // pluto + {0x526B, 0x52DA, 0x5340, 0x53A1, 0x540C}, // jupiter + {0x50F6, 0x512C, 0x5170, 0x51D5, 0x5228}, // mars + {0x56AA, 0x571C, 0x579E, 0x5807, 0x5875} // uranus +}; + +// message offsets + +#define IDO_MSA_COPYRIGHT 0x7801 +#define IDO_MSA_INTRO 0x4679 +#define IDO_MSA_GAME_STORY 0x6E9C + +#define IDO_MSA_CHECK_DISK_DRIVE 0x7885 +#define IDO_MSA_YOU_CAN_SEE_MICKEY_ALREADY 0x46D1 +#define IDO_MSA_THE_CABINET_IS_ALREADY_OPEN 0x46EF + +#define IDO_MSA_PRESS_1_TO_9 0x7530 +#define IDO_MSA_PRESS_YES_OR_NO 0x480D +#define IDO_MSA_TOO_MANY_BUTTONS_PRESSED 0x5DF7 + +#define IDO_MSA_MICKEY_HAS_PRESSED 0x5D90 + +#define IDO_MSA_XL30_SPEAKING 0x4725 +#define IDO_MSA_CRYSTAL_PIECE_FOUND 0x600C + +#define IDO_MSA_FONT 0x7EDC // 256 chars, 2048 bytes (00110010 * 8 = character) + +#define IDO_MSA_ROOM_TEXT 0x4B80 +#define IDO_MSA_ROOM_TEXT_OFFSETS 0x8B01 +#define IDO_MSA_ROOM_OBJECT 0x475C +#define IDO_MSA_ROOM_PICTURE 0x4AE4 +#define IDO_MSA_ROOM_OBJECT_XY_OFFSETS 0x8EA8 +#define IDO_MSA_PIC_SHIP_LIGHT 0x8F38 +#define IDO_MSA_XTAL_ROOM_XY 0x97F8 +//#define IDO_MSA_PLANET_INFO 0x6048 +#define IDO_MSA_ROOM_MENU_FIX 0x4a27 +#define IDO_MSA_ROOM_MENU_FIX_OFFSETS 0x5E7A + +// offsets to offset arrays + +#define IDOFS_MSA_INTERPRETER_ERRORS 0x4c8e +#define IDOFS_MSA_HIDDEN_FEATURE 0x8c3a +#define IDOFS_MSA_MENU_PATCHES 0x5e7a +#define IDOFS_MSA_SOUND_DATA 0x9deb +#define IDOFS_MSA_NEXT_PLANET_CLUES 0x4d7c +#define IDOFS_MSA_PLANET_INFORMATION 0x6048 +#define IDOFS_MSA_PLANET_ADDRESSES 0x5e40 +#define IDOFS_MSA_OBJECT_DATA 0x8ea8 +#define IDOFS_MSA_EXTENDED_ROOM_DESCRIPTIONS 0x8b01 + +// game structure + +struct MSA_GAME { + int iRoom; + int iPlanet; + int iDisk; + + int nAir; + int nButtons; + int nRocks; + + bool fHasXtal; + int nXtals; + int iPlanetXtal[IDI_MSA_MAX_DAT]; + int iClue[IDI_MSA_MAX_PLANET]; + char szAddr[IDI_MSA_MAX_BUTTON + 1]; + + bool fIntro; + bool fSuit; + bool fShipDoorOpen; + bool fFlying; + bool fStoryShown; + bool fTempleDoorOpen; + + bool fItem[IDI_MSA_MAX_ITEM]; + bool fItemUsed[IDI_MSA_MAX_ITEM]; + int iItem[IDI_MSA_MAX_ITEM]; + int nItems; + + int8 fRmTxt[IDI_MSA_MAX_ROOM]; + int8 iRmObj[IDI_MSA_MAX_ROOM]; + uint8 iRmPic[IDI_MSA_MAX_ROOM]; + uint16 oRmTxt[IDI_MSA_MAX_ROOM]; + + uint8 iRmMenu[IDI_MSA_MAX_ROOM]; + uint8 nRmMenu[IDI_MSA_MAX_ROOM]; + + int nFrame; // 0.1.4 + bool fAnimXL30; // 0.1.4 + int nTicks; // 0.1.4 +}; + +class Mickey { + friend class PreAgiEngine; +public: + + Mickey(PreAgiEngine *vm); + ~Mickey(); + + void init(); + void run(); +protected: + PreAgiEngine *_vm; + MSA_GAME game; + bool clickToMove; + + int getDat(int); + void readExe(int, uint8*, long); + void getDatFileName(int, char*); + void readDatHdr(char*, MSA_DAT_HEADER*); + void readDesc(int, char*, long); + void readMenu(int, char*); + void readDatStr(int, int, char*, long); + void readOfsData(int, int, uint8*, long); + bool chooseY_N(int, bool); + int choose1to9(int); + void printStr(char*); + void printExeStr(int); + void printExeMsg(int); + void printDatStr(int, int); + void printDesc(int); + void drawMenu(MSA_MENU, int, int); + void getMouseMenuSelRow(MSA_MENU, int*, int*, int, int, int); + bool getMenuSelRow(MSA_MENU, int*, int*, int); + void getMenuSel(char*, int*, int*); + void centerMenu(MSA_MENU*); + void patchMenu(MSA_MENU*); + void printDatString(int); + void printDatMessage(int); + void playNote(MSA_SND_NOTE); + void playSound(ENUM_MSA_SOUND); + void debug(); + void drawObj(ENUM_MSA_OBJECT, int, int); + void drawPic(int); + void drawRoomPicture(); + void drawRoomObjects(); + void drawRoomAnimation(); + void drawRoom(); + void drawLogo(); + void animate(); + void printRoomDesc(); + bool loadGame(); + void saveGame(); + void showPlanetInfo(); + void printStory(); + void hidden(); + int getPlanet(); + void pressOB(int); + void checkAirSupply(bool, int*); + void insertDisk(int); + void gameOver(); + void inventory(); + void randomize(); + void flashScreen(); + void intro(); + void getItem(ENUM_MSA_ITEM); + void getXtal(int); + bool parse(int, int); + void gameLoop(); + void debug_DrawObjs(); + void debug_DrawPics(); + void initVars(); + void initEngine(); + void flipSwitch(); + void waitAnyKeyAnim(); + void waitAnyKey(bool anim = false); +}; + +} // End of namespace Agi + +#endif diff --git a/engines/agi/preagi_troll.cpp b/engines/agi/preagi_troll.cpp new file mode 100644 index 0000000000..5136286768 --- /dev/null +++ b/engines/agi/preagi_troll.cpp @@ -0,0 +1,502 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * $URL$ + * $Id$ + * + */ + +#include "agi/preagi.h" +#include "agi/preagi_common.h" +#include "agi/preagi_troll.h" +#include "agi/graphics.h" + +#include "graphics/cursorman.h" + +#include "common/events.h" + +namespace Agi { + +Troll::Troll(PreAgiEngine* vm) : _vm(vm) { +} + +// User Interface + +void Troll::pressAnyKey() { + _vm->drawStr(24, 4, kColorDefault, IDS_TRO_PRESSANYKEY); + _vm->_gfx->doUpdate(); + _vm->waitAnyKeyChoice(); +} + +void Troll::drawMenu(const char *szMenu, int iSel) { + _vm->clearTextArea(); + _vm->drawStr(21, 0, kColorDefault, szMenu); + _vm->drawStr(22 + iSel, 0, kColorDefault, " *"); + _vm->_gfx->doUpdate(); +} + +void Troll::getMenuSel(const char *szMenu, int *iSel, int nSel) { + Common::Event event; + int y; + + drawMenu(szMenu, *iSel); + + for (;;) { + while (_vm->_system->getEventManager()->pollEvent(event)) { + switch(event.type) { + case Common::EVENT_QUIT: + _vm->_system->quit(); + case Common::EVENT_MOUSEMOVE: + y = event.mouse.y / 8; + + if (y >= 22) + if (nSel > y - 22) + *iSel = y - 22; + + drawMenu(szMenu, *iSel); + break; + case Common::EVENT_LBUTTONUP: + return; + case Common::EVENT_KEYDOWN: + switch (event.kbd.keycode) { + case Common::KEYCODE_t: + case Common::KEYCODE_f: + inventory(); + *iSel = 0; + drawMenu(szMenu, *iSel); + break; + case Common::KEYCODE_SPACE: + *iSel += 1; + + if (*iSel == nSel) + *iSel = IDI_TRO_SEL_OPTION_1; + + drawMenu(szMenu, *iSel); + break; + case Common::KEYCODE_RETURN: + case Common::KEYCODE_KP_ENTER: + return; + default: + break; + } + break; + default: + break; + } + } + _vm->_system->updateScreen(); + _vm->_system->delayMillis(10); + } +} + +// Graphics + +void Troll::drawPic(int iPic, bool f3IsCont, bool clear) { + uint8 frame[] = { + 0xf1, 0x3, 0xf9, 0x0, 0x0, 0x9f, 0x0, 0x9f, 0xa7, 0x0, 0xa7, 0x0, 0x0, 0xff + }; + + if (clear) + _vm->clearScreen(0x0f); + + _vm->_picture->setDimensions(IDI_TRO_PIC_WIDTH, IDI_TRO_PIC_HEIGHT); + + _vm->_picture->setPictureData(frame, ARRAYSIZE(frame)); + _vm->_picture->drawPicture(); + + _vm->_picture->setPictureData(_gameData + _pictureOffsets[iPic], 4096); + + if (f3IsCont) + _vm->_picture->setPictureFlags(kPicFf3Cont); + else + _vm->_picture->setPictureFlags(kPicFf3Stop); + + _vm->_picture->drawPicture(); + + _vm->_picture->showPic(); + _vm->_gfx->doUpdate(); +} + +// Game Logic + +void Troll::inventory() { + char szMissing[40]; + + _vm->clearScreen(0x07); + _vm->drawStr(1, 12, kColorDefault, IDS_TRO_TREASURE_0); + _vm->drawStr(2, 12, kColorDefault, IDS_TRO_TREASURE_1); + + switch (_treasuresLeft) { + case 1: + sprintf(szMissing, IDS_TRO_TREASURE_5, _treasuresLeft); + _vm->drawStr(20, 10,kColorDefault, szMissing); + break; + case 0: + _vm->drawStr(20, 1, kColorDefault, IDS_TRO_TREASURE_6); + break; + case IDI_TRO_MAX_TREASURE: + _vm->drawStr(3, 17, kColorDefault, IDS_TRO_TREASURE_2); + default: + sprintf(szMissing, IDS_TRO_TREASURE_4, _treasuresLeft); + _vm->drawStr(20, 10,kColorDefault, szMissing); + break; + } + + _vm->drawStr(24, 6, kColorDefault, IDS_TRO_PRESSANYKEY); + _vm->_gfx->doUpdate(); + _vm->waitAnyKeyChoice(); +} + +void Troll::waitAnyKeyIntro() { + Common::Event event; + int iMsg = 0; + + for (;;) { + while (_vm->_system->getEventManager()->pollEvent(event)) { + switch(event.type) { + case Common::EVENT_QUIT: + _vm->_system->quit(); + case Common::EVENT_LBUTTONUP: + case Common::EVENT_KEYDOWN: + return; + default: + break; + } + } + + switch (iMsg) { + case 200: + iMsg = 0; + case 0: + _vm->drawStr(22, 3, kColorDefault, IDS_TRO_INTRO_2); + _vm->_gfx->doUpdate(); + break; + case 100: + _vm->drawStr(22, 3, kColorDefault, IDS_TRO_INTRO_3); + _vm->_gfx->doUpdate(); + break; + } + + iMsg++; + + _vm->_system->updateScreen(); + _vm->_system->delayMillis(10); + } +} + +void Troll::credits() { + _vm->clearScreen(0x07); + + _vm->drawStr(1, 2, kColorDefault, IDS_TRO_CREDITS_0); + + int color = 10; + char str[2]; + + str[1] = 0; + + for (uint i = 0; i < strlen(IDS_TRO_CREDITS_1); i++) { + str[0] = IDS_TRO_CREDITS_1[i]; + _vm->drawStr(7, 19 + i, color++, str); + if (color > 15) + color = 9; + } + + _vm->drawStr(8, 19, kColorDefault, IDS_TRO_CREDITS_2); + + _vm->drawStr(13, 11, 9, IDS_TRO_CREDITS_3); + _vm->drawStr(15, 8, 10, IDS_TRO_CREDITS_4); + _vm->drawStr(17, 7, 12, IDS_TRO_CREDITS_5); + _vm->drawStr(19, 2, 14, IDS_TRO_CREDITS_6); + + _vm->_gfx->doUpdate(); + + pressAnyKey(); +} + +void Troll::tutorial() { + bool done = false; + int iSel = 0; + //char szTreasure[16] = {0}; + + for (;;) { + _vm->clearScreen(0xFF); + + _vm->printStr(IDS_TRO_TUTORIAL_0); + _vm->getSelection(kSelSpace); + + _vm->clearScreen(0x55); + _vm->setDefaultTextColor(0x0F); + + done = false; + while (!done) { + getMenuSel(IDS_TRO_TUTORIAL_1, &iSel, IDI_TRO_MAX_OPTION); + switch(iSel) { + case IDI_TRO_SEL_OPTION_1: + _vm->clearScreen(0x22, false); + _vm->_gfx->doUpdate(); + break; + case IDI_TRO_SEL_OPTION_2: + _vm->clearScreen(0x00, false); + _vm->_gfx->doUpdate(); + break; + case IDI_TRO_SEL_OPTION_3: + done = true; + break; + } + } + + // do you need more practice ? + _vm->clearScreen(0x4F); + _vm->drawStr(7, 4, kColorDefault, IDS_TRO_TUTORIAL_5); + _vm->drawStr(9, 4, kColorDefault, IDS_TRO_TUTORIAL_6); + _vm->_gfx->doUpdate(); + + if (!_vm->getSelection(kSelYesNo)) + break; + } + + // show info texts + _vm->clearScreen(0x5F); + _vm->drawStr(4, 1, kColorDefault, IDS_TRO_TUTORIAL_7); + _vm->drawStr(5, 1, kColorDefault, IDS_TRO_TUTORIAL_8); + _vm->_gfx->doUpdate(); + pressAnyKey(); + + _vm->clearScreen(0x2F); + _vm->drawStr(6, 1, kColorDefault, IDS_TRO_TUTORIAL_9); + _vm->_gfx->doUpdate(); + pressAnyKey(); + + _vm->clearScreen(0x19); + _vm->drawStr(7, 1, kColorDefault, IDS_TRO_TUTORIAL_10); + _vm->drawStr(8, 1, kColorDefault, IDS_TRO_TUTORIAL_11); + _vm->_gfx->doUpdate(); + pressAnyKey(); + + _vm->clearScreen(0x6E); + _vm->drawStr(9, 1, kColorDefault, IDS_TRO_TUTORIAL_12); + _vm->drawStr(10, 1, kColorDefault, IDS_TRO_TUTORIAL_13); + _vm->_gfx->doUpdate(); + pressAnyKey(); + + _vm->clearScreen(0x4C); + _vm->drawStr(11, 1, kColorDefault, IDS_TRO_TUTORIAL_14); + _vm->drawStr(12, 1, kColorDefault, IDS_TRO_TUTORIAL_15); + _vm->_gfx->doUpdate(); + pressAnyKey(); + + _vm->clearScreen(0x5D); + _vm->drawStr(13, 1, kColorDefault, IDS_TRO_TUTORIAL_16); + _vm->drawStr(14, 1, kColorDefault, IDS_TRO_TUTORIAL_17); + _vm->drawStr(15, 1, kColorDefault, IDS_TRO_TUTORIAL_18); + _vm->_gfx->doUpdate(); + pressAnyKey(); + + // show treasures + _vm->clearScreen(0x2A); + _vm->drawStr(2, 1, kColorDefault, IDS_TRO_TUTORIAL_19); + for (int i = 0; i < IDI_TRO_MAX_TREASURE; i++) + _vm->drawStr(19 - i, 11, kColorDefault, (const char *)IDS_TRO_NAME_TREASURE[i]); + + _vm->_gfx->doUpdate(); + + pressAnyKey(); +} + +void Troll::intro() { + // sierra on-line presents + _vm->clearScreen(0x2F); + _vm->drawStr(9, 10, kColorDefault, IDS_TRO_INTRO_0); + _vm->drawStr(14, 15, kColorDefault, IDS_TRO_INTRO_1); + _vm->_gfx->doUpdate(); + _vm->_system->updateScreen(); + _vm->_system->delayMillis(3200); + + // Draw logo + drawPic(45, false, true); + _vm->_gfx->doUpdate(); + + // wait for keypress and alternate message + waitAnyKeyIntro(); + + // have you played this game before? + _vm->drawStr(22, 3, kColorDefault, IDS_TRO_INTRO_4); + _vm->drawStr(23, 6, kColorDefault, IDS_TRO_INTRO_5); + _vm->_gfx->doUpdate(); + + if (!_vm->getSelection(kSelYesNo)) + tutorial(); + + credits(); +} + +void Troll::gameOver() { + char szMoves[40]; + + _vm->clearScreen(0x0f); // hack + + _vm->clearTextArea(); + //DrawPic(0); + + _vm->clearTextArea(); + //DrawPic(0); + + sprintf(szMoves, IDS_TRO_GAMEOVER_0, _moves); + _vm->drawStr(21, 1, kColorDefault, szMoves); + _vm->drawStr(22, 1, kColorDefault, IDS_TRO_GAMEOVER_1); + _vm->_gfx->doUpdate(); + pressAnyKey(); +} + +int Troll::drawRoom(char *menu) { + int n; + + drawPic(_currentRoom - 1, false, true); + _vm->_gfx->doUpdate(); + + // TODO: Troll + + char tmp[10]; + strncat(menu, (char*)_gameData + IDO_TRO_LOCMESSAGES + _locationDescIndex * 39, 39); + + for (int i = 0; i < 3; i++) { + if (_roomDescs[_currentRoom - 1].options[i]) { + sprintf(tmp, "\n %d.", i); + strcat(menu, tmp); + + strncat(menu, (char *)_gameData + _options[_roomDescs[_currentRoom - 1].options[i]], 35); + + n = i + 1; + } + } + + return n; +} + +void Troll::gameLoop() { + bool done = false; + char menu[160+5]; + int currentOption, numberOfOptions; + + _moves = 0; + _currentRoom = 1; + _treasuresLeft = IDI_TRO_MAX_TREASURE; + _haveFlashlight = false; + _locationDescIndex = 0; + + while (!done) { + *menu = 0; + + currentOption = 0; + + numberOfOptions = drawRoom(menu); + + getMenuSel(menu, ¤tOption, numberOfOptions); + _moves++; + + switch(_roomDescs[_currentRoom - 1].optionTypes[currentOption]) { + case IDI_TRO_SEL_OPTION_1: + break; + case IDI_TRO_SEL_OPTION_2: + break; + case IDI_TRO_SEL_OPTION_3: + break; + case OT_UNKN: + break; + } + } + +} + +void Troll::fillOffsets() { + int i; + + for (i = 0; i < IDI_TRO_PICNUM; i++) + _pictureOffsets[i] = READ_LE_UINT16(_gameData + IDO_TRO_PIC_START + i * 2); + + for (i = 0; i < IDI_TRO_NUM_OPTIONS; i++) + _options[i] = READ_LE_UINT16(_gameData + IDO_TRO_OPTIONS + i * 2); +} + +void Troll::fillRoomDescs() { + int start = READ_LE_UINT16(_gameData + IDO_TRO_ROOMDESCS); + int ptr; + int j; + + for (int i = 0; i < IDI_TRO_NUM_ROOMDESCS; i++) { + ptr = READ_LE_UINT16(_gameData + start); + + for (j = 0; j < 3; j++) + _roomDescs[i].options[j] = _gameData[ptr++]; + + for (j = 0; j < 3; j++) { + switch (_gameData[ptr++]) { + case 0: + _roomDescs[i].optionTypes[j] = OT_GO; + break; + case 1: + _roomDescs[i].optionTypes[j] = OT_GET; + break; + case 2: + _roomDescs[i].optionTypes[j] = OT_WIN; + break; + case 3: + _roomDescs[i].optionTypes[j] = OT_UNKN; + break; + default: + error("Bad data @ (%x) %d", ptr - 1, i); + } + } + + for (j = 0; j < 3; j++) + _roomDescs[i].roomDescIndex[j] = _gameData[ptr++]; + + start += 2; + } +} + +// Init + +void Troll::init() { + _vm->_picture->setPictureVersion(AGIPIC_V15); + //SetScreenPar(320, 200, (char*)ibm_fontdata); + + Common::File infile; + if (!infile.open(IDA_TRO_BINNAME)) + return; + + _gameData = (byte *)malloc(infile.size()); + infile.seek(IDO_TRO_DATA_START); + infile.read(_gameData, infile.size() - IDO_TRO_DATA_START); + infile.close(); + + fillOffsets(); + fillRoomDescs(); +} + +void Troll::run() { + intro(); + + gameLoop(); + + gameOver(); +} + +} // end of namespace Agi diff --git a/engines/agi/preagi_troll.h b/engines/agi/preagi_troll.h new file mode 100644 index 0000000000..ef458afb41 --- /dev/null +++ b/engines/agi/preagi_troll.h @@ -0,0 +1,197 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * $URL$ + * $Id$ + * + */ + +#ifndef AGI_PREAGI_TROLL_H +#define AGI_PREAGI_TROLL_H + +#include "agi/agi.h" + +namespace Agi { + +// strings + +#define IDS_TRO_DISK "ERROR ERROR !" +#define IDS_TRO_PATH_PIC "%s" + +#define IDS_TRO_PRESSANYKEY "PRESS ANY KEY TO CONTINUE:" + +#define IDS_TRO_INTRO_0 "SIERRA ON-LINE INC." +#define IDS_TRO_INTRO_1 "Presents :" +#define IDS_TRO_INTRO_2 "Copyright 1984 Sierra On-Line Inc." +#define IDS_TRO_INTRO_3 " Press any key to continue. " +#define IDS_TRO_INTRO_4 "HAVE YOU PLAYED THIS GAME BEFORE ?" +#define IDS_TRO_INTRO_5 "PRESS <Y> OR <N>" + +#define IDS_TRO_TUTORIAL_0 " First press the <space bar>.\n 1. Turn the screen GREEN.\n 2. Turn the screen BLACK.\n *3. SEE a SURPRISE, and then more." +#define IDS_TRO_TUTORIAL_1 " Press <return> to make your choice.\n 1. Turn the screen GREEN.\n 2. Turn the screen BLACK.\n 3. SEE a SURPRISE, and then more." +//#define IDS_TRO_TUTORIAL_0 "First press the <space bar>." +//#define IDS_TRO_TUTORIAL_1 "1. Turn the screen GREEN." +//#define IDS_TRO_TUTORIAL_2 "2. Turn the screen BLACK." +//#define IDS_TRO_TUTORIAL_3 "3. SEE a SURPRISE, and then more." +//#define IDS_TRO_TUTORIAL_4 "Press <return> to make your choice." +#define IDS_TRO_TUTORIAL_5 "Would you like more practice ?" +#define IDS_TRO_TUTORIAL_6 "Press <Y> for yes, <N> for no." +#define IDS_TRO_TUTORIAL_7 "The evil TROLL has hidden all the" +#define IDS_TRO_TUTORIAL_8 "Treasures of MARK, the Dwarf King." +#define IDS_TRO_TUTORIAL_9 "Help KING MARK find his Treasures." +#define IDS_TRO_TUTORIAL_10 "You can't take a Treasure if the TROLL" +#define IDS_TRO_TUTORIAL_11 "is in the same picture as the Treasure." +#define IDS_TRO_TUTORIAL_12 "To make the TROLL go away you have to" +#define IDS_TRO_TUTORIAL_13 "make the picture change." +#define IDS_TRO_TUTORIAL_14 "During the game see the Treasures you" +#define IDS_TRO_TUTORIAL_15 "have already found by pressing <F>." +#define IDS_TRO_TUTORIAL_16 "During the game you can turn the sound" +#define IDS_TRO_TUTORIAL_17 "on or off by pressing the <S> key " +#define IDS_TRO_TUTORIAL_18 "while holding down the <Ctrl> key." +#define IDS_TRO_TUTORIAL_19 "The TROLL has hidden these Treasures:" + +#define IDS_TRO_CREDITS_0 "Prepare to enter the world of . . ." +#define IDS_TRO_CREDITS_1 "TROLL'S TALE (tm)" +#define IDS_TRO_CREDITS_2 "------------" +#define IDS_TRO_CREDITS_3 "Written by MIKE MACCHESNEY" +#define IDS_TRO_CREDITS_4 "Conversion by PETER OLIPHANT" +#define IDS_TRO_CREDITS_5 "Graphic Art by DOUG MACNEILL" +#define IDS_TRO_CREDITS_6 "Original Version by AL LOWE" + +#define IDS_TRO_TREASURE_0 "TREASURES FOUND" +#define IDS_TRO_TREASURE_1 "---------------" +#define IDS_TRO_TREASURE_2 "NONE" +#define IDS_TRO_TREASURE_3 "THERE ARE STILL" +#define IDS_TRO_TREASURE_4 "%d TREASURES TO FIND" +#define IDS_TRO_TREASURE_5 "%d TREASURE TO FIND" +#define IDS_TRO_TREASURE_6 "YOU HAVE FOUND ALL OF THE TREASURES!!" +#define IDS_TRO_TREASURE_7 "THERE'S ONLY ONE MORE TREASURE TO FIND." +#define IDS_TRO_TREASURE_8 "GREAT!! YOU HAVE FOUND EVERY TREASURE." +#define IDS_TRO_TREASURE_9 "TAKE THE TREASURES TO THE GUARD." + +#define IDS_TRO_GAMEOVER_0 "You took %d moves to complete TROLL'S" +#define IDS_TRO_GAMEOVER_1 "TALE. Do you think you can do better?" + +const char IDS_TRO_NAME_TREASURE[][16] = { + " FLASHLIGHT ", " BAG OF GOLD ", " BOX OF JEWELS ", " DIAMOND RING ", + " CANDY SUCKER ", "DOLLAR AND CENT", " FIDDLE ", "BAG OF PENNIES ", + " TREASURE CHEST", " PENNY ", " SILVER CUP ", " NECKLACE ", + " SHELL ", " GOLD BRICK ", " GIFT ", " POT OF MONEY " +}; + +// picture + +#define IDI_TRO_PICNUM 47 + +#define IDI_TRO_PIC_WIDTH 160 +#define IDI_TRO_PIC_HEIGHT 168 +#define IDI_TRO_PIC_X0 0 +#define IDI_TRO_PIC_Y0 0 +#define IDI_TRO_PIC_FLAGS IDF_AGI_PIC_V15 + +// max values + +#define IDI_TRO_MAX_TREASURE 16 +#define IDI_TRO_MAX_OPTION 3 + +#define IDI_TRO_SEL_OPTION_1 0 +#define IDI_TRO_SEL_OPTION_2 1 +#define IDI_TRO_SEL_OPTION_3 2 + +#define IDI_TRO_MAX_ROW_PIC 21 + +#define IDI_TRO_NUM_ROOMDESCS 65 +#define IDI_TRO_NUM_OPTIONS 129 + +// offsets + +#define IDA_TRO_BINNAME "troll.exe" + +#define IDO_TRO_DATA_START 0x1960 +#define IDO_TRO_PIC_START 0x3EF5 +#define IDO_TRO_LOCMESSAGES 0x1F7C +#define IDO_TRO_ROOMDESCS 0x0082 +#define IDO_TRO_OPTIONS 0x0364 + +enum OptionType { + OT_GO, + OT_GET, + OT_WIN, + OT_UNKN +}; + +struct RoomDesc { + int options[3]; + OptionType optionTypes[3]; + int roomDescIndex[3]; +}; + +class Troll { + friend class PreAgiEngine; +public: + Troll(PreAgiEngine *vm); + + void init(); + void run(); + +private: + int _currentRoom; + int _moves; + int _treasuresLeft; + int _locationDescIndex; + int _numberOfOptions; + + bool _haveFlashlight; + + RoomDesc _roomDescs[IDI_TRO_NUM_ROOMDESCS]; + int _options[IDI_TRO_NUM_OPTIONS]; + + byte *_gameData; + + PreAgiEngine *_vm; + + void intro(); + void drawPic(int iPic, bool f3IsCont, bool clear); + void gameLoop(); + void gameOver(); + void tutorial(); + void credits(); + + void inventory(); + + int drawRoom(char *menu); + + void pressAnyKey(); + void waitAnyKeyIntro(); + + void getMenuSel(const char*, int*, int); + + void drawMenu(const char *szMenu, int iSel); + + void fillOffsets(); + void fillRoomDescs(); + +private: + int _pictureOffsets[IDI_TRO_PICNUM]; +}; + +} // End of namespace Agi + +#endif diff --git a/engines/agi/preagi_winnie.cpp b/engines/agi/preagi_winnie.cpp new file mode 100644 index 0000000000..8d60f0861e --- /dev/null +++ b/engines/agi/preagi_winnie.cpp @@ -0,0 +1,1127 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * $URL$ + * $Id$ + * + */ + +#include "agi/preagi.h" +#include "agi/preagi_winnie.h" +#include "agi/graphics.h" + +#include "graphics/cursorman.h" + +#include "common/events.h" +#include "common/savefile.h" + +namespace Agi { + +// default attributes +#define IDA_DEFAULT 0x0F +#define IDA_DEFAULT_REV 0xF0 + +void Winnie::initEngine() { + //SetScreenPar(320, 200, (char*)ibm_fontdata); + //SetMenuPars(21, 21, IDS_WTP_SELECTION); +} + +void Winnie::initVars() { + memset(&game, 0, sizeof(game)); + game.fSound = 1; + game.nObjMiss = IDI_WTP_MAX_OBJ_MISSING; + game.nObjRet = 0; + game.fGame[0] = 1; + game.fGame[1] = 1; + room = IDI_WTP_ROOM_HOME; + + mist = -1; + doWind = false; + winnie_event = false; +} + +void Winnie::readRoom(int iRoom, uint8 *buffer, int buflen) { + char szFile[256] = {0}; + sprintf(szFile, IDS_WTP_PATH_ROOM, iRoom); + Common::File file; + if (!file.open(szFile)) + return; + uint32 filelen = file.size(); + memset(buffer, 0, sizeof(buffer)); + file.read(buffer, filelen); + file.close(); +} + +void Winnie::readObj(int iObj, uint8 *buffer, int buflen) { + char szFile[256] = {0}; + sprintf(szFile, IDS_WTP_PATH_OBJ, iObj); + Common::File file; + if (!file.open(szFile)) + return; + uint32 filelen = file.size(); + memset(buffer, 0, sizeof(buffer)); + file.read(buffer, filelen); + file.close(); +} + +void Winnie::randomize() { + int iObj = 0; + int iRoom = 0; + bool done; + + for (int i = 0; i < IDI_WTP_MAX_OBJ_MISSING; i++) { + done = false; + while (!done) { + iObj = _vm->rnd(IDI_WTP_MAX_OBJ - 1) + 2; + done = true; + for (int j = 0; j < IDI_WTP_MAX_OBJ_MISSING; j++) { + if (game.iUsedObj[j] == iObj) { + done = false; + break; + } + } + } + + game.iUsedObj[i] = iObj; + + done = false; + while (!done) { + iRoom = _vm->rnd(IDI_WTP_MAX_ROOM_NORMAL) + 1; + done = true; + for (int j = 0; j < IDI_WTP_MAX_ROOM_OBJ; j++) { + if (game.iObjRoom[j] == iRoom) { + done = false; + break; + } + } + } + + game.iObjRoom[iObj] = iRoom; + } +} + +void Winnie::intro() { + drawPic(IDS_WTP_FILE_LOGO); + _vm->printStr(IDS_WTP_INTRO_0); + _vm->_system->delayMillis(0x640); + drawPic(IDS_WTP_FILE_TITLE); + _vm->printStr(IDS_WTP_INTRO_1); + _vm->_system->delayMillis(0x640); + //if (!Winnie_PlaySound(IDI_WTP_SND_POOH_0)) return; + //if (!Winnie_PlaySound(IDI_WTP_SND_POOH_1)) return; + //if (!Winnie_PlaySound(IDI_WTP_SND_POOH_2)) return; +} + +int Winnie::getObjInRoom(int iRoom) { + for (int iObj = 1; iObj < IDI_WTP_MAX_ROOM_OBJ; iObj++) + if (game.iObjRoom[iObj] == iRoom) + return iObj; + return 0; +} + +#define setTakeDrop() {\ + if (getObjInRoom(room))\ + fCanSel[IDI_WTP_SEL_TAKE] = true;\ + else\ + fCanSel[IDI_WTP_SEL_TAKE] = false;\ + if (game.iObjHave)\ + fCanSel[IDI_WTP_SEL_DROP] = true;\ + else\ + fCanSel[IDI_WTP_SEL_DROP] = false;\ +} + +void Winnie::setFlag(int iFlag) { + game.fGame[iFlag] = 1; +} + +void Winnie::clearFlag(int iFlag) { + game.fGame[iFlag] = 0; +} + +int Winnie::parser(int pc, int index, uint8 *buffer) { + WTP_ROOM_HDR hdr; + int startpc = pc; + int8 opcode; + int iNewRoom = 0; + + int iSel, iDir, iBlock; + int fCanSel[IDI_WTP_SEL_LAST + 1]; + char szMenu[121] = {0}; + bool done; + int fBlock; + + // extract header from buffer + memcpy(&hdr, buffer, sizeof(WTP_ROOM_HDR)); + + for (;;) { + pc = startpc; + + // check if block is to be run + + iBlock = *(buffer + pc++); + if (iBlock == 0) + return IDI_WTP_PAR_OK; + + fBlock = *(buffer + pc++); + if (game.fGame[iBlock] != fBlock) + return IDI_WTP_PAR_OK; + + // extract text from block + + opcode = *(buffer + pc); + switch(opcode) { + case 0: + case IDO_WTP_OPTION_0: + case IDO_WTP_OPTION_1: + case IDO_WTP_OPTION_2: + // clear fCanSel block + memset(fCanSel, 0, sizeof(fCanSel)); + + // check if NSEW directions should be displayed + if (hdr.roomNew[0]) + fCanSel[IDI_WTP_SEL_NORTH] = fCanSel[IDI_WTP_SEL_SOUTH] = + fCanSel[IDI_WTP_SEL_EAST] = fCanSel[IDI_WTP_SEL_WEST] = true; + + // check if object in room or player carrying one + setTakeDrop(); + + // check which rows have a menu option + for (iSel = 0; iSel < IDI_WTP_MAX_OPTION; iSel++) { + opcode = *(buffer + pc++); + if (opcode) { + fCanSel[opcode - IDO_WTP_OPTION_0] = true; + fCanSel[iSel + IDI_WTP_SEL_REAL_OPT_1] = opcode - 0x14; + } + } + + // extract menu string + strcpy(szMenu, (char *)(buffer + pc)); + _vm->XOR80(szMenu); + break; + default: + // print description + _vm->printStrXOR((char *)(buffer + pc)); + if (getSelOkBack()) + return IDI_WTP_PAR_OK; + else + return IDI_WTP_PAR_BACK; + } + + // input handler + + done = false; + while (!done) { + // run wind if it's time + if (doWind) + wind(); + + // get menu selection + getMenuSel(szMenu, &iSel, fCanSel); + + if (++game.nMoves == IDI_WTP_MAX_MOVES_UNTIL_WIND) + doWind = true; + + if (winnie_event && (room <= IDI_WTP_MAX_ROOM_TELEPORT)) { + if (!tigger_mist) { + tigger_mist = 1; + //Winnie_Tigger(); + } else { + tigger_mist = 0; + //Winnie_Mist(); + } + winnie_event = false; + return IDI_WTP_PAR_GOTO; + } + + // process selection + switch(iSel) { + case IDI_WTP_SEL_HOME: + switch(room) { + case IDI_WTP_ROOM_HOME: + case IDI_WTP_ROOM_MIST: + case IDI_WTP_ROOM_TIGGER: + break; + default: + room = IDI_WTP_ROOM_HOME; + return IDI_WTP_PAR_GOTO; + } + break; + case IDI_WTP_SEL_BACK: + return IDI_WTP_PAR_BACK; + case IDI_WTP_SEL_OPT_1: + case IDI_WTP_SEL_OPT_2: + case IDI_WTP_SEL_OPT_3: + done = true; + break; + case IDI_WTP_SEL_NORTH: + case IDI_WTP_SEL_SOUTH: + case IDI_WTP_SEL_EAST: + case IDI_WTP_SEL_WEST: + iDir = iSel - IDI_WTP_SEL_NORTH; + if (hdr.roomNew[iDir] == IDI_WTP_ROOM_NONE) { + _vm->printStr(IDS_WTP_CANT_GO); + _vm->waitAnyKeyChoice(); + } else { + room = hdr.roomNew[iDir]; + return IDI_WTP_PAR_GOTO; + } + break; + case IDI_WTP_SEL_TAKE: + takeObj(room); + setTakeDrop(); + break; + case IDI_WTP_SEL_DROP: + dropObj(room); + setTakeDrop(); + break; + } + } + + // jump to the script block of the selected option + pc = hdr.opt[index].ofsOpt[iSel] - IDI_WTP_OFS_ROOM; + opcode = *(buffer + pc); + if (!opcode) pc++; + + // process script + do { + opcode = *(buffer + pc++); + switch(opcode) { + case IDO_WTP_GOTO_ROOM: + opcode = *(buffer + pc++); + iNewRoom = opcode; + break; + case IDO_WTP_PRINT_MSG: + opcode = *(buffer + pc++); + printRoomStr(room, opcode); + _vm->waitAnyKeyChoice(); + break; + case IDO_WTP_PRINT_STR: + opcode = *(buffer + pc++); + printRoomStr(room, opcode); + break; + case IDO_WTP_DROP_OBJ: + opcode = *(buffer + pc++); + opcode = -1; + dropObjRnd(); + break; + case IDO_WTP_FLAG_CLEAR: + opcode = *(buffer + pc++); + clearFlag(opcode); + break; + case IDO_WTP_FLAG_SET: + opcode = *(buffer + pc++); + setFlag(opcode); + break; + case IDO_WTP_GAME_OVER: + gameOver(); + break; + case IDO_WTP_WALK_MIST: + mist--; + if (!mist) { + room = _vm->rnd(IDI_WTP_MAX_ROOM_TELEPORT) + 1; + return IDI_WTP_PAR_GOTO; + } + break; + case IDO_WTP_PLAY_SOUND: + opcode = *(buffer + pc++); + //Winnie_PlaySound((ENUM_WTP_SOUND)opcode); + break; + case IDO_WTP_SAVE_GAME: + saveGame(); + room = IDI_WTP_ROOM_HOME; + return IDI_WTP_PAR_GOTO; + case IDO_WTP_LOAD_GAME: + loadGame(); + room = IDI_WTP_ROOM_HOME; + return IDI_WTP_PAR_GOTO; + case IDO_WTP_OWL_HELP: + opcode = *(buffer + pc++); + showOwlHelp(); + break; + case IDO_WTP_GOTO_RND: + room = _vm->rnd(IDI_WTP_MAX_ROOM_TELEPORT) + 1; + return IDI_WTP_PAR_GOTO; + default: + opcode = 0; + break; + } + } while (opcode); + + if (iNewRoom) { + room = iNewRoom; + return IDI_WTP_PAR_GOTO; + } + + if (iBlock == 1) + return IDI_WTP_PAR_OK; + } +} + +void Winnie::keyHelp() { + //Winnie_PlaySound(IDI_WTP_SND_KEYHELP); + _vm->printStr(IDS_WTP_HELP_0); + _vm->waitAnyKeyChoice(); + _vm->printStr(IDS_WTP_HELP_1); + _vm->waitAnyKeyChoice(); +} + +void Winnie::inventory() { + char szMissing[41] = {0}; + + if (game.iObjHave) + printObjStr(game.iObjHave, IDI_WTP_OBJ_TAKE); + else { + _vm->clearTextArea(); + _vm->drawStr(IDI_WTP_ROW_MENU, IDI_WTP_COL_MENU, IDA_DEFAULT, IDS_WTP_INVENTORY_0); + } + + sprintf(szMissing, IDS_WTP_INVENTORY_1, game.nObjMiss); + _vm->drawStr(IDI_WTP_ROW_OPTION_4, IDI_WTP_COL_MENU, IDA_DEFAULT, szMissing); + _vm->_gfx->doUpdate(); + _vm->_system->updateScreen(); + _vm->waitAnyKeyChoice(); +} + +void Winnie::printObjStr(int iObj, int iStr) { + WTP_OBJ_HDR hdr; + uint8 *buffer = (uint8 *)malloc(2048); + + readObj(iObj, buffer, 2048); + memcpy(&hdr, buffer, sizeof(hdr)); + _vm->printStrXOR((char *)(buffer + hdr.ofsStr[iStr] - IDI_WTP_OFS_OBJ)); + + free(buffer); +} + +bool Winnie::isRightObj(int iRoom, int iObj, int *iCode) { + WTP_ROOM_HDR roomhdr; + WTP_OBJ_HDR objhdr; + uint8 *roomdata = new uint8[4096]; + uint8 *objdata = new uint8[2048]; + + readRoom(iRoom, roomdata, 4096); + memcpy(&roomhdr, roomdata, sizeof(WTP_ROOM_HDR)); + readObj(iObj, objdata, 2048); + memcpy(&objhdr, objdata, sizeof(WTP_OBJ_HDR)); + + delete [] roomdata; + delete [] objdata; + + *iCode = objhdr.objId; + + if (objhdr.objId == 11) objhdr.objId = 34; + + if (roomhdr.objId == objhdr.objId) + return true; + else + return false; +} + +void Winnie::takeObj(int iRoom) { + if (game.iObjHave) { + // player is already carrying an object, can't take + _vm->printStr(IDS_WTP_CANT_TAKE); + _vm->waitAnyKeyChoice(); + } else { + // take object + int iObj = getObjInRoom(iRoom); + game.iObjHave = iObj; + game.iObjRoom[iObj] = 0; + + _vm->printStr(IDS_WTP_OK); + //Winnie_PlaySound(IDI_WTP_SND_TAKE); + + drawRoomPic(); + + // print object "take" string + printObjStr(game.iObjHave, IDI_WTP_OBJ_TAKE); + _vm->waitAnyKeyChoice(); + + // HACK WARNING + if (iObj == 18) { + game.fGame[0x0d] = 1; + } + } +} + +void Winnie::dropObj(int iRoom) { + int iCode; + + if (getObjInRoom(iRoom)) { + // there already is an object in the room, can't drop + _vm->printStr(IDS_WTP_CANT_DROP); + _vm->waitAnyKeyChoice(); + } else { + // HACK WARNING + if (game.iObjHave == 18) { + game.fGame[0x0d] = 0; + } + + if (isRightObj(iRoom, game.iObjHave, &iCode)) { + // object has been dropped in the right place + _vm->printStr(IDS_WTP_OK); + _vm->waitAnyKeyChoice(); + //Winnie_PlaySound(IDI_WTP_SND_DROP_OK); + printObjStr(game.iObjHave, IDI_WTP_OBJ_DROP); + _vm->waitAnyKeyChoice(); + + // increase amount of objects returned, decrease amount of objects missing + game.nObjMiss--; + game.nObjRet++; + + // xor the dropped object with 0x80 to signify it has been dropped in the right place + for (int i = 0; i < IDI_WTP_MAX_OBJ_MISSING; i++) { + if (game.iUsedObj[i] == game.iObjHave) { + game.iUsedObj[i] ^= 0x80; + break; + } + } + + // set flag according to dropped object's id + game.fGame[iCode] = 1; + + // player is carrying nothing + game.iObjHave = 0; + + if (!game.nObjMiss) { + // all objects returned, tell player to find party + //Winnie_PlaySound(IDI_WTP_SND_FANFARE); + _vm->printStr(IDS_WTP_GAME_OVER_0); + _vm->waitAnyKeyChoice(); + _vm->printStr(IDS_WTP_GAME_OVER_1); + _vm->waitAnyKeyChoice(); + } + } else { + // drop object in the given room + game.iObjRoom[game.iObjHave] = iRoom; + + // object has been dropped in the wrong place + _vm->printStr(IDS_WTP_WRONG_PLACE); + _vm->waitAnyKeyChoice(); + //Winnie_PlaySound(IDI_WTP_SND_DROP); + drawRoomPic(); + _vm->printStr(IDS_WTP_WRONG_PLACE); + _vm->waitAnyKeyChoice(); + + // print object description + printObjStr(game.iObjHave, IDI_WTP_OBJ_DESC); + _vm->waitAnyKeyChoice(); + + game.iObjHave = 0; + } + } +} + +void Winnie::dropObjRnd() { + if (!game.iObjHave) + return; + + int iRoom = 0; + bool done = false; + + while (!done) { + iRoom = _vm->rnd(IDI_WTP_MAX_ROOM_NORMAL); + done = true; + if (iRoom == room) + done = false; + for (int j = 0; j < IDI_WTP_MAX_ROOM_OBJ; j++) { + if (game.iObjRoom[j] == iRoom) { + done = false; + } + } + } + + game.iObjRoom[game.iObjHave] = iRoom; + game.iObjHave = 0; +} + +void Winnie::wind() { + int iRoom = 0; + bool done; + + doWind = 0; + game.nMoves = 0; + if (!game.nObjMiss) + return; + + _vm->printStr(IDS_WTP_WIND_0); + //Winnie_PlaySound(IDI_WTP_SND_WIND_0); + _vm->waitAnyKeyChoice(); + _vm->printStr(IDS_WTP_WIND_1); + //Winnie_PlaySound(IDI_WTP_SND_WIND_0); + _vm->waitAnyKeyChoice(); + + dropObjRnd(); + + // randomize positions of objects at large + for (int i = 0; i < IDI_WTP_MAX_OBJ_MISSING; i++) { + if (!(game.iUsedObj[i] & IDI_XOR_KEY)) { + done = false; + while (!done) { + iRoom = _vm->rnd(IDI_WTP_MAX_ROOM_NORMAL); + done = true; + for (int j = 0; j < IDI_WTP_MAX_ROOM_OBJ; j++) { + if (game.iObjRoom[j] == iRoom) { + done = false; + } + } + } + game.iObjRoom[game.iUsedObj[i]] = iRoom; + } + } +} + +void Winnie::showOwlHelp() { + if (game.iObjHave) { + _vm->printStr(IDS_WTP_OWL_0); + _vm->waitAnyKeyChoice(); + printObjStr(game.iObjHave, IDI_WTP_OBJ_HELP); + _vm->waitAnyKeyChoice(); + } + if (getObjInRoom(room)) { + _vm->printStr(IDS_WTP_OWL_0); + _vm->waitAnyKeyChoice(); + printObjStr(getObjInRoom(room), IDI_WTP_OBJ_HELP); + _vm->waitAnyKeyChoice(); + } +} + + +void Winnie::drawMenu(char *szMenu, int iSel, int fCanSel[]) { + int iRow = 0, iCol = 0; + + _vm->clearTextArea(); + _vm->drawStr(IDI_WTP_ROW_MENU, IDI_WTP_COL_MENU, IDA_DEFAULT, szMenu); + + if (fCanSel[IDI_WTP_SEL_NORTH]) + _vm->drawStr(IDI_WTP_ROW_OPTION_4, IDI_WTP_COL_NSEW, IDA_DEFAULT, IDS_WTP_NSEW); + if (fCanSel[IDI_WTP_SEL_TAKE]) + _vm->drawStr(IDI_WTP_ROW_OPTION_4, IDI_WTP_COL_TAKE, IDA_DEFAULT, IDS_WTP_TAKE); + if (fCanSel[IDI_WTP_SEL_DROP]) + _vm->drawStr(IDI_WTP_ROW_OPTION_4, IDI_WTP_COL_DROP, IDA_DEFAULT, IDS_WTP_DROP); + + switch(iSel) { + case IDI_WTP_SEL_OPT_1: + iRow = IDI_WTP_ROW_OPTION_1; + iCol = IDI_WTP_COL_OPTION; + break; + case IDI_WTP_SEL_OPT_2: + iRow = IDI_WTP_ROW_OPTION_2; + iCol = IDI_WTP_COL_OPTION; + break; + case IDI_WTP_SEL_OPT_3: + iRow = IDI_WTP_ROW_OPTION_3; + iCol = IDI_WTP_COL_OPTION; + break; + case IDI_WTP_SEL_NORTH: + iRow = IDI_WTP_ROW_OPTION_4; + iCol = IDI_WTP_COL_NORTH; + break; + case IDI_WTP_SEL_SOUTH: + iRow = IDI_WTP_ROW_OPTION_4; + iCol = IDI_WTP_COL_SOUTH; + break; + case IDI_WTP_SEL_EAST: + iRow = IDI_WTP_ROW_OPTION_4; + iCol = IDI_WTP_COL_EAST; + break; + case IDI_WTP_SEL_WEST: + iRow = IDI_WTP_ROW_OPTION_4; + iCol = IDI_WTP_COL_WEST; + break; + case IDI_WTP_SEL_TAKE: + iRow = IDI_WTP_ROW_OPTION_4; + iCol = IDI_WTP_COL_TAKE; + break; + case IDI_WTP_SEL_DROP: + iRow = IDI_WTP_ROW_OPTION_4; + iCol = IDI_WTP_COL_DROP; + break; + } + _vm->drawStr(iRow, iCol - 1, IDA_DEFAULT, IDS_WTP_SELECTION); + _vm->_gfx->doUpdate(); + _vm->_system->updateScreen(); // TODO: this should go in the game's main loop +} + +void Winnie::incMenuSel(int *iSel, int fCanSel[]) { + do { + *iSel += 1; + if (*iSel > IDI_WTP_SEL_DROP) *iSel = IDI_WTP_SEL_OPT_1; + } while(!fCanSel[*iSel]); +} + +void Winnie::decMenuSel(int *iSel, int fCanSel[]) { + do { + *iSel -= 1; + if (*iSel < IDI_WTP_SEL_OPT_1) *iSel = IDI_WTP_SEL_DROP; + } while(!fCanSel[*iSel]); +} + +void Winnie::getMenuMouseSel(int *iSel, int fCanSel[], int x, int y) { + switch(y) { + case IDI_WTP_ROW_OPTION_1: + if (fCanSel[IDI_WTP_SEL_OPT_1]) *iSel = IDI_WTP_SEL_OPT_1; + break; + case IDI_WTP_ROW_OPTION_2: + if (fCanSel[IDI_WTP_SEL_OPT_2]) *iSel = IDI_WTP_SEL_OPT_2; + break; + case IDI_WTP_ROW_OPTION_3: + if (fCanSel[IDI_WTP_SEL_OPT_3]) *iSel = IDI_WTP_SEL_OPT_3; + break; + case IDI_WTP_ROW_OPTION_4: + if (fCanSel[IDI_WTP_SEL_NORTH] && (x > IDI_WTP_COL_NORTH - 1) && (x < 6)) *iSel = IDI_WTP_SEL_NORTH; + if (fCanSel[IDI_WTP_SEL_SOUTH] && (x > IDI_WTP_COL_SOUTH - 1) && (x < 13)) *iSel = IDI_WTP_SEL_SOUTH; + if (fCanSel[IDI_WTP_SEL_EAST] && (x > IDI_WTP_COL_EAST - 1) && (x < 19)) *iSel = IDI_WTP_SEL_EAST; + if (fCanSel[IDI_WTP_SEL_WEST] && (x > IDI_WTP_COL_WEST - 1) && (x < 25)) *iSel = IDI_WTP_SEL_WEST; + if (fCanSel[IDI_WTP_SEL_TAKE] && (x > IDI_WTP_COL_TAKE - 1) && (x < 33)) *iSel = IDI_WTP_SEL_TAKE; + if (fCanSel[IDI_WTP_SEL_DROP] && (x > IDI_WTP_COL_DROP - 1) && (x < 39)) *iSel = IDI_WTP_SEL_DROP; + break; + } +} + +#define makeSel() {\ + if (fCanSel[*iSel]) {\ + return;\ + } else {\ + keyHelp();\ + clrMenuSel(iSel, fCanSel);\ + }\ +} + +void Winnie::getMenuSel(char *szMenu, int *iSel, int fCanSel[]) { + Common::Event event; + int x, y; + + clrMenuSel(iSel, fCanSel); + drawMenu(szMenu, *iSel, fCanSel); + + // Show the mouse cursor for the menu + CursorMan.showMouse(true); + + for (;;) { + // check if tigger/mist is to be triggered +// if (something) +// event = true; + + while (_vm->_system->getEventManager()->pollEvent(event)) { + switch(event.type) { + case Common::EVENT_QUIT: + _vm->_system->quit(); + break; + case Common::EVENT_MOUSEMOVE: + x = event.mouse.x / 8; + y = event.mouse.y / 8; + getMenuMouseSel(iSel, fCanSel, x, y); + + // Change cursor + if (fCanSel[IDI_WTP_SEL_NORTH] && (event.mouse.x >= 20 && event.mouse.x <= (IDI_WTP_PIC_WIDTH + 10) * 2) && + (event.mouse.y >= 0 && event.mouse.y <= 10)) { + _vm->_gfx->setCursorPalette(true); + } else if (fCanSel[IDI_WTP_SEL_SOUTH] && (event.mouse.x >= 20 && event.mouse.x <= (IDI_WTP_PIC_WIDTH + 10) * 2) && + (event.mouse.y >= IDI_WTP_PIC_HEIGHT - 10 && event.mouse.y <= IDI_WTP_PIC_HEIGHT)) { + _vm->_gfx->setCursorPalette(true); + } else if (fCanSel[IDI_WTP_SEL_WEST] && (event.mouse.y >= 0 && event.mouse.y <= IDI_WTP_PIC_HEIGHT) && + (event.mouse.x >= 20 && event.mouse.x <= 30)) { + _vm->_gfx->setCursorPalette(true); + } else if (fCanSel[IDI_WTP_SEL_EAST] && (event.mouse.y >= 0 && event.mouse.y <= IDI_WTP_PIC_HEIGHT) && + (event.mouse.x >= IDI_WTP_PIC_WIDTH * 2 && event.mouse.x <= (IDI_WTP_PIC_WIDTH + 10) * 2)) { + _vm->_gfx->setCursorPalette(true); + } else { + _vm->_gfx->setCursorPalette(false); + } + + break; + case Common::EVENT_LBUTTONUP: + // Click to move + if (fCanSel[IDI_WTP_SEL_NORTH] && (event.mouse.x >= 20 && event.mouse.x <= (IDI_WTP_PIC_WIDTH + 10) * 2) && + (event.mouse.y >= 0 && event.mouse.y <= 10)) { + *iSel = IDI_WTP_SEL_NORTH; + makeSel(); + _vm->_gfx->setCursorPalette(false); + return; + } else if (fCanSel[IDI_WTP_SEL_SOUTH] && (event.mouse.x >= 20 && event.mouse.x <= (IDI_WTP_PIC_WIDTH + 10) * 2) && + (event.mouse.y >= IDI_WTP_PIC_HEIGHT - 10 && event.mouse.y <= IDI_WTP_PIC_HEIGHT)) { + *iSel = IDI_WTP_SEL_SOUTH; + makeSel(); + _vm->_gfx->setCursorPalette(false); + return; + } else if (fCanSel[IDI_WTP_SEL_WEST] && (event.mouse.y >= 0 && event.mouse.y <= IDI_WTP_PIC_HEIGHT) && + (event.mouse.x >= 20 && event.mouse.x <= 30)) { + *iSel = IDI_WTP_SEL_WEST; + makeSel(); + _vm->_gfx->setCursorPalette(false); + return; + } else if (fCanSel[IDI_WTP_SEL_EAST] && (event.mouse.y >= 0 && event.mouse.y <= IDI_WTP_PIC_HEIGHT) && + (event.mouse.x >= IDI_WTP_PIC_WIDTH * 2 && event.mouse.x <= (IDI_WTP_PIC_WIDTH + 10) * 2)) { + *iSel = IDI_WTP_SEL_EAST; + makeSel(); + _vm->_gfx->setCursorPalette(false); + return; + } else { + _vm->_gfx->setCursorPalette(false); + } + + switch(*iSel) { + case IDI_WTP_SEL_OPT_1: + case IDI_WTP_SEL_OPT_2: + case IDI_WTP_SEL_OPT_3: + for (int iSel2 = 0; iSel2 < IDI_WTP_MAX_OPTION; iSel2++) { + if (*iSel == (fCanSel[iSel2 + IDI_WTP_SEL_REAL_OPT_1] - 1)) { + *iSel = iSel2; + // Menu selection made, hide the mouse cursor + CursorMan.showMouse(false); + return; + } + } + break; + default: + if (fCanSel[*iSel]) { + // Menu selection made, hide the mouse cursor + CursorMan.showMouse(false); + return; + } + break; + } + break; + case Common::EVENT_RBUTTONUP: + *iSel = IDI_WTP_SEL_BACK; + // Menu selection made, hide the mouse cursor + CursorMan.showMouse(false); + return; + case Common::EVENT_WHEELUP: + decMenuSel(iSel, fCanSel); + break; + case Common::EVENT_WHEELDOWN: + incMenuSel(iSel, fCanSel); + break; + case Common::EVENT_KEYDOWN: + switch (event.kbd.keycode) { + case Common::KEYCODE_ESCAPE: + *iSel = IDI_WTP_SEL_HOME; + // Menu selection made, hide the mouse cursor + CursorMan.showMouse(false); + return; + case Common::KEYCODE_BACKSPACE: + *iSel = IDI_WTP_SEL_BACK; + // Menu selection made, hide the mouse cursor + CursorMan.showMouse(false); + return; + case Common::KEYCODE_c: + inventory(); + break; + case Common::KEYCODE_SPACE: + case Common::KEYCODE_RIGHT: + case Common::KEYCODE_DOWN: + incMenuSel(iSel, fCanSel); + break; + case Common::KEYCODE_LEFT: + case Common::KEYCODE_UP: + decMenuSel(iSel, fCanSel); + break; + case Common::KEYCODE_1: + case Common::KEYCODE_2: + case Common::KEYCODE_3: + *iSel = event.kbd.keycode - Common::KEYCODE_1; + if (fCanSel[*iSel + IDI_WTP_SEL_REAL_OPT_1]) { + // Menu selection made, hide the mouse cursor + CursorMan.showMouse(false); + return; + } else { + keyHelp(); + clrMenuSel(iSel, fCanSel); + } + break; + case Common::KEYCODE_n: + *iSel = IDI_WTP_SEL_NORTH; + makeSel(); + break; + case Common::KEYCODE_s: + if (event.kbd.flags & Common::KBD_CTRL) { + //FlipSound(); + } else { + *iSel = IDI_WTP_SEL_SOUTH; + makeSel(); + } + break; + case Common::KEYCODE_e: + *iSel = IDI_WTP_SEL_EAST; + makeSel(); + break; + case Common::KEYCODE_w: + *iSel = IDI_WTP_SEL_WEST; + makeSel(); + break; + case Common::KEYCODE_t: + *iSel = IDI_WTP_SEL_TAKE; + makeSel(); + break; + case Common::KEYCODE_d: + *iSel = IDI_WTP_SEL_DROP; + makeSel(); + break; + case Common::KEYCODE_RETURN: + switch(*iSel) { + case IDI_WTP_SEL_OPT_1: + case IDI_WTP_SEL_OPT_2: + case IDI_WTP_SEL_OPT_3: + for (int iSel2 = 0; iSel2 < IDI_WTP_MAX_OPTION; iSel2++) { + if (*iSel == (fCanSel[iSel2 + IDI_WTP_SEL_REAL_OPT_1] - 1)) { + *iSel = iSel2; + // Menu selection made, hide the mouse cursor + CursorMan.showMouse(false); + return; + } + } + break; + default: + if (fCanSel[*iSel]) { + // Menu selection made, hide the mouse cursor + CursorMan.showMouse(false); + return; + } + break; + } + default: + keyHelp(); + clrMenuSel(iSel, fCanSel); + break; + } + break; + default: + break; + } + + drawMenu(szMenu, *iSel, fCanSel); + } + } +} + +void Winnie::gameLoop() { + WTP_ROOM_HDR hdr; + uint8 *roomdata = new uint8[4096]; + int iBlock; + +phase0: + if (!game.nObjMiss && (room == IDI_WTP_ROOM_PICNIC)) + room = IDI_WTP_ROOM_PARTY; + readRoom(room, roomdata, 4096); + memcpy(&hdr, roomdata, sizeof(WTP_ROOM_HDR)); + drawRoomPic(); +phase1: + if (getObjInRoom(room)) { + printObjStr(getObjInRoom(room), IDI_WTP_OBJ_DESC); + _vm->waitAnyKeyChoice(); + } +phase2: + for (iBlock = 0; iBlock < IDI_WTP_MAX_BLOCK; iBlock++) { + if (parser(hdr.ofsDesc[iBlock] - IDI_WTP_OFS_ROOM, iBlock, roomdata) == IDI_WTP_PAR_BACK) { + goto phase1; + } + } + for (;;) { + for (iBlock = 0; iBlock < IDI_WTP_MAX_BLOCK; iBlock++) { + switch(parser(hdr.ofsBlock[iBlock] - IDI_WTP_OFS_ROOM, iBlock, roomdata)) { + case IDI_WTP_PAR_GOTO: + goto phase0; + break; + case IDI_WTP_PAR_BACK: + goto phase2; + break; + } + } + } + + delete [] roomdata; +} + +void Winnie::drawPic(const char *szName) { + char szFile[256] = {0}; + uint8 *buffer = new uint8[4096]; + + // construct filename + sprintf(szFile, IDS_WTP_PATH, szName); + Common::File file; + if (!file.open(szName)) + return; + uint32 size = file.size(); + file.read(buffer, size); + file.close(); + + _vm->_picture->decodePicture(buffer, size, 1, IDI_WTP_PIC_WIDTH, IDI_WTP_PIC_HEIGHT); + _vm->_picture->showPic(IDI_WTP_PIC_X0, IDI_WTP_PIC_Y0, IDI_WTP_PIC_WIDTH, IDI_WTP_PIC_HEIGHT); + _vm->_gfx->doUpdate(); + _vm->_system->updateScreen(); // TODO: this should go in the game's main loop + + delete [] buffer; +} + +void Winnie::drawObjPic(int iObj, int x0, int y0) { + WTP_OBJ_HDR objhdr; + uint8 *buffer = new uint8[2048]; + + if (!iObj) + return; + + readObj(iObj, buffer, 2048); + memcpy(&objhdr, buffer, sizeof(WTP_OBJ_HDR)); + + _vm->_picture->setOffset(x0, y0); + _vm->_picture->decodePicture(buffer + objhdr.ofsPic - IDI_WTP_OFS_OBJ, 4096, 0, IDI_WTP_PIC_WIDTH, IDI_WTP_PIC_HEIGHT); + _vm->_picture->setOffset(0, 0); + _vm->_picture->showPic(10, 0, IDI_WTP_PIC_WIDTH, IDI_WTP_PIC_HEIGHT); + _vm->_gfx->doUpdate(); + _vm->_system->updateScreen(); + + delete [] buffer; +} + +void Winnie::drawRoomPic() { + WTP_ROOM_HDR roomhdr; + uint8 *buffer = new uint8[4096]; + int iObj = getObjInRoom(room); + + // clear gfx screen + _vm->_gfx->clearScreen(0); + _vm->_gfx->doUpdate(); + _vm->_system->updateScreen(); // TODO: this should go in the game's main loop + + // read room picture + readRoom(room, buffer, 4096); + memcpy(&roomhdr, buffer, sizeof(WTP_ROOM_HDR)); + + // draw room picture + _vm->_picture->decodePicture(buffer + roomhdr.ofsPic - IDI_WTP_OFS_ROOM, 4096, 1, IDI_WTP_PIC_WIDTH, IDI_WTP_PIC_HEIGHT); + _vm->_picture->showPic(IDI_WTP_PIC_X0, IDI_WTP_PIC_Y0, IDI_WTP_PIC_WIDTH, IDI_WTP_PIC_HEIGHT); + _vm->_gfx->doUpdate(); + _vm->_system->updateScreen(); // TODO: this should go in the game's main loop + + // draw object picture + drawObjPic(iObj, IDI_WTP_PIC_X0 + roomhdr.objX, IDI_WTP_PIC_Y0 + roomhdr.objY); + + delete [] buffer; +} + +bool Winnie::getSelOkBack() { + Common::Event event; + + for (;;) { + while (_vm->_system->getEventManager()->pollEvent(event)) { + switch (event.type) { + case Common::EVENT_QUIT: + _vm->_system->quit(); + break; + case Common::EVENT_LBUTTONUP: + return true; + case Common::EVENT_RBUTTONUP: + return false; + case Common::EVENT_KEYDOWN: + switch (event.kbd.keycode) { + case Common::KEYCODE_BACKSPACE: + return false; + default: + return true; + } + default: + break; + } + } + } +} +void Winnie::clrMenuSel(int *iSel, int fCanSel[]) { + *iSel = IDI_WTP_SEL_OPT_1; + while(!fCanSel[*iSel]) { + *iSel += 1; + } +} + +void Winnie::printRoomStr(int iRoom, int iStr) { + WTP_ROOM_HDR hdr; + uint8 *buffer = (uint8 *)malloc(4096); + + readRoom(iRoom, buffer, 4096); + memcpy(&hdr, buffer, sizeof(hdr)); + _vm->printStrXOR((char *)(buffer + hdr.ofsStr[iStr - 1] - IDI_WTP_OFS_ROOM)); + + free(buffer); +} + +void Winnie::gameOver() { + // sing the Pooh song forever + for (;;) { + _vm->printStr(IDS_WTP_SONG_0); + //Winnie_PlaySound(IDI_WTP_SND_POOH_0); + _vm->printStr(IDS_WTP_SONG_1); + //Winnie_PlaySound(IDI_WTP_SND_POOH_1); + _vm->printStr(IDS_WTP_SONG_2); + //Winnie_PlaySound(IDI_WTP_SND_POOH_2); + _vm->waitAnyKeyChoice(); + } +} + +void Winnie::saveGame() { + uint8 *buffer = new uint8[sizeof(WTP_SAVE_GAME)]; + memcpy(buffer, &game, sizeof(WTP_SAVE_GAME)); + writeSaveGame(buffer); + delete [] buffer; +} + +void Winnie::loadGame() { + uint8 *buffer = new uint8[sizeof(WTP_SAVE_GAME)]; + readSaveGame(buffer); + memcpy(&game, buffer, sizeof(WTP_SAVE_GAME)); + delete [] buffer; +} + +void Winnie::readSaveGame(uint8 *buffer) { + Common::InSaveFile* infile; + char szFile[256] = {0}; + sprintf(szFile, IDS_WTP_FILE_SAVEGAME); + if (!(infile = _vm->getSaveFileMan()->openForLoading(szFile))) + return; + infile->read(buffer, sizeof(WTP_SAVE_GAME)); + delete infile; +} + +void Winnie::writeSaveGame(uint8 *buffer) { + Common::OutSaveFile* outfile; + char szFile[256] = {0}; + sprintf(szFile, IDS_WTP_FILE_SAVEGAME); + if (!(outfile = _vm->getSaveFileMan()->openForSaving(szFile))) + return; + outfile->write(buffer, sizeof(WTP_SAVE_GAME)); + delete outfile; +} + +Winnie::Winnie(PreAgiEngine* vm) : _vm(vm) { + +} + +void Winnie::init() { + initEngine(); + initVars(); +} + +void Winnie::run() { + randomize(); + intro(); + gameLoop(); +} + +} diff --git a/engines/agi/preagi_winnie.h b/engines/agi/preagi_winnie.h new file mode 100644 index 0000000000..625795d7e1 --- /dev/null +++ b/engines/agi/preagi_winnie.h @@ -0,0 +1,352 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * $URL$ + * $Id$ + * + */ + +#ifndef AGI_PREAGI_WINNIE_H +#define AGI_PREAGI_WINNIE_H + +#include "agi/agi.h" + +namespace Agi { + +// strings + +#define IDS_WTP_SELECTION ">" + +#define IDS_WTP_PATH_ROOM "rooms\\rm.%02d" +#define IDS_WTP_PATH_OBJ "obj.%02d" +#define IDS_WTP_PATH_SND "snd.%02d" +#define IDS_WTP_PATH "%s" + +#define IDS_WTP_FILE_LOGO "logo.pic" +#define IDS_WTP_FILE_TITLE "title.pic" +#define IDS_WTP_FILE_SAVEGAME "savegame" +#define IDS_WTP_FILE_RND "rnd" + +#define IDS_WTP_DISK_ERROR "There is a problem with your disk drive.Please make sure your Winnie-the-Pooh disk is in the drive correctly." + +#define IDS_WTP_INTRO_0 " PRESENT" +#define IDS_WTP_INTRO_1 " TM designates trademark of\n Sierra On-Line, Inc.\n (c) 1985 Walt Disney Productions" + +#define IDS_WTP_HELP_0 "The <SPACE BAR> moves the pointer. Press <RETURN> when it is by the choice you want. Press the <Backspace> key to see what you just finished reading." +#define IDS_WTP_HELP_1 "Press <C> to see what you are carrying. <Ctrl-S> turns the sound off and on. <ESC> takes you to the playroom (in caseyou get lost or want to save the game)." + +#define IDS_WTP_GAME_OVER_0 "Congratulations!! You did it! You returned everything that was lost. Now,Christopher Robin invites you to a Hero party." +#define IDS_WTP_GAME_OVER_1 "The good news is: YOU are the Hero!! The bad news is: you have to find the party by yourself. Good luck!" + +#define IDS_WTP_OWL_0 "\"For example, that object you are carrying now is interesting. I know I've seen it before. Hmmm. Let me think about this . . .\"" +#define IDS_WTP_OWL_1 "\"You know, this object here beside me isfamiliar. I'm sure I could give you some sort of clue about it. Let me see. . .\"" + +#define IDS_WTP_WIND_0 "Oh, no! The Blustery Wind begins to howl. It has returned, and mixed up all the objects in the Wood." +#define IDS_WTP_WIND_1 "But don't worry. Everyone still has theobjects you returned to them.\n\n (Today must be Winds-day!)" +#define IDS_WTP_TIGGER "\"Hallooooo, there!!!! It's ME, Tigger! Let's BOUNCE!\"" +#define IDS_WTP_MIST "Oh, look out! The mysterious mist is coming in. It gets so thick that you can't see through it. Just keep walkingand it will soon clear up." + +#define IDS_WTP_SONG_0 "Winnie-the-Pooh, Winnie-the-Pooh, Tubby little cubby all stuffed with fluff, He's Winnie-the-Pooh, Winnie-the-Pooh, Willy, nilly, silly, old bear." +#define IDS_WTP_SONG_1 "Deep in the Hundred Acre Wood, Where Christopher Robin plays, You will find the enchanted neighborhoodof Christopher's childhood days." +#define IDS_WTP_SONG_2 "A donkey named Eeyore is his friend, and Kanga and little Roo. There's Rabbit and Piglet and there's Owl But most of all Winnie-the-Pooh!" + +#define IDS_WTP_NSEW "North South East West" +#define IDS_WTP_TAKE "Take" +#define IDS_WTP_DROP "Drop" +#define IDS_WTP_CANT_GO "\nSorry, but you can't go that way." +#define IDS_WTP_CANT_TAKE "You can't take it. You can only carry one object at a time." +#define IDS_WTP_CANT_DROP "You can't drop it. Another object is already here." +#define IDS_WTP_WRONG_PLACE "\nOk, but it doesn't belong here." +#define IDS_WTP_OK "\nOk." + +#define IDS_WTP_INVENTORY_0 "You are carrying nothing." +#define IDS_WTP_INVENTORY_1 "Number of objects still missing: %d" + +// COMMODORE 64 version strings + +#define IDS_WTP_PATH_ROOM_C64 "%sroom%02d" +#define IDS_WTP_PATH_OBJ_C64 "%sobject%02d" +#define IDS_WTP_PATH_SND_C64 "%ssound.obj" +#define IDS_WTP_FILE_SAVEGAME_C64 "saved game" +#define IDS_WTP_DISK_ERROR_C64 "There is a problem with your disk drive.Please make sure your disk is in the drive correctly." +#define IDS_WTP_HELP_0_C64 "The <SPACE BAR> moves the pointer. Press <RETURN> when it is by the choice you want. <F1> brings back what you have already read." +#define IDS_WTP_HELP_1_C64 "<F3> takes you back to the playroom (if you get lost, or want to save the game).<F5> turns the sound off and on. <F7> shows what you're carrying." +#define IDS_WTP_WRONG_PLACE_C64 "\nOk, but this is not the right place." + +// maximum values + +#define IDI_WTP_MAX_OBJ_MISSING 10 + +#define IDI_WTP_MAX_ROOM 62 +#define IDI_WTP_MAX_OBJ 40 +#define IDI_WTP_MAX_SND 14 +#define IDI_WTP_MAX_PIC 2 + +#define IDI_WTP_MAX_ROOM_NORMAL 57 +#define IDI_WTP_MAX_ROOM_TELEPORT 30 +#define IDI_WTP_MAX_ROOM_OBJ 42 +#define IDI_WTP_MAX_BLOCK 4 +#define IDI_WTP_MAX_STR 6 +#define IDI_WTP_MAX_OBJ_STR 4 +#define IDI_WTP_MAX_OBJ_STR_END 2 +#define IDI_WTP_MAX_FLAG 40 +#define IDI_WTP_MAX_OPTION 3 +#define IDI_WTP_MAX_DIR 4 +#define IDI_WTP_MAX_MOVES_UNTIL_WIND 150 + +// positions + +#define IDI_WTP_ROW_MENU 21 +#define IDI_WTP_ROW_OPTION_1 21 +#define IDI_WTP_ROW_OPTION_2 22 +#define IDI_WTP_ROW_OPTION_3 23 +#define IDI_WTP_ROW_OPTION_4 24 + +#define IDI_WTP_COL_MENU 0 +#define IDI_WTP_COL_OPTION 1 +#define IDI_WTP_COL_NSEW 1 +#define IDI_WTP_COL_NORTH 1 +#define IDI_WTP_COL_SOUTH 8 +#define IDI_WTP_COL_EAST 15 +#define IDI_WTP_COL_WEST 21 +#define IDI_WTP_COL_TAKE 29 +#define IDI_WTP_COL_DROP 35 +#define IDI_WTP_COL_PRESENT 17 + +// data file offset modifiers + +#define IDI_WTP_OFS_ROOM 0x5400 +#define IDI_WTP_OFS_OBJ 0x0800 + +// picture + +#define IDI_WTP_PIC_WIDTH 140 +#define IDI_WTP_PIC_HEIGHT 159 +#define IDI_WTP_PIC_X0 10 +#define IDI_WTP_PIC_Y0 0 +#define IDI_WTP_PIC_FLAGS IDF_AGI_PIC_V2 + +// selections + +enum { + IDI_WTP_SEL_HOME = -2, + IDI_WTP_SEL_BACK, + IDI_WTP_SEL_OPT_1, + IDI_WTP_SEL_OPT_2, + IDI_WTP_SEL_OPT_3, + IDI_WTP_SEL_NORTH, + IDI_WTP_SEL_SOUTH, + IDI_WTP_SEL_EAST, + IDI_WTP_SEL_WEST, + IDI_WTP_SEL_TAKE, + IDI_WTP_SEL_DROP, + IDI_WTP_SEL_REAL_OPT_1, + IDI_WTP_SEL_REAL_OPT_2, + IDI_WTP_SEL_REAL_OPT_3 +}; + +#define IDI_WTP_SEL_LAST IDI_WTP_SEL_REAL_OPT_3 + +// rooms + +enum { + IDI_WTP_ROOM_NONE = -1, + IDI_WTP_ROOM_NORTH, + IDI_WTP_ROOM_SOUTH, + IDI_WTP_ROOM_EAST, + IDI_WTP_ROOM_WEST +}; + +#define IDI_WTP_ROOM_HIDE 0 + +#define IDI_WTP_ROOM_PICNIC 2 +#define IDI_WTP_ROOM_HOME 28 +#define IDI_WTP_ROOM_PARTY 58 +#define IDI_WTP_ROOM_MIST 59 +#define IDI_WTP_ROOM_TIGGER 61 + +// sound + +enum ENUM_WTP_SOUND { + IDI_WTP_SND_POOH_0 = 1, + IDI_WTP_SND_TIGGER, + IDI_WTP_SND_TAKE, + IDI_WTP_SND_DROP, + IDI_WTP_SND_DROP_OK, + IDI_WTP_SND_FANFARE, + IDI_WTP_SND_POOH_1, + IDI_WTP_SND_KEYHELP, + IDI_WTP_SND_POOH_2, + IDI_WTP_SND_WIND_0, + IDI_WTP_SND_WIND_1 +}; + +// script opcodes + +#define IDO_WTP_GOTO_ROOM 0x06 +#define IDO_WTP_PRINT_MSG 0x08 +#define IDO_WTP_PRINT_STR 0x0A +#define IDO_WTP_DROP_OBJ 0x0C +#define IDO_WTP_FLAG_CLEAR 0x0E +#define IDO_WTP_FLAG_SET 0x10 +#define IDO_WTP_GAME_OVER 0x12 +#define IDO_WTP_WALK_MIST 0x14 +#define IDO_WTP_PLAY_SOUND 0x16 +#define IDO_WTP_SAVE_GAME 0x18 +#define IDO_WTP_LOAD_GAME 0x1A +#define IDO_WTP_OWL_HELP 0x1C +#define IDO_WTP_GOTO_RND 0x1E + +#define IDO_WTP_OPTION_0 0x15 +#define IDO_WTP_OPTION_1 0x16 +#define IDO_WTP_OPTION_2 0x17 + +enum { + IDI_WTP_OBJ_DESC = 0, + IDI_WTP_OBJ_TAKE, + IDI_WTP_OBJ_DROP, + IDI_WTP_OBJ_HELP +}; + +enum { + IDI_WTP_PAR_OK = 0, + IDI_WTP_PAR_GOTO, + IDI_WTP_PAR_BACK +}; + +// room file option block + +struct WTP_ROOM_BLOCK { + uint16 ofsOpt[IDI_WTP_MAX_BLOCK]; +}; + +// room file header + +struct WTP_ROOM_HDR { + uint8 roomNumber; + uint8 objId; + uint16 ofsPic; + uint16 fileLen; + uint16 reserved0; + int8 roomNew[IDI_WTP_MAX_DIR]; + uint8 objX; + uint8 objY; + uint16 reserved1; + uint16 ofsDesc[IDI_WTP_MAX_BLOCK]; + uint16 ofsBlock[IDI_WTP_MAX_BLOCK]; + uint16 ofsStr[IDI_WTP_MAX_STR]; + uint32 reserved2; + WTP_ROOM_BLOCK opt[IDI_WTP_MAX_BLOCK]; +}; + +// object file header + +struct WTP_OBJ_HDR { + uint16 fileLen; + uint16 objId; + uint16 ofsEndStr[IDI_WTP_MAX_OBJ_STR_END]; + uint16 ofsStr[IDI_WTP_MAX_OBJ_STR]; + uint16 ofsPic; +}; + +// savegame + +struct WTP_SAVE_GAME { + uint16 reserved0; // 10c2 unused + uint16 fSound; // 10c4 + uint16 nMoves; // 10c6 + uint16 nObjMiss; // 10c8 + uint16 nObjRet; // 10ca + uint16 reserved1; // 10ce unused + uint16 reserved2; // 10cf unused + uint16 reserved3; // 10d0 unused + uint16 iObjHave; // 10d2 + uint16 o10d4; // 10d4 can be ignored + uint16 o10d6; // 10d6 can be ignored + uint16 o10d8; // 10d8 can be ignored + uint8 fGame[IDI_WTP_MAX_FLAG]; // 10da + uint8 iUsedObj[IDI_WTP_MAX_OBJ_MISSING]; // 1102 + uint8 iObjRoom[IDI_WTP_MAX_ROOM_OBJ]; // 110c + uint16 o1136; // 1136 can be ignored + uint16 o1138; // 1138 can be ignored +}; + +#define IDI_XOR_KEY 0x80 + +class Winnie { + friend class PreAgiEngine; +public: + Winnie(PreAgiEngine *vm); + //~Winnie(); + + void init(); + void run(); + +private: + PreAgiEngine *_vm; + WTP_SAVE_GAME game; + int room; + int mist; + bool doWind; + bool winnie_event; + int tigger_mist; + + void initEngine(); + void initVars(); + void randomize(); + void intro(); + void drawPic(const char*); + void gameLoop(); + void readRoom(int, uint8*, int); + void drawRoomPic(); + int parser(int, int, uint8*); + int getObjInRoom(int); + bool getSelOkBack(); + void getMenuSel(char*, int*, int[]); + void keyHelp(); + void clrMenuSel(int*, int[]); + void incMenuSel(int*, int[]); + void decMenuSel(int*, int[]); + void drawMenu(char*, int, int[]); + void printRoomStr(int, int); + void inventory(); + void printObjStr(int, int); + void readObj(int, uint8*, int); + void takeObj(int); + void dropObj(int); + bool isRightObj(int, int, int*); + void drawObjPic(int, int, int); + void getMenuMouseSel(int*, int[], int, int); + void setFlag(int); + void clearFlag(int); + void gameOver(); + void saveGame(); + void loadGame(); + void writeSaveGame(uint8*); + void readSaveGame(uint8*); + void dropObjRnd(); + void wind(); + void showOwlHelp(); +}; + +} // End of namespace Agi + +#endif + diff --git a/engines/agi/predictive.cpp b/engines/agi/predictive.cpp index eef4360cbf..5ffa3d159f 100644 --- a/engines/agi/predictive.cpp +++ b/engines/agi/predictive.cpp @@ -199,7 +199,8 @@ bool AgiEngine::predictiveDialog(void) { color2 = 7; } - bool _addIsActive = false; // FIXME + // needs fixing, or remove it! + bool _addIsActive = false; // FIXME: word adding is not implemented if (i == 10 && !_addIsActive) { // Add color2 = 7; } diff --git a/engines/agi/saveload.cpp b/engines/agi/saveload.cpp index 05ce80b1a3..c8cae3b479 100644 --- a/engines/agi/saveload.cpp +++ b/engines/agi/saveload.cpp @@ -525,7 +525,7 @@ int AgiEngine::selectSlot() { int oldActive = active + 1; for (;;) { - int sbPos; + int sbPos = 0; if (oldFirstSlot != _firstSlot || oldActive != active) { char dstr[64]; diff --git a/engines/agi/sound.cpp b/engines/agi/sound.cpp index b083b77440..b76ab309a5 100644 --- a/engines/agi/sound.cpp +++ b/engines/agi/sound.cpp @@ -25,6 +25,10 @@ #include "common/stdafx.h" +#include "common/md5.h" +#include "common/config-manager.h" +#include "common/fs.h" +#include "common/algorithm.h" #include "sound/mixer.h" #include "agi/agi.h" @@ -33,204 +37,241 @@ namespace Agi { #define USE_INTERPOLATION -#define USE_CHORUS +static bool g_useChorus = true; /* TODO: add support for variable sampling rate in the output device */ -#ifdef USE_IIGS_SOUND +AgiSound *AgiSound::createFromRawResource(uint8 *data, uint32 len, int resnum, SoundMgr &manager) { + if (data == NULL || len < 2) return NULL; // Check for too small resource or no resource at all + uint16 type = READ_LE_UINT16(data); + + switch (type) { // Create a sound object based on the type + case AGI_SOUND_SAMPLE : return new IIgsSample(data, len, resnum, manager); + case AGI_SOUND_MIDI : return new IIgsMidi (data, len, resnum, manager); + case AGI_SOUND_4CHN : return new PCjrSound (data, len, resnum, manager); + } + + warning("Sound resource (%d) has unknown type (0x%04x). Not using the sound", resnum, type); + return NULL; +} -struct IIgsEnvelopeSegment { - uint8 bp; - uint16 inc; ///< 8b.8b fixed point, big endian? -}; +IIgsMidi::IIgsMidi(uint8 *data, uint32 len, int resnum, SoundMgr &manager) : AgiSound(manager) { + _data = data; // Save the resource pointer + _ptr = _data + 2; // Set current position to just after the header + _len = len; // Save the resource's length + _type = READ_LE_UINT16(data); // Read sound resource's type + _isValid = (_type == AGI_SOUND_MIDI) && (_data != NULL) && (_len >= 2); -#define ENVELOPE_SEGMENT_COUNT 8 -struct IIgsEnvelope { - IIgsEnvelopeSegment seg[ENVELOPE_SEGMENT_COUNT]; -}; + if (!_isValid) // Check for errors + warning("Error creating Apple IIGS midi sound from resource %d (Type %d, length %d)", resnum, _type, len); +} -// 2**(1/12) i.e. the 12th root of 2 -#define SEMITONE 1.059463094359295 - -struct IIgsWaveInfo { - uint8 top; - uint8 addr; - uint8 size; -// Oscillator channel (Bits 4-7 of mode-byte). Simplified to use only stereo here. -#define MASK_OSC_CHANNEL (1 << 4) -#define OSC_CHANNEL_LEFT (1 << 4) -#define OSC_CHANNEL_RIGHT (0 << 4) -// Oscillator halt bit (Bit 0 of mode-byte) -#define MASK_OSC_HALT (1 << 0) -#define OSC_HALT (1 << 0) -// Oscillator mode (Bits 1 and 2 of mode-byte) -#define MASK_OSC_MODE (3 << 1) -#define OSC_MODE_LOOP (0 << 1) -#define OSC_MODE_ONESHOT (1 << 1) -#define OSC_MODE_SYNC_AM (2 << 1) -#define OSC_MODE_SWAP (3 << 1) - uint8 mode; - uint16 relPitch; ///< 8b.8b fixed point, big endian? -}; +PCjrSound::PCjrSound(uint8 *data, uint32 len, int resnum, SoundMgr &manager) : AgiSound(manager) { + _data = data; // Save the resource pointer + _len = len; // Save the resource's length + _type = READ_LE_UINT16(data); // Read sound resource's type + _isValid = (_type == AGI_SOUND_4CHN) && (_data != NULL) && (_len >= 2); -#define MAX_WAVE_COUNT 8 -struct IIgsInstrumentHeader { - IIgsEnvelope env; - uint8 relseg; - uint8 priority; - uint8 bendrange; - uint8 vibdepth; - uint8 vibspeed; - uint8 spare; - uint8 wac; - uint8 wbc; - IIgsWaveInfo wal[MAX_WAVE_COUNT]; - IIgsWaveInfo wbl[MAX_WAVE_COUNT]; -}; + if (!_isValid) // Check for errors + warning("Error creating PCjr 4-channel sound from resource %d (Type %d, length %d)", resnum, _type, len); +} -struct IIgsSampleHeader { - uint16 type; - uint8 pitch; ///< Logarithmic, base is 2**(1/12), unknown multiplier (Possibly in range 1040-1080) - uint8 unknownByte_Ofs3; // 0x7F in Gold Rush's sound resource 60, 0 in all others. - uint8 volume; ///< Current guess: Logarithmic in 6 dB steps - uint8 unknownByte_Ofs5; ///< 0 in all tested samples. - uint16 instrumentSize; ///< Little endian. 44 in all tested samples. A guess. - uint16 sampleSize; ///< Little endian. Accurate in all tested samples excluding Manhunter I's sound resource 16. - IIgsInstrumentHeader instrument; -}; +const uint8 *PCjrSound::getVoicePointer(uint voiceNum) { + assert(voiceNum < 4); + uint16 voiceStartOffset = READ_LE_UINT16(_data + voiceNum * 2); + return _data + voiceStartOffset; +} -#if 0 -static SoundInstrument *instruments; -static int numInstruments; -static uint8 *wave; -#endif +IIgsSample::IIgsSample(uint8 *data, uint32 len, int resnum, SoundMgr &manager) : AgiSound(manager) { + Common::MemoryReadStream stream(data, len, true); -bool readIIgsEnvelope(IIgsEnvelope &envelope, Common::SeekableReadStream &stream) { + // Check that the header was read ok and that it's of the correct type + if (_header.read(stream) && _header.type == AGI_SOUND_SAMPLE) { // An Apple IIGS AGI sample resource + uint32 sampleStartPos = stream.pos(); + uint32 tailLen = stream.size() - sampleStartPos; + + if (tailLen < _header.sampleSize) { // Check if there's no room for the sample data in the stream + // Apple IIGS Manhunter I: Sound resource 16 has only 16074 bytes + // of sample data although header says it should have 16384 bytes. + warning("Apple IIGS sample (%d) too short (%d bytes. Should be %d bytes). Using the part that's left", + resnum, tailLen, _header.sampleSize); + _header.sampleSize = (uint16) tailLen; // Use the part that's left + } + + if (_header.pitch > 0x7F) { // Check if the pitch is invalid + warning("Apple IIGS sample (%d) has too high pitch (0x%02x)", resnum, _header.pitch); + _header.pitch &= 0x7F; // Apple IIGS AGI probably did it this way too + } + + // Finalize the header info using the 8-bit unsigned sample data + _header.finalize(stream); + + // Convert sample data from 8-bit unsigned to 16-bit signed format + stream.seek(sampleStartPos); + _sample = new int16[_header.sampleSize]; + if (_sample != NULL) + _isValid = _manager.convertWave(stream, _sample, _header.sampleSize); + } + + if (!_isValid) // Check for errors + warning("Error creating Apple IIGS sample from resource %d (Type %d, length %d)", resnum, _header.type, len); +} + +/** Reads an Apple IIGS envelope from then given stream. */ +bool IIgsEnvelope::read(Common::SeekableReadStream &stream) { for (int segNum = 0; segNum < ENVELOPE_SEGMENT_COUNT; segNum++) { - envelope.seg[segNum].bp = stream.readByte(); - envelope.seg[segNum].inc = stream.readUint16BE(); + seg[segNum].bp = stream.readByte(); + seg[segNum].inc = stream.readUint16LE(); } return !stream.ioFailed(); } -bool readIIgsWaveInfo(IIgsWaveInfo &waveInfo, Common::SeekableReadStream &stream) { - waveInfo.top = stream.readByte(); - waveInfo.addr = stream.readByte(); - waveInfo.size = stream.readByte(); - waveInfo.mode = stream.readByte(); - waveInfo.relPitch = stream.readUint16BE(); +/** Reads an Apple IIGS wave information structure from the given stream. */ +bool IIgsWaveInfo::read(Common::SeekableReadStream &stream, bool ignoreAddr) { + top = stream.readByte(); + addr = stream.readByte() * 256; + size = (1 << (stream.readByte() & 7)) * 256; + + // Read packed mode byte and parse it into parts + byte packedModeByte = stream.readByte(); + channel = (packedModeByte >> 4) & 1; // Bit 4 + mode = (packedModeByte >> 1) & 3; // Bits 1-2 + halt = (packedModeByte & 1) != 0; // Bit 0 (Converted to boolean) + + relPitch = stream.readSint16LE(); + + // Zero the wave address if we want to ignore the wave address info + if (ignoreAddr) + addr = 0; + return !stream.ioFailed(); } -/** - * Read an Apple IIGS instrument header from the given stream. - * @param header The header to which to write the data. - * @param stream The source stream from which to read the data. - * @return True if successful, false otherwise. - */ -bool readIIgsInstrumentHeader(IIgsInstrumentHeader &header, Common::SeekableReadStream &stream) { - readIIgsEnvelope(header.env, stream); - header.relseg = stream.readByte(); - header.priority = stream.readByte(); - header.bendrange = stream.readByte(); - header.vibdepth = stream.readByte(); - header.vibspeed = stream.readByte(); - header.spare = stream.readByte(); - header.wac = stream.readByte(); - header.wbc = stream.readByte(); - for (int waveA = 0; waveA < header.wac; waveA++) // Read A wave lists - readIIgsWaveInfo(header.wal[waveA], stream); - for (int waveB = 0; waveB < header.wbc; waveB++) // Read B wave lists - readIIgsWaveInfo(header.wbl[waveB], stream); - return !stream.ioFailed(); +bool IIgsWaveInfo::finalize(Common::SeekableReadStream &uint8Wave) { + uint32 startPos = uint8Wave.pos(); // Save stream's starting position + uint8Wave.seek(addr, SEEK_CUR); // Seek to wave's address + + // Calculate the true sample size (A zero ends the sample prematurely) + uint trueSize = size; // Set a default value for the result + for (uint i = 0; i < size; i++) { + if (uint8Wave.readByte() == 0) { + trueSize = i; + // A zero in the sample stream turns off looping + // (At least that's what MESS 0.117 and KEGS32 0.91 seem to do) + if (mode == OSC_MODE_LOOP) + mode = OSC_MODE_ONESHOT; + break; + } + } + size = trueSize; // Set the true sample size + + uint8Wave.seek(startPos); // Seek back to the stream's starting position + return true; } -/** - * Read an Apple IIGS AGI sample header from the given stream. - * @param header The header to which to write the data. - * @param stream The source stream from which to read the data. - * @return True if successful, false otherwise. - */ -bool readIIgsSampleHeader(IIgsSampleHeader &header, Common::SeekableReadStream &stream) { - header.type = stream.readUint16LE(); - header.pitch = stream.readByte(); - header.unknownByte_Ofs3 = stream.readByte(); - header.volume = stream.readByte(); - header.unknownByte_Ofs5 = stream.readByte(); - header.instrumentSize = stream.readUint16LE(); - header.sampleSize = stream.readUint16LE(); - return readIIgsInstrumentHeader(header.instrument, stream); +bool IIgsOscillator::finalize(Common::SeekableReadStream &uint8Wave) { + for (uint i = 0; i < WAVES_PER_OSCILLATOR; i++) + if (!waves[i].finalize(uint8Wave)) + return false; + return true; } -/** - * Load an Apple IIGS AGI sample resource from the given stream and - * create an AudioStream out of it. - * - * @param stream The source stream. - * @param resnum Sound resource number. Optional. Used for error messages. - * @return A non-null AudioStream pointer if successful, NULL otherwise. - * @note In case of failure (i.e. NULL is returned), stream is reset back - * to its original position and its I/O failed -status is cleared. - * TODO: Add better handling of invalid resource number when printing error messages. - * TODO: Add support for looping sounds. - * FIXME: Fix sample rate calculation, it's probably not accurate at the moment. - */ -Audio::AudioStream *makeIIgsSampleStream(Common::SeekableReadStream &stream, int resnum = -1) { - const uint32 startPos = stream.pos(); - IIgsSampleHeader header; - Audio::AudioStream *result = NULL; - bool readHeaderOk = readIIgsSampleHeader(header, stream); +bool IIgsOscillatorList::read(Common::SeekableReadStream &stream, uint oscillatorCount, bool ignoreAddr) { + // First read the A waves and then the B waves for the oscillators + for (uint waveNum = 0; waveNum < WAVES_PER_OSCILLATOR; waveNum++) + for (uint oscNum = 0; oscNum < oscillatorCount; oscNum++) + if (!osc[oscNum].waves[waveNum].read(stream, ignoreAddr)) + return false; - // Check that the header was read ok and that it's of the correct type - // and that there's room for the sample data in the stream. - if (readHeaderOk && header.type == AGI_SOUND_SAMPLE) { // An Apple IIGS AGI sample resource - uint32 tailLen = stream.size() - stream.pos(); - if (tailLen < header.sampleSize) { // Check if there's no room for the sample data in the stream - // Apple IIGS Manhunter I: Sound resource 16 has only 16074 bytes - // of sample data although header says it should have 16384 bytes. - warning("Apple IIGS sample (%d) too short (%d bytes. Should be %d bytes). Using the part that's left", resnum, tailLen, header.sampleSize); - header.sampleSize = (uint16) tailLen; // Use the part that's left - } - if (header.pitch > 0x7F) { // Check if the pitch is invalid - warning("Apple IIGS sample (%d) has too high pitch (0x%02x)", resnum, header.pitch); - header.pitch &= 0x7F; // Apple IIGS AGI probably did it this way too - } - // Allocate memory for the sample data and read it in - byte *sampleData = (byte *) malloc(header.sampleSize); - uint32 readBytes = stream.read(sampleData, header.sampleSize); - if (readBytes == header.sampleSize) { // Check that we got all the data we requested - // Make an audio stream from the mono, 8 bit, unsigned input data - byte flags = Audio::Mixer::FLAG_AUTOFREE | Audio::Mixer::FLAG_UNSIGNED; - int rate = (int) (1076 * pow(SEMITONE, header.pitch)); - result = Audio::makeLinearInputStream(sampleData, header.sampleSize, rate, flags, 0, 0); - } - } + count = oscillatorCount; // Set the oscillator count + return true; +} - // If couldn't make a sample out of the input stream for any reason then - // rewind back to stream's starting position and clear I/O failed -status. - if (result == NULL) { - stream.seek(startPos); - stream.clearIOFailed(); - } +bool IIgsOscillatorList::finalize(Common::SeekableReadStream &uint8Wave) { + for (uint i = 0; i < count; i++) + if (!osc[i].finalize(uint8Wave)) + return false; + return true; +} - return result; +bool IIgsInstrumentHeader::read(Common::SeekableReadStream &stream, bool ignoreAddr) { + env.read(stream); + relseg = stream.readByte(); + /*byte priority =*/ stream.readByte(); // Not needed? 32 in all tested data. + bendrange = stream.readByte(); + vibdepth = stream.readByte(); + vibspeed = stream.readByte(); + /*byte spare =*/ stream.readByte(); // Not needed? 0 in all tested data. + byte wac = stream.readByte(); // Read A wave count + byte wbc = stream.readByte(); // Read B wave count + oscList.read(stream, wac, ignoreAddr); // Read the oscillators + return (wac == wbc) && !stream.ioFailed(); // A and B wave counts must match } -#endif +bool IIgsInstrumentHeader::finalize(Common::SeekableReadStream &uint8Wave) { + return oscList.finalize(uint8Wave); +} + +bool IIgsSampleHeader::read(Common::SeekableReadStream &stream) { + type = stream.readUint16LE(); + pitch = stream.readByte(); + unknownByte_Ofs3 = stream.readByte(); + volume = stream.readByte(); + unknownByte_Ofs5 = stream.readByte(); + instrumentSize = stream.readUint16LE(); + sampleSize = stream.readUint16LE(); + // Read the instrument header *ignoring* its wave address info + return instrument.read(stream, true); +} + +bool IIgsSampleHeader::finalize(Common::SeekableReadStream &uint8Wave) { + return instrument.finalize(uint8Wave); +} + +/** Older Apple IIGS AGI instrument set. Used only by Space Quest I (AGI v1.002). */ +static const instrumentSetInfo instSetV1 = { + 1192, 26, "7ee16bbc135171ffd6b9120cc7ff1af2", "edd3bf8905d9c238e02832b732fb2e18" +}; -static int playing; -static ChannelInfo chn[NUM_CHANNELS]; -static int endflag = -1; -static int playingSound = -1; -static uint8 *song; -static uint8 env; +/** Newer Apple IIGS AGI instrument set (AGI v1.003+). Used by all others than Space Quest I. */ +static const instrumentSetInfo instSetV2 = { + 1292, 28, "b7d428955bb90721996de1cbca25e768", "c05fb0b0e11deefab58bc68fbd2a3d07" +}; +/** Information about different Apple IIGS AGI executables. */ +static const IIgsExeInfo IIgsExeInfos[] = { + {GID_SQ1, "SQ", 0x1002, 138496, 0x80AD, instSetV1}, + {GID_LSL1, "LL", 0x1003, 141003, 0x844E, instSetV2}, + {GID_AGIDEMO, "DEMO", 0x1005, 141884, 0x8469, instSetV2}, + {GID_KQ1, "KQ", 0x1006, 141894, 0x8469, instSetV2}, + {GID_PQ1, "PQ", 0x1007, 141882, 0x8469, instSetV2}, + {GID_MIXEDUP, "MG", 0x1013, 142552, 0x84B7, instSetV2}, + {GID_KQ2, "KQ2", 0x1013, 143775, 0x84B7, instSetV2}, + {GID_KQ3, "KQ3", 0x1014, 144312, 0x84B7, instSetV2}, + {GID_SQ2, "SQ2", 0x1014, 107882, 0x6563, instSetV2}, + {GID_MH1, "MH", 0x2004, 147678, 0x8979, instSetV2}, + {GID_KQ4, "KQ4", 0x2006, 147652, 0x8979, instSetV2}, + {GID_BC, "BC", 0x3001, 148192, 0x8979, instSetV2}, + {GID_GOLDRUSH, "GR", 0x3003, 148268, 0x8979, instSetV2} +}; -static int16 *sndBuffer; -static int16 *waveform; +static IIgsInstrumentHeader g_instruments[MAX_INSTRUMENTS]; +static uint g_numInstruments = 0; +static int16 g_wave[SIERRASTANDARD_SIZE]; // FIXME? Should this be allocated from the heap? (Size is 128KiB) +// Time (In milliseconds) in Apple IIGS mixing buffer time granularity +// (i.e. in IIGS_BUFFER_SIZE / getRate() seconds granularity) +static uint32 g_IIgsBufGranMillis = 0; +static uint32 g_midiMillis = 0; // Time position (In milliseconds) in currently playing MIDI sound + +bool SoundMgr::finalizeInstruments(Common::SeekableReadStream &uint8Wave) { + for (uint i = 0; i < g_numInstruments; i++) + if (!g_instruments[i].finalize(uint8Wave)) + return false; + return true; +} -static int16 waveformRamp[WAVEFORM_SIZE] = { +static const int16 waveformRamp[WAVEFORM_SIZE] = { 0, 8, 16, 24, 32, 40, 48, 56, 64, 72, 80, 88, 96, 104, 112, 120, 128, 136, 144, 152, 160, 168, 176, 184, @@ -241,7 +282,7 @@ static int16 waveformRamp[WAVEFORM_SIZE] = { -64, -56, -48, -40, -32, -24, -16, -8 /* Ramp up */ }; -static int16 waveformSquare[WAVEFORM_SIZE] = { +static const int16 waveformSquare[WAVEFORM_SIZE] = { 255, 230, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, @@ -252,7 +293,7 @@ static int16 waveformSquare[WAVEFORM_SIZE] = { -220, -220, -220, -110, 0, 0, 0, 0 /* Square */ }; -static int16 waveformMac[WAVEFORM_SIZE] = { +static const int16 waveformMac[WAVEFORM_SIZE] = { 45, 110, 135, 161, 167, 173, 175, 176, 156, 137, 123, 110, 91, 72, 35, -2, -60, -118, -142, -165, -170, -176, -177, -179, @@ -263,157 +304,137 @@ static int16 waveformMac[WAVEFORM_SIZE] = { -175, -172, -165, -159, -137, -114, -67, -19 }; -#ifdef USE_IIGS_SOUND - -static uint16 period[] = { +static const uint16 period[] = { 1024, 1085, 1149, 1218, 1290, 1367, 1448, 1534, 1625, 1722, 1825, 1933 }; -static struct AgiNote playSample[] = { - {0xff, 0x7f, 0x18, 0x00, 0x7f}, - {0xff, 0xff, 0x00, 0x00, 0x00}, - {0xff, 0xff, 0x00, 0x00, 0x00}, - {0xff, 0xff, 0x00, 0x00, 0x00} -}; - +#if 0 static int noteToPeriod(int note) { return 10 * (period[note % 12] >> (note / 12 - 3)); } - -#endif /* USE_IIGS_SOUND */ +#endif void SoundMgr::unloadSound(int resnum) { if (_vm->_game.dirSound[resnum].flags & RES_LOADED) { - if (_vm->_game.sounds[resnum].flags & SOUND_PLAYING) - /* FIXME: Stop playing */ - ; + if (_vm->_game.sounds[resnum]->isPlaying()) { + _vm->_game.sounds[resnum]->stop(); + } - /* Release RAW data for sound */ - free(_vm->_game.sounds[resnum].rdata); - _vm->_game.sounds[resnum].rdata = NULL; + // Release the sound resource's data + delete _vm->_game.sounds[resnum]; + _vm->_game.sounds[resnum] = NULL; _vm->_game.dirSound[resnum].flags &= ~RES_LOADED; } } -void SoundMgr::decodeSound(int resnum) { -#if 0 - int type, size; - int16 *buf; - uint8 *src; - struct SoundIIgsSample *smp; - - debugC(3, kDebugLevelSound, "(%d)", resnum); - type = READ_LE_UINT16(_vm->_game.sounds[resnum].rdata); - - if (type == AGI_SOUND_SAMPLE) { - /* Convert sample data to 16 bit signed format - */ - smp = (struct SoundIIgsSample *)_vm->_game.sounds[resnum].rdata; - size = ((int)smp->sizeHi << 8) + smp->sizeLo; - src = (uint8 *)_vm->_game.sounds[resnum].rdata; - buf = (int16 *)calloc(1, 54 + (size << 1) + 100); /* FIXME */ - memcpy(buf, src, 54); - for (; size--; buf[size + 54] = ((int16)src[size + 54] - 0x80) << 4); /* FIXME */ - _vm->_game.sounds[resnum].rdata = (uint8 *) buf; - free(src); - } -#endif -} - void SoundMgr::startSound(int resnum, int flag) { - int i, type; -#if 0 - struct SoundIIgsSample *smp; -#endif + int i; + AgiSoundType type; - if (_vm->_game.sounds[resnum].flags & SOUND_PLAYING) + if (_vm->_game.sounds[resnum] != NULL && _vm->_game.sounds[resnum]->isPlaying()) return; stopSound(); - if (_vm->_game.sounds[resnum].rdata == NULL) + if (_vm->_game.sounds[resnum] == NULL) // Is this needed at all? return; - type = READ_LE_UINT16(_vm->_game.sounds[resnum].rdata); + type = (AgiSoundType)_vm->_game.sounds[resnum]->type(); if (type != AGI_SOUND_SAMPLE && type != AGI_SOUND_MIDI && type != AGI_SOUND_4CHN) return; - _vm->_game.sounds[resnum].flags |= SOUND_PLAYING; - _vm->_game.sounds[resnum].type = type; - playingSound = resnum; - song = (uint8 *)_vm->_game.sounds[resnum].rdata; + _vm->_game.sounds[resnum]->play(); + _playingSound = resnum; + + debugC(3, kDebugLevelSound, "startSound(resnum = %d, flag = %d)", resnum, flag); switch (type) { -#if 0 - case AGI_SOUND_SAMPLE: - debugC(3, kDebugLevelSound, "IIGS sample"); - smp = (struct SoundIIgsSample *)_vm->_game.sounds[resnum].rdata; - for (i = 0; i < NUM_CHANNELS; i++) { - chn[i].type = type; - chn[i].flags = 0; - chn[i].ins = (int16 *)&_vm->_game.sounds[resnum].rdata[54]; - chn[i].size = ((int)smp->sizeHi << 8) + smp->sizeLo; - chn[i].ptr = &playSample[i]; - chn[i].timer = 0; - chn[i].vol = 0; - chn[i].end = 0; - } + case AGI_SOUND_SAMPLE: { + IIgsSample *sampleRes = (IIgsSample *) _vm->_game.sounds[_playingSound]; + const IIgsWaveInfo &waveInfo = _IIgsChannel.ins.oscList(0).waves[0]; + const IIgsSampleHeader &header = sampleRes->getHeader(); + + _IIgsChannel.ins = header.instrument; + _IIgsChannel.sample = sampleRes->getSample() + waveInfo.addr; + _IIgsChannel.pos = intToFrac(0); + _IIgsChannel.posAdd = intToFrac(0); + _IIgsChannel.note = intToFrac(header.pitch) + doubleToFrac(waveInfo.relPitch/256.0); + _IIgsChannel.startEnvVol = intToFrac(0); + _IIgsChannel.chanVol = intToFrac(header.volume); + _IIgsChannel.envVol = _IIgsChannel.startEnvVol; + _IIgsChannel.vol = doubleToFrac(fracToDouble(_IIgsChannel.envVol) * fracToDouble(_IIgsChannel.chanVol) / 127.0); + _IIgsChannel.envSeg = intToFrac(0); + _IIgsChannel.loop = (waveInfo.mode == OSC_MODE_LOOP); + _IIgsChannel.size = waveInfo.size - waveInfo.addr; + _IIgsChannel.end = false; break; + } case AGI_SOUND_MIDI: + g_IIgsBufGranMillis = g_midiMillis = 0; +#if 0 debugC(3, kDebugLevelSound, "IIGS MIDI sequence"); for (i = 0; i < NUM_CHANNELS; i++) { - chn[i].type = type; - chn[i].flags = AGI_SOUND_LOOP | AGI_SOUND_ENVELOPE; - chn[i].ins = waveform; - chn[i].size = WAVEFORM_SIZE; - chn[i].vol = 0; - chn[i].end = 0; + _chn[i].type = type; + _chn[i].flags = AGI_SOUND_LOOP | AGI_SOUND_ENVELOPE; + _chn[i].ins = _waveform; + _chn[i].size = WAVEFORM_SIZE; + _chn[i].vol = 0; + _chn[i].end = 0; } - chn[0].timer = *(song + 2); - chn[0].ptr = (struct AgiNote *)(song + 3); - break; + _chn[0].timer = *(song + 2); + _chn[0].ptr = (struct AgiNote *)(song + 3); #endif + break; case AGI_SOUND_4CHN: + PCjrSound *pcjrSound = (PCjrSound *) _vm->_game.sounds[resnum]; /* Initialize channel info */ for (i = 0; i < NUM_CHANNELS; i++) { - chn[i].type = type; - chn[i].flags = AGI_SOUND_LOOP; - if (env) { - chn[i].flags |= AGI_SOUND_ENVELOPE; - chn[i].adsr = AGI_SOUND_ENV_ATTACK; + _chn[i].type = type; + _chn[i].flags = AGI_SOUND_LOOP; + if (_env) { + _chn[i].flags |= AGI_SOUND_ENVELOPE; + _chn[i].adsr = AGI_SOUND_ENV_ATTACK; } - chn[i].ins = waveform; - chn[i].size = WAVEFORM_SIZE; - chn[i].ptr = (struct AgiNote *)(song + (song[i << 1] | (song[(i << 1) + 1] << 8))); - chn[i].timer = 0; - chn[i].vol = 0; - chn[i].end = 0; + _chn[i].ins = _waveform; + _chn[i].size = WAVEFORM_SIZE; + _chn[i].ptr = pcjrSound->getVoicePointer(i % 4); + _chn[i].timer = 0; + _chn[i].vol = 0; + _chn[i].end = 0; } break; } - memset(sndBuffer, 0, BUFFER_SIZE << 1); - endflag = flag; + memset(_sndBuffer, 0, BUFFER_SIZE << 1); + _endflag = flag; /* Nat Budin reports that the flag should be reset when sound starts */ - _vm->setflag(endflag, false); + _vm->setflag(_endflag, false); } void SoundMgr::stopSound() { int i; - endflag = -1; - for (i = 0; i < NUM_CHANNELS; i++) - stopNote(i); + _endflag = -1; + if (_vm->_soundemu != SOUND_EMU_APPLE2GS) { + for (i = 0; i < NUM_CHANNELS; i++) + stopNote(i); + } - if (playingSound != -1) { - _vm->_game.sounds[playingSound].flags &= ~SOUND_PLAYING; - playingSound = -1; + if (_playingSound != -1) { + _vm->_game.sounds[_playingSound]->stop(); + + if (_vm->_soundemu == SOUND_EMU_APPLE2GS) { + _IIgsChannel.end = true; + _IIgsChannel.chanVol = intToFrac(0); + } + + _playingSound = -1; } } @@ -422,37 +443,36 @@ static int16 *buffer; int SoundMgr::initSound() { int r = -1; - buffer = sndBuffer = (int16 *)calloc(2, BUFFER_SIZE); + buffer = _sndBuffer = (int16 *)calloc(2, BUFFER_SIZE); - env = false; + _env = false; switch (_vm->_soundemu) { case SOUND_EMU_NONE: - waveform = waveformRamp; - env = true; + _waveform = waveformRamp; + _env = true; break; case SOUND_EMU_AMIGA: case SOUND_EMU_PC: - waveform = waveformSquare; + _waveform = waveformSquare; break; case SOUND_EMU_MAC: - waveform = waveformMac; + _waveform = waveformMac; + break; + case SOUND_EMU_APPLE2GS: + loadInstruments(); break; } report("Initializing sound:\n"); report("sound: envelopes "); - if (env) { + if (_env) { report("enabled (decay=%d, sustain=%d)\n", ENV_DECAY, ENV_SUSTAIN); } else { report("disabled\n"); } -#ifdef USE_IIGS_SOUND - /*loadInstruments("demo.sys"); */ -#endif - _mixer->playInputStream(Audio::Mixer::kPlainSoundType, &_soundHandle, this, -1, Audio::Mixer::kMaxChannelVolume, 0, false, true); return r; @@ -461,19 +481,19 @@ int SoundMgr::initSound() { void SoundMgr::deinitSound() { debugC(3, kDebugLevelSound, "()"); _mixer->stopHandle(_soundHandle); - free(sndBuffer); + free(_sndBuffer); } void SoundMgr::stopNote(int i) { - chn[i].adsr = AGI_SOUND_ENV_RELEASE; + _chn[i].adsr = AGI_SOUND_ENV_RELEASE; -#ifdef USE_CHORUS - /* Stop chorus ;) */ - if (chn[i].type == AGI_SOUND_4CHN && - _vm->_soundemu == SOUND_EMU_NONE && i < 3) { - stopNote(i + 4); + if (g_useChorus) { + /* Stop chorus ;) */ + if (_chn[i].type == AGI_SOUND_4CHN && + _vm->_soundemu == SOUND_EMU_NONE && i < 3) { + stopNote(i + 4); + } } -#endif } void SoundMgr::playNote(int i, int freq, int vol) { @@ -482,127 +502,186 @@ void SoundMgr::playNote(int i, int freq, int vol) { else if (vol && _vm->_soundemu == SOUND_EMU_PC) vol = 160; - chn[i].phase = 0; - chn[i].freq = freq; - chn[i].vol = vol; - chn[i].env = 0x10000; - chn[i].adsr = AGI_SOUND_ENV_ATTACK; - -#ifdef USE_CHORUS - /* Add chorus ;) */ - if (chn[i].type == AGI_SOUND_4CHN && - _vm->_soundemu == SOUND_EMU_NONE && i < 3) { - int newfreq = freq * 1007 / 1000; - if (freq == newfreq) - newfreq++; - playNote(i + 4, newfreq, vol * 2 / 3); + _chn[i].phase = 0; + _chn[i].freq = freq; + _chn[i].vol = vol; + _chn[i].env = 0x10000; + _chn[i].adsr = AGI_SOUND_ENV_ATTACK; + + if (g_useChorus) { + /* Add chorus ;) */ + if (_chn[i].type == AGI_SOUND_4CHN && + _vm->_soundemu == SOUND_EMU_NONE && i < 3) { + int newfreq = freq * 1007 / 1000; + if (freq == newfreq) + newfreq++; + playNote(i + 4, newfreq, vol * 2 / 3); + } } -#endif } -#ifdef USE_IIGS_SOUND - void SoundMgr::playMidiSound() { - uint8 *p; + const uint8 *p; uint8 parm1, parm2; static uint8 cmd, ch; - playing = 1; - - if (chn[0].timer > 0) { - chn[0].timer -= 2; + if (_playingSound == -1 || _vm->_game.sounds[_playingSound] == NULL) { + warning("Error playing Apple IIGS MIDI sound resource"); + _playing = false; return; } - p = (uint8 *)chn[0].ptr; + IIgsMidi *midiObj = (IIgsMidi *) _vm->_game.sounds[_playingSound]; - if (*p & 0x80) { - cmd = *p++; - ch = cmd & 0x0f; - cmd >>= 4; - } + _playing = true; + p = midiObj->getPtr(); - switch (cmd) { - case 0x08: - parm1 = *p++; - parm2 = *p++; - if (ch < NUM_CHANNELS) - stopNote(ch); - break; - case 0x09: - parm1 = *p++; - parm2 = *p++; - if (ch < NUM_CHANNELS) - playNote(ch, noteToPeriod(parm1), 127); - break; - case 0x0b: - parm1 = *p++; - parm2 = *p++; - debugC(3, kDebugLevelSound, "controller %02x, ch %02x, val %02x", parm1, ch, parm2); - break; - case 0x0c: - parm1 = *p++; -#if 0 - if (ch < NUM_CHANNELS) { - chn[ch].ins = (uint16 *)&wave[waveaddr[parm1]]; - chn[ch].size = wavesize[parm1]; + g_IIgsBufGranMillis += (IIGS_BUFFER_SIZE * 1000) / getRate(); + + while (g_midiMillis < g_IIgsBufGranMillis) { + uint8 readByte = *p++; + + // Check for end of MIDI sequence marker (Can also be here before delta-time) + if (readByte == MIDI_BYTE_STOP_SEQUENCE) { + debugC(3, kDebugLevelSound, "End of MIDI sequence (Before reading delta-time)"); + g_IIgsBufGranMillis = g_midiMillis = 0; + _playing = false; + midiObj->rewind(); + return; + } else if (readByte == MIDI_BYTE_TIMER_SYNC) { + debugC(3, kDebugLevelSound, "Timer sync"); + continue; + } + + uint8 deltaTime = readByte; + uint32 bpm = 120; // Don't know if this is correct + g_midiMillis += (deltaTime * 1000) / bpm; + + // Check for end of MIDI sequence marker (This time it after reading delta-time) + if (*p == MIDI_BYTE_STOP_SEQUENCE) { + debugC(3, kDebugLevelSound, "End of MIDI sequence (After reading delta-time)"); + g_IIgsBufGranMillis = g_midiMillis = 0; + _playing = false; + midiObj->rewind(); + return; + } + + // Separate byte into command and channel if it's a command byte. + // Otherwise use running status (i.e. previously set command and channel). + if (*p & 0x80) { + cmd = *p++; + ch = cmd & 0x0f; + cmd >>= 4; } - debugC(3, kDebugLevelSound, "set patch %02x (%d,%d), ch %02x", - parm1, waveaddr[parm1], wavesize[parm1], ch); + + switch (cmd) { + case MIDI_CMD_NOTE_OFF: + parm1 = *p++; + parm2 = *p++; +#if 0 + if (ch < NUM_CHANNELS) + stopNote(ch); #endif - break; + debugC(3, kDebugLevelSound, "note off, channel %02x, note %02x, velocity %02x", ch, parm1, parm2); + break; + case MIDI_CMD_NOTE_ON: + parm1 = *p++; + parm2 = *p++; +#if 0 + if (ch < NUM_CHANNELS) + playNote(ch, noteToPeriod(parm1), 127); +#endif + debugC(3, kDebugLevelSound, "note on, channel %02x, note %02x, velocity %02x", ch, parm1, parm2); + break; + case MIDI_CMD_CONTROLLER: + // The tested Apple IIGS AGI MIDI resources only used + // controllers 0 (Bank select?), 7 (Volume) and 64 (Sustain On/Off). + // Controller 0's parameter was in range 94-127, + // controller 7's parameter was in range 0-127 and + // controller 64's parameter was always 0 (i.e. sustain off). + // TODO: Find out what controller 0 does and implement volume changes. + parm1 = *p++; + parm2 = *p++; + debugC(3, kDebugLevelSound, "controller %02x, ch %02x, val %02x", parm1, ch, parm2); + break; + case MIDI_CMD_PROGRAM_CHANGE: + // In all the tested Apple IIGS AGI MIDI resources + // program change's parameter was in range 0-43. + // This doesn't map directly to instrument numbers as all of + // the tested Apple IIGS AGI games only use 26 or 28 instruments. + // TODO: Find out the mapping to instruments and implement it. + parm1 = *p++; + debugC(3, kDebugLevelSound, "program change %02x, channel %02x", parm1, ch); +#if 0 + if (ch < NUM_CHANNELS) { + chn[ch].ins = (uint16 *)&wave[waveaddr[parm1]]; + chn[ch].size = wavesize[parm1]; + } + debugC(3, kDebugLevelSound, "set patch %02x (%d,%d), ch %02x", + parm1, waveaddr[parm1], wavesize[parm1], ch); +#endif + break; + case MIDI_CMD_PITCH_WHEEL: + parm1 = *p++; + parm2 = *p++; + // In all the tested Apple IIGS AGI MIDI resources + // pitch wheel commands always had 0x2000 (Center position) + // as the combined 14-bit value for the position. + uint16 wheelPos = ((parm2 & 0x7F) << 7) | (parm1 & 0x7F); // 14-bit value + debugC(3, kDebugLevelSound, "Pitch wheel position %04x (Not implemented yet)", wheelPos); + break; + } } - chn[0].timer = *p++; - chn[0].ptr = (struct AgiNote *)p; + midiObj->setPtr(p); +} - if (*p >= 0xfc) { - debugC(3, kDebugLevelSound, "end of sequence"); - playing = 0; +void SoundMgr::playSampleSound() { + if (_vm->_soundemu != SOUND_EMU_APPLE2GS) { + warning("Trying to play a sample but not using Apple IIGS sound emulation mode"); return; } -} -void SoundMgr::playSampleSound() { - playNote(0, 11025 * 10, 200); - playing = 1; + if (_playingSound != -1) + _playing = !_IIgsChannel.end; } -#endif /* USE_IIGS_SOUND */ - void SoundMgr::playAgiSound() { - int i, freq; + int i; + AgiNote note; - for (playing = i = 0; i < (_vm->_soundemu == SOUND_EMU_PC ? 1 : 4); i++) { - playing |= !chn[i].end; + _playing = false; + for (i = 0; i < (_vm->_soundemu == SOUND_EMU_PC ? 1 : 4); i++) { + _playing |= !_chn[i].end; + note.read(_chn[i].ptr); // Read a single note (Doesn't advance the pointer) - if (chn[i].end) + if (_chn[i].end) continue; - if ((--chn[i].timer) <= 0) { + if ((--_chn[i].timer) <= 0) { stopNote(i); - freq = ((chn[i].ptr->frq0 & 0x3f) << 4) | (int)(chn[i].ptr->frq1 & 0x0f); - if (freq) { - uint8 v = chn[i].ptr->vol & 0x0f; - playNote(i, freq * 10, v == 0xf ? 0 : 0xff - (v << 1)); + if (note.freqDiv != 0) { + int volume = (note.attenuation == 0x0F) ? 0 : (0xFF - note.attenuation * 2); + playNote(i, note.freqDiv * 10, volume); } - chn[i].timer = ((int)chn[i].ptr->durHi << 8) | chn[i].ptr->durLo; - - if (chn[i].timer == 0xffff) { - chn[i].end = 1; - chn[i].vol = 0; - chn[i].env = 0; -#ifdef USE_CHORUS - /* chorus */ - if (chn[i].type == AGI_SOUND_4CHN && _vm->_soundemu == SOUND_EMU_NONE && i < 3) { - chn[i + 4].vol = 0; - chn[i + 4].env = 0; + _chn[i].timer = note.duration; + + if (_chn[i].timer == 0xffff) { + _chn[i].end = 1; + _chn[i].vol = 0; + _chn[i].env = 0; + + if (g_useChorus) { + /* chorus */ + if (_chn[i].type == AGI_SOUND_4CHN && _vm->_soundemu == SOUND_EMU_NONE && i < 3) { + _chn[i + 4].vol = 0; + _chn[i + 4].env = 0; + } } -#endif } - chn[i].ptr++; + _chn[i].ptr += 5; // Advance the pointer to the next note data (5 bytes per note) } } } @@ -610,100 +689,183 @@ void SoundMgr::playAgiSound() { void SoundMgr::playSound() { int i; - if (endflag == -1) + if (_endflag == -1) return; -#ifdef USE_IIGS_SOUND - if (chn[0].type == AGI_SOUND_MIDI) { - /* play_midi_sound (); */ - playing = 0; - } else if (chn[0].type == AGI_SOUND_SAMPLE) { - playSampleSound(); - } else -#endif + if (_vm->_soundemu == SOUND_EMU_APPLE2GS) { + if (_playingSound != -1) { + if (_vm->_game.sounds[_playingSound]->type() == AGI_SOUND_MIDI) { + playMidiSound(); + //warning("playSound: Trying to play an Apple IIGS MIDI sound. Not yet implemented!"); + } else if (_vm->_game.sounds[_playingSound]->type() == AGI_SOUND_SAMPLE) { + //debugC(3, kDebugLevelSound, "playSound: Trying to play an Apple IIGS sample"); + playSampleSound(); + } + } + } else { + //debugC(3, kDebugLevelSound, "playSound: Trying to play a PCjr 4-channel sound"); playAgiSound(); + } - if (!playing) { - for (i = 0; i < NUM_CHANNELS; chn[i++].vol = 0); + if (!_playing) { + if (_vm->_soundemu != SOUND_EMU_APPLE2GS) { + for (i = 0; i < NUM_CHANNELS; _chn[i++].vol = 0); + } - if (endflag != -1) - _vm->setflag(endflag, true); + if (_endflag != -1) + _vm->setflag(_endflag, true); - if (playingSound != -1) - _vm->_game.sounds[playingSound].flags &= ~SOUND_PLAYING; - playingSound = -1; - endflag = -1; + if (_playingSound != -1) + _vm->_game.sounds[_playingSound]->stop(); + _playingSound = -1; + _endflag = -1; } } uint32 SoundMgr::mixSound(void) { register int i, p; - int16 *src; + const int16 *src; int c, b, m; - memset(sndBuffer, 0, BUFFER_SIZE << 1); + memset(_sndBuffer, 0, BUFFER_SIZE << 1); + + if (!_playing || _playingSound == -1) + return BUFFER_SIZE; + + // Handle Apple IIGS sound mixing here + if (_vm->_soundemu == SOUND_EMU_APPLE2GS) { + AgiSoundType type = (AgiSoundType) _vm->_game.sounds[_playingSound]->type(); + // Currently we only support mixing a single sample in Apple IIGS mixing code. + if (type != AGI_SOUND_SAMPLE) + return IIGS_BUFFER_SIZE; + //IIgsWaveInfo &waveInfo = _IIgsChannel.ins.oscList(0).waves[0]; + + //uint period = noteToPeriod(fracToInt(_IIgsChannel.note + FRAC_HALF)); + //_IIgsChannel.posAdd = ((frac_t) (118600 * 4 / period)) << (FRAC_BITS - 8); + + // Hertz (number of vibrations a second) = 6.875 x 2 ^ ( ( 3 + MIDI_Pitch ) / 12 ) + // From http://www.musicmasterworks.com/WhereMathMeetsMusic.html + //double hertz = 6.875 * pow(SEMITONE, 3 + fracToDouble(_IIgsChannel.note)); + //double hertz = 8.175798915644 * pow(SEMITONE, fracToDouble(_IIgsChannel.note)); + // double step = getRate() / hertz; + // _IIgsChannel.posAdd = doubleToFrac(step); + + // Frequency multiplier was 1076.0 based on tests made with MESS 0.117. + // Tests made with KEGS32 averaged the multiplier to around 1045. + // So this is a guess but maybe it's 1046.5... i.e. C6's frequency? + double hertz = C6_FREQ * pow(SEMITONE, fracToDouble(_IIgsChannel.note)); + _IIgsChannel.posAdd = doubleToFrac(hertz / getRate()); + _IIgsChannel.vol = doubleToFrac(fracToDouble(_IIgsChannel.envVol) * fracToDouble(_IIgsChannel.chanVol) / 127.0); + double tempVol = fracToDouble(_IIgsChannel.vol)/127.0; + + for (i = 0; i < IIGS_BUFFER_SIZE; i++) { + b = _IIgsChannel.sample[fracToInt(_IIgsChannel.pos)]; + // DOESN'T DO MIXING YET! ONLY ONE SAMPLE PER PLAYING! + _sndBuffer[i] = (int16) (b * tempVol); + _IIgsChannel.pos += _IIgsChannel.posAdd; + + if (_IIgsChannel.pos >= intToFrac(_IIgsChannel.size)) { + if (_IIgsChannel.loop) { + _IIgsChannel.pos %= intToFrac(_IIgsChannel.size); + // Probably we should loop the envelope too + _IIgsChannel.envSeg = 0; + _IIgsChannel.envVol = _IIgsChannel.startEnvVol; + } else { + _IIgsChannel.pos = _IIgsChannel.chanVol = 0; + _IIgsChannel.end = true; + break; + } + } + } + + if (_IIgsChannel.envSeg <= _IIgsChannel.ins.relseg) { + IIgsEnvelopeSegment &seg = _IIgsChannel.ins.env.seg[_IIgsChannel.envSeg]; + double bufSecLen = IIGS_BUFFER_SIZE / (double) getRate(); + double ticksPerSec = 100; // 1000 is way too much + double bufTickLen = bufSecLen / (1.0/ticksPerSec); + frac_t envVolDelta = doubleToFrac((seg.inc/256.0)*bufTickLen); + if (intToFrac(seg.bp) >= _IIgsChannel.envVol) { + _IIgsChannel.envVol += envVolDelta; + if (_IIgsChannel.envVol >= intToFrac(seg.bp)) { + _IIgsChannel.envVol = intToFrac(seg.bp); + _IIgsChannel.envSeg += 1; + } + } else { + _IIgsChannel.envVol -= envVolDelta; + if (_IIgsChannel.envVol <= intToFrac(seg.bp)) { + _IIgsChannel.envVol = intToFrac(seg.bp); + _IIgsChannel.envSeg += 1; + } + } + } + //_IIgsChannel.envSeg += doubleToFrac(1/100.0); + return IIGS_BUFFER_SIZE; + } /* else ... */ + // Handle PCjr 4-channel sound mixing here for (c = 0; c < NUM_CHANNELS; c++) { - if (!chn[c].vol) + if (!_chn[c].vol) continue; - m = chn[c].flags & AGI_SOUND_ENVELOPE ? - chn[c].vol * chn[c].env >> 16 : chn[c].vol; + m = _chn[c].flags & AGI_SOUND_ENVELOPE ? + _chn[c].vol * _chn[c].env >> 16 : _chn[c].vol; - if (chn[c].type != AGI_SOUND_4CHN || c != 3) { - src = chn[c].ins; + if (_chn[c].type != AGI_SOUND_4CHN || c != 3) { + src = _chn[c].ins; - p = chn[c].phase; + p = _chn[c].phase; for (i = 0; i < BUFFER_SIZE; i++) { b = src[p >> 8]; #ifdef USE_INTERPOLATION - b += ((src[((p >> 8) + 1) % chn[c].size] - src[p >> 8]) * (p & 0xff)) >> 8; + b += ((src[((p >> 8) + 1) % _chn[c].size] - src[p >> 8]) * (p & 0xff)) >> 8; #endif - sndBuffer[i] += (b * m) >> 4; + _sndBuffer[i] += (b * m) >> 4; - p += (uint32) 118600 *4 / chn[c].freq; + p += (uint32) 118600 *4 / _chn[c].freq; + // FIXME: Fingolfin asks: why is there a FIXME here? Please either clarify what + // needs fixing, or remove it! /* FIXME */ - if (chn[c].flags & AGI_SOUND_LOOP) { - p %= chn[c].size << 8; + if (_chn[c].flags & AGI_SOUND_LOOP) { + p %= _chn[c].size << 8; } else { - if (p >= chn[c].size << 8) { - p = chn[c].vol = 0; - chn[c].end = 1; + if (p >= _chn[c].size << 8) { + p = _chn[c].vol = 0; + _chn[c].end = 1; break; } } } - chn[c].phase = p; + _chn[c].phase = p; } else { /* Add white noise */ for (i = 0; i < BUFFER_SIZE; i++) { b = _vm->_rnd->getRandomNumber(255) - 128; - sndBuffer[i] += (b * m) >> 4; + _sndBuffer[i] += (b * m) >> 4; } } - switch (chn[c].adsr) { + switch (_chn[c].adsr) { case AGI_SOUND_ENV_ATTACK: /* not implemented */ - chn[c].adsr = AGI_SOUND_ENV_DECAY; + _chn[c].adsr = AGI_SOUND_ENV_DECAY; break; case AGI_SOUND_ENV_DECAY: - if (chn[c].env > chn[c].vol * ENV_SUSTAIN + ENV_DECAY) { - chn[c].env -= ENV_DECAY; + if (_chn[c].env > _chn[c].vol * ENV_SUSTAIN + ENV_DECAY) { + _chn[c].env -= ENV_DECAY; } else { - chn[c].env = chn[c].vol * ENV_SUSTAIN; - chn[c].adsr = AGI_SOUND_ENV_SUSTAIN; + _chn[c].env = _chn[c].vol * ENV_SUSTAIN; + _chn[c].adsr = AGI_SOUND_ENV_SUSTAIN; } break; case AGI_SOUND_ENV_SUSTAIN: break; case AGI_SOUND_ENV_RELEASE: - if (chn[c].env >= ENV_RELEASE) { - chn[c].env -= ENV_RELEASE; + if (_chn[c].env >= ENV_RELEASE) { + _chn[c].env -= ENV_RELEASE; } else { - chn[c].env = 0; + _chn[c].env = 0; } } } @@ -711,101 +873,194 @@ uint32 SoundMgr::mixSound(void) { return BUFFER_SIZE; } -#ifdef USE_IIGS_SOUND +/** + * Finds information about an Apple IIGS AGI executable based on the game ID. + * @return A non-null IIgsExeInfo pointer if successful, otherwise NULL. + */ +const IIgsExeInfo *SoundMgr::getIIgsExeInfo(enum AgiGameID gameid) const { + for (int i = 0; i < ARRAYSIZE(IIgsExeInfos); i++) + if (IIgsExeInfos[i].gameid == gameid) + return &IIgsExeInfos[i]; + return NULL; +} -#if 0 -int SoundMgr::loadInstruments(char *fname) { - Common::File fp; - int i, j, k; - struct SoundInstrument ai; - int numWav; - char *path; - - path = "sierrast"; - - if (!fp.open(path)) - return errBadFileOpen; - report("Loading samples: %s\n", path); - - if ((wave = malloc(0x10000 * 2)) == NULL) - return errNotEnoughMemory; - - fp.read(wave, 0x10000); - fp.close(); - for (i = 0x10000; i--;) { - ((int16 *)wave)[i] = 2 * ((int16)wave[i] - 128); - } +bool SoundMgr::loadInstrumentHeaders(const Common::String &exePath, const IIgsExeInfo &exeInfo) { + bool loadedOk = false; // Was loading successful? + Common::File file; - fp = fopen("bla", "w"); - fwrite(wave, 2, 0x10000, fp); - fclose(fp); + // Open the executable file and check that it has correct size + file.open(exePath); + if (file.size() != exeInfo.exeSize) { + debugC(3, kDebugLevelSound, "Apple IIGS executable (%s) has wrong size (Is %d, should be %d)", + exePath.c_str(), file.size(), exeInfo.exeSize); + } - report("Loading instruments: %s\n", path); + // Read the whole executable file into memory + Common::MemoryReadStream *data = file.readStream(file.size()); + file.close(); + + // Check that we got enough data to be able to parse the instruments + if (data != NULL && data->size() >= (exeInfo.instSetStart + exeInfo.instSet.byteCount)) { + // Check instrument set's length (The info's saved in the executable) + data->seek(exeInfo.instSetStart - 4); + uint16 instSetByteCount = data->readUint16LE(); + if (instSetByteCount != exeInfo.instSet.byteCount) { + debugC(3, kDebugLevelSound, "Wrong instrument set size (Is %d, should be %d) in Apple IIGS executable (%s)", + instSetByteCount, exeInfo.instSet.byteCount, exePath.c_str()); + } - if ((fp = fopen(path, "rb")) == NULL) - return errBadFileOpen; + // Check instrument set's md5sum + data->seek(exeInfo.instSetStart); + char md5str[32+1]; + Common::md5_file_string(*data, md5str, exeInfo.instSet.byteCount); + if (scumm_stricmp(md5str, exeInfo.instSet.md5)) { + warning("Unknown Apple IIGS instrument set (md5: %s) in %s, trying to use it nonetheless", + md5str, exePath.c_str()); + } - fseek(fp, 0x8469, SEEK_SET); + // Read in the instrument set one instrument at a time + data->seek(exeInfo.instSetStart); + g_numInstruments = 0; // Zero number of successfully loaded instruments + for (uint i = 0; i < exeInfo.instSet.instCount; i++) { + if (!g_instruments[i].read(*data)) { + warning("Error loading Apple IIGS instrument (%d. of %d) from %s, not loading more instruments", + i + 1, exeInfo.instSet.instCount, exePath.c_str()); + break; + } + g_numInstruments++; // Increase number of successfully loaded instruments + } - for (numWav = j = 0; j < 40; j++) { - fread(&ai, 1, 32, fp); + // Loading was successful only if all instruments were loaded successfully + loadedOk = (g_numInstruments == exeInfo.instSet.instCount); + } else // Couldn't read enough data from the executable file + warning("Error loading instruments from Apple IIGS executable (%s)", exePath.c_str()); - if (ai.env[0].bp > 0x7f) - break; + delete data; // Free the memory buffer allocated for reading the executable file + return loadedOk; +} -#if 0 - printf("Instrument %d loaded ----------------\n", j); - printf("Envelope:\n"); - for (i = 0; i < 8; i++) - printf("[seg %d]: BP %02x Inc %04x\n", i, ai.env[i].bp, - ((int)ai.env[i].inc_hi << 8) | ai.env[i].inc_lo); - printf("rel seg: %d, pri inc: %d, bend range: %d, vib dep: %d, " - "vib spd: %d\n", ai.relseg, ai.priority, - ai.bendrange, ai.vibdepth, ai.vibspeed); - printf("A wave count: %d, B wave count: %d\n", ai.wac, ai.wbc); -#endif +/** + * Convert sample from 8-bit unsigned to 16-bit signed format. + * @param source Source stream containing the 8-bit unsigned sample data. + * @param dest Destination buffer for the 16-bit signed sample data. + * @param length Length of the sample data to be converted. + */ +bool SoundMgr::convertWave(Common::SeekableReadStream &source, int16 *dest, uint length) { + // Convert the wave from 8-bit unsigned to 16-bit signed format + for (uint i = 0; i < length; i++) + dest[i] = (int16) ((source.readByte() - 128) * 256); + return !source.ioFailed(); +} - for (k = 0; k < ai.wac; k++, num_wav++) { - fread(&ai.wal[k], 1, 6, fp); -#if 0 - printf("[A %d of %d] top: %02x, wave address: %02x, " - "size: %02x, mode: %02x, relPitch: %04x\n", k + 1, - ai.wac, ai.wal[k].top, ai.wal[k].addr, ai.wal[k].size, - ai.wal[k].mode, ((int)ai.wal[k].rel_hi << 8) | ai.wal[k].rel_lo); -#endif +Common::MemoryReadStream *SoundMgr::loadWaveFile(const Common::String &wavePath, const IIgsExeInfo &exeInfo) { + Common::File file; + + // Open the wave file and read it into memory + file.open(wavePath); + Common::MemoryReadStream *uint8Wave = file.readStream(file.size()); + file.close(); + + // Check that we got the whole wave file + if (uint8Wave != NULL && uint8Wave->size() == SIERRASTANDARD_SIZE) { + // Check wave file's md5sum + char md5str[32+1]; + Common::md5_file_string(*uint8Wave, md5str, SIERRASTANDARD_SIZE); + if (scumm_stricmp(md5str, exeInfo.instSet.waveFileMd5)) { + warning("Unknown Apple IIGS wave file (md5: %s, game: %s).\n" \ + "Please report the information on the previous line to the ScummVM team.\n" \ + "Using the wave file as it is - music may sound weird", md5str, exeInfo.exePrefix); } + uint8Wave->seek(0); // Seek wave to its start + return uint8Wave; + } else { // Couldn't read the wave file or it had incorrect size + warning("Error loading Apple IIGS wave file (%s), not loading instruments", wavePath.c_str()); + delete uint8Wave; // Free the memory buffer allocated for reading the wave file + return NULL; + } +} - for (k = 0; k < ai.wbc; k++, num_wav++) { - fread(&ai.wbl[k], 1, 6, fp); -#if 0 - printf("[B %d of %d] top: %02x, wave address: %02x, " - "size: %02x, mode: %02x, relPitch: %04x\n", k + 1, ai.wbc, - ai.wbl[k].top, ai.wbl[k].addr, ai.wbl[k].size, - ai.wbl[k].mode, ((int)ai.wbl[k].rel_hi << 8) | ai.wbl[k].rel_lo); -#endif - } - waveaddr[j] = 256 * ai.wal[0].addr; - wavesize[j] = 256 * (1 << ((ai.wal[0].size) & 0x07)); -#if 1 - printf("%d addr = %d\n", j, waveaddr[j]); - printf(" size = %d\n", wavesize[j]); -#endif +/** + * A function object (i.e. a functor) for testing if a FilesystemNode + * object's name is equal (Ignoring case) to a string or to at least + * one of the strings in a list of strings. Can be used e.g. with find_if(). + */ +struct fsnodeNameEqualsIgnoreCase : public Common::UnaryFunction<const FilesystemNode&, bool> { + fsnodeNameEqualsIgnoreCase(const Common::StringList &str) : _str(str) {} + fsnodeNameEqualsIgnoreCase(const Common::String str) { _str.push_back(str); } + bool operator()(const FilesystemNode ¶m) const { + for (Common::StringList::const_iterator iter = _str.begin(); iter != _str.end(); iter++) + if (param.getName().equalsIgnoreCase(*iter)) + return true; + return false; } +private: + Common::StringList _str; +}; - numInstruments = j; - printf("%d Ensoniq 5503 instruments loaded. (%d waveforms)\n", num_instruments, num_wav); +bool SoundMgr::loadInstruments() { + // Check that the platform is Apple IIGS, as only it uses custom instruments + if (_vm->getPlatform() != Common::kPlatformApple2GS) { + debugC(3, kDebugLevelSound, "Platform isn't Apple IIGS so not loading any instruments"); + return true; + } + + // Get info on the particular Apple IIGS AGI game's executable + const IIgsExeInfo *exeInfo = getIIgsExeInfo((enum AgiGameID) _vm->getGameID()); + if (exeInfo == NULL) { + warning("Unsupported Apple IIGS game, not loading instruments"); + return false; + } + + // List files in the game path + FSList fslist; + FilesystemNode dir(ConfMan.get("path")); + if (!dir.getChildren(fslist, FilesystemNode::kListFilesOnly)) { + warning("Invalid game path (\"%s\"), not loading Apple IIGS instruments", dir.getPath().c_str()); + return false; + } - fclose(fp); + // Populate executable filenames list (Long filename and short filename) for searching + Common::StringList exeNames; + exeNames.push_back(Common::String(exeInfo->exePrefix) + ".SYS16"); + exeNames.push_back(Common::String(exeInfo->exePrefix) + ".SYS"); + + // Populate wave filenames list (Long filename and short filename) for searching + Common::StringList waveNames; + waveNames.push_back("SIERRASTANDARD"); + waveNames.push_back("SIERRAST"); + + // Search for the executable file and the wave file (i.e. check if any of the filenames match) + FSList::const_iterator exeFsnode, waveFsnode; + exeFsnode = Common::find_if(fslist.begin(), fslist.end(), fsnodeNameEqualsIgnoreCase(exeNames)); + waveFsnode = Common::find_if(fslist.begin(), fslist.end(), fsnodeNameEqualsIgnoreCase(waveNames)); + + // Make sure that we found the executable file + if (exeFsnode == fslist.end()) { + warning("Couldn't find Apple IIGS game executable (%s), not loading instruments", exeNames.begin()->c_str()); + return false; + } - return errOK; -} + // Make sure that we found the wave file + if (waveFsnode == fslist.end()) { + warning("Couldn't find Apple IIGS wave file (%s), not loading instruments", waveNames.begin()->c_str()); + return false; + } -void Sound::unloadInstruments() { - free(instruments); -} -#endif + // First load the wave file and then load the instrument headers. + // Finally fix the instruments' lengths using the wave file data + // (A zero in the wave file data can end the sample prematurely) + // and convert the wave file from 8-bit unsigned to 16-bit signed format. + Common::MemoryReadStream *uint8Wave = loadWaveFile(waveFsnode->getPath(), *exeInfo); + // Seek the wave to its + if (uint8Wave != NULL) + uint8Wave->seek(0); + + bool result = uint8Wave != NULL && loadInstrumentHeaders(exeFsnode->getPath(), *exeInfo) && + finalizeInstruments(*uint8Wave) && convertWave(*uint8Wave, g_wave, uint8Wave->size()); -#endif /* USE_IIGS_SOUND */ + delete uint8Wave; // Free the 8-bit unsigned wave file buffer + return result; +} static void fillAudio(void *udata, int16 *stream, uint len) { SoundMgr *soundMgr = (SoundMgr *)udata; @@ -834,10 +1089,14 @@ static void fillAudio(void *udata, int16 *stream, uint len) { n -= s; } -SoundMgr::SoundMgr(AgiEngine *agi, Audio::Mixer *pMixer) { +SoundMgr::SoundMgr(AgiBase *agi, Audio::Mixer *pMixer) { _vm = agi; _mixer = pMixer; _sampleRate = pMixer->getOutputRate(); + _endflag = -1; + _playingSound = -1; + _sndBuffer = 0; + _waveform = 0; } void SoundMgr::premixerCall(int16 *data, uint len) { diff --git a/engines/agi/sound.h b/engines/agi/sound.h index 5b3a16668b..5d9bfda445 100644 --- a/engines/agi/sound.h +++ b/engines/agi/sound.h @@ -26,20 +26,23 @@ #ifndef AGI_SOUND_H #define AGI_SOUND_H +#include "agi/agi.h" #include "sound/audiostream.h" #include "sound/mixer.h" +#include "common/frac.h" namespace Agi { #define BUFFER_SIZE 410 +#define IIGS_BUFFER_SIZE 200 #define SOUND_EMU_NONE 0 #define SOUND_EMU_PC 1 #define SOUND_EMU_TANDY 2 #define SOUND_EMU_MAC 3 #define SOUND_EMU_AMIGA 4 +#define SOUND_EMU_APPLE2GS 5 -#define SOUND_PLAYING 0x01 #define WAVEFORM_SIZE 64 #define ENV_ATTACK 10000 /**< envelope attack rate */ #define ENV_DECAY 1000 /**< envelope decay rate */ @@ -47,51 +50,197 @@ namespace Agi { #define ENV_RELEASE 7500 /**< envelope release rate */ #define NUM_CHANNELS 7 /**< number of sound channels */ -/** - * AGI sound resource structure. - */ -struct AgiSound { - uint32 flen; /**< size of raw data */ - uint8 *rdata; /**< raw sound data */ - uint8 flags; /**< sound flags */ - uint16 type; /**< sound resource type */ +// MIDI command values (Shifted right by 4 so they're in the lower nibble) +#define MIDI_CMD_NOTE_OFF 0x08 +#define MIDI_CMD_NOTE_ON 0x09 +#define MIDI_CMD_CONTROLLER 0x0B +#define MIDI_CMD_PROGRAM_CHANGE 0x0C +#define MIDI_CMD_PITCH_WHEEL 0x0E +// Whole MIDI byte values (Command and channel info together) +#define MIDI_BYTE_STOP_SEQUENCE 0xFC +#define MIDI_BYTE_TIMER_SYNC 0xF8 + +struct IIgsEnvelopeSegment { + uint8 bp; + uint16 inc; ///< 8b.8b fixed point, very probably little endian +}; + +#define ENVELOPE_SEGMENT_COUNT 8 +struct IIgsEnvelope { + IIgsEnvelopeSegment seg[ENVELOPE_SEGMENT_COUNT]; + + /** Reads an Apple IIGS envelope from then given stream. */ + bool read(Common::SeekableReadStream &stream); +}; + +// 2**(1/12) i.e. the 12th root of 2 +#define SEMITONE 1.059463094359295 + +// C6's frequency is A4's (440 Hz) frequency but one full octave and three semitones higher +// i.e. C6_FREQ = 440 * pow(2.0, 15/12.0) +#define C6_FREQ 1046.502261202395 + +// Size of the SIERRASTANDARD file (i.e. the wave file i.e. the sample data used by the instruments). +#define SIERRASTANDARD_SIZE 65536 + +// Maximum number of instruments in an Apple IIGS instrument set. +// Chosen empirically based on Apple IIGS AGI game data, increase if needed. +#define MAX_INSTRUMENTS 28 + +struct IIgsWaveInfo { + uint8 top; + uint addr; + uint size; +// Oscillator channel +#define OSC_CHANNEL_RIGHT 0 +#define OSC_CHANNEL_LEFT 1 + uint channel; +// Oscillator mode +#define OSC_MODE_LOOP 0 +#define OSC_MODE_ONESHOT 1 +#define OSC_MODE_SYNC_AM 2 +#define OSC_MODE_SWAP 3 + uint mode; + bool halt; + int16 relPitch; ///< Relative pitch in semitones (Signed 8b.8b fixed point) + + /** Reads an Apple IIGS wave information structure from the given stream. */ + bool read(Common::SeekableReadStream &stream, bool ignoreAddr = false); + bool finalize(Common::SeekableReadStream &uint8Wave); }; -#include "common/pack-start.h" +// Number of waves per Apple IIGS sound oscillator +#define WAVES_PER_OSCILLATOR 2 + +/** An Apple IIGS sound oscillator. Consists always of two waves. */ +struct IIgsOscillator { + IIgsWaveInfo waves[WAVES_PER_OSCILLATOR]; + + bool finalize(Common::SeekableReadStream &uint8Wave); +}; + +// Maximum number of oscillators in an Apple IIGS instrument. +// Chosen empirically based on Apple IIGS AGI game data, increase if needed. +#define MAX_OSCILLATORS 4 + +/** An Apple IIGS sound oscillator list. */ +struct IIgsOscillatorList { + uint count; ///< Oscillator count + IIgsOscillator osc[MAX_OSCILLATORS]; ///< The oscillators + + /** Indexing operators for easier access to the oscillators. */ + const IIgsOscillator &operator()(uint index) const { return osc[index]; } + IIgsOscillator &operator()(uint index) { return osc[index]; } + + /** Reads an Apple IIGS oscillator list from the given stream. */ + bool read(Common::SeekableReadStream &stream, uint oscillatorCount, bool ignoreAddr = false); + bool finalize(Common::SeekableReadStream &uint8Wave); +}; + +struct IIgsInstrumentHeader { + IIgsEnvelope env; + uint8 relseg; + uint8 bendrange; + uint8 vibdepth; + uint8 vibspeed; + IIgsOscillatorList oscList; + + /** + * Read an Apple IIGS instrument header from the given stream. + * @param stream The source stream from which to read the data. + * @param ignoreAddr Should we ignore wave infos' wave address variable's value? + * @return True if successful, false otherwise. + */ + bool read(Common::SeekableReadStream &stream, bool ignoreAddr = false); + bool finalize(Common::SeekableReadStream &uint8Wave); +}; + +struct IIgsSampleHeader { + uint16 type; + uint8 pitch; ///< Logarithmic, base is 2**(1/12), unknown multiplier (Possibly in range 1040-1080) + uint8 unknownByte_Ofs3; // 0x7F in Gold Rush's sound resource 60, 0 in all others. + uint8 volume; ///< Current guess: Logarithmic in 6 dB steps + uint8 unknownByte_Ofs5; ///< 0 in all tested samples. + uint16 instrumentSize; ///< Little endian. 44 in all tested samples. A guess. + uint16 sampleSize; ///< Little endian. Accurate in all tested samples excluding Manhunter I's sound resource 16. + IIgsInstrumentHeader instrument; + + /** + * Read an Apple IIGS AGI sample header from the given stream. + * @param stream The source stream from which to read the data. + * @return True if successful, false otherwise. + */ + bool read(Common::SeekableReadStream &stream); + bool finalize(Common::SeekableReadStream &uint8Wave); +}; /** * AGI sound note structure. */ struct AgiNote { - uint8 durLo; /**< LSB of note duration */ - uint8 durHi; /**< MSB of note duration */ - uint8 frq0; /**< LSB of note frequency */ - uint8 frq1; /**< MSB of note frequency */ - uint8 vol; /**< note volume */ + uint16 duration; ///< Note duration + uint16 freqDiv; ///< Note frequency divisor (10-bit) + uint8 attenuation; ///< Note volume attenuation (4-bit) + + /** Reads an AgiNote through the given pointer. */ + void read(const uint8 *ptr) { + duration = READ_LE_UINT16(ptr); + uint16 freqByte0 = *(ptr + 2); // Bits 4-9 of the frequency divisor + uint16 freqByte1 = *(ptr + 3); // Bits 0-3 of the frequency divisor + // Merge the frequency divisor's bits together into a single variable + freqDiv = ((freqByte0 & 0x3F) << 4) | (freqByte1 & 0x0F); + attenuation = *(ptr + 4) & 0x0F; + } }; -#include "common/pack-end.h" +struct IIgsChannelInfo { + IIgsInstrumentHeader ins; ///< Instrument info + const int16 *sample; ///< Source sample data (16-bit signed format) + frac_t pos; ///< Current sample position + frac_t posAdd; ///< Current sample position adder (Calculated using note, vibrato etc) + frac_t note; ///< Note + frac_t vol; ///< Current volume (Takes both channel volume and enveloping into account) + frac_t chanVol; ///< Channel volume + frac_t startEnvVol; ///< Starting envelope volume + frac_t envVol; ///< Current envelope volume + uint envSeg; ///< Current envelope segment + uint size; ///< Sample size + bool loop; ///< Should we loop the sample? + bool end; ///< Has the playing ended? +}; + /** + * AGI sound resource types. + * It's probably coincidence that all the values here are powers of two + * as they're simply the different used values in AGI sound resources' + * starts (The first 16-bit little endian word, to be precise). + */ + enum AgiSoundType { + AGI_SOUND_SAMPLE = 0x0001, + AGI_SOUND_MIDI = 0x0002, + AGI_SOUND_4CHN = 0x0008 + }; + enum AgiSoundFlags { + AGI_SOUND_LOOP = 0x0001, + AGI_SOUND_ENVELOPE = 0x0002 + }; + enum AgiSoundEnv { + AGI_SOUND_ENV_ATTACK = 3, + AGI_SOUND_ENV_DECAY = 2, + AGI_SOUND_ENV_SUSTAIN = 1, + AGI_SOUND_ENV_RELEASE = 0 + }; /** * AGI engine sound channel structure. */ struct ChannelInfo { -#define AGI_SOUND_SAMPLE 0x0001 -#define AGI_SOUND_MIDI 0x0002 -#define AGI_SOUND_4CHN 0x0008 - uint32 type; - struct AgiNote *ptr; - int16 *ins; + AgiSoundType type; + const uint8 *ptr; // Pointer to the AgiNote data + const int16 *ins; int32 size; uint32 phase; -#define AGI_SOUND_LOOP 0x0001 -#define AGI_SOUND_ENVELOPE 0x0002 - uint32 flags; -#define AGI_SOUND_ENV_ATTACK 3 -#define AGI_SOUND_ENV_DECAY 2 -#define AGI_SOUND_ENV_SUSTAIN 1 -#define AGI_SOUND_ENV_RELEASE 0 - uint32 adsr; + uint32 flags; // ORs values from AgiSoundFlags + AgiSoundEnv adsr; int32 timer; uint32 end; uint32 freq; @@ -99,13 +248,101 @@ struct ChannelInfo { uint32 env; }; +class SoundMgr; + +/** + * AGI sound resource structure. + */ +class AgiSound { +public: + AgiSound(SoundMgr &manager) : _manager(manager), _isPlaying(false), _isValid(false) {} + virtual ~AgiSound() {} + virtual void play() { _isPlaying = true; } + virtual void stop() { _isPlaying = false; } + virtual bool isPlaying() { return _isPlaying; } + virtual uint16 type() = 0; + + /** + * A named constructor for creating different types of AgiSound objects + * from a raw sound resource. + * + * NOTE: This function should take responsibility for freeing the raw resource + * from memory using free() or delegate the responsibility onwards to some other + * function! + */ + static AgiSound *createFromRawResource(uint8 *data, uint32 len, int resnum, SoundMgr &manager); + +protected: + SoundMgr &_manager; ///< AGI sound manager object + bool _isPlaying; ///< Is the sound playing? + bool _isValid; ///< Is this a valid sound object? +}; + +class PCjrSound : public AgiSound { +public: + PCjrSound(uint8 *data, uint32 len, int resnum, SoundMgr &manager); + ~PCjrSound() { if (_data != NULL) free(_data); } + virtual uint16 type() { return _type; } + const uint8 *getVoicePointer(uint voiceNum); +protected: + uint8 *_data; ///< Raw sound resource data + uint32 _len; ///< Length of the raw sound resource + uint16 _type; ///< Sound resource type +}; + +class IIgsMidi : public AgiSound { +public: + IIgsMidi(uint8 *data, uint32 len, int resnum, SoundMgr &manager); + ~IIgsMidi() { if (_data != NULL) free(_data); } + virtual uint16 type() { return _type; } + virtual const uint8 *getPtr() { return _ptr; } + virtual void setPtr(const uint8 *ptr) { _ptr = ptr; } + virtual void rewind() { _ptr = _data + 2; } +protected: + uint8 *_data; ///< Raw sound resource data + const uint8 *_ptr; ///< Pointer to the current position in the MIDI data + uint32 _len; ///< Length of the raw sound resource + uint16 _type; ///< Sound resource type +}; + +class IIgsSample : public AgiSound { +public: + IIgsSample(uint8 *data, uint32 len, int resnum, SoundMgr &manager); + ~IIgsSample() { delete[] _sample; } + virtual uint16 type() { return _header.type; } + const IIgsSampleHeader &getHeader() const { return _header; } + const int16 *getSample() const { return _sample; } +protected: + IIgsSampleHeader _header; ///< Apple IIGS AGI sample header + int16 *_sample; ///< Sample data (16-bit signed format) +}; + +/** Apple IIGS AGI instrument set information. */ +struct instrumentSetInfo { + uint byteCount; ///< Length of the whole instrument set in bytes + uint instCount; ///< Amount of instrument in the set + const char *md5; ///< MD5 hex digest of the whole instrument set + const char *waveFileMd5; ///< MD5 hex digest of the wave file (i.e. the sample data used by the instruments) +}; + +/** Apple IIGS AGI executable file information. */ +struct IIgsExeInfo { + enum AgiGameID gameid; ///< Game ID + const char *exePrefix; ///< Prefix of the Apple IIGS AGI executable (e.g. "SQ", "PQ", "KQ4" etc) + uint agiVer; ///< Apple IIGS AGI version number, not strictly needed + uint exeSize; ///< Size of the Apple IIGS AGI executable file in bytes + uint instSetStart; ///< Starting offset of the instrument set inside the executable file + const instrumentSetInfo &instSet; ///< Information about the used instrument set +}; + class AgiEngine; +class AgiBase; class SoundMgr : public Audio::AudioStream { - AgiEngine *_vm; + AgiBase *_vm; public: - SoundMgr(AgiEngine *agi, Audio::Mixer *pMixer); + SoundMgr(AgiBase *agi, Audio::Mixer *pMixer); ~SoundMgr(); virtual void setVolume(uint8 volume); @@ -133,11 +370,19 @@ private: Audio::SoundHandle _soundHandle; uint32 _sampleRate; + bool _playing; + ChannelInfo _chn[NUM_CHANNELS]; + IIgsChannelInfo _IIgsChannel; + int _endflag; + int _playingSound; + uint8 _env; + + int16 *_sndBuffer; + const int16 *_waveform; + void premixerCall(int16 *buf, uint len); public: - - void decodeSound(int); void unloadSound(int); void playSound(); int initSound(); @@ -148,11 +393,15 @@ public: void playNote(int i, int freq, int vol); void playAgiSound(); uint32 mixSound(); - int loadInstruments(char *fname); -#ifdef USE_IIGS_SOUND + bool loadInstruments(); void playMidiSound(); void playSampleSound(); -#endif + bool finalizeInstruments(Common::SeekableReadStream &uint8Wave); + Audio::AudioStream *makeIIgsSampleStream(Common::SeekableReadStream &stream, int resnum = -1); + const IIgsExeInfo *getIIgsExeInfo(enum AgiGameID gameid) const; + bool loadInstrumentHeaders(const Common::String &exePath, const IIgsExeInfo &exeInfo); + bool convertWave(Common::SeekableReadStream &source, int16 *dest, uint length); + Common::MemoryReadStream *loadWaveFile(const Common::String &wavePath, const IIgsExeInfo &exeInfo); }; } // End of namespace Agi diff --git a/engines/agi/text.cpp b/engines/agi/text.cpp index 1d653a9415..bb334d0401 100644 --- a/engines/agi/text.cpp +++ b/engines/agi/text.cpp @@ -67,6 +67,8 @@ void AgiEngine::printText2(int l, const char *msg, int foff, int xoff, int yoff, for (m = (const unsigned char *)msg, x1 = y1 = 0; *m; m++) { if (*m >= 0x20 || *m == 1 || *m == 2 || *m == 3) { + // FIXME: Fingolfin asks: why is there a FIXME here? Please either clarify what + // needs fixing, or remove it! /* FIXME */ int ypos; diff --git a/engines/agos/agos.cpp b/engines/agos/agos.cpp index 76e4378982..aa927b1dcd 100644 --- a/engines/agos/agos.cpp +++ b/engines/agos/agos.cpp @@ -37,21 +37,10 @@ #include "sound/mididrv.h" #include "sound/mods/protracker.h" -#ifdef PALMOS_68K -#include "globals.h" -#endif - using Common::File; namespace AGOS { -#ifdef PALMOS_68K -#define PTR(a) a -static const GameSpecificSettings *simon1_settings; -static const GameSpecificSettings *simon2_settings; -static const GameSpecificSettings *feeblefiles_settings; -#else -#define PTR(a) &a static const GameSpecificSettings simon1_settings = { "EFFECTS", // effects_filename "SIMON", // speech_filename @@ -71,8 +60,6 @@ static const GameSpecificSettings puzzlepack_settings = { "", // effects_filename "MUSIC", // speech_filename }; -#endif - AGOSEngine_PuzzlePack::AGOSEngine_PuzzlePack(OSystem *system) : AGOSEngine_Feeble(system) { @@ -692,13 +679,9 @@ static const uint16 initialVideoWindows_Common[20] = { }; void AGOSEngine_PuzzlePack::setupGame() { - gss = PTR(puzzlepack_settings); + gss = &puzzlepack_settings; _numVideoOpcodes = 85; -#ifndef PALMOS_68K _vgaMemSize = 7500000; -#else - _vgaMemSize = gVars->memory[kMemSimon2Games]; -#endif _itemMemSize = 20000; _tableMemSize = 200000; _frameCount = 1; @@ -713,13 +696,9 @@ void AGOSEngine_PuzzlePack::setupGame() { } void AGOSEngine_Feeble::setupGame() { - gss = PTR(feeblefiles_settings); + gss = &feeblefiles_settings; _numVideoOpcodes = 85; -#ifndef PALMOS_68K _vgaMemSize = 7500000; -#else - _vgaMemSize = gVars->memory[kMemSimon2Games]; -#endif _itemMemSize = 20000; _tableMemSize = 200000; _frameCount = 1; @@ -736,14 +715,12 @@ void AGOSEngine_Feeble::setupGame() { } void AGOSEngine_Simon2::setupGame() { - gss = PTR(simon2_settings); + gss = &simon2_settings; _tableIndexBase = 1580 / 4; _textIndexBase = 1500 / 4; _numVideoOpcodes = 75; #if defined(__DS__) _vgaMemSize = 1300000; -#elif defined(PALMOS_68K) - _vgaMemSize = gVars->memory[kMemSimon2Games]; #else _vgaMemSize = 2000000; #endif @@ -772,15 +749,11 @@ void AGOSEngine_Simon2::setupGame() { } void AGOSEngine_Simon1::setupGame() { - gss = PTR(simon1_settings); + gss = &simon1_settings; _tableIndexBase = 1576 / 4; _textIndexBase = 1460 / 4; _numVideoOpcodes = 64; -#ifndef PALMOS_68K _vgaMemSize = 1000000; -#else - _vgaMemSize = gVars->memory[kMemSimon1Games]; -#endif _itemMemSize = 20000; _tableMemSize = 50000; _musicIndexBase = 1316 / 4; @@ -802,13 +775,9 @@ void AGOSEngine_Simon1::setupGame() { } void AGOSEngine_Waxworks::setupGame() { - gss = PTR(simon1_settings); + gss = &simon1_settings; _numVideoOpcodes = 64; -#ifndef PALMOS_68K _vgaMemSize = 1000000; -#else - _vgaMemSize = gVars->memory[kMemSimon1Games]; -#endif _itemMemSize = 80000; _tableMemSize = 50000; _frameCount = 4; @@ -826,13 +795,9 @@ void AGOSEngine_Waxworks::setupGame() { } void AGOSEngine_Elvira2::setupGame() { - gss = PTR(simon1_settings); + gss = &simon1_settings; _numVideoOpcodes = 60; -#ifndef PALMOS_68K _vgaMemSize = 1000000; -#else - _vgaMemSize = gVars->memory[kMemSimon1Games]; -#endif _itemMemSize = 64000; _tableMemSize = 100000; _frameCount = 4; @@ -849,13 +814,9 @@ void AGOSEngine_Elvira2::setupGame() { } void AGOSEngine_Elvira1::setupGame() { - gss = PTR(simon1_settings); + gss = &simon1_settings; _numVideoOpcodes = 57; -#ifndef PALMOS_68K _vgaMemSize = 1000000; -#else - _vgaMemSize = gVars->memory[kMemSimon1Games]; -#endif _itemMemSize = 64000; _tableMemSize = 256000; _frameCount = 4; @@ -1094,20 +1055,3 @@ void AGOSEngine::shutdown() { } } // End of namespace AGOS - -#ifdef PALMOS_68K -#include "scumm_globals.h" - -_GINIT(AGOS_AGOS) -_GSETPTR(AGOS::simon1_settings, GBVARS_SIMON1SETTINGS_INDEX, AGOS::GameSpecificSettings, GBVARS_AGOS) -_GSETPTR(AGOS::simon2_settings, GBVARS_SIMON2SETTINGS_INDEX, AGOS::GameSpecificSettings, GBVARS_AGOS) -_GSETPTR(AGOS::feeblefiles_settings, GBVARS_FEEBLEFILESSETTINGS_INDEX, AGOS::GameSpecificSettings, GBVARS_AGOS) -_GEND - -_GRELEASE(AGOS_AGOS) -_GRELEASEPTR(GBVARS_SIMON1SETTINGS_INDEX, GBVARS_AGOS) -_GRELEASEPTR(GBVARS_SIMON2SETTINGS_INDEX, GBVARS_AGOS) -_GRELEASEPTR(GBVARS_FEEBLEFILESSETTINGS_INDEX, GBVARS_AGOS) -_GEND - -#endif diff --git a/engines/agos/charset.cpp b/engines/agos/charset.cpp index 9a37d90c33..68eb2d7ac8 100644 --- a/engines/agos/charset.cpp +++ b/engines/agos/charset.cpp @@ -543,7 +543,15 @@ void AGOSEngine::justifyOutPut(byte chr) { doOutput(&chr, 1); clsCheck(_textWindow); } else if (chr == 0 || chr == ' ' || chr == 10) { - if (_printCharMaxPos - _printCharCurPos >= _printCharPixelCount) { + bool fit; + + if (getGameType() == GType_FF || getGameType() == GType_PP) { + fit = _printCharMaxPos - _printCharCurPos > _printCharPixelCount; + } else { + fit = _printCharMaxPos - _printCharCurPos >= _printCharPixelCount; + } + + if (fit) { _printCharCurPos += _printCharPixelCount; doOutput(_lettersToPrintBuf, _numLettersToPrint); @@ -741,22 +749,6 @@ void AGOSEngine::windowScroll(WindowBlock *window) { _lockWord &= ~0x8000; } -#ifdef PALMOS_68K -static const byte *feeble_windowFont; -static const byte *czech_simonFont; -static const byte *russian_simonFont; -static const byte *polish_simonFont; -static const byte *french_simonFont; -static const byte *german_simonFont; -static const byte *hebrew_simonFont; -static const byte *italian_simonFont; -static const byte *spanish_simonFont; -static const byte *english_simonFont; -static const byte *spanish_commonFont; -static const byte *italian_commonFont; -static const byte *french_commonFont; -static const byte *english_commonFont; -#else static const byte feeble_windowFont[] = { 0,0,0,0,0,0,0,0,0,0,0,0,0, 128,128,128,128,128,128,128,0,0,128,0,0,0, @@ -2267,7 +2259,6 @@ static const byte english_commonFont[] = { 0xFC, 0xFC, 0xFC, 0xFC, 0xFC, 0xFC, 0xFC, 0xFC, 0x00, 0xFC, 0xFC, 0xFC, 0xFC, 0xFC, 0xFC, 0x00, }; -#endif void AGOSEngine::windowDrawChar(WindowBlock *window, uint x, uint y, byte chr) { const byte *src; @@ -2379,29 +2370,3 @@ void AGOSEngine::windowDrawChar(WindowBlock *window, uint x, uint y, byte chr) { } // End of namespace AGOS -#ifdef PALMOS_68K -#include "scumm_globals.h" - -_GINIT(AGOS_Charset) -_GSETPTR(AGOS::russian_windowFont, GBVARS_RUSSIANVIDEOFONT_INDEX, byte, GBVARS_AGOS) -//_GSETPTR(AGOS::polish_windowFont, GBVARS_POLISHVIDEOFONT_INDEX, byte, GBVARS_AGOS) -_GSETPTR(AGOS::french_windowFont, GBVARS_FRENCHVIDEOFONT_INDEX, byte, GBVARS_AGOS) -_GSETPTR(AGOS::german_windowFont, GBVARS_GERMANVIDEOFONT_INDEX, byte, GBVARS_AGOS) -_GSETPTR(AGOS::hebrew_windowFont, GBVARS_HEBREWVIDEOFONT_INDEX, byte, GBVARS_AGOS) -_GSETPTR(AGOS::italian_windowFont, GBVARS_ITALIANVIDEOFONT_INDEX, byte, GBVARS_AGOS) -_GSETPTR(AGOS::spanish_windowFont, GBVARS_SPANISHVIDEOFONT_INDEX, byte, GBVARS_AGOS) -_GSETPTR(AGOS::english_windowFont, GBVARS_VIDEOFONT_INDEX, byte, GBVARS_AGOS) -_GEND - -_GRELEASE(AGOS_Charset) -_GRELEASEPTR(GBVARS_RUSSIANVIDEOFONT_INDEX, GBVARS_AGOS) -//_GRELEASEPTR(GBVARS_POLISHVIDEOFONT_INDEX, GBVARS_AGOS) -_GRELEASEPTR(GBVARS_FRENCHVIDEOFONT_INDEX, GBVARS_AGOS) -_GRELEASEPTR(GBVARS_GERMANVIDEOFONT_INDEX, GBVARS_AGOS) -_GRELEASEPTR(GBVARS_HEBREWVIDEOFONT_INDEX, GBVARS_AGOS) -_GRELEASEPTR(GBVARS_ITALIANVIDEOFONT_INDEX, GBVARS_AGOS) -_GRELEASEPTR(GBVARS_SPANISHVIDEOFONT_INDEX, GBVARS_AGOS) -_GRELEASEPTR(GBVARS_VIDEOFONT_INDEX, GBVARS_AGOS) -_GEND - -#endif diff --git a/engines/agos/cursor.cpp b/engines/agos/cursor.cpp index 35bb8ea216..9c2cb42988 100644 --- a/engines/agos/cursor.cpp +++ b/engines/agos/cursor.cpp @@ -790,16 +790,3 @@ void AGOSEngine::drawMousePointer() { } } // End of namespace AGOS - -#ifdef PALMOS_68K -#include "scumm_globals.h" - -_GINIT(AGOS_Cursor) -_GSETPTR(AGOS::_simon1_cursor, GBVARS_SIMON1CURSOR_INDEX, byte, GBVARS_AGOS) -_GEND - -_GRELEASE(AGOS_Cursor) -_GRELEASEPTR(GBVARS_SIMON1CURSOR_INDEX, GBVARS_AGOS) -_GEND - -#endif diff --git a/engines/agos/detection.cpp b/engines/agos/detection.cpp index 0f5aa2768a..31ff220412 100644 --- a/engines/agos/detection.cpp +++ b/engines/agos/detection.cpp @@ -18,8 +18,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL:https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/branches/gsoc2007-fsnode/engines/agos/detection.cpp $ - * $Id:detection.cpp 26949 2007-05-26 20:23:24Z david_corrales $ + * $URL$ + * $Id$ * */ @@ -101,55 +101,42 @@ static const Common::ADParams detectionParams = { Common::kADFlagAugmentPreferredTarget }; -GameList Engine_AGOS_gameIDList() { - return GameList(simonGames); -} - -GameDescriptor Engine_AGOS_findGameID(const char *gameid) { - return Common::AdvancedDetector::findGameID(gameid, simonGames, obsoleteGameIDsTable); -} +bool engineCreateAgos(OSystem *syst, Engine **engine, Common::EncapsulatedADGameDesc encapsulatedDesc) { + const AGOS::AGOSGameDescription *gd = (const AGOS::AGOSGameDescription *)(encapsulatedDesc.realDesc); + bool res = true; -GameList Engine_AGOS_detectGames(const FSList &fslist) { - return Common::AdvancedDetector::detectAllGames(fslist, detectionParams); -} - -PluginError Engine_AGOS_create(OSystem *syst, Engine **engine) { - assert(engine); - const char *gameid = ConfMan.get("gameid").c_str(); - - //Common::EncapsulatedADGameDesc encapsulatedDesc = Common::AdvancedDetector::detectBestMatchingGame(detectionParams); - //const AGOSGameDescription *gd = (const AGOSGameDescription *)(encapsulatedDesc.realDesc); - //if (gd == 0) { - // return kNoGameDataFoundError; - //} - - if (!scumm_stricmp("elvira1", gameid)) { + switch (gd->gameType) { + case AGOS::GType_ELVIRA1: *engine = new AGOS::AGOSEngine_Elvira1(syst); - } else if (!scumm_stricmp("elvira2", gameid)) { + break; + case AGOS::GType_ELVIRA2: *engine = new AGOS::AGOSEngine_Elvira2(syst); - } else if (!scumm_stricmp("waxworks", gameid)) { + break; + case AGOS::GType_WW: *engine = new AGOS::AGOSEngine_Waxworks(syst); - } else if (!scumm_stricmp("simon1", gameid)) { + break; + case AGOS::GType_SIMON1: *engine = new AGOS::AGOSEngine_Simon1(syst); - } else if (!scumm_stricmp("simon2", gameid)) { + break; + case AGOS::GType_SIMON2: *engine = new AGOS::AGOSEngine_Simon2(syst); - } else if (!scumm_stricmp("feeble", gameid)) { + break; + case AGOS::GType_FF: *engine = new AGOS::AGOSEngine_Feeble(syst); - } else if (!scumm_stricmp("dimp", gameid)) { - *engine = new AGOS::AGOSEngine_PuzzlePack(syst); - } else if (!scumm_stricmp("jumble", gameid)) { + break; + case AGOS::GType_PP: *engine = new AGOS::AGOSEngine_PuzzlePack(syst); - } else if (!scumm_stricmp("puzzle", gameid)) { - *engine = new AGOS::AGOSEngine_PuzzlePack(syst); - } else if (!scumm_stricmp("swampy", gameid)) { - *engine = new AGOS::AGOSEngine_PuzzlePack(syst); - } else { - error("AGOS engine created with invalid gameid"); + break; + default: + res = false; + error("AGOS engine: unknown gameType"); } - return kNoError; + return res; } - + +ADVANCED_DETECTOR_DEFINE_PLUGIN_WITH_COMPLEX_CREATION(AGOS, engineCreateAgos, detectionParams); + REGISTER_PLUGIN(AGOS, "AGOS", "AGOS (C) Adventure Soft"); namespace AGOS { diff --git a/engines/agos/detection_tables.h b/engines/agos/detection_tables.h index 988de6729b..f600b3febf 100644 --- a/engines/agos/detection_tables.h +++ b/engines/agos/detection_tables.h @@ -18,8 +18,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL:https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/branches/gsoc2007-fsnode/engines/agos/detection_tables.h $ - * $Id:detection_tables.h 26949 2007-05-26 20:23:24Z david_corrales $ + * $URL$ + * $Id$ * */ @@ -290,6 +290,31 @@ static const AGOSGameDescription gameDescriptions[] = { GF_OLD_BUNDLE | GF_CRUNCHED | GF_PLANAR }, + // Elvira 2 - German Amiga Floppy + { + { + "elvira2", + "Floppy", + + { + { "menus.dat", GAME_MENUFILE, "a2fdc88a77c8bdffec6b36cbeda4d955", -1}, + { "stripped.txt", GAME_STRFILE, "41c975a9c1106cb5298a0bc3df0a266e", -1}, + { "gameamiga", GAME_BASEFILE, "7af80eb9759bcafcd8df21e61c5af200", -1}, + { "icon.dat", GAME_ICONFILE, "a88b1c02e13ab04dd790ec30502c323d", -1}, + { "tbllist", GAME_TBLFILE, "177f5f2640e80ef92d1421d32de06a5e", -1}, + { "start", GAME_RESTFILE, "a9f876c6c66dfd011b971da3dc7b4ada", -1}, + { NULL, 0, NULL, 0} + }, + Common::DE_DEU, + Common::kPlatformAmiga, + Common::ADGF_NO_FLAGS + }, + + GType_ELVIRA2, + GID_ELVIRA2, + GF_OLD_BUNDLE | GF_CRUNCHED | GF_PLANAR + }, + // Elvira 2 - Italian Amiga Floppy { { diff --git a/engines/agos/draw.cpp b/engines/agos/draw.cpp index bb28da73b5..68bb152844 100644 --- a/engines/agos/draw.cpp +++ b/engines/agos/draw.cpp @@ -503,8 +503,8 @@ void AGOSEngine::saveBackGround(VgaSprite *vsp) { if (_window3Flag == 1) { animTable->srcPtr = (const byte *)_window4BackScn; } else { - uint xoffs = (_videoWindows[vsp->windowNum * 4 + 0] * 2 + x) * 8; - uint yoffs = (_videoWindows[vsp->windowNum * 4 + 1] + y); + int xoffs = (_videoWindows[vsp->windowNum * 4 + 0] * 2 + x) * 8; + int yoffs = (_videoWindows[vsp->windowNum * 4 + 1] + y); animTable->srcPtr = getBackGround() + xoffs + yoffs * _screenWidth; } diff --git a/engines/agos/gfx.cpp b/engines/agos/gfx.cpp index 15937db0da..20ab84d15d 100644 --- a/engines/agos/gfx.cpp +++ b/engines/agos/gfx.cpp @@ -668,7 +668,7 @@ void AGOSEngine_Simon1::drawImage(VC10_state *state) { if (_windowNum == 4 || (_windowNum >= 10 && _windowNum <= 27)) { state->surf2_addr = getBackGround(); state->surf2_pitch = _screenWidth; - + state->surf_addr = _window4BackScn; state->surf_pitch = _videoWindows[18] * 16; diff --git a/engines/agos/intern.h b/engines/agos/intern.h index 44d38fbeed..a6d843d183 100644 --- a/engines/agos/intern.h +++ b/engines/agos/intern.h @@ -187,13 +187,8 @@ struct TimeEvent { }; struct GameSpecificSettings { -#ifndef PALMOS_68K const char *effects_filename; const char *speech_filename; - #else - const char effects_filename[12]; - const char speech_filename[12]; - #endif }; enum BoxFlags { diff --git a/engines/cine/sound.cpp b/engines/cine/sound.cpp index 4746e87a66..4ba083a653 100644 --- a/engines/cine/sound.cpp +++ b/engines/cine/sound.cpp @@ -18,8 +18,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL:https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/branches/gsoc2007-fsnode/engines/cine/sound.cpp $ - * $Id:sound.cpp 26949 2007-05-26 20:23:24Z david_corrales $ + * $URL$ + * $Id$ * */ diff --git a/engines/cine/sound.h b/engines/cine/sound.h index 4ebda2c236..719f37f151 100644 --- a/engines/cine/sound.h +++ b/engines/cine/sound.h @@ -18,8 +18,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL:https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/branches/gsoc2007-fsnode/engines/cine/sound.h $ - * $Id:sound.h 26949 2007-05-26 20:23:24Z david_corrales $ + * $URL$ + * $Id$ * */ diff --git a/engines/cruise/actor.cpp b/engines/cruise/actor.cpp index dd38e15838..c4af217117 100644 --- a/engines/cruise/actor.cpp +++ b/engines/cruise/actor.cpp @@ -18,8 +18,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL:https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/branches/gsoc2007-fsnode/engines/cruise/actor.cpp $ - * $Id:actor.cpp 26949 2007-05-26 20:23:24Z david_corrales $ + * $URL$ + * $Id$ * */ @@ -471,8 +471,7 @@ void valide_noeud(int16 table[], int16 p, int *nclick, int16 solution0[20 + 3][2 (*nclick)++; ctpVar19 = ctpVar11; - if (*nclick == 2) // second point - { + if (*nclick == 2) { // second point x1 = table_ptselect[0][0]; y1 = table_ptselect[0][1]; x2 = table_ptselect[1][0]; @@ -858,26 +857,18 @@ void processAnimation(void) { currentActor->phase = ANIM_PHASE_MOVE; } - if ((currentActor->counter >= - 0) - && ((currentActor->phase == - ANIM_PHASE_STATIC_END) - || (currentActor-> - phase == - ANIM_PHASE_STATIC))) + if ((currentActor->counter >= 0) + && ((currentActor->phase == ANIM_PHASE_STATIC_END) + || (currentActor->phase == ANIM_PHASE_STATIC))) { int newA; int inc = 1; - int t_inc = - currentActor-> - startDirection - 1; + int t_inc = currentActor->startDirection - 1; if (t_inc < 0) t_inc = 3; - if (currentActor-> - nextDirection == - t_inc) + if (currentActor->nextDirection == t_inc) inc = -1; if (inc > 0) diff --git a/engines/cruise/actor.h b/engines/cruise/actor.h index 072eef9581..43b9b03e87 100644 --- a/engines/cruise/actor.h +++ b/engines/cruise/actor.h @@ -18,8 +18,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL:https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/branches/gsoc2007-fsnode/engines/cruise/actor.h $ - * $Id:actor.h 26949 2007-05-26 20:23:24Z david_corrales $ + * $URL$ + * $Id$ * */ diff --git a/engines/cruise/background.cpp b/engines/cruise/background.cpp index ebf0b78934..f23c331eb8 100644 --- a/engines/cruise/background.cpp +++ b/engines/cruise/background.cpp @@ -18,8 +18,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL:https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/branches/gsoc2007-fsnode/engines/cruise/background.cpp $ - * $Id:background.cpp 26949 2007-05-26 20:23:24Z david_corrales $ + * $URL$ + * $Id$ * */ @@ -98,8 +98,7 @@ int loadBackground(char *name, int idx) { backgroundPtrtable[idx] = (uint8 *) mallocAndZero(320 * 200 /*64000 */ ); } -/* else - { +/* else { backgroundPtrtable[idx] = hwMemAddr[idx]; } */ } diff --git a/engines/cruise/background.h b/engines/cruise/background.h index b8b9e623c6..d506d1663e 100644 --- a/engines/cruise/background.h +++ b/engines/cruise/background.h @@ -18,8 +18,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL:https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/branches/gsoc2007-fsnode/engines/cruise/background.h $ - * $Id:background.h 26949 2007-05-26 20:23:24Z david_corrales $ + * $URL$ + * $Id$ * */ diff --git a/engines/cruise/backgroundIncrust.cpp b/engines/cruise/backgroundIncrust.cpp index edaa68b490..7e79c048b1 100644 --- a/engines/cruise/backgroundIncrust.cpp +++ b/engines/cruise/backgroundIncrust.cpp @@ -18,8 +18,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL:https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/branches/gsoc2007-fsnode/engines/cruise/backgroundIncrust.cpp $ - * $Id:backgroundIncrust.cpp 26949 2007-05-26 20:23:24Z david_corrales $ + * $URL$ + * $Id$ * */ @@ -113,8 +113,7 @@ backgroundIncrustStruct *addBackgroundIncrust(int16 overlayIdx, newElement->ptr = NULL; strcpy(newElement->name, filesDatabase[params.fileIdx].subData.name); - if (filesDatabase[params.fileIdx].subData.resourceType == 4) // sprite - { + if (filesDatabase[params.fileIdx].subData.resourceType == 4) { // sprite int width = filesDatabase[params.fileIdx].width; int height = filesDatabase[params.fileIdx].height; @@ -125,8 +124,7 @@ backgroundIncrustStruct *addBackgroundIncrust(int16 overlayIdx, newElement->Y, newElement->X, (char *)backgroundPtr, (char *)filesDatabase[params.fileIdx].subData.ptr); // ASSERT(0); - } else // poly - { + } else { // poly /* if(param4 == 1) * { * int var_A; diff --git a/engines/cruise/backgroundIncrust.h b/engines/cruise/backgroundIncrust.h index 3f61faadae..6de30978fd 100644 --- a/engines/cruise/backgroundIncrust.h +++ b/engines/cruise/backgroundIncrust.h @@ -18,8 +18,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL:https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/branches/gsoc2007-fsnode/engines/cruise/backgroundIncrust.h $ - * $Id:backgroundIncrust.h 26949 2007-05-26 20:23:24Z david_corrales $ + * $URL$ + * $Id$ * */ diff --git a/engines/cruise/cell.cpp b/engines/cruise/cell.cpp index 8a7b524a7b..d4b5aaed66 100644 --- a/engines/cruise/cell.cpp +++ b/engines/cruise/cell.cpp @@ -18,8 +18,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL:https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/branches/gsoc2007-fsnode/engines/cruise/cell.cpp $ - * $Id:cell.cpp 26949 2007-05-26 20:23:24Z david_corrales $ + * $URL$ + * $Id$ * */ diff --git a/engines/cruise/cell.h b/engines/cruise/cell.h index ea2fb7e777..c10ab93541 100644 --- a/engines/cruise/cell.h +++ b/engines/cruise/cell.h @@ -18,8 +18,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL:https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/branches/gsoc2007-fsnode/engines/cruise/cell.h $ - * $Id:cell.h 26949 2007-05-26 20:23:24Z david_corrales $ + * $URL$ + * $Id$ * */ diff --git a/engines/cruise/cruise.cpp b/engines/cruise/cruise.cpp index b427498c6f..9693fb7d03 100644 --- a/engines/cruise/cruise.cpp +++ b/engines/cruise/cruise.cpp @@ -18,8 +18,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL:https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/branches/gsoc2007-fsnode/engines/cruise/cruise.cpp $ - * $Id:cruise.cpp 26949 2007-05-26 20:23:24Z david_corrales $ + * $URL$ + * $Id$ * */ diff --git a/engines/cruise/cruise.h b/engines/cruise/cruise.h index cf768d8d57..73de46c599 100644 --- a/engines/cruise/cruise.h +++ b/engines/cruise/cruise.h @@ -18,8 +18,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL:https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/branches/gsoc2007-fsnode/engines/cruise/cruise.h $ - * $Id:cruise.h 26949 2007-05-26 20:23:24Z david_corrales $ + * $URL$ + * $Id$ * */ diff --git a/engines/cruise/cruise_main.cpp b/engines/cruise/cruise_main.cpp index 79a699433f..b3b0077ee7 100644 --- a/engines/cruise/cruise_main.cpp +++ b/engines/cruise/cruise_main.cpp @@ -18,8 +18,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL:https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/branches/gsoc2007-fsnode/engines/cruise/cruise_main.cpp $ - * $Id:cruise_main.cpp 26949 2007-05-26 20:23:24Z david_corrales $ + * $URL$ + * $Id$ * */ @@ -627,192 +627,98 @@ int getCursorFromObject(int mouseX, int mouseY, int *outX, int *outY) { cellStruct *currentObject = cellHead.prev; while (currentObject) { - if (currentObject->overlay >= 0) { - if (overlayTable[currentObject->overlay].alreadyLoaded) { - if (currentObject->type == 4 - || currentObject->type == 1 - || currentObject->type == 9 - || currentObject->type == 3) { - strcpy(objectName, - getObjectName(currentObject->idx, - overlayTable[currentObject-> - overlay].ovlData-> - specialString2)); - - if (strlen(objectName)) { - if (currentObject->freeze == 0) { - var_2 = - currentObject->idx; - var_4 = - currentObject-> - overlay; - var_14 = - currentObject-> - followObjectIdx; - var_16 = - currentObject-> - followObjectOverlayIdx; - - getMultipleObjectParam - (currentObject-> - overlay, - currentObject->idx, - ¶ms); - - var_10 = 0; - var_E = 0; - var_C = 0; - - if ((var_4 != var_16) - && (var_2 != - var_14)) { - getMultipleObjectParam - (var_16, - var_14, - ¶ms); - - var_C = - params.X; - var_E = - params.Y; - var_10 = - params. - fileIdx; + if (currentObject->overlay >= 0 && overlayTable[currentObject->overlay].alreadyLoaded + && (currentObject->type == 4 || currentObject->type == 1 + || currentObject->type == 9 || currentObject->type == 3)) { + strcpy(objectName, + getObjectName(currentObject->idx, + overlayTable[currentObject->overlay].ovlData->specialString2)); + + if (strlen(objectName)) { + if (currentObject->freeze == 0) { + var_2 = currentObject->idx; + var_4 = currentObject->overlay; + var_14 = currentObject->followObjectIdx; + var_16 = currentObject->followObjectOverlayIdx; + + getMultipleObjectParam(currentObject->overlay, currentObject->idx, ¶ms); + + var_10 = 0; + var_E = 0; + var_C = 0; + + if ((var_4 != var_16) + && (var_2 != var_14)) { + getMultipleObjectParam + (var_16, var_14, ¶ms); + + var_C = params.X; + var_E = params.Y; + var_10 = params.fileIdx; + } + + if (params.var5 >= 0 && params.fileIdx >= 0) { + if (currentObject->type == 3) { + assert(0); + + var_2 = params.scale; + var_A = params.X + var_C; + + // TODO: this var3 is stupid, investigate... + if ((var_A <= mouseX) && (var_A + params.fileIdx >= mouseX) && (mouseY >= params.Y + var_E) && (params.Y + var_E + var2 >= mouseY)) { + *outX = var_16; + *outY = var_14; + + return (currentObject->type); } + } else if (currentObject->type == 4 || + currentObject->type == 1 || + currentObject->type == 9) { + int si; + int var_8; + int di; - if (params.var5 >= 0 - && params. - fileIdx >= 0) { - if (currentObject->type == 3) { - assert - (0); - - var_2 = - params. - scale; - var_A = - params. - X + - var_C; - - // TODO: this var3 is stupid, investigate... - if ((var_A <= mouseX) && (var_A + params.fileIdx >= mouseX) && (mouseY >= params.Y + var_E) && (params.Y + var_E + var2 >= mouseY)) { - *outX - = - var_16; - *outY - = - var_14; - - return - (currentObject-> - type); - } - } else - if - (currentObject-> - type == 4 - || - currentObject-> - type == 1 - || - currentObject-> - type == - 9) { - int si; - int var_8; - int di; - - var_A = - params. - X + - var_C; - var_6 = - params. - Y + - var_E; - - di = params.fileIdx; - - if (di - < - 0) - { - di += var_10; - } + var_A = params.X + var_C; + var_6 = params.Y + var_E; -/* if((filesDatabase[di].subData.resourceType == 8) && (filesDatabase[di].subData.ptr)) - { - assert(0); - } - else */ - { - var_4 - = - filesDatabase - [di]. - resType; + di = params.fileIdx; + if (di < 0) { + di += var_10; + } + +/* if((filesDatabase[di].subData.resourceType == 8) && (filesDatabase[di].subData.ptr)) { + assert(0); + } +*/ + { + var_4 = filesDatabase[di].resType; + + if (var_4 == 1) { + var_C = filesDatabase[di].widthInColumn / 2; + } else { + var_C = filesDatabase[di].width; + } + + var_8 = filesDatabase[di].height; + + var_2 = mouseX - var_A; + si = mouseY - var_6; + + if (var_2 > 0 && var_C > var_2 && si > 0 && var_8 >= si) { + if (filesDatabase[di].subData.ptr) { if (var_4 == 1) { - var_C - = - filesDatabase - [di]. - widthInColumn - / - 2; } else { - var_C - = - filesDatabase - [di]. - width; } - var_8 - = - filesDatabase - [di]. - height; - - var_2 - = - mouseX - - - var_A; - si = mouseY - var_6; - - if (var_2 > 0) { - if (var_C > var_2) { - if (si > 0) { - if (var_8 >= si) { - if (filesDatabase[di].subData.ptr) { - if (var_4 == 1) { - } else { - } - - printf - ("should compare to mask in getCursorFromObject...\n"); + printf("should compare to mask in getCursorFromObject...\n"); - *outX - = - var_16; - *outY - = - var_14; + *outX = var_16; + *outY = var_14; - printf - ("Selected: %s\n", - objectName); + printf("Selected: %s\n", objectName); - return - currentObject-> - type; - } - } - } - } - } + return currentObject->type; } } } @@ -878,52 +784,22 @@ void buildInventory(int X, int Y) { menuStruct *pMenu; pMenu = createMenu(X, Y, "Inventaire"); - menuTable[1] = pMenu; - if (pMenu) { - numObjectInInventory = 0; + if (pMenu && numOfLoadedOverlay > 1) { + for (int i = 1; i < numOfLoadedOverlay; i++) { + ovlDataStruct *pOvlData = overlayTable[i].ovlData; - if (numOfLoadedOverlay > 1) { - int i; + if (pOvlData && pOvlData->objDataTable && pOvlData->numObjData) { + for (int j = 0; j < pOvlData->numObjData; j++) { + if (buildInventorySub1(i, j) != 3) { + int16 returnVar; - for (i = 1; i < numOfLoadedOverlay; i++) { - ovlDataStruct *pOvlData = - overlayTable[i].ovlData; + getSingleObjectParam(i, j, 5, &returnVar); - if (pOvlData && pOvlData->objDataTable) { - int var_2; - - var_2 = 0; - - if (pOvlData->numObjData) { - int j; - - for (j = 0; - j < pOvlData->numObjData; - j++) { - if (buildInventorySub1 - (i, j) != 3) { - int16 - returnVar; - - getSingleObjectParam - (i, j, 5, - &returnVar); - - if (returnVar < - -1) { - addSelectableMenuEntry - (i, - j, - pMenu, - 1, - -1, - getObjectName - (j, pOvlData->specialString2)); - numObjectInInventory++; - } - } + if (returnVar < -1) { + addSelectableMenuEntry(i, j, pMenu, 1, -1, getObjectName(j, pOvlData->specialString2)); + numObjectInInventory++; } } } @@ -1014,12 +890,9 @@ int callInventoryObject(int param0, int param1, int x, int y) { var_34->stringNameOffset); if (var_2 == param0) { - if (param1 == - var_34->stringNameOffset) { + if (param1 == var_34->stringNameOffset) { if (pObject) { - if (pObject-> - type != - 3) { + if (pObject->type != 3) { char var_214[80]; char var_1C4[80]; char var_174[80]; @@ -1027,110 +900,52 @@ int callInventoryObject(int param0, int param1, int x, int y) { char var_D4[80]; char var_84[80]; - ovlDataStruct - *var_12; - ovlDataStruct - *var_22; + ovlDataStruct *var_12; + ovlDataStruct *var_22; int var_E = var_34->varIdx; - int cx - = - var_34-> - stringIdx; + int cx = var_34->stringIdx; int var_C = var_34->procIdx; - int di - = - var_E; + int di = var_E; if (var_E == 0) di = var_1E; - var_2 = - cx; - if (cx - == - 0) - var_2 - = - var_1E; + var_2 = cx; + if (cx == 0) + var_2 = var_1E; if (var_C == 0) - var_C - = - var_1E; - - var_12 - = - NULL; - var_22 - = - NULL; - - var_214 - [0] - = - 0; - var_1C4 - [0] - = - 0; - var_174 - [0] - = - 0; - var_124 - [0] - = - 0; - var_D4 - [0] - = - 0; - var_84 - [0] - = - 0; - - if (di - > - 0) - { - var_22 - = - overlayTable - [di]. - ovlData; + var_C = var_1E; + + var_12 = NULL; + var_22 = NULL; + + var_214[0] = 0; + var_1C4[0] = 0; + var_174[0] = 0; + var_124[0] = 0; + var_D4[0] = 0; + var_84[0] = 0; + + if (di > 0) { + var_22 = overlayTable[di].ovlData; } if (var_2 > 0) { - var_12 - = - overlayTable - [var_2]. - ovlData; + var_12 = overlayTable[var_2].ovlData; } if (var_12) { if (var_34->stringNameOffset) { - var_30 - = - var_34-> - field_1A; + var_30 = var_34->field_1A; if (var_28) { if (var_12->specialString2) { if (var_30 == -1 || var_30 == returnVar) { char *ptrName = getObjectName(var_34->stringNameOffset, var_12->specialString2); - menuTable - [0] - = - createMenu - (x, - y, - ptrName); - var_28 - = - 0; + menuTable[0] = createMenu(x, y, ptrName); + var_28 = 0; } } } @@ -1138,8 +953,7 @@ int callInventoryObject(int param0, int param1, int x, int y) { } if (var_22) { - if (true /*var_34->varNameOffset>=0 */ ) // FIXME: This check is always true since varNameOffset is unsigned - { + if (true /*var_34->varNameOffset>=0 */ ) { // FIXME: This check is always true since varNameOffset is unsigned if (var_22->specialString1) { char *ptr = getObjectName(var_34->varNameOffset, var_22->specialString1); @@ -1289,8 +1103,7 @@ int processInput(void) { ASSERT(0); } - if (var38 == 0) // are we in inventory mode ? - { + if (var38 == 0) { // are we in inventory mode ? if (menuTable[0] == 0) { int X; int Y; diff --git a/engines/cruise/cruise_main.h b/engines/cruise/cruise_main.h index 324d99f024..c42650a007 100644 --- a/engines/cruise/cruise_main.h +++ b/engines/cruise/cruise_main.h @@ -18,8 +18,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL:https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/branches/gsoc2007-fsnode/engines/cruise/cruise_main.h $ - * $Id:cruise_main.h 26949 2007-05-26 20:23:24Z david_corrales $ + * $URL$ + * $Id$ * */ diff --git a/engines/cruise/ctp.cpp b/engines/cruise/ctp.cpp index 07df6029b2..5af2cda46c 100644 --- a/engines/cruise/ctp.cpp +++ b/engines/cruise/ctp.cpp @@ -18,8 +18,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL:https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/branches/gsoc2007-fsnode/engines/cruise/ctp.cpp $ - * $Id:ctp.cpp 26949 2007-05-26 20:23:24Z david_corrales $ + * $URL$ + * $Id$ * */ @@ -66,16 +66,14 @@ void loadCtpSub2(short int coordCount, short int *ptr) { short int *cur_ctp_routeCoords = (short int *)ctp_routeCoords; // coordinates table int8 *cur_ctp_routes = (int8 *) ctp_routes; - for (i = 0; i < coordCount; i++) // for i < ctp_routeCoordCount - { + for (i = 0; i < coordCount; i++) { // for i < ctp_routeCoordCount int varX = cur_ctp_routeCoords[0]; // x int varY = cur_ctp_routeCoords[1]; // y int di = 0; int var4Offset = 2; - while (*(int16 *) cur_ctp_routes > di) // while (coordCount > counter++) - { + while (*(int16 *) cur_ctp_routes > di) { // while (coordCount > counter++) int idx = *(int16 *) (cur_ctp_routes + var4Offset); ptr[offset + idx] = ctpProc2(varX, varY, ctp_routeCoords[idx][0], @@ -189,8 +187,7 @@ void loadCtpSub1(int boxIdx, int scale, uint16 *_walkboxTable, ASSERT(boxIdx <= 15); - if (_walkboxTable[boxIdx * 40] > 0) // is walkbox used ? - { + if (_walkboxTable[boxIdx * 40] > 0) { // is walkbox used ? getWalkBoxCenter(boxIdx, _walkboxTable); currentWalkBoxCenterYBis = currentWalkBoxCenterY; diff --git a/engines/cruise/ctp.h b/engines/cruise/ctp.h index b35523a3a7..2ea47ce62e 100644 --- a/engines/cruise/ctp.h +++ b/engines/cruise/ctp.h @@ -18,8 +18,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL:https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/branches/gsoc2007-fsnode/engines/cruise/ctp.h $ - * $Id:ctp.h 26949 2007-05-26 20:23:24Z david_corrales $ + * $URL$ + * $Id$ * */ diff --git a/engines/cruise/dataLoader.cpp b/engines/cruise/dataLoader.cpp index 2212a3bde2..54a0e97732 100644 --- a/engines/cruise/dataLoader.cpp +++ b/engines/cruise/dataLoader.cpp @@ -18,8 +18,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL:https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/branches/gsoc2007-fsnode/engines/cruise/dataLoader.cpp $ - * $Id:dataLoader.cpp 26949 2007-05-26 20:23:24Z david_corrales $ + * $URL$ + * $Id$ * */ diff --git a/engines/cruise/dataLoader.h b/engines/cruise/dataLoader.h index 6b6bf52cf6..46e4ef447f 100644 --- a/engines/cruise/dataLoader.h +++ b/engines/cruise/dataLoader.h @@ -18,8 +18,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL:https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/branches/gsoc2007-fsnode/engines/cruise/dataLoader.h $ - * $Id:dataLoader.h 26949 2007-05-26 20:23:24Z david_corrales $ + * $URL$ + * $Id$ * */ diff --git a/engines/cruise/decompiler.cpp b/engines/cruise/decompiler.cpp index 68beab0846..b027f948aa 100644 --- a/engines/cruise/decompiler.cpp +++ b/engines/cruise/decompiler.cpp @@ -18,8 +18,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL:https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/branches/gsoc2007-fsnode/engines/cruise/decompiler.cpp $ - * $Id:decompiler.cpp 26949 2007-05-26 20:23:24Z david_corrales $ + * $URL$ + * $Id$ * */ @@ -136,52 +136,47 @@ void pushDecomp(char *string, ...) { void resolveDecompShort(char *buffer) { ovlData3Struct *data3Ptr = currentScript; + int i; - { - int i; + importScriptStruct *importEntry = + (importScriptStruct *) (data3Ptr->dataPtr + + data3Ptr->offsetToImportData); - importScriptStruct *importEntry = - (importScriptStruct *) (data3Ptr->dataPtr + - data3Ptr->offsetToImportData); - - for (i = 0; i < data3Ptr->numImport; i++) { - switch (importEntry->type) { - case 20: // script - case 30: - case 40: - case 50: - { - if (importEntry->offset == currentDecompScriptPtr->var4 - 3) // param1 - { - sprintf(buffer, - data3Ptr->dataPtr + - data3Ptr-> - offsetToImportName + - importEntry->offsetToName); - return; - } - if (importEntry->offset == currentDecompScriptPtr->var4 - 6) // param2 - { - sprintf(buffer, "linkedIdx"); - return; - } - break; + for (i = 0; i < data3Ptr->numImport; i++) { + switch (importEntry->type) { + case 20: // script + case 30: + case 40: + case 50: + { + if (importEntry->offset == currentDecompScriptPtr->var4 - 3) { // param1 + sprintf(buffer, + data3Ptr->dataPtr + + data3Ptr-> + offsetToImportName + + importEntry->offsetToName); + return; } - default: - { - if (importEntry->offset == - currentDecompScriptPtr->var4 - 4) { - sprintf(buffer, - data3Ptr->dataPtr + - data3Ptr-> - offsetToImportName + - importEntry->offsetToName); - return; - } + if (importEntry->offset == currentDecompScriptPtr->var4 - 6) { // param2 + sprintf(buffer, "linkedIdx"); + return; + } + break; + } + default: + { + if (importEntry->offset == + currentDecompScriptPtr->var4 - 4) { + sprintf(buffer, + data3Ptr->dataPtr + + data3Ptr-> + offsetToImportName + + importEntry->offsetToName); + return; } } - importEntry++; } + importEntry++; } buffer[0] = 0; @@ -190,31 +185,28 @@ void resolveDecompShort(char *buffer) { void resolveDecompChar(char *buffer) { ovlData3Struct *data3Ptr = currentScript; + int i; - { - int i; + importScriptStruct *importEntry = + (importScriptStruct *) (data3Ptr->dataPtr + + data3Ptr->offsetToImportData); - importScriptStruct *importEntry = - (importScriptStruct *) (data3Ptr->dataPtr + - data3Ptr->offsetToImportData); - - for (i = 0; i < data3Ptr->numImport; i++) { - switch (importEntry->type) { - default: - { - if (importEntry->offset == - currentDecompScriptPtr->var4 - 2) { - sprintf(buffer, - data3Ptr->dataPtr + - data3Ptr-> - offsetToImportName + - importEntry->offsetToName); - return; - } + for (i = 0; i < data3Ptr->numImport; i++) { + switch (importEntry->type) { + default: + { + if (importEntry->offset == + currentDecompScriptPtr->var4 - 2) { + sprintf(buffer, + data3Ptr->dataPtr + + data3Ptr-> + offsetToImportName + + importEntry->offsetToName); + return; } } - importEntry++; } + importEntry++; } buffer[0] = 0; @@ -342,16 +334,14 @@ void resolveVarName(char *ovlIdxString, int varType, char *varIdxString, for (i = 0; i < currentDecompOvl->numExport; i++) { if (varIdx == currentDecompOvl->exportDataPtr[i].idx) { - if (((currentDecompOvl->exportDataPtr[i].var4 & 0xF0) == 0) && varType != 0x20) // var - { + if (((currentDecompOvl->exportDataPtr[i].var4 & 0xF0) == 0) && varType != 0x20) { // var strcpy(outputName, currentDecompOvl->exportNamesPtr + currentDecompOvl->exportDataPtr[i]. offsetToName); return; } - if ((currentDecompOvl->exportDataPtr[i].var4) == 20 && varType == 0x20) // script - { + if ((currentDecompOvl->exportDataPtr[i].var4) == 20 && varType == 0x20) { // script strcpy(outputName, currentDecompOvl->exportNamesPtr + currentDecompOvl->exportDataPtr[i]. @@ -722,13 +712,11 @@ int decompCompare(void) { if(!pop) si = 1; - if(pop<0) - { + if(pop<0) { si |= 4; } - if(pop>0) - { + if(pop>0) { si |= 2; } @@ -1435,7 +1423,7 @@ int decompBreak(void) { } void generateIndentation(void) { - int i; + int i, j; for (i = 0; i < positionInDecompileLineTable; i++) { if (decompileLineTable[i].type != 0) { @@ -1449,37 +1437,25 @@ void generateIndentation(void) { gotoStatement = strchr(gotoStatement, ' ') + 1; destLine = atoi(gotoStatement); + destLineIdx = -1; - { - int j; - - destLineIdx = -1; - - for (j = 0; j < positionInDecompileLineTable; - j++) { - if (decompileLineTable[j].lineOffset == - destLine) { - destLineIdx = j; - break; - } + for (j = 0; j < positionInDecompileLineTable; j++) { + if (decompileLineTable[j].lineOffset == destLine) { + destLineIdx = j; + break; } + } - assert(destLineIdx != -1); - - if (destLineIdx > i) { - int j; + assert(destLineIdx != -1); - for (j = i + 1; j < destLineIdx; j++) { - decompileLineTable[j].indent++; - } + if (destLineIdx > i) { + for (j = i + 1; j < destLineIdx; j++) { + decompileLineTable[j].indent++; + } - if (strstr(decompileLineTable - [destLineIdx - 1].line, - "goto") == - decompileLineTable[destLineIdx - - 1].line) { - //decompileLineTable[destLineIdx-1].pendingElse = 1; - } + if (strstr(decompileLineTable[destLineIdx - 1].line, "goto") == + decompileLineTable[destLineIdx - 1].line) { + //decompileLineTable[destLineIdx-1].pendingElse = 1; } } } diff --git a/engines/cruise/delphine-unpack.cpp b/engines/cruise/delphine-unpack.cpp index db4188fbfe..b1cdc13148 100644 --- a/engines/cruise/delphine-unpack.cpp +++ b/engines/cruise/delphine-unpack.cpp @@ -18,8 +18,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL:https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/branches/gsoc2007-fsnode/engines/cruise/delphine-unpack.cpp $ - * $Id:delphine-unpack.cpp 26949 2007-05-26 20:23:24Z david_corrales $ + * $URL$ + * $Id$ * */ diff --git a/engines/cruise/detection.cpp b/engines/cruise/detection.cpp index fc1d864a56..2ca83f4046 100644 --- a/engines/cruise/detection.cpp +++ b/engines/cruise/detection.cpp @@ -18,8 +18,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL:https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/branches/gsoc2007-fsnode/engines/cruise/detection.cpp $ - * $Id:detection.cpp 26949 2007-05-26 20:23:24Z david_corrales $ + * $URL$ + * $Id$ * */ diff --git a/engines/cruise/font.cpp b/engines/cruise/font.cpp index 92064acc53..ee99567525 100644 --- a/engines/cruise/font.cpp +++ b/engines/cruise/font.cpp @@ -18,8 +18,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL:https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/branches/gsoc2007-fsnode/engines/cruise/font.cpp $ - * $Id:font.cpp 26949 2007-05-26 20:23:24Z david_corrales $ + * $URL$ + * $Id$ * */ @@ -253,8 +253,7 @@ void renderWord(uint8 * fontPtr_Data, uint8 * outBufferPtr, outBufferPtr += heightOff * width * 2; // param2 = height , param6 = width outBufferPtr += drawPosPixel_X; // param1 = drawPosPixel_X - for (i = 0; i < height; i++) // y++ - { + for (i = 0; i < height; i++) { // y++ uint16 currentColor1 = (*(fontPtr_Data) << 8) | *(fontPtr_Data + 1); uint16 currentColor2 = diff --git a/engines/cruise/font.h b/engines/cruise/font.h index 2a75cf28dd..b74482962d 100644 --- a/engines/cruise/font.h +++ b/engines/cruise/font.h @@ -18,8 +18,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL:https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/branches/gsoc2007-fsnode/engines/cruise/font.h $ - * $Id:font.h 26949 2007-05-26 20:23:24Z david_corrales $ + * $URL$ + * $Id$ * */ diff --git a/engines/cruise/fontCharacterTable.cpp b/engines/cruise/fontCharacterTable.cpp index ce0bec0f0f..2c2dddc479 100644 --- a/engines/cruise/fontCharacterTable.cpp +++ b/engines/cruise/fontCharacterTable.cpp @@ -18,8 +18,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL:https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/branches/gsoc2007-fsnode/engines/cruise/fontCharacterTable.cpp $ - * $Id:fontCharacterTable.cpp 26949 2007-05-26 20:23:24Z david_corrales $ + * $URL$ + * $Id$ * */ diff --git a/engines/cruise/fontCharacterTable.h b/engines/cruise/fontCharacterTable.h index f7956968ec..0bfe78641a 100644 --- a/engines/cruise/fontCharacterTable.h +++ b/engines/cruise/fontCharacterTable.h @@ -18,8 +18,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL:https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/branches/gsoc2007-fsnode/engines/cruise/fontCharacterTable.h $ - * $Id:fontCharacterTable.h 26949 2007-05-26 20:23:24Z david_corrales $ + * $URL$ + * $Id$ * */ diff --git a/engines/cruise/function.cpp b/engines/cruise/function.cpp index 092425bfc7..cfb579e331 100644 --- a/engines/cruise/function.cpp +++ b/engines/cruise/function.cpp @@ -18,8 +18,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL:https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/branches/gsoc2007-fsnode/engines/cruise/function.cpp $ - * $Id:function.cpp 26949 2007-05-26 20:23:24Z david_corrales $ + * $URL$ + * $Id$ * */ @@ -1006,8 +1006,7 @@ actorStruct *addAnimation(actorStruct * pHead, int overlay, int objIdx, int para return pNewElement; } -int removeAnimation(actorStruct * pHead, int overlay, int objIdx, int objType) -{ +int removeAnimation(actorStruct * pHead, int overlay, int objIdx, int objType) { actorStruct* pl; actorStruct* pl2; actorStruct* pl3; @@ -1019,14 +1018,12 @@ int removeAnimation(actorStruct * pHead, int overlay, int objIdx, int objType) pl2 = pl; pl = pl2->next; - while(pl) - { + while (pl) { pl2 = pl; - if(((pl->overlayNumber == overlay) || (overlay == -1)) && + if (((pl->overlayNumber == overlay) || (overlay == -1)) && ((pl->idx == objIdx) || (objIdx == -1)) && - ((pl->type == objType) || (objType == -1))) - { + ((pl->type == objType) || (objType == -1))) { pl->type = -1; } @@ -1037,29 +1034,25 @@ int removeAnimation(actorStruct * pHead, int overlay, int objIdx, int objType) pl2 = pl; pl = pl2->next; - while(pl) - { - if(pl->type == -1) - { + while (pl) { + if (pl->type == -1) { pl4 = pl->next; pl2->next = pl4; pl3 = pl4; - if(pl3 == NULL) + if (pl3 == NULL) pl3 = pHead; pl3->prev = pl->prev; dir = pl->startDirection; - if(pl->idx >= 0) + if (pl->idx >= 0) freePerso(pl->idx); free(pl); pl = pl4; - } - else - { + } else { pl2 = pl; pl = pl2->next; } diff --git a/engines/cruise/function.h b/engines/cruise/function.h index 76100e41ba..13eb21ea1f 100644 --- a/engines/cruise/function.h +++ b/engines/cruise/function.h @@ -18,8 +18,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL:https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/branches/gsoc2007-fsnode/engines/cruise/function.h $ - * $Id:function.h 26949 2007-05-26 20:23:24Z david_corrales $ + * $URL$ + * $Id$ * */ diff --git a/engines/cruise/gfxModule.cpp b/engines/cruise/gfxModule.cpp index 119f99739e..9228193560 100644 --- a/engines/cruise/gfxModule.cpp +++ b/engines/cruise/gfxModule.cpp @@ -18,8 +18,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL:https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/branches/gsoc2007-fsnode/engines/cruise/gfxModule.cpp $ - * $Id:gfxModule.cpp 26949 2007-05-26 20:23:24Z david_corrales $ + * $URL$ + * $Id$ * */ @@ -526,10 +526,8 @@ void gfxModuleData_field_60(char *sourcePtr, int width, int height, int i; int j; - for(i=x;i<height+x;i++) - { - for(j=y;j<width*16+y;j++) - { + for(i=x;i<height+x;i++) { + for(j=y;j<width*16+y;j++) { if(i>=0&&i<200&&j>=0&&j<320) destPtr[i*320+j] = *(sourcePtr++); } diff --git a/engines/cruise/gfxModule.h b/engines/cruise/gfxModule.h index 7339113f4c..e63b26e29f 100644 --- a/engines/cruise/gfxModule.h +++ b/engines/cruise/gfxModule.h @@ -18,8 +18,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL:https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/branches/gsoc2007-fsnode/engines/cruise/gfxModule.h $ - * $Id:gfxModule.h 26949 2007-05-26 20:23:24Z david_corrales $ + * $URL$ + * $Id$ * */ diff --git a/engines/cruise/linker.cpp b/engines/cruise/linker.cpp index 0057625e81..e72218037b 100644 --- a/engines/cruise/linker.cpp +++ b/engines/cruise/linker.cpp @@ -18,8 +18,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL:https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/branches/gsoc2007-fsnode/engines/cruise/linker.cpp $ - * $Id:linker.cpp 26949 2007-05-26 20:23:24Z david_corrales $ + * $URL$ + * $Id$ * */ @@ -186,70 +186,36 @@ int updateScriptImport(int ovlIdx) { int temp = ptrImportData-> offset; - if (out1) //is sub function... (ie 'invent.livre:s') - { + if (out1) { //is sub function... (ie 'invent.livre:s') uint8 *ptr = ptrData + temp; - *(ptr + - 1) - = - out2; - *(int16 - *) - (ptr - + - 2) - = - ptrDest2-> - idx; - - flipShort - ( - (int16 - *) - (ptr + 2)); + *(ptr + 1) = out2; + *(int16 *)(ptr + 2) = ptrDest2->idx; + + flipShort((int16 *)(ptr + 2)); } else { - if (param2 == 20 || param2 == 30 || param2 == 40 || param2 == 50) // this patch a double push - { - uint8 - * - ptr - = - ptrData - + - temp; + if (param2 == 20 || param2 == 30 || param2 == 40 || param2 == 50) { // this patch a double push + uint8 *ptr = ptrData + temp; *(ptr + 1) = 0; *(ptr + 2) = out2; // update the overlay number - *(int16 *) (ptr + 4) = ptrDest2->idx; + *(int16 *)(ptr + 4) = ptrDest2->idx; - flipShort - ( - (int16 - *) - (ptr + 4)); + flipShort((int16 *)(ptr + 4)); } else { int var_4 = ptrDest2->var4; if (var_4 & 1) { - param2 - = - 8; + param2 = 8; } else { - param2 - = - 16; + param2 = 16; } if (var_4 >= 0 && var_4 <= 3) { - param2 - |= - 5; + param2 |= 5; } else { - param2 - |= - 6; + param2 |= 6; } *(ptrData + temp) = param2; diff --git a/engines/cruise/linker.h b/engines/cruise/linker.h index 975ed0f322..808ace75e0 100644 --- a/engines/cruise/linker.h +++ b/engines/cruise/linker.h @@ -18,8 +18,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL:https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/branches/gsoc2007-fsnode/engines/cruise/linker.h $ - * $Id:linker.h 26949 2007-05-26 20:23:24Z david_corrales $ + * $URL$ + * $Id$ * */ diff --git a/engines/cruise/mainDraw.cpp b/engines/cruise/mainDraw.cpp index 3d409d0ba5..b30dc29380 100644 --- a/engines/cruise/mainDraw.cpp +++ b/engines/cruise/mainDraw.cpp @@ -18,13 +18,14 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL:https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/branches/gsoc2007-fsnode/engines/cruise/mainDraw.cpp $ - * $Id:mainDraw.cpp 26949 2007-05-26 20:23:24Z david_corrales $ + * $URL$ + * $Id$ * */ #include "cruise/cruise_main.h" -#include "polys.h" +#include "cruise/polys.h" +#include "common/util.h" namespace Cruise { @@ -131,8 +132,7 @@ void getPolyData(int fileIndex, int X, int Y, int *outScale, int *outY, newFileIndex += fileIndex; - if (true /*newFileIndex >= 0 */ ) // FIXME: comparison is always true due to limited range of data type - { + if (true /*newFileIndex >= 0 */ ) { // FIXME: comparison is always true due to limited range of data type if (filesDatabase[newFileIndex].resType == 0 && filesDatabase[newFileIndex].subData.ptr) { dataPtr = @@ -180,8 +180,7 @@ void getPolySize(int positionX, int positionY, int scale, int sizeTable[4], int lowerBorder; m_flipLeftRight = 0; - if (scale < 0) // flip left right - { + if (scale < 0) { // flip left right m_flipLeftRight = 1; scale = -scale; } @@ -208,11 +207,8 @@ void getPolySize(int positionX, int positionY, int scale, int sizeTable[4], upperBorder = (upscaleValue(upperBorder, scale) + 0x8000) >> 16; - if (upperBorder < lowerBorder) // exchange borders if lower > upper - { - int temp = upperBorder; - upperBorder = lowerBorder; - lowerBorder = temp; + if (upperBorder < lowerBorder) { // exchange borders if lower > upper + SWAP(upperBorder, lowerBorder); } sizeTable[0] = lowerBorder; // left @@ -231,11 +227,8 @@ void getPolySize(int positionX, int positionY, int scale, int sizeTable[4], upperBorder -= *(dataPtr + 4); upperBorder = (upscaleValue(upperBorder, scale) + 0x8000) >> 16; - if (upperBorder < lowerBorder) // exchange borders if lower > upper - { - int temp = upperBorder; - upperBorder = lowerBorder; - lowerBorder = temp; + if (upperBorder < lowerBorder) { // exchange borders if lower > upper + SWAP(upperBorder, lowerBorder); } sizeTable[2] = lowerBorder; // bottom @@ -397,8 +390,7 @@ void buildPolyModel(int positionX, int positionY, int scale, char *ptr2, m_flipLeftRight = 1; } - if (scale < 0x180) // If scale is smaller than 384 - { + if (scale < 0x180) { // If scale is smaller than 384 m_useSmallScale = 1; m_scaleValue = scale << 1; // double scale } else { @@ -448,8 +440,7 @@ void buildPolyModel(int positionX, int positionY, int scale, char *ptr2, x = *(dataPointer++) - m_first_X; y = *(dataPointer++) - m_first_Y; - if (m_useSmallScale) // shrink all coordinates by factor 2 if a scale smaller than 384 is used - { + if (m_useSmallScale) { // shrink all coordinates by factor 2 if a scale smaller than 384 is used x >>= 1; y >>= 1; } @@ -502,8 +493,7 @@ void buildPolyModel(int positionX, int positionY, int scale, char *ptr2, do { int linesToDraw = *dataPointer++; - if (linesToDraw > 1) // if value not zero - { + if (linesToDraw > 1) { // if value not zero uint16 minimumScale; m_color = *dataPointer; // color @@ -514,8 +504,7 @@ void buildPolyModel(int positionX, int positionY, int scale, char *ptr2, flipShort(&minimumScale); - if (minimumScale > scale) // if the scale is too small, for the model to be drawn ... - { + if (minimumScale > scale) { // if the scale is too small, for the model to be drawn ... dataPointer += linesToDraw; // ... skip ahead } else { if (m_flipLeftRight) { @@ -913,13 +902,10 @@ void mainDraw(int16 param) { } if ((params.var5 >= 0) && (objZ2 >= 0) && filesDatabase[objZ2].subData.ptr) { - if (filesDatabase[objZ2].subData.resourceType == 8) // Poly - { + if (filesDatabase[objZ2].subData.resourceType == 8) { // Poly mainDrawPolygons(objZ2, currentObjPtr, objX2, params.scale, objY2, (char *)gfxModuleData.pPage10, (char *)filesDatabase[objZ2].subData.ptr); // poly - } else if (filesDatabase[objZ2].subData.resourceType == 6) // sound - { - } else if (filesDatabase[objZ2].resType == 1) //(num plan == 1) - { + } else if (filesDatabase[objZ2].subData.resourceType == 6) { // sound + } else if (filesDatabase[objZ2].resType == 1) { //(num plan == 1) } else if (filesDatabase[objZ2].subData.resourceType == 4) { objX1 = filesDatabase[objZ2].width; // width spriteHeight = filesDatabase[objZ2].height; // height @@ -953,12 +939,10 @@ void mainDraw(int16 param) { change = false; currentObjPtr->animStep = 0; - if (currentObjPtr->animType) // should we resume the script ? - { + if (currentObjPtr->animType) { // should we resume the script ? if (currentObjPtr->parentType == 20) { changeScriptParamInList(currentObjPtr->parentOverlay, currentObjPtr->parent, &procHead, 0, -1); - } - else if(currentObjPtr->parentType == 30) { + } else if (currentObjPtr->parentType == 30) { changeScriptParamInList(currentObjPtr->parentOverlay, currentObjPtr->parent, &relHead, 0, -1); } } diff --git a/engines/cruise/mainDraw.h b/engines/cruise/mainDraw.h index 7ff6ffdc8f..ad10bcddc6 100644 --- a/engines/cruise/mainDraw.h +++ b/engines/cruise/mainDraw.h @@ -18,8 +18,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL:https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/branches/gsoc2007-fsnode/engines/cruise/mainDraw.h $ - * $Id:mainDraw.h 26949 2007-05-26 20:23:24Z david_corrales $ + * $URL$ + * $Id$ * */ diff --git a/engines/cruise/menu.cpp b/engines/cruise/menu.cpp index e30542cc1b..4f828d1fd3 100644 --- a/engines/cruise/menu.cpp +++ b/engines/cruise/menu.cpp @@ -18,8 +18,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL:https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/branches/gsoc2007-fsnode/engines/cruise/menu.cpp $ - * $Id:menu.cpp 26949 2007-05-26 20:23:24Z david_corrales $ + * $URL$ + * $Id$ * */ @@ -221,8 +221,7 @@ int playerMenu(int menuX, int menuY) { freeStuff2(); } /* - if(currentMenu) - { + if(currentMenu) { freeMenu(currentMenu); currentMenu = 0; var37 = 0; @@ -230,8 +229,7 @@ int playerMenu(int menuX, int menuY) { main9 = -1; } - if(inventoryMenu) - { + if(inventoryMenu) { freeMenu(inventoryMenu); inventoryMenu = 0; var37 = 0; @@ -239,8 +237,7 @@ int playerMenu(int menuX, int menuY) { main9 = -1; }*/ -/* if(mouseVar2) - { +/* if(mouseVar2) { free3(mouseVar2); } */ diff --git a/engines/cruise/menu.h b/engines/cruise/menu.h index 9a33545224..4e15d15cf1 100644 --- a/engines/cruise/menu.h +++ b/engines/cruise/menu.h @@ -18,8 +18,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL:https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/branches/gsoc2007-fsnode/engines/cruise/menu.h $ - * $Id:menu.h 26949 2007-05-26 20:23:24Z david_corrales $ + * $URL$ + * $Id$ * */ diff --git a/engines/cruise/mouse.cpp b/engines/cruise/mouse.cpp index c9cec8f72a..a918e0536f 100644 --- a/engines/cruise/mouse.cpp +++ b/engines/cruise/mouse.cpp @@ -18,8 +18,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL:https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/branches/gsoc2007-fsnode/engines/cruise/mouse.cpp $ - * $Id:mouse.cpp 26949 2007-05-26 20:23:24Z david_corrales $ + * $URL$ + * $Id$ * */ diff --git a/engines/cruise/mouse.h b/engines/cruise/mouse.h index c7ef2a69c5..a6911ce27e 100644 --- a/engines/cruise/mouse.h +++ b/engines/cruise/mouse.h @@ -18,8 +18,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL:https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/branches/gsoc2007-fsnode/engines/cruise/mouse.h $ - * $Id:mouse.h 26949 2007-05-26 20:23:24Z david_corrales $ + * $URL$ + * $Id$ * */ diff --git a/engines/cruise/object.cpp b/engines/cruise/object.cpp index ce4de2a12b..22e81dea90 100644 --- a/engines/cruise/object.cpp +++ b/engines/cruise/object.cpp @@ -18,8 +18,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL:https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/branches/gsoc2007-fsnode/engines/cruise/object.cpp $ - * $Id:object.cpp 26949 2007-05-26 20:23:24Z david_corrales $ + * $URL$ + * $Id$ * */ diff --git a/engines/cruise/object.h b/engines/cruise/object.h index feec666687..546d2bc440 100644 --- a/engines/cruise/object.h +++ b/engines/cruise/object.h @@ -18,8 +18,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL:https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/branches/gsoc2007-fsnode/engines/cruise/object.h $ - * $Id:object.h 26949 2007-05-26 20:23:24Z david_corrales $ + * $URL$ + * $Id$ * */ diff --git a/engines/cruise/overlay.cpp b/engines/cruise/overlay.cpp index c1b35f61f6..179c53357d 100644 --- a/engines/cruise/overlay.cpp +++ b/engines/cruise/overlay.cpp @@ -18,8 +18,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL:https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/branches/gsoc2007-fsnode/engines/cruise/overlay.cpp $ - * $Id:overlay.cpp 26949 2007-05-26 20:23:24Z david_corrales $ + * $URL$ + * $Id$ * */ @@ -375,8 +375,7 @@ int loadOverlay(const uint8 *scriptName) { if (!ovlData->ptr8) { /* releaseScript(scriptIdx,scriptName); - if(freeIsNeeded) - { + if(freeIsNeeded) { freePtr(unpackedBuffer); } */ @@ -396,8 +395,7 @@ int loadOverlay(const uint8 *scriptName) { if (!ovlData->objDataTable) { /* releaseScript(scriptIdx,scriptName); - if(freeIsNeeded) - { + if(freeIsNeeded) { freePtr(unpackedBuffer); } */ @@ -457,8 +455,7 @@ int loadOverlay(const uint8 *scriptName) { if (!ovlData->objData2WorkTable) { /* releaseScript(scriptIdx,scriptName); - if(freeIsNeeded) - { + if(freeIsNeeded) { freePtr(unpackedBuffer); } */ @@ -474,8 +471,7 @@ int loadOverlay(const uint8 *scriptName) { if (!ovlData->objData2SourceTable) { /* releaseScript(scriptIdx,scriptName); - if(freeIsNeeded) - { + if(freeIsNeeded) { freePtr(unpackedBuffer); } */ @@ -501,8 +497,7 @@ int loadOverlay(const uint8 *scriptName) { } } -/* if(freeIsNeeded) - { +/* if(freeIsNeeded) { freePtr(unpackedBuffer); } */ @@ -701,14 +696,12 @@ int releaseOverlay(const char *name) { if (!ovlDataPtr) return -4; /* - if(overlayTable[overlayIdx].var1E) - { + if(overlayTable[overlayIdx].var1E) { free(overlayTable[overlayIdx].var1E); overlayTable[overlayIdx].var1E = NULL; } - if(overlayTable[overlayIdx].var16) - { + if(overlayTable[overlayIdx].var16) { free(overlayTable[overlayIdx].var16); overlayTable[overlayIdx].var16 = NULL; } */ diff --git a/engines/cruise/overlay.h b/engines/cruise/overlay.h index 03db06fada..5d2e4e890e 100644 --- a/engines/cruise/overlay.h +++ b/engines/cruise/overlay.h @@ -18,8 +18,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL:https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/branches/gsoc2007-fsnode/engines/cruise/overlay.h $ - * $Id:overlay.h 26949 2007-05-26 20:23:24Z david_corrales $ + * $URL$ + * $Id$ * */ diff --git a/engines/cruise/perso.cpp b/engines/cruise/perso.cpp index a95607a2f1..e0cd85f2fe 100644 --- a/engines/cruise/perso.cpp +++ b/engines/cruise/perso.cpp @@ -18,8 +18,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL:https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/branches/gsoc2007-fsnode/engines/cruise/perso.cpp $ - * $Id:perso.cpp 26949 2007-05-26 20:23:24Z david_corrales $ + * $URL$ + * $Id$ * */ diff --git a/engines/cruise/perso.h b/engines/cruise/perso.h index 0d5676a4c8..aa9f59a1a3 100644 --- a/engines/cruise/perso.h +++ b/engines/cruise/perso.h @@ -18,8 +18,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL:https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/branches/gsoc2007-fsnode/engines/cruise/perso.h $ - * $Id:perso.h 26949 2007-05-26 20:23:24Z david_corrales $ + * $URL$ + * $Id$ * */ diff --git a/engines/cruise/polys.cpp b/engines/cruise/polys.cpp index 83192b0dda..a2eea8a9a7 100644 --- a/engines/cruise/polys.cpp +++ b/engines/cruise/polys.cpp @@ -18,8 +18,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL:https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/branches/gsoc2007-fsnode/engines/cruise/polys.cpp $ - * $Id:polys.cpp 26949 2007-05-26 20:23:24Z david_corrales $ + * $URL$ + * $Id$ * */ diff --git a/engines/cruise/polys.h b/engines/cruise/polys.h index b5da8dd241..53ce4672cd 100644 --- a/engines/cruise/polys.h +++ b/engines/cruise/polys.h @@ -18,8 +18,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL:https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/branches/gsoc2007-fsnode/engines/cruise/polys.h $ - * $Id:polys.h 26949 2007-05-26 20:23:24Z david_corrales $ + * $URL$ + * $Id$ * */ diff --git a/engines/cruise/saveload.cpp b/engines/cruise/saveload.cpp index ffda142e66..189bde1ea1 100644 --- a/engines/cruise/saveload.cpp +++ b/engines/cruise/saveload.cpp @@ -18,8 +18,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL:https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/branches/gsoc2007-fsnode/engines/cruise/saveload.cpp $ - * $Id:saveload.cpp 26949 2007-05-26 20:23:24Z david_corrales $ + * $URL$ + * $Id$ * */ diff --git a/engines/cruise/saveload.h b/engines/cruise/saveload.h index de97f24b64..5a719066c5 100644 --- a/engines/cruise/saveload.h +++ b/engines/cruise/saveload.h @@ -18,8 +18,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL:https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/branches/gsoc2007-fsnode/engines/cruise/saveload.h $ - * $Id:saveload.h 26949 2007-05-26 20:23:24Z david_corrales $ + * $URL$ + * $Id$ * */ diff --git a/engines/cruise/script.cpp b/engines/cruise/script.cpp index dc1b12f736..c9ba819d75 100644 --- a/engines/cruise/script.cpp +++ b/engines/cruise/script.cpp @@ -18,8 +18,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL:https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/branches/gsoc2007-fsnode/engines/cruise/script.cpp $ - * $Id:script.cpp 26949 2007-05-26 20:23:24Z david_corrales $ + * $URL$ + * $Id$ * */ @@ -73,8 +73,7 @@ int32 opcodeType0(void) { if (!byte2) { ptr = scriptDataPtrTable[var_E] + short1; - } else // TODO: - { + } else { // TODO: if (!overlayTable[byte2].alreadyLoaded) { return (-7); } @@ -145,8 +144,7 @@ int32 opcodeType0(void) { if (!byte2) { ptr = scriptDataPtrTable[var_E] + var_12; - } else // TODO: - { + } else { // TODO: if (!overlayTable[byte2].alreadyLoaded) { return (-7); } @@ -635,8 +633,7 @@ uint8 *attacheNewScriptToTail(int16 overlayNumber, oldTail = scriptHandlePtr; - while (oldTail->nextScriptPtr) // go to the end of the list - { + while (oldTail->nextScriptPtr) { // go to the end of the list oldTail = oldTail->nextScriptPtr; } @@ -660,8 +657,7 @@ uint8 *attacheNewScriptToTail(int16 overlayNumber, tempPtr->scriptNumber = param; tempPtr->overlayNumber = overlayNumber; - if (scriptType == 20) // Obj or not ? - { + if (scriptType == 20) { // Obj or not ? tempPtr->sysKey = useArg3Neg; } else { tempPtr->sysKey = 1; diff --git a/engines/cruise/script.h b/engines/cruise/script.h index ca7d812836..e5d21b1ba0 100644 --- a/engines/cruise/script.h +++ b/engines/cruise/script.h @@ -18,8 +18,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL:https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/branches/gsoc2007-fsnode/engines/cruise/script.h $ - * $Id:script.h 26949 2007-05-26 20:23:24Z david_corrales $ + * $URL$ + * $Id$ * */ diff --git a/engines/cruise/stack.cpp b/engines/cruise/stack.cpp index 7622564503..1639ba3942 100644 --- a/engines/cruise/stack.cpp +++ b/engines/cruise/stack.cpp @@ -18,8 +18,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL:https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/branches/gsoc2007-fsnode/engines/cruise/stack.cpp $ - * $Id:stack.cpp 26949 2007-05-26 20:23:24Z david_corrales $ + * $URL$ + * $Id$ * */ diff --git a/engines/cruise/stack.h b/engines/cruise/stack.h index 1adb3540cb..831c07e217 100644 --- a/engines/cruise/stack.h +++ b/engines/cruise/stack.h @@ -18,8 +18,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL:https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/branches/gsoc2007-fsnode/engines/cruise/stack.h $ - * $Id:stack.h 26949 2007-05-26 20:23:24Z david_corrales $ + * $URL$ + * $Id$ * */ diff --git a/engines/cruise/stringSupport.cpp b/engines/cruise/stringSupport.cpp index 54747104ff..791f203d9b 100644 --- a/engines/cruise/stringSupport.cpp +++ b/engines/cruise/stringSupport.cpp @@ -18,8 +18,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL:https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/branches/gsoc2007-fsnode/engines/cruise/stringSupport.cpp $ - * $Id:stringSupport.cpp 26949 2007-05-26 20:23:24Z david_corrales $ + * $URL$ + * $Id$ * */ diff --git a/engines/cruise/stringSupport.h b/engines/cruise/stringSupport.h index 531fe56aca..841e2dd496 100644 --- a/engines/cruise/stringSupport.h +++ b/engines/cruise/stringSupport.h @@ -18,8 +18,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL:https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/branches/gsoc2007-fsnode/engines/cruise/stringSupport.h $ - * $Id:stringSupport.h 26949 2007-05-26 20:23:24Z david_corrales $ + * $URL$ + * $Id$ * */ diff --git a/engines/cruise/various.cpp b/engines/cruise/various.cpp index e4c908af5f..5c6134c374 100644 --- a/engines/cruise/various.cpp +++ b/engines/cruise/various.cpp @@ -18,8 +18,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL:https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/branches/gsoc2007-fsnode/engines/cruise/various.cpp $ - * $Id:various.cpp 26949 2007-05-26 20:23:24Z david_corrales $ + * $URL$ + * $Id$ * */ diff --git a/engines/cruise/various.h b/engines/cruise/various.h index f6e07e00e7..fe18e5abd6 100644 --- a/engines/cruise/various.h +++ b/engines/cruise/various.h @@ -18,8 +18,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL:https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/branches/gsoc2007-fsnode/engines/cruise/various.h $ - * $Id:various.h 26949 2007-05-26 20:23:24Z david_corrales $ + * $URL$ + * $Id$ * */ diff --git a/engines/cruise/vars.cpp b/engines/cruise/vars.cpp index 1a3d5f0a27..094680f0bb 100644 --- a/engines/cruise/vars.cpp +++ b/engines/cruise/vars.cpp @@ -18,8 +18,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL:https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/branches/gsoc2007-fsnode/engines/cruise/vars.cpp $ - * $Id:vars.cpp 26949 2007-05-26 20:23:24Z david_corrales $ + * $URL$ + * $Id$ * */ diff --git a/engines/cruise/vars.h b/engines/cruise/vars.h index 63a15f24e4..dbace8bdf3 100644 --- a/engines/cruise/vars.h +++ b/engines/cruise/vars.h @@ -18,8 +18,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL:https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/branches/gsoc2007-fsnode/engines/cruise/vars.h $ - * $Id:vars.h 26949 2007-05-26 20:23:24Z david_corrales $ + * $URL$ + * $Id$ * */ diff --git a/engines/cruise/volume.cpp b/engines/cruise/volume.cpp index 901ac4a7a5..b32ffb0ccd 100644 --- a/engines/cruise/volume.cpp +++ b/engines/cruise/volume.cpp @@ -18,8 +18,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL:https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/branches/gsoc2007-fsnode/engines/cruise/volume.cpp $ - * $Id:volume.cpp 26949 2007-05-26 20:23:24Z david_corrales $ + * $URL$ + * $Id$ * */ diff --git a/engines/cruise/volume.h b/engines/cruise/volume.h index 7881f6c872..0f9e489236 100644 --- a/engines/cruise/volume.h +++ b/engines/cruise/volume.h @@ -18,8 +18,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL:https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/branches/gsoc2007-fsnode/engines/cruise/volume.h $ - * $Id:volume.h 26949 2007-05-26 20:23:24Z david_corrales $ + * $URL$ + * $Id$ * */ diff --git a/engines/drascula/drascula.cpp b/engines/drascula/drascula.cpp index df433e12f0..eb676a7be4 100644 --- a/engines/drascula/drascula.cpp +++ b/engines/drascula/drascula.cpp @@ -118,7 +118,7 @@ static char mirar_t[3][88] = {TEXT100, TEXT101, TEXT54}; static char mirar_v[3][14] = {"100.als", "101.als", "54.als"}; static char poder_t[6][88] = {TEXT11, TEXT109, TEXT111, TEXT110, TEXT115, TEXT116}; static char poder_v[6][14] = {"11.als", "109.als", "111.als", "110.als", "115.als", "116.als"}; - + int DrasculaEngine::init() { // Detect game if (!initGame()) { @@ -128,14 +128,13 @@ int DrasculaEngine::init() { // Initialize backend _system->beginGFXTransaction(); - initCommonGFX(false); + initCommonGFX(false); _system->initSize(320, 200); _system->endGFXTransaction(); return 0; } - int DrasculaEngine::go() { num_ejec = 1; @@ -163,7 +162,8 @@ int DrasculaEngine::go() { frame_velas = 0; cont_sv = 0; term_int = 0; - cual_ejec = 0; hay_que_load = 0; + con_voces = 1; + hay_que_load = 0; corta_musica = 0; hay_seleccion = 0; Leng = 0; @@ -178,20 +178,73 @@ int DrasculaEngine::go() { asigna_memoria(); carga_info(); - lee_dibujos("95.alg"); - descomprime_dibujo(dir_mesa, 1); + if (num_ejec != 6) { + lee_dibujos("95.alg"); + descomprime_dibujo(dir_mesa, 1); + } + + if (num_ejec == 6) + dir_pendulo = dir_dibujo3; - lee_dibujos("96.alg"); - descomprime_dibujo(dir_hare_frente, COMPLETA); if (num_ejec == 1) { + con_voces = 0; + lee_dibujos("96.alg"); + descomprime_dibujo(dir_hare_frente, COMPLETA); lee_dibujos("99.alg"); descomprime_dibujo(dir_hare_fondo, 1); lee_dibujos("97.alg"); descomprime_dibujo(dir_hare_dch, 1); } else if (num_ejec == 2) { + lee_dibujos("96.alg"); + descomprime_dibujo(dir_hare_frente, COMPLETA); lee_dibujos("pts.alg"); descomprime_dibujo(dir_dibujo2, 1); - } + } else if (num_ejec == 3) { + lee_dibujos("aux13.alg"); + descomprime_dibujo(dir_dibujo1, COMPLETA); + lee_dibujos("96.alg"); + descomprime_dibujo(dir_hare_frente, 1); + lee_dibujos("97.alg"); + descomprime_dibujo(dir_hare_dch, 1); + lee_dibujos("99.alg"); + descomprime_dibujo(dir_hare_fondo, 1); + } else if (num_ejec == 4) { + lee_dibujos("96.alg"); + descomprime_dibujo(dir_hare_frente, COMPLETA); + if (hay_que_load == 0) + animacion_rayo(); + lee_dibujos("96.alg"); + descomprime_dibujo(dir_hare_frente, 1); + borra_pantalla(); + lee_dibujos("99.alg"); + descomprime_dibujo(dir_hare_fondo, 1); + lee_dibujos("97.alg"); + descomprime_dibujo(dir_hare_dch, 1); + } else if (num_ejec == 5) { + lee_dibujos("96.alg"); + descomprime_dibujo(dir_hare_frente, COMPLETA); + lee_dibujos("97.alg"); + descomprime_dibujo(dir_hare_dch, 1); + lee_dibujos("99.alg"); + descomprime_dibujo(dir_hare_fondo, 1); + } else if (num_ejec == 6) { + x_igor = 105, y_igor = 85, sentido_igor = 1; + x_dr = 62, y_dr = 99, sentido_dr = 1; + frame_pen = 0; + flag_tv = 0; + + dir_pendulo = dir_dibujo3; + + lee_dibujos("96.alg"); + descomprime_dibujo(dir_hare_frente, COMPLETA); + lee_dibujos("99.alg"); + descomprime_dibujo(dir_hare_fondo, 1); + lee_dibujos("97.alg"); + descomprime_dibujo(dir_hare_dch, 1); + + lee_dibujos("95.alg"); + descomprime_dibujo(dir_mesa, 1); + } strcpy(nombre_icono[1], "look"); strcpy(nombre_icono[2], "take"); strcpy(nombre_icono[3], "open"); @@ -206,6 +259,7 @@ int DrasculaEngine::go() { } salir_al_dos(0); } + return 0; } @@ -363,7 +417,7 @@ void DrasculaEngine::setvgapalette256(byte *PalBuf) { } void DrasculaEngine::DIBUJA_FONDO(int xorg, int yorg, int xdes, int ydes, int Ancho, - int Alto, byte *Origen, byte *Destino) { + int Alto, byte *Origen, byte *Destino) { int x; Destino += xdes + ydes * 320; Origen += xorg + yorg * 320; @@ -375,7 +429,7 @@ void DrasculaEngine::DIBUJA_FONDO(int xorg, int yorg, int xdes, int ydes, int An } void DrasculaEngine::DIBUJA_BLOQUE(int xorg, int yorg, int xdes, int ydes, int Ancho, - int Alto, byte *Origen, byte *Destino) { + int Alto, byte *Origen, byte *Destino) { int y, x; Destino += xdes + ydes * 320; @@ -437,19 +491,21 @@ void DrasculaEngine::VUELCA_PANTALLA(int xorg, int yorg, int xdes, int ydes, int } bool DrasculaEngine::escoba() { - int soc, l, n; + int n; dir_texto = dir_mesa; musica_antes = -1; - soc = 0; - for (l = 0; l < 6; l++) { - soc = soc + ANCHO_PERSONAJE; - frame_x[l] = soc; + if (num_ejec != 2) { + int soc = 0; + for (n = 0; n < 6; n++) { + soc = soc + ANCHO_PERSONAJE; + frame_x[n] = soc; + } } - for (n = 1; n < 43; n++) + for (n = 1; n < 50; n++) objetos_que_tengo[n] = 0; for (n = 0; n < NUM_BANDERAS; n++) @@ -479,7 +535,7 @@ bool DrasculaEngine::escoba() { if (hay_que_load != 0) para_cargar(nom_partida); else { - carga_escoba_1("62.ald"); + carga_escoba("62.ald"); hare_x = -20; hare_y = 56; lleva_al_hare(65, 145); @@ -490,9 +546,73 @@ bool DrasculaEngine::escoba() { sentido_hare = 3; obj_saliendo = 162; if (hay_que_load == 0) - carga_escoba_2("14.ald"); + carga_escoba("14.ald"); + else + para_cargar(nom_partida); + } else if (num_ejec == 3) { + suma_objeto(28); + suma_objeto(11); + suma_objeto(14); + suma_objeto(22); + suma_objeto(9); + suma_objeto(20); + suma_objeto(19); + flags[1] = 1; + buffer_teclado(); + sentido_hare = 1; + obj_saliendo = 99; + if (hay_que_load == 0) + carga_escoba("20.ald"); else para_cargar(nom_partida); + } else if (num_ejec == 3) { + suma_objeto(28); + suma_objeto(9); + suma_objeto(20); + suma_objeto(22); + buffer_teclado(); + obj_saliendo = 100; + if (hay_que_load == 0) { + carga_escoba("21.ald"); + sentido_hare = 0; + hare_x = 235; + hare_y = 164; + } else + para_cargar(nom_partida); + } else if (num_ejec == 5) { + suma_objeto(28); + suma_objeto(7); + suma_objeto(9); + suma_objeto(11); + suma_objeto(13); + suma_objeto(14); + suma_objeto(15); + suma_objeto(17); + suma_objeto(20); + buffer_teclado(); + sentido_hare = 1; + obj_saliendo = 100; + if (hay_que_load == 0) { + carga_escoba("45.ald"); + } else + para_cargar(nom_partida); + } else if (num_ejec == 6) { + suma_objeto(28); + suma_objeto(9); + + buffer_teclado(); + sentido_hare = 1; + obj_saliendo = 104; + if (hay_que_load == 0) + carga_escoba("58.ald"); + else + para_cargar(nom_partida); + if (hay_que_load == 0) + animacion_1_6(); + else { + lee_dibujos("auxdr.alg"); + descomprime_dibujo(dir_dibujo2, 1); + } } bucles: @@ -525,38 +645,50 @@ bucles: comprueba_objetos(); if (boton_dch == 1 && menu_scr == 1) { - if (num_ejec == 1) - lee_dibujos("99.alg"); - else if (num_ejec == 2) + if (num_ejec == 2) lee_dibujos(fondo_y_menu); + else + lee_dibujos("99.alg"); descomprime_dibujo(dir_hare_fondo, 1); setvgapalette256((byte *)&palJuego); menu_scr = 0; espera_soltar(); - cont_sv = 0; + if (num_ejec != 3) + cont_sv = 0; } if (boton_dch == 1 && menu_scr == 0) { hare_se_mueve = 0; if (sentido_hare == 2) sentido_hare = 1; - lee_dibujos("icons.alg"); + if (num_ejec == 4) + lee_dibujos("icons2.alg"); + else if (num_ejec == 5) + lee_dibujos("icons3.alg"); + else if (num_ejec == 6) + lee_dibujos("iconsp.alg"); + else + lee_dibujos("icons.alg"); descomprime_dibujo(dir_hare_fondo, 1); menu_scr = 1; espera_soltar(); sin_verbo(); - cont_sv = 0; + if (num_ejec != 3) + cont_sv = 0; } if (boton_izq == 1 && menu_bar == 1) { elige_en_barra(); - cont_sv = 0; + if (num_ejec != 3) + cont_sv = 0; } else if (boton_izq == 1 && lleva_objeto == 0) { if (comprueba1()) return true; - cont_sv = 0; + if (num_ejec != 3) + cont_sv = 0; } else if (boton_izq == 1 && lleva_objeto == 1) { comprueba2(); - cont_sv = 0; + if (num_ejec != 3) + cont_sv = 0; } if (y_raton < 24 && menu_scr == 0) @@ -567,59 +699,85 @@ bucles: Common::KeyCode key = getscan(); if (key == Common::KEYCODE_F1 && menu_scr == 0) { elige_verbo(1); - cont_sv = 0; + if (num_ejec != 3) + cont_sv = 0; } else if (key == Common::KEYCODE_F2 && menu_scr == 0) { elige_verbo(2); - cont_sv = 0; + if (num_ejec != 3) + cont_sv = 0; } else if (key == Common::KEYCODE_F3 && menu_scr == 0) { elige_verbo(3); - cont_sv = 0; + if (num_ejec != 3) + cont_sv = 0; } else if (key == Common::KEYCODE_F4 && menu_scr == 0) { elige_verbo(4); cont_sv = 0; } else if (key == Common::KEYCODE_F5 && menu_scr == 0) { elige_verbo(5); - cont_sv = 0; + if (num_ejec != 3) + cont_sv = 0; } else if (key == Common::KEYCODE_F6 && menu_scr == 0) { elige_verbo(6); - cont_sv = 0; + if (num_ejec != 3) + cont_sv = 0; } else if (key == Common::KEYCODE_F9) { mesa(); - cont_sv = 0; + if (num_ejec != 3) + cont_sv = 0; } else if (key == Common::KEYCODE_F10) { saves(); - cont_sv = 0; + if (num_ejec != 3) + cont_sv = 0; } else if (key == Common::KEYCODE_F8) { sin_verbo(); - cont_sv = 0; + if (num_ejec != 3) + cont_sv = 0; } else if (key == Common::KEYCODE_v) { con_voces = 1; print_abc(SYS2, 96, 86); VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); delay(1410); - cont_sv = 0; + if (num_ejec != 3) + cont_sv = 0; } else if (key == Common::KEYCODE_t) { con_voces = 0; print_abc(SYS3, 94, 86); VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); delay(1460); - cont_sv = 0; + if (num_ejec != 3) + cont_sv = 0; } else if (key == Common::KEYCODE_DELETE) { - confirma_go(); - cont_sv = 0; + if (num_ejec == 4) + carga_partida("gsave00"); + else + confirma_go(); + if (num_ejec != 3) + cont_sv = 0; } else if (key == Common::KEYCODE_ESCAPE) { confirma_salir(); - cont_sv = 0; + if (num_ejec != 3) + cont_sv = 0; + } else if (num_ejec == 6 && key == Common::KEYCODE_0 && !strcmp(num_room, "61.alg")) { + lee_dibujos("alcbar.alg"); + descomprime_dibujo(dir_dibujo1, 255); } else if (cont_sv == 1500) { salva_pantallas(); - cont_sv = 0; - } else - cont_sv++; + if (num_ejec != 3) + cont_sv = 0; + } else { + if (num_ejec != 3) + cont_sv++; + } goto bucles; } void DrasculaEngine::agarra_objeto(int objeto) { - lee_dibujos("icons.alg"); + if (num_ejec == 6) + lee_dibujos("iconsp.alg"); + else if (num_ejec == 4 || num_ejec == 5) + lee_dibujos("icons2.alg"); + else + lee_dibujos("icons.alg"); descomprime_dibujo(dir_hare_fondo, 1); elige_objeto(objeto); lee_dibujos("99.alg"); @@ -627,8 +785,13 @@ void DrasculaEngine::agarra_objeto(int objeto) { } void DrasculaEngine::elige_objeto(int objeto) { - if (lleva_objeto == 1 && menu_scr == 0) - suma_objeto(objeto_que_lleva); + if (num_ejec == 5) { + if (lleva_objeto == 1 && menu_scr == 0 && objeto_que_lleva != 16) + suma_objeto(objeto_que_lleva); + } else { + if (lleva_objeto == 1 && menu_scr == 0) + suma_objeto(objeto_que_lleva); + } DIBUJA_FONDO(x1d_menu[objeto], y1d_menu[objeto], 0, 0, ANCHOBJ,ALTOBJ, dir_hare_fondo, dir_dibujo3); lleva_objeto = 1; objeto_que_lleva = objeto; @@ -1082,7 +1245,7 @@ bool DrasculaEngine::animacion_2_1() { if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE)) break; - strcpy(num_room,"16.alg"); + strcpy(num_room, "16.alg"); if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE)) break; @@ -1221,9 +1384,14 @@ void DrasculaEngine::sin_verbo() { int c = 171; if (menu_scr == 1) c = 0; - if (lleva_objeto == 1) - suma_objeto(objeto_que_lleva); - DIBUJA_FONDO(0, c, 0, 0, ANCHOBJ,ALTOBJ, dir_hare_fondo, dir_dibujo3); + if (num_ejec == 5) { + if (lleva_objeto == 1 && objeto_que_lleva != 16) + suma_objeto(objeto_que_lleva); + } else { + if (lleva_objeto == 1) + suma_objeto(objeto_que_lleva); + } + DIBUJA_FONDO(0, c, 0, 0, ANCHOBJ,ALTOBJ, dir_hare_fondo, dir_dibujo3); lleva_objeto = 0; hay_nombre = 0; @@ -1232,14 +1400,14 @@ void DrasculaEngine::sin_verbo() { void DrasculaEngine::para_cargar(char nom_game[]) { musica_antes = musica_room; menu_scr = 0; - if (num_ejec == 2) + if (num_ejec == 2 || num_ejec == 3 || num_ejec == 4) borra_pantalla(); carga_partida(nom_game); - if (num_ejec == 1) { - carga_escoba_1(datos_actuales); - } else if (num_ejec == 2) { - ald->close(); - carga_escoba_2(datos_actuales); + if (num_ejec == 1 || num_ejec == 4) { + carga_escoba(datos_actuales); + } else if (num_ejec == 2 || num_ejec == 3) { + delete ald; + carga_escoba(datos_actuales); } sin_verbo(); } @@ -1269,10 +1437,11 @@ static char *getLine(Common::File *fp, char *buf, int len) { return buf; } -void DrasculaEngine::carga_escoba_1(const char *nom_fich) { - int l, obj_salir; +void DrasculaEngine::carga_escoba(const char *nom_fich) { + int soc, l, martin, obj_salir; float chiquez, pequegnez = 0; - char para_codificar[13]; + char pant1[20], pant2[20], pant3[20], pant4[20]; + char para_codificar[20]; char buffer[256]; hay_nombre = 0; @@ -1301,183 +1470,39 @@ void DrasculaEngine::carga_escoba_1(const char *nom_fich) { getLine(ald, buffer, size); sscanf(buffer, "%d", &nivel_osc); - getLine(ald, buffer, size); - sscanf(buffer, "%d", &objs_room); - - for (l = 0; l < objs_room; l++) { + if (num_ejec == 2) { getLine(ald, buffer, size); - sscanf(buffer, "%d", &num_obj[l]); + sscanf(buffer, "%d", &martin); + if (martin == 0) + goto martini; + ancho_hare = martin; getLine(ald, buffer, size); - sscanf(buffer, "%s", nombre_obj[l]); + sscanf(buffer, "%d",&alto_hare); getLine(ald, buffer, size); - sscanf(buffer, "%d", &x1[l]); - getLine(ald, buffer, size); - sscanf(buffer, "%d", &y1[l]); + sscanf(buffer, "%d",&alto_pies); getLine(ald, buffer, size); - sscanf(buffer, "%d", &x2[l]); + sscanf(buffer, "%d",&paso_x); getLine(ald, buffer, size); - sscanf(buffer, "%d", &y2[l]); + sscanf(buffer, "%d",&paso_y); + getLine(ald, buffer, size); - sscanf(buffer, "%d", &sitiobj_x[l]); + sscanf(buffer, "%s",pant1); getLine(ald, buffer, size); - sscanf(buffer, "%d", &sitiobj_y[l]); + sscanf(buffer, "%s",pant2); getLine(ald, buffer, size); - sscanf(buffer, "%d", &sentidobj[l]); + sscanf(buffer, "%s",pant3); getLine(ald, buffer, size); - sscanf(buffer, "%d", &visible[l]); - getLine(ald, buffer, size); - sscanf(buffer, "%d", &espuerta[l]); - if (espuerta[l] != 0) { - getLine(ald, buffer, size); - sscanf(buffer, "%s", alapantallakeva[l]); - getLine(ald, buffer, size); - sscanf(buffer, "%d", &x_alakeva[l]); - getLine(ald, buffer, size); - sscanf(buffer, "%d", &y_alakeva[l]); - getLine(ald, buffer, size); - sscanf(buffer, "%d", &sentido_alkeva[l]); - getLine(ald, buffer, size); - sscanf(buffer, "%d", &alapuertakeva[l]); - puertas_cerradas(l); - } - } - - getLine(ald, buffer, size); - sscanf(buffer, "%d", &suelo_x1); - getLine(ald, buffer, size); - sscanf(buffer, "%d", &suelo_y1); - getLine(ald, buffer, size); - sscanf(buffer, "%d", &suelo_x2); - getLine(ald, buffer, size); - sscanf(buffer, "%d", &suelo_y2); - - getLine(ald, buffer, size); - sscanf(buffer, "%d", &lejos); - getLine(ald, buffer, size); - sscanf(buffer, "%d", &cerca); - delete ald; - - canal_p(para_codificar); - - for (l = 0; l < objs_room; l++) { - if (num_obj[l] == obj_saliendo) - obj_salir = l; - } - - lee_dibujos(pantalla_disco); - descomprime_dibujo(dir_dibujo3, 1); - - lee_dibujos(num_room); - descomprime_dibujo(dir_dibujo1, MEDIA); - - DIBUJA_FONDO(0, 171, 0, 0, ANCHOBJ, ALTOBJ, dir_hare_fondo, dir_dibujo3); - - color_hare(); - if (nivel_osc != 0) - funde_hare(nivel_osc); - paleta_hare_claro(); - color_hare(); - funde_hare(nivel_osc + 2); - paleta_hare_oscuro(); - - hare_claro(); - cambio_de_color = -1; - - for (l = 0; l <= suelo_y1; l++) - factor_red[l] = lejos; - for (l = suelo_y1; l <= 201; l++) - factor_red[l] = cerca; + sscanf(buffer, "%s",pant4); - chiquez = (float)(cerca-lejos) / (float)(suelo_y2 - suelo_y1); - for (l = suelo_y1; l <= suelo_y2; l++) { - factor_red[l] = (int)(lejos + pequegnez); - pequegnez = pequegnez + chiquez; - } - - if (hare_x == -1) { - hare_x = x_alakeva[obj_salir]; - hare_y = y_alakeva[obj_salir]; - alto_hare = (ALTO_PERSONAJE * factor_red[hare_y]) / 100; - ancho_hare = (ANCHO_PERSONAJE * factor_red[hare_y]) / 100; - hare_y = hare_y - alto_hare; - } else { - alto_hare = (ALTO_PERSONAJE * factor_red[hare_y]) / 100; - ancho_hare = (ANCHO_PERSONAJE * factor_red[hare_y]) / 100; - } - hare_se_mueve = 0; - - actualiza_datos(); - - espuerta[7] = 0; - - if (musica_antes != musica_room) - playmusic(musica_room); - refresca_pantalla(); -} - -void DrasculaEngine::carga_escoba_2(const char *nom_fich) { - int soc, l, martin, obj_salir; - char pant1[20], pant2[20], pant3[20], pant4[20]; - char para_codificar[20]; - char buffer[256]; - - hay_nombre = 0; - - strcpy(para_codificar, nom_fich); - canal_p(para_codificar); - strcpy(datos_actuales, nom_fich); - - buffer_teclado(); + lee_dibujos(pant2); + descomprime_dibujo(dir_hare_dch, 1); + lee_dibujos(pant1); + descomprime_dibujo(dir_hare_frente, 1); + lee_dibujos(pant4); + descomprime_dibujo(dir_hare_fondo, 1); - ald = new Common::File; - ald->open(nom_fich); - if (!ald->isOpen()) { - error("missing data file"); + strcpy(fondo_y_menu, pant4); } - int size = ald->size(); - - getLine(ald, buffer, size); - sscanf(buffer, "%s", num_room); - strcat(num_room, ".alg"); - - getLine(ald, buffer, size); - sscanf(buffer, "%d", &musica_room); - getLine(ald, buffer, size); - sscanf(buffer, "%s", pantalla_disco); - getLine(ald, buffer, size); - sscanf(buffer, "%d", &nivel_osc); - - getLine(ald, buffer, size); - sscanf(buffer, "%d", &martin); - if (martin == 0) - goto martini; - ancho_hare = martin; - getLine(ald, buffer, size); - sscanf(buffer, "%d",&alto_hare); - getLine(ald, buffer, size); - sscanf(buffer, "%d",&alto_pies); - getLine(ald, buffer, size); - sscanf(buffer, "%d",&paso_x); - getLine(ald, buffer, size); - sscanf(buffer, "%d",&paso_y); - - getLine(ald, buffer, size); - sscanf(buffer, "%s",pant1); - getLine(ald, buffer, size); - sscanf(buffer, "%s",pant2); - getLine(ald, buffer, size); - sscanf(buffer, "%s",pant3); - getLine(ald, buffer, size); - sscanf(buffer, "%s",pant4); - - lee_dibujos(pant2); - descomprime_dibujo(dir_hare_dch, 1); - lee_dibujos(pant1); - descomprime_dibujo(dir_hare_frente, 1); - lee_dibujos(pant4); - descomprime_dibujo(dir_hare_fondo, 1); - - strcpy(fondo_y_menu, pant4); martini: @@ -1531,37 +1556,47 @@ martini: getLine(ald, buffer, size); sscanf(buffer, "%d", &suelo_y2); + if (num_ejec != 2) { + getLine(ald, buffer, size); + sscanf(buffer, "%d", &lejos); + getLine(ald, buffer, size); + sscanf(buffer, "%d", &cerca); + } delete ald; - canal_p(para_codificar); - if (martin == 0) { - paso_x = PASO_HARE_X; - paso_y = PASO_HARE_Y; - alto_hare = ALTO_PERSONAJE; - ancho_hare = ANCHO_PERSONAJE; - alto_pies = PIES_HARE; - lee_dibujos("97.alg"); - descomprime_dibujo(dir_hare_dch, 1); - lee_dibujos("96.alg"); - descomprime_dibujo(dir_hare_frente, 1); - lee_dibujos("99.alg"); - descomprime_dibujo(dir_hare_fondo, 1); + if (num_ejec == 2) { + if (martin == 0) { + paso_x = PASO_HARE_X; + paso_y = PASO_HARE_Y; + alto_hare = ALTO_PERSONAJE; + ancho_hare = ANCHO_PERSONAJE; + alto_pies = PIES_HARE; + lee_dibujos("97.alg"); + descomprime_dibujo(dir_hare_dch, 1); + lee_dibujos("96.alg"); + descomprime_dibujo(dir_hare_frente, 1); + lee_dibujos("99.alg"); + descomprime_dibujo(dir_hare_fondo, 1); - strcpy(fondo_y_menu,"99.alg"); + strcpy(fondo_y_menu, "99.alg"); + } } - + + obj_salir = -1; for (l = 0; l < objs_room; l++) { if (num_obj[l] == obj_saliendo) obj_salir = l; } - if (hare_x == -1) { - hare_x = x_alakeva[obj_salir]; - hare_y = y_alakeva[obj_salir] - alto_hare; + if (num_ejec == 2) { + if (hare_x == -1) { + assert(obj_salir != -1); + hare_x = x_alakeva[obj_salir]; + hare_y = y_alakeva[obj_salir] - alto_hare; + } + hare_se_mueve = 0; } - hare_se_mueve = 0; - lee_dibujos(pantalla_disco); descomprime_dibujo(dir_dibujo3, 1); @@ -1581,21 +1616,72 @@ martini: hare_claro(); cambio_de_color = -1; - color_abc(VERDE_CLARO); + if (num_ejec == 2) + color_abc(VERDE_CLARO); + + if (num_ejec != 2) { + for (l = 0; l <= suelo_y1; l++) + factor_red[l] = lejos; + for (l = suelo_y1; l <= 201; l++) + factor_red[l] = cerca; + + chiquez = (float)(cerca - lejos) / (float)(suelo_y2 - suelo_y1); + for (l = suelo_y1; l <= suelo_y2; l++) { + factor_red[l] = (int)(lejos + pequegnez); + pequegnez = pequegnez + chiquez; + } + } + + if (!strcmp(num_room, "24.alg")) { + for (l = suelo_y1 - 1; l > 74; l--) { + factor_red[l] = (int)(lejos - pequegnez); + pequegnez = pequegnez + chiquez; + } + } + + if (!strcmp(num_room, "54.alg")) { + for (l = suelo_y1 - 1; l > 84; l--) { + factor_red[l] = (int)(lejos - pequegnez); + pequegnez = pequegnez + chiquez; + } + } - soc = 0; - for (l = 0; l < 6; l++) { - soc = soc + ancho_hare; - frame_x[l] = soc; + if (num_ejec != 2) { + if (hare_x == -1) { + assert(obj_salir != -1); + hare_x = x_alakeva[obj_salir]; + hare_y = y_alakeva[obj_salir]; + alto_hare = (ALTO_PERSONAJE * factor_red[hare_y]) / 100; + ancho_hare = (ANCHO_PERSONAJE * factor_red[hare_y]) / 100; + hare_y = hare_y - alto_hare; + } else { + alto_hare = (ALTO_PERSONAJE * factor_red[hare_y]) / 100; + ancho_hare = (ANCHO_PERSONAJE * factor_red[hare_y]) / 100; + } + hare_se_mueve = 0; + } + + if (num_ejec == 2) { + soc = 0; + for (l = 0; l < 6; l++) { + soc = soc + ancho_hare; + frame_x[l] = soc; + } } + if (num_ejec == 5) + hare_se_ve = 1; + actualiza_datos(); + if (num_ejec == 1) + espuerta[7] = 0; + if (!strcmp(num_room, "14.alg") && flags[39] == 1) musica_room = 16; else if (!strcmp(num_room, "15.alg") && flags[39] == 1) musica_room = 16; - if (!strcmp(num_room, "14.alg") && flags[5]==1) + if (!strcmp(num_room, "14.alg") && flags[5] == 1) musica_room = 0; else if (!strcmp(num_room, "15.alg") && flags[5] == 1) musica_room = 0; @@ -1606,9 +1692,17 @@ martini: stopmusic(); if ((!strcmp(num_room, "9.alg")) || (strcmp(num_room, "2.alg")) - || (!strcmp(num_room, "14.alg")) || (!strcmp(num_room, "18.alg"))) - conta_ciego_vez = vez(); + || (!strcmp(num_room, "14.alg")) || (!strcmp(num_room, "18.alg")) + || (!strcmp(num_room, "26.alg"))) + conta_ciego_vez = (int)vez(); + if (!strcmp(num_room, "24.alg") && flags[29] == 1) + animacion_7_4(); + if (!strcmp(num_room, "45.alg")) + hare_se_ve = 0; + if (!strcmp(num_room, "49.alg") && flags[7] == 0) + animacion_4_5(); + refresca_pantalla(); } @@ -1619,11 +1713,18 @@ void DrasculaEngine::borra_pantalla() { } void DrasculaEngine::lleva_al_hare(int punto_x, int punto_y) { + if (num_ejec == 5 || num_ejec == 6) { + if (hare_se_ve == 0) { + hare_x = sitio_x; + hare_y = sitio_y; + goto fin; + } + } sitio_x = punto_x; sitio_y = punto_y; empieza_andar(); - for(;;) { + for (;;) { refresca_pantalla(); VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); if (hare_se_mueve == 0) @@ -1634,6 +1735,7 @@ void DrasculaEngine::lleva_al_hare(int punto_x, int punto_y) { anda_a_objeto = 0; sentido_hare = sentido_final; } +fin: refresca_pantalla(); VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); } @@ -1681,20 +1783,21 @@ void DrasculaEngine::comprueba_objetos() { } } - if (num_ejec == 1) + if (num_ejec == 2) { if (x_raton > hare_x + 2 && y_raton > hare_y + 2 - && x_raton < hare_x + ancho_hare - 2 && y_raton < hare_y + alto_hare - 2 && veo == 0) { + && x_raton < hare_x + ancho_hare - 2 && y_raton < hare_y + alto_hare - 2) { strcpy(texto_nombre, "hacker"); hay_nombre = 1; veo = 1; } - else if (num_ejec == 2) + } else { if (x_raton > hare_x + 2 && y_raton > hare_y + 2 - && x_raton < hare_x + ancho_hare - 2 && y_raton < hare_y + alto_hare - 2) { + && x_raton < hare_x + ancho_hare - 2 && y_raton < hare_y + alto_hare - 2 && veo == 0) { strcpy(texto_nombre, "hacker"); hay_nombre = 1; veo = 1; } + } if (veo == 0) hay_nombre = 0; @@ -1790,6 +1893,8 @@ void DrasculaEngine::comprueba2() { anda_a_objeto = 1; lleva_al_hare(sitiobj_x[l], sitiobj_y[l]); banderas(num_obj[l]); + if (num_ejec == 4) + break; } } } @@ -1847,8 +1952,13 @@ void DrasculaEngine::elige_verbo(int verbo) { if (menu_scr == 1) c = 0; - if (lleva_objeto == 1) - suma_objeto(objeto_que_lleva); + if (num_ejec == 5) { + if (lleva_objeto == 1 && objeto_que_lleva != 16) + suma_objeto(objeto_que_lleva); + } else { + if (lleva_objeto == 1) + suma_objeto(objeto_que_lleva); + } DIBUJA_FONDO(ANCHOBJ * verbo, c, 0, 0, ANCHOBJ, ALTOBJ, dir_hare_fondo, dir_dibujo3); @@ -1920,7 +2030,7 @@ void DrasculaEngine::mesa() { void DrasculaEngine::saves() { char nombres[10][23]; char fichero[13]; - int n, n2, num_sav, y = 27; + int n, n2, num_sav = 0, y = 27; Common::InSaveFile *sav; borra_pantalla(); @@ -1955,6 +2065,9 @@ void DrasculaEngine::saves() { for (n = 0; n < NUM_SAVES; n++) { if (x_raton > 115 && y_raton > y + (9 * n) && x_raton < 115 + 175 && y_raton < y + 10 + (9 * n)) { strcpy(select, nombres[n]); + + // FIXME: The indention is wrong and misleading here!!! Or maybe there's simply a + // closing brace missing here??? See below for a second FIXME of a similar kind... if (strcmp(select, "*")) hay_seleccion = 1; @@ -1962,6 +2075,8 @@ void DrasculaEngine::saves() { introduce_nombre(); strcpy(nombres[n], select); if (hay_seleccion == 1) { + // FIXME: Just use: + //sprintf(fichero, "gsave%02d", n+1); if (n == 0) strcpy(fichero, "gsave01"); if (n == 1) @@ -2001,6 +2116,8 @@ void DrasculaEngine::saves() { y = y + 9; } if (hay_seleccion == 1) { + // FIXME: Just use: + //sprintf(fichero, "gsave%02d", n+1); if (n == 0) strcpy(fichero, "gsave01"); if (n == 1) @@ -2020,7 +2137,12 @@ void DrasculaEngine::saves() { if (n == 8) strcpy(fichero, "gsave09"); if (n == 9) - strcpy(fichero, "gsave10");} + strcpy(fichero, "gsave10");} // FIXME: EVIL wrong place for closing brace! + // In particular: is the assignment below maybe supposed to be inside the "if" + // statement that was just closed? + // Also note that the indention is wrong here, which is not immediately visible + // due to the other indention mistake above. But is the indention wrong, or is + // the brace placement wrong??? num_sav = n; } } @@ -2052,7 +2174,7 @@ void DrasculaEngine::saves() { } else if (x_raton > 168 && y_raton > 154 && x_raton < 242 && y_raton < 180) break; else if (hay_seleccion == 0) { - print_abc("elige una partida",117,15); + print_abc("elige una partida", 117, 15); } VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); delay(400); @@ -2436,8 +2558,8 @@ char DrasculaEngine::LimitaVGA(char valor) { } void DrasculaEngine::centra_texto(const char *mensaje, int x_texto, int y_texto) { - char bb[190], m2[190], m1[190], mb[10][40]; - char m3[190]; + char bb[200], m2[200], m1[200], mb[10][50]; + char m3[200]; int h, fil, x_texto3, x_texto2, x_texto1, conta_f = 0, ya = 0; strcpy(m1, " "); @@ -2669,10 +2791,14 @@ void DrasculaEngine::pon_igor() { int pos_igor[6]; pos_igor[0] = 1; - if (sentido_igor == 3) + if (num_ejec == 4) { pos_igor[1] = 138; - else if (sentido_igor == 1) - pos_igor[1] = 76; + } else { + if (sentido_igor == 3) + pos_igor[1] = 138; + else if (sentido_igor == 1) + pos_igor[1] = 76; + } pos_igor[2] = x_igor; pos_igor[3] = y_igor; pos_igor[4] = 54; @@ -2719,13 +2845,13 @@ void DrasculaEngine::habla_igor_dch(const char *dicho, const char *filename) { int tiempou; long tiempol; - int x_habla[8] = { 56, 82, 108, 134, 160, 186, 212, 238}; + int x_habla[8] = { 56, 82, 108, 134, 160, 186, 212, 238 }; int cara; int longitud; longitud = strlen(dicho); - tiempol = time (NULL); + tiempol = _system->getMillis(); tiempou = (unsigned int)tiempol / 2; _rnd->setSeed(tiempou); @@ -2754,11 +2880,9 @@ bucless: pon_igor(); pon_dr(); - DIBUJA_FONDO(x_igor + 17, y_igor, x_igor + 17, y_igor, 37, 24, - dir_dibujo1, dir_zona_pantalla); + DIBUJA_FONDO(x_igor + 17, y_igor, x_igor + 17, y_igor, 37, 24, dir_dibujo1, dir_zona_pantalla); - DIBUJA_BLOQUE(x_habla[cara], 148, x_igor + 17, y_igor, 25, 24, - dir_hare_frente, dir_zona_pantalla); + DIBUJA_BLOQUE(x_habla[cara], 148, x_igor + 17, y_igor, 25, 24, dir_hare_frente, dir_zona_pantalla); actualiza_refresco(); @@ -2832,8 +2956,7 @@ bucless: pon_dr(); DIBUJA_FONDO(x_dr, y_dr, x_dr, y_dr, 38, 31, dir_dibujo1, dir_zona_pantalla); - DIBUJA_BLOQUE(x_habla[cara], 90, x_dr, y_dr, 38, 31, - dir_hare_fondo, dir_zona_pantalla); + DIBUJA_BLOQUE(x_habla[cara], 90, x_dr, y_dr, 38, 31, dir_hare_fondo, dir_zona_pantalla); actualiza_refresco(); @@ -2907,8 +3030,7 @@ bucless: pon_dr(); DIBUJA_FONDO(x_dr, y_dr, x_dr, y_dr, 45, 31, dir_dibujo1, dir_zona_pantalla); - DIBUJA_BLOQUE(x_habla[cara], 58, x_dr + 7, y_dr, 38, 31, - dir_hare_fondo, dir_zona_pantalla); + DIBUJA_BLOQUE(x_habla[cara], 58, x_dr + 7, y_dr, 38, 31, dir_hare_fondo, dir_zona_pantalla); actualiza_refresco(); @@ -2994,7 +3116,7 @@ void DrasculaEngine::habla_igor_frente(const char *dicho, const char *filename) int tiempou; long tiempol; - int x_habla[8] = { 56, 86, 116, 146, 176, 206, 236, 266}; + int x_habla[8] = { 56, 86, 116, 146, 176, 206, 236, 266 }; int cara; int longitud; @@ -3029,17 +3151,15 @@ bucless: pon_igor(); pon_dr(); - DIBUJA_FONDO(x_igor, y_igor, x_igor, y_igor, 29, 25, - dir_dibujo1, dir_zona_pantalla); - DIBUJA_BLOQUE(x_habla[cara], 173, x_igor, y_igor, 29, 25, - dir_hare_frente, dir_zona_pantalla); + DIBUJA_FONDO(x_igor, y_igor, x_igor, y_igor, 29, 25, dir_dibujo1, dir_zona_pantalla); + DIBUJA_BLOQUE(x_habla[cara], 173, x_igor, y_igor, 29, 25, dir_hare_frente, dir_zona_pantalla); actualiza_refresco(); if (con_voces == 0) centra_texto(dicho, x_igor + 26, y_igor); - VUELCA_PANTALLA(0,0, 0,0, 320,200, dir_zona_pantalla); + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); pausa(3); @@ -3070,7 +3190,7 @@ void DrasculaEngine::habla_tabernero(const char *dicho, const char *filename) { int tiempou; long tiempol; - int x_habla[9] = { 1, 23, 45, 67, 89, 111, 133, 155, 177}; + int x_habla[9] = { 1, 23, 45, 67, 89, 111, 133, 155, 177 }; int cara; int longitud; @@ -3138,23 +3258,33 @@ bucless: void DrasculaEngine::hipo(int contador) { int y = 0, sentido = 0; - - contador = contador; + if (num_ejec == 3) + y = -1; comienza: contador--; refresca_pantalla(); - VUELCA_PANTALLA(0, 1, 0, y, 320, 198, dir_zona_pantalla); + if (num_ejec <= 2) + VUELCA_PANTALLA(0, 1, 0, y, 320, 198, dir_zona_pantalla); + else if (num_ejec == 3) + VUELCA_PANTALLA(0, 0, 0, y, 320, 200, dir_zona_pantalla); if (sentido == 0) y++; else y--; - if (y == 2) - sentido = 1; - if (y == 0) - sentido = 0; + if (num_ejec <= 2) { + if (y == 2) + sentido = 1; + if (y == 0) + sentido = 0; + } else if (num_ejec == 3) { + if (y == 1) + sentido = 1; + if (y == -1) + sentido = 0; + } if (contador > 0) goto comienza; @@ -3175,7 +3305,7 @@ void DrasculaEngine::habla_bj(const char *dicho, const char *filename) { int tiempou; long tiempol; - int x_habla[5] = { 64, 92, 120, 148, 176}; + int x_habla[5] = { 64, 92, 120, 148, 176 }; int cara; int longitud; @@ -3258,6 +3388,17 @@ void DrasculaEngine::hablar(const char *dicho, const char *filename) { int longitud; longitud = strlen(dicho); + if (num_ejec == 6) { + if (flags[0] == 0 && (!strcmp(num_room, "102.alg"))) { + habla_pen(dicho, filename); + return; + } + if (flags[0] == 0 && (!strcmp(num_room, "58.alg"))) { + habla_pen2(dicho, filename); + return; + } + } + tiempol = _system->getMillis(); tiempou = (unsigned int)tiempol / 2; _rnd->setSeed(tiempou); @@ -3268,8 +3409,12 @@ void DrasculaEngine::hablar(const char *dicho, const char *filename) { if (num_ejec == 2) buffer_teclado(); - color_abc(AMARILLO); - + if (num_ejec == 4) { + if (strcmp(num_room, "24.alg") || flags[29] == 0) + color_abc(AMARILLO); + } else { + color_abc(AMARILLO); + } if (hay_sb == 1) { sku = new Common::File; sku->open(filename); @@ -3289,20 +3434,15 @@ bucless: actualiza_refresco_antes(); if (num_ejec == 1) - DIBUJA_FONDO(hare_x, hare_y, ANCHOBJ + 1, 0, - ancho_hare * factor_red[hare_y + alto_hare] / 100, - (alto_habla - 1) * factor_red[hare_y + alto_hare] / 100, - dir_zona_pantalla, dir_dibujo3); + DIBUJA_FONDO(hare_x, hare_y, ANCHOBJ + 1, 0, ancho_hare * factor_red[hare_y + alto_hare] / 100, + (alto_habla - 1) * factor_red[hare_y + alto_hare] / 100, dir_zona_pantalla, dir_dibujo3); else if (num_ejec == 2) - DIBUJA_FONDO(hare_x, hare_y, ANCHOBJ + 1, 0, ancho_hare, alto_habla - 1, - dir_zona_pantalla, dir_dibujo3); + DIBUJA_FONDO(hare_x, hare_y, ANCHOBJ + 1, 0, ancho_hare, alto_habla - 1, dir_zona_pantalla, dir_dibujo3); pon_hare(); if (num_ejec == 1) - DIBUJA_FONDO(ANCHOBJ + 1, 0, hare_x, hare_y, - ancho_hare * factor_red[hare_y + alto_hare] / 100, - (alto_habla - 1) * factor_red[hare_y + alto_hare] / 100, - dir_dibujo3, dir_zona_pantalla); + DIBUJA_FONDO(ANCHOBJ + 1, 0, hare_x, hare_y, ancho_hare * factor_red[hare_y + alto_hare] / 100, + (alto_habla - 1) * factor_red[hare_y + alto_hare] / 100, dir_dibujo3, dir_zona_pantalla); else if (num_ejec == 2) DIBUJA_FONDO(ANCHOBJ + 1, 0, hare_x, hare_y, ancho_hare, alto_habla - 1, @@ -3310,24 +3450,20 @@ bucless: if (sentido_hare == 0) { if (num_ejec == 1) - reduce_hare_chico(x_habla_izq[cara], y_mask_habla, - hare_x + 8 * factor_red[hare_y + alto_hare] / 100, + reduce_hare_chico(x_habla_izq[cara], y_mask_habla, hare_x + 8 * factor_red[hare_y + alto_hare] / 100, hare_y, ancho_habla, alto_habla, factor_red[hare_y + alto_hare], dir_hare_dch, dir_zona_pantalla); else if (num_ejec == 2) - DIBUJA_BLOQUE(x_habla_dch[cara], y_mask_habla, - hare_x + 12, hare_y, ancho_habla, alto_habla, + DIBUJA_BLOQUE(x_habla_dch[cara], y_mask_habla, hare_x + 12, hare_y, ancho_habla, alto_habla, dir_hare_dch, dir_zona_pantalla); actualiza_refresco(); } else if (sentido_hare == 1) { if (num_ejec == 1) - reduce_hare_chico(x_habla_dch[cara], y_mask_habla, - hare_x + 12 * factor_red[hare_y + alto_hare] / 100, - hare_y, ancho_habla,alto_habla, factor_red[hare_y + alto_hare], + reduce_hare_chico(x_habla_dch[cara], y_mask_habla, hare_x + 12 * factor_red[hare_y + alto_hare] / 100, + hare_y, ancho_habla,alto_habla, factor_red[hare_y + alto_hare], dir_hare_dch, dir_zona_pantalla); else if (num_ejec == 2) - DIBUJA_BLOQUE(x_habla_dch[cara], y_mask_habla, - hare_x + 8, hare_y, ancho_habla, alto_habla, + DIBUJA_BLOQUE(x_habla_dch[cara], y_mask_habla, hare_x + 8, hare_y, ancho_habla, alto_habla, dir_hare_dch, dir_zona_pantalla); actualiza_refresco(); } else if (sentido_hare == 2) { @@ -3393,7 +3529,13 @@ int DrasculaEngine::music_status() { void DrasculaEngine::refresca_pantalla() { DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla); actualiza_refresco_antes(); - pon_hare(); + if (num_ejec == 3) { + if (flags[0] == 0) + pon_hare(); + else + DIBUJA_BLOQUE(113, 54, hare_x - 20, hare_y - 1, 77, 89, dir_dibujo3, dir_zona_pantalla); + } else + pon_hare(); actualiza_refresco(); } @@ -3465,38 +3607,92 @@ void DrasculaEngine::canal_p(const char *fich){ rename(fich2, fich); } -void DrasculaEngine::puertas_cerradas (int l) { - if (num_ejec == 1) +void DrasculaEngine::puertas_cerradas(int l) { + if (num_ejec == 1 || num_ejec == 3 || num_ejec == 5 || num_ejec == 6) return; - - if (num_obj[l] == 138 && flags[0] == 0) - espuerta[l] = 0; - else if (num_obj[l] == 138 && flags[0] == 1) - espuerta[l] = 1; - else if (num_obj[l] == 136 && flags[8] == 0) - espuerta[l] = 0; - else if (num_obj[l] == 136 && flags[8] == 1) - espuerta[l] = 1; - else if (num_obj[l] == 156 && flags[16] == 0) - espuerta[l] = 0; - else if (num_obj[l] == 156 && flags[16] == 1) - espuerta[l] = 1; - else if (num_obj[l] == 163 && flags[17] == 0) - espuerta[l] = 0; - else if (num_obj[l] == 163 && flags[17] == 1) - espuerta[l] = 1; - else if (num_obj[l] == 177 && flags[15] == 0) - espuerta[l] = 0; - else if (num_obj[l] == 177 && flags[15] == 1) - espuerta[l] = 1; - else if (num_obj[l] == 175 && flags[40] == 0) - espuerta[l] = 0; - else if (num_obj[l] == 175 && flags[40] == 1) - espuerta[l] = 1; - else if (num_obj[l] == 173 && flags[36] == 0) - espuerta[l] = 0; - else if (num_obj[l] == 173 && flags[36] == 1) - espuerta[l] = 1; + else if (num_ejec == 2) { + if (num_obj[l] == 138 && flags[0] == 0) + espuerta[l] = 0; + else if (num_obj[l] == 138 && flags[0] == 1) + espuerta[l] = 1; + else if (num_obj[l] == 136 && flags[8] == 0) + espuerta[l] = 0; + else if (num_obj[l] == 136 && flags[8] == 1) + espuerta[l] = 1; + else if (num_obj[l] == 156 && flags[16] == 0) + espuerta[l] = 0; + else if (num_obj[l] == 156 && flags[16] == 1) + espuerta[l] = 1; + else if (num_obj[l] == 163 && flags[17] == 0) + espuerta[l] = 0; + else if (num_obj[l] == 163 && flags[17] == 1) + espuerta[l] = 1; + else if (num_obj[l] == 177 && flags[15] == 0) + espuerta[l] = 0; + else if (num_obj[l] == 177 && flags[15] == 1) + espuerta[l] = 1; + else if (num_obj[l] == 175 && flags[40] == 0) + espuerta[l] = 0; + else if (num_obj[l] == 175 && flags[40] == 1) + espuerta[l] = 1; + else if (num_obj[l] == 173 && flags[36] == 0) + espuerta[l] = 0; + else if (num_obj[l] == 173 && flags[36] == 1) + espuerta[l] = 1; + } else if (num_ejec == 4) { + if (num_obj[l] == 101 && flags[0] == 0) + espuerta[l] = 0; + else if (num_obj[l] == 101 && flags[0] == 1 && flags[28] == 1) + espuerta[l] = 1; + else if (num_obj[l] == 103 && flags[0] == 0) + espuerta[l] = 0; + else if (num_obj[l] == 103 && flags[0] == 1) + espuerta[l] = 1; + else if (num_obj[l] == 104 && flags[1] == 0) + espuerta[l] = 0; + else if (num_obj[l] == 104 && flags[1] == 1) + espuerta[l] = 1; + else if (num_obj[l] == 105 && flags[1] == 0) + espuerta[l] = 0; + else if (num_obj[l] == 105 && flags[1] == 1) + espuerta[l] = 1; + else if (num_obj[l] == 106 && flags[2] == 0) + espuerta[l] = 0; + else if (num_obj[l] == 106 && flags[2] == 1) + espuerta[l] = 1; + else if (num_obj[l] == 107 && flags[2] == 0) + espuerta[l] = 0; + else if (num_obj[l] == 107 && flags[2] == 1) + espuerta[l] = 1; + else if (num_obj[l] == 110 && flags[6] == 0) + espuerta[l] = 0; + else if (num_obj[l] == 110 && flags[6] == 1) + espuerta[l] = 1; + else if (num_obj[l] == 114 && flags[4] == 0) + espuerta[l] = 0; + else if (num_obj[l] == 114 && flags[4] == 1) + espuerta[l] = 1; + else if (num_obj[l] == 115 && flags[4] == 0) + espuerta[l] = 0; + else if (num_obj[l] == 115 && flags[4] == 1) + espuerta[l] = 1; + else if (num_obj[l] == 116 && flags[5] == 0) + espuerta[l] = 0; + else if (num_obj[l] == 116 && flags[5] == 1 && flags[23] == 1) + espuerta[l] = 1; + else if (num_obj[l] == 117 && flags[5] == 0) + espuerta[l] = 0; + else if (num_obj[l] == 117 && flags[5] == 1) + espuerta[l] = 1; + else if (num_obj[l] == 120 && flags[8] == 0) + espuerta[l] = 0; + else if (num_obj[l] == 120 && flags[8] == 1) + espuerta[l] = 1; + else if (num_obj[l] == 122 && flags[7] == 0) + espuerta[l] = 0; + else if (num_obj[l] == 122 && flags[7] == 1) + espuerta[l] = 1; + } } void DrasculaEngine::color_hare() { @@ -3559,18 +3755,7 @@ void DrasculaEngine::empieza_andar() { paso_x = PASO_HARE_X; paso_y = PASO_HARE_Y; - if (num_ejec == 1) { - if ((sitio_x < hare_x + ancho_hare / 2 ) && (sitio_y <= (hare_y + alto_hare))) - cuadrante_1(); - else if ((sitio_x < hare_x + ancho_hare / 2) && (sitio_y > (hare_y + alto_hare))) - cuadrante_3(); - else if ((sitio_x > hare_x + ancho_hare / 2) && (sitio_y <= (hare_y + alto_hare))) - cuadrante_2(); - else if ((sitio_x > hare_x + ancho_hare / 2) && (sitio_y > (hare_y + alto_hare))) - cuadrante_4(); - else - hare_se_mueve = 0; - } else if (num_ejec == 2) { + if (num_ejec == 2) { if ((sitio_x < hare_x) && (sitio_y <= (hare_y + alto_hare))) cuadrante_1(); else if ((sitio_x < hare_x) && (sitio_y > (hare_y + alto_hare))) @@ -3583,6 +3768,17 @@ void DrasculaEngine::empieza_andar() { anda_parriba(); else if (sitio_y > hare_y + alto_hare) anda_pabajo(); + } else { + if ((sitio_x < hare_x + ancho_hare / 2 ) && (sitio_y <= (hare_y + alto_hare))) + cuadrante_1(); + else if ((sitio_x < hare_x + ancho_hare / 2) && (sitio_y > (hare_y + alto_hare))) + cuadrante_3(); + else if ((sitio_x > hare_x + ancho_hare / 2) && (sitio_y <= (hare_y + alto_hare))) + cuadrante_2(); + else if ((sitio_x > hare_x + ancho_hare / 2) && (sitio_y > (hare_y + alto_hare))) + cuadrante_4(); + else + hare_se_mueve = 0; } conta_vez = vez(); } @@ -3592,7 +3788,13 @@ void DrasculaEngine::actualiza_refresco() { refresca_63(); else if (!strcmp(num_room, "62.alg")) refresca_62(); - else if (!strcmp(num_room, "3.alg")) + else if (!strcmp(num_room, "60.alg")) + refresca_60(); + else if (!strcmp(num_room, "61.alg")) + refresca_61(); + else if (!strcmp(num_room, "58.alg")) + refresca_58(); + else if (!strcmp(num_room, "3.alg")) refresca_3(); else if (!strcmp(num_room, "2.alg")) refresca_2(); @@ -3608,11 +3810,29 @@ void DrasculaEngine::actualiza_refresco() { refresca_18(); else if (!strcmp(num_room, "10.alg")) mapa(); -} + else if (!strcmp(num_room, "20.alg")) + refresca_20(); + else if (!strcmp(num_room, "13.alg")) + refresca_13(); + else if (!strcmp(num_room, "45.alg")) + mapa(); + else if (!strcmp(num_room, "50.alg")) + refresca_50(); + else if (!strcmp(num_room, "57.alg")) + refresca_57(); + } void DrasculaEngine::actualiza_refresco_antes() { if (!strcmp(num_room, "62.alg")) refresca_62_antes(); + else if (!strcmp(num_room, "102.alg")) + refresca_pendulo(); + else if (!strcmp(num_room, "58.alg")) + refresca_58_antes(); + else if (!strcmp(num_room, "59.alg")) + refresca_59_antes(); + else if (!strcmp(num_room, "60.alg")) + refresca_60_antes(); else if (!strcmp(num_room, "1.alg")) refresca_1_antes(); else if (!strcmp(num_room, "3.alg")) @@ -3639,6 +3859,14 @@ void DrasculaEngine::actualiza_refresco_antes() { refresca_17_antes(); else if (!strcmp(num_room,"18.alg")) refresca_18_antes(); + else if (!strcmp(num_room,"49.alg")) + refresca_49_antes(); + else if (!strcmp(num_room,"53.alg")) + refresca_53_antes(); + else if (!strcmp(num_room,"54.alg")) + refresca_54_antes(); + else if (!strcmp(num_room,"56.alg")) + refresca_56_antes(); } void DrasculaEngine::pon_hare() { @@ -3691,7 +3919,7 @@ void DrasculaEngine::pon_hare() { } } - if (num_ejec == 1) + if (num_ejec == 1 || num_ejec == 4 || num_ejec == 5 || num_ejec == 6) if (hare_se_ve == 0) goto no_vuelco; @@ -3700,100 +3928,76 @@ void DrasculaEngine::pon_hare() { pos_hare[1] = DIF_MASK_HARE; pos_hare[2] = hare_x; pos_hare[3] = hare_y; - if (num_ejec == 1) { - pos_hare[4] = ANCHO_PERSONAJE; - pos_hare[5] = ALTO_PERSONAJE; - } else if (num_ejec == 2) { + if (num_ejec == 2) { pos_hare[4] = ancho_hare; pos_hare[5] = alto_hare; + } else { + pos_hare[4] = ANCHO_PERSONAJE; + pos_hare[5] = ALTO_PERSONAJE; } if (sentido_hare == 0) { pos_hare[1] = 0; - if (num_ejec == 1) - reduce_hare_chico(pos_hare[0], pos_hare[1], - pos_hare[2], pos_hare[3], - pos_hare[4], pos_hare[5], - factor_red[hare_y + alto_hare], - dir_hare_dch, dir_zona_pantalla); - else if (num_ejec == 2) + if (num_ejec == 2) DIBUJA_BLOQUE_CUT(pos_hare, dir_hare_dch, dir_zona_pantalla); + else + reduce_hare_chico(pos_hare[0], pos_hare[1], pos_hare[2], pos_hare[3], pos_hare[4], pos_hare[5], + factor_red[hare_y + alto_hare], dir_hare_dch, dir_zona_pantalla); } else if (sentido_hare == 1) - if (num_ejec == 1) - reduce_hare_chico(pos_hare[0], pos_hare[1], - pos_hare[2], pos_hare[3], - pos_hare[4], pos_hare[5], - factor_red[hare_y + alto_hare], - dir_hare_dch, dir_zona_pantalla); - else if (num_ejec == 2) + if (num_ejec == 2) DIBUJA_BLOQUE_CUT(pos_hare, dir_hare_dch, dir_zona_pantalla); + else + reduce_hare_chico(pos_hare[0], pos_hare[1], pos_hare[2], pos_hare[3], pos_hare[4], pos_hare[5], + factor_red[hare_y + alto_hare], dir_hare_dch, dir_zona_pantalla); else if (sentido_hare == 2) - if (num_ejec == 1) - reduce_hare_chico( pos_hare[0], pos_hare[1], - pos_hare[2], pos_hare[3], - pos_hare[4], pos_hare[5], - factor_red[hare_y + alto_hare], - dir_hare_fondo, dir_zona_pantalla); - else if (num_ejec == 2) + if (num_ejec == 2) DIBUJA_BLOQUE_CUT(pos_hare, dir_hare_fondo, dir_zona_pantalla); + else + reduce_hare_chico(pos_hare[0], pos_hare[1], pos_hare[2], pos_hare[3], pos_hare[4], pos_hare[5], + factor_red[hare_y + alto_hare], dir_hare_fondo, dir_zona_pantalla); else - if (num_ejec == 1) - reduce_hare_chico( pos_hare[0], pos_hare[1], - pos_hare[2], pos_hare[3], - pos_hare[4], pos_hare[5], - factor_red[hare_y + alto_hare], - dir_hare_frente, dir_zona_pantalla); - else if (num_ejec == 2) + if (num_ejec == 2) DIBUJA_BLOQUE_CUT(pos_hare, dir_hare_frente, dir_zona_pantalla); + else + reduce_hare_chico( pos_hare[0], pos_hare[1], pos_hare[2], pos_hare[3], pos_hare[4], pos_hare[5], + factor_red[hare_y + alto_hare], dir_hare_frente, dir_zona_pantalla); } else if (hare_se_mueve == 1) { pos_hare[0] = frame_x[num_frame]; pos_hare[1] = frame_y + DIF_MASK_HARE; pos_hare[2] = hare_x; pos_hare[3] = hare_y; - if (num_ejec == 1) { - pos_hare[4] = ANCHO_PERSONAJE; - pos_hare[5] = ALTO_PERSONAJE; - } else if (num_ejec == 2) { + if (num_ejec == 2) { pos_hare[4] = ancho_hare; pos_hare[5] = alto_hare; + } else { + pos_hare[4] = ANCHO_PERSONAJE; + pos_hare[5] = ALTO_PERSONAJE; } if (sentido_hare == 0) { pos_hare[1] = 0; - if (num_ejec == 1) - reduce_hare_chico(pos_hare[0], pos_hare[1], - pos_hare[2], pos_hare[3], - pos_hare[4], pos_hare[5], - factor_red[hare_y + alto_hare], - dir_hare_dch, dir_zona_pantalla); - else if (num_ejec == 2) + if (num_ejec == 2) DIBUJA_BLOQUE_CUT(pos_hare, dir_hare_dch, dir_zona_pantalla); + else + reduce_hare_chico(pos_hare[0], pos_hare[1], pos_hare[2], pos_hare[3], pos_hare[4], pos_hare[5], + factor_red[hare_y + alto_hare], dir_hare_dch, dir_zona_pantalla); } else if (sentido_hare == 1) if (num_ejec == 1) - reduce_hare_chico(pos_hare[0], pos_hare[1], - pos_hare[2], pos_hare[3], - pos_hare[4], pos_hare[5], - factor_red[hare_y + alto_hare], - dir_hare_dch, dir_zona_pantalla); - else if (num_ejec == 2) DIBUJA_BLOQUE_CUT(pos_hare, dir_hare_dch, dir_zona_pantalla); + else + reduce_hare_chico(pos_hare[0], pos_hare[1], pos_hare[2], pos_hare[3], pos_hare[4], pos_hare[5], + factor_red[hare_y + alto_hare], dir_hare_dch, dir_zona_pantalla); else if (sentido_hare == 2) - if (num_ejec == 1) - reduce_hare_chico(pos_hare[0], pos_hare[1], - pos_hare[2], pos_hare[3], - pos_hare[4], pos_hare[5], - factor_red[hare_y + alto_hare], - dir_hare_fondo, dir_zona_pantalla); - else if (num_ejec == 2) + if (num_ejec == 2) DIBUJA_BLOQUE_CUT(pos_hare, dir_hare_fondo, dir_zona_pantalla); + else + reduce_hare_chico(pos_hare[0], pos_hare[1], pos_hare[2], pos_hare[3], pos_hare[4], pos_hare[5], + factor_red[hare_y + alto_hare], dir_hare_fondo, dir_zona_pantalla); else - if (num_ejec == 1) - reduce_hare_chico(pos_hare[0], pos_hare[1], - pos_hare[2], pos_hare[3], - pos_hare[4], pos_hare[5], - factor_red[hare_y + alto_hare], - dir_hare_frente, dir_zona_pantalla); - else if (num_ejec == 2) + if (num_ejec == 2) DIBUJA_BLOQUE_CUT(pos_hare, dir_hare_frente, dir_zona_pantalla); + else + reduce_hare_chico(pos_hare[0], pos_hare[1], pos_hare[2], pos_hare[3], pos_hare[4], pos_hare[5], + factor_red[hare_y + alto_hare], dir_hare_frente, dir_zona_pantalla); no_vuelco: aumenta_num_frame(); @@ -3811,8 +4015,12 @@ void DrasculaEngine::menu_sin_volcar() { h = objetos_que_tengo[n]; if (h != 0) - DIBUJA_FONDO(x_pol[n], y_pol[n], x_obj[n], y_obj[n], - ANCHOBJ, ALTOBJ, dir_hare_frente, dir_zona_pantalla); + if (num_ejec == 6) + DIBUJA_FONDO(x_pol[n], y_pol[n], x_obj[n], y_obj[n], + ANCHOBJ, ALTOBJ, dir_mesa, dir_zona_pantalla); + else + DIBUJA_FONDO(x_pol[n], y_pol[n], x_obj[n], y_obj[n], + ANCHOBJ, ALTOBJ, dir_hare_frente, dir_zona_pantalla); DIBUJA_BLOQUE(x1d_menu[h], y1d_menu[h], x_obj[n], y_obj[n], ANCHOBJ, ALTOBJ, dir_hare_fondo, dir_zona_pantalla); @@ -3828,9 +4036,8 @@ void DrasculaEngine::barra_menu() { for (n = 0; n < 7; n++) { if (x_raton > x_barra[n] && x_raton < x_barra[n + 1]) sobre_verbo = 0; - DIBUJA_BLOQUE(ANCHOBJ * n, ALTOBJ * sobre_verbo, - x_barra[n], 2, ANCHOBJ, ALTOBJ, - dir_hare_fondo, dir_zona_pantalla); + DIBUJA_BLOQUE(ANCHOBJ * n, ALTOBJ * sobre_verbo, x_barra[n], 2, + ANCHOBJ, ALTOBJ, dir_hare_fondo, dir_zona_pantalla); sobre_verbo = 1; } } @@ -3882,7 +4089,7 @@ bool DrasculaEngine::sal_de_la_habitacion(int l) { strcpy(salgo, alapantallakeva[l]); strcat(salgo, ".ald"); hare_x = -1; - carga_escoba_1(salgo); + carga_escoba(salgo); } } } else if (num_ejec == 2) { @@ -3893,13 +4100,13 @@ bool DrasculaEngine::sal_de_la_habitacion(int l) { sentido_hare = sentido_alkeva[l]; obj_saliendo = alapuertakeva[l]; rompo = 1; - musica_antes = musica_room; + musica_antes = musica_room; if (num_obj[l] == 136) animacion_2_2(); if (num_obj[l] == 124) animacion_3_2(); if (num_obj[l] == 173) - animacion_35(); + animacion_35_2(); if (num_obj[l] == 146 && flags[39] == 1) { flags[5] = 1; flags[11] = 1; @@ -3910,11 +4117,91 @@ bool DrasculaEngine::sal_de_la_habitacion(int l) { suma_objeto(11); } borra_pantalla(); - ald->close(); + delete ald; + strcpy(salgo, alapantallakeva[l]); + strcat(salgo, ".ald"); + hare_x =- 1; + carga_escoba(salgo); + } + } else if (num_ejec == 3) { + puertas_cerradas(l); + if (espuerta[l] != 0 && visible[l] == 1) { + lleva_al_hare(sitiobj_x[l], sitiobj_y[l]); + sentido_hare = sentidobj[l]; + refresca_pantalla(); + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); + hare_se_mueve = 0; + sentido_hare = sentido_alkeva[l]; + obj_saliendo = alapuertakeva[l]; + rompo = 1; + musica_antes = musica_room; + borra_pantalla(); strcpy(salgo, alapantallakeva[l]); strcat(salgo, ".ald"); hare_x =- 1; - carga_escoba_2(salgo); + carga_escoba(salgo); + } + } else if (num_ejec == 4) { + puertas_cerradas(l); + if (espuerta[l] != 0) { + lleva_al_hare(sitiobj_x[l], sitiobj_y[l]); + sentido_hare = sentidobj[l]; + refresca_pantalla(); + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); + hare_se_mueve = 0; + sentido_hare = sentido_alkeva[l]; + obj_saliendo = alapuertakeva[l]; + rompo = 1; + musica_antes = musica_room; + + if (num_obj[l] == 108) + lleva_al_hare(171, 78); + borra_pantalla(); + strcpy(salgo, alapantallakeva[l]); + strcat(salgo, ".ald"); + hare_x = -1; + carga_escoba(salgo); + } + } else if (num_ejec == 5) { + puertas_cerradas(l); + if (espuerta[l] != 0 && visible[l] == 1) { + lleva_al_hare(sitiobj_x[l], sitiobj_y[l]); + sentido_hare = sentidobj[l]; + refresca_pantalla(); + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); + hare_se_mueve = 0; + sentido_hare = sentido_alkeva[l]; + obj_saliendo = alapuertakeva[l]; + rompo = 1; + musica_antes = musica_room; + hare_se_ve = 1; + borra_pantalla(); + strcpy(salgo, alapantallakeva[l]); + strcat(salgo, ".ald"); + hare_x = -1; + carga_escoba(salgo); + } + } else if (num_ejec == 6) { + puertas_cerradas(l); + + if (espuerta[l] != 0) { + lleva_al_hare(sitiobj_x[l], sitiobj_y[l]); + sentido_hare = sentidobj[l]; + refresca_pantalla(); + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); + hare_se_mueve = 0; + sentido_hare = sentido_alkeva[l]; + obj_saliendo = alapuertakeva[l]; + rompo = 1; + musica_antes = musica_room; + borra_pantalla(); + strcpy(salgo, alapantallakeva[l]); + strcat(salgo, ".ald"); + hare_x = -1; + carga_escoba(salgo); + + if (obj_saliendo == 105) + animacion_19_6(); } } @@ -3959,60 +4246,236 @@ void DrasculaEngine::banderas(int fl) { hay_respuesta = 1; if (menu_scr == 1) { - if (objeto_que_lleva == MIRAR && fl == 28) - hablar(TEXT328, "328.als"); - if ((objeto_que_lleva == MIRAR && fl == 22 && flags[23] == 0) - || (objeto_que_lleva == ABRIR && fl == 22 && flags[23] == 0)) { - hablar(TEXT164, "164.als"); - flags[23] = 1; - sin_verbo(); - suma_objeto(7); - suma_objeto(18); - } else if (objeto_que_lleva == MIRAR && fl == 22 && flags[23] == 1) - hablar(TEXT307, "307.als"); - else if (objeto_que_lleva == MIRAR && fl == 7) - hablar(TEXT143, "143.als"); - else if (objeto_que_lleva == HABLAR && fl == 7) - hablar(TEXT144, "144.als"); - else if (objeto_que_lleva == MIRAR && fl == 8) - hablar(TEXT145, "145.als"); - else if (objeto_que_lleva == HABLAR && fl == 8) - hablar(TEXT146, "146.als"); - else if (objeto_que_lleva == MIRAR && fl == 9) - hablar(TEXT147, "147.als"); - else if (objeto_que_lleva == HABLAR && fl == 9) - hablar(TEXT148, "148.als"); - else if (objeto_que_lleva == MIRAR && fl == 10) - hablar(TEXT151, "151.als"); - else if (objeto_que_lleva == MIRAR && fl == 11) - hablar(TEXT152, "152.als"); - else if (objeto_que_lleva == HABLAR && fl == 11) - hablar(TEXT153, "153.als"); - else if (objeto_que_lleva == MIRAR && fl == 12) - hablar(TEXT154, "154.als"); - else if (objeto_que_lleva == MIRAR && fl == 13) - hablar(TEXT155, "155.als"); - else if (objeto_que_lleva == MIRAR && fl == 14) - hablar(TEXT157, "157.als"); - else if (objeto_que_lleva == MIRAR && fl == 15) - hablar(TEXT58, "58.als"); - else if (objeto_que_lleva == MIRAR && fl == 16) - hablar(TEXT158, "158.als"); - else if (objeto_que_lleva == MIRAR && fl == 17) - hablar(TEXT159, "159.als"); - else if (objeto_que_lleva == MIRAR && fl == 18) - hablar(TEXT160, "160.als"); - else if (objeto_que_lleva == MIRAR && fl == 19) - hablar(TEXT161, "161.als"); - else if (objeto_que_lleva == MIRAR && fl == 20) - hablar(TEXT162, "162.als"); - else if (objeto_que_lleva == MIRAR && fl == 23) - hablar(TEXT152, "152.als"); - else - hay_respuesta = 0; + if (num_ejec == 4) { + if (objeto_que_lleva == MIRAR && fl == 28) + hablar(TEXT328, "328.als"); + else if (objeto_que_lleva == MIRAR && fl == 7) + hablar(TEXT478, "478.als"); + else if (objeto_que_lleva == MIRAR && fl == 8) + hablar(TEXT120, "120.als"); + else if (objeto_que_lleva == MIRAR && fl == 9) { + hablar(TEXT482, "482.als"); + hablar(TEXT483, "483.als"); + } else if (objeto_que_lleva == MIRAR && fl == 11) + hablar(TEXT488, "488.als"); + else if (objeto_que_lleva == MIRAR && fl == 13) + hablar(TEXT490, "490.als"); + else if (objeto_que_lleva == MIRAR && fl == 14) + hablar(TEXT121, "121.als"); + else if (objeto_que_lleva == MIRAR && fl == 15) + hablar(TEXT117, "117.als" ); + else if (objeto_que_lleva == HABLAR && fl == 15) + hablar(TEXT118, "118.als" ); + else if (objeto_que_lleva == ABRIR && fl == 15) + hablar(TEXT119, "119.als" ); + else if (objeto_que_lleva == MIRAR && fl == 17) + hablar(TEXT478, "478.als"); + else if (objeto_que_lleva == MIRAR && fl == 20) + hablar(TEXT162, "162.als"); + else + hay_respuesta = 0; + return; + } + if (num_ejec == 3) { + if (objeto_que_lleva == MIRAR && fl == 22) + hablar(TEXT307, "307.als"); + else if (objeto_que_lleva == MIRAR && fl == 28) + hablar(TEXT328, "328.als"); + else if (objeto_que_lleva == MIRAR && fl == 7) + hablar(TEXT143, "143.als"); + else if (objeto_que_lleva == HABLAR && fl == 7) + hablar(TEXT144, "144.als"); + else if (objeto_que_lleva == MIRAR && fl == 8) + hablar(TEXT145, "145.als"); + else if (objeto_que_lleva == HABLAR && fl == 8) + hablar(TEXT146, "146.als"); + else if (objeto_que_lleva == MIRAR && fl == 9) + hablar(TEXT147, "147.als"); + else if (objeto_que_lleva == HABLAR && fl == 9) + hablar(TEXT148, "148.als"); + else if (objeto_que_lleva == MIRAR && fl == 10) + hablar(TEXT151, "151.als"); + else if (objeto_que_lleva == MIRAR && fl == 11) + hablar(TEXT152, "152.als"); + else if (objeto_que_lleva == HABLAR && fl == 11) + hablar(TEXT153, "153.als"); + else if (objeto_que_lleva == MIRAR && fl == 12) + hablar(TEXT154, "154.als"); + else if (objeto_que_lleva == MIRAR && fl == 13) + hablar(TEXT155, "155.als"); + else if (objeto_que_lleva == MIRAR && fl == 14) + hablar(TEXT157, "157.als"); + else if (objeto_que_lleva == MIRAR && fl == 15) + hablar(TEXT58, "58.als"); + else if (objeto_que_lleva == MIRAR && fl == 16) + hablar(TEXT158, "158.als"); + else if (objeto_que_lleva == MIRAR && fl == 17) + hablar(TEXT159, "159.als"); + else if (objeto_que_lleva == MIRAR && fl == 18) + hablar(TEXT160, "160.als"); + else if (objeto_que_lleva == MIRAR && fl == 19) + hablar(TEXT161, "161.als"); + else if (objeto_que_lleva == MIRAR && fl == 20) + hablar(TEXT162, "162.als"); + else if (objeto_que_lleva == MIRAR && fl == 23) + hablar(TEXT152, "152.als"); + else + hay_respuesta = 0; + } else if (num_ejec == 1) { + if (objeto_que_lleva == MIRAR && fl == 28) + hablar(TEXT328, "328.als"); + if ((objeto_que_lleva == MIRAR && fl == 22 && flags[23] == 0) + || (objeto_que_lleva == ABRIR && fl == 22 && flags[23] == 0)) { + hablar(TEXT164, "164.als"); + flags[23] = 1; + sin_verbo(); + suma_objeto(7); + suma_objeto(18); + } else if (objeto_que_lleva == MIRAR && fl == 22 && flags[23] == 1) + hablar(TEXT307, "307.als"); + else if (objeto_que_lleva == MIRAR && fl == 7) + hablar(TEXT143, "143.als"); + else if (objeto_que_lleva == HABLAR && fl == 7) + hablar(TEXT144, "144.als"); + else if (objeto_que_lleva == MIRAR && fl == 8) + hablar(TEXT145, "145.als"); + else if (objeto_que_lleva == HABLAR && fl == 8) + hablar(TEXT146, "146.als"); + else if (objeto_que_lleva == MIRAR && fl == 9) + hablar(TEXT147, "147.als"); + else if (objeto_que_lleva == HABLAR && fl == 9) + hablar(TEXT148, "148.als"); + else if (objeto_que_lleva == MIRAR && fl == 10) + hablar(TEXT151, "151.als"); + else if (objeto_que_lleva == MIRAR && fl == 11) + hablar(TEXT152, "152.als"); + else if (objeto_que_lleva == HABLAR && fl == 11) + hablar(TEXT153, "153.als"); + else if (objeto_que_lleva == MIRAR && fl == 12) + hablar(TEXT154, "154.als"); + else if (objeto_que_lleva == MIRAR && fl == 13) + hablar(TEXT155, "155.als"); + else if (objeto_que_lleva == MIRAR && fl == 14) + hablar(TEXT157, "157.als"); + else if (objeto_que_lleva == MIRAR && fl == 15) + hablar(TEXT58, "58.als"); + else if (objeto_que_lleva == MIRAR && fl == 16) + hablar(TEXT158, "158.als"); + else if (objeto_que_lleva == MIRAR && fl == 17) + hablar(TEXT159, "159.als"); + else if (objeto_que_lleva == MIRAR && fl == 18) + hablar(TEXT160, "160.als"); + else if (objeto_que_lleva == MIRAR && fl == 19) + hablar(TEXT161, "161.als"); + else if (objeto_que_lleva == MIRAR && fl == 20) + hablar(TEXT162, "162.als"); + else if (objeto_que_lleva == MIRAR && fl == 23) + hablar(TEXT152, "152.als"); + else + hay_respuesta = 0; + } else if (num_ejec == 4) { + if ((objeto_que_lleva == 18 && fl == 19) || (objeto_que_lleva == 19 && fl == 18)) { + sin_verbo(); + elige_objeto(21); + resta_objeto(18); + resta_objeto(19); + } else if ((objeto_que_lleva == 14 && fl == 19) || + (objeto_que_lleva == 19 && fl == 14)) + hablar(TEXT484, "484.als"); + else if (objeto_que_lleva == MIRAR && fl == 28) + hablar(TEXT328, "328.als"); + else if (objeto_que_lleva == MIRAR && fl == 7) + hablar(TEXT478, "478.als"); + else if (objeto_que_lleva == MIRAR && fl == 8) + hablar(TEXT480, "480.als"); + else if (objeto_que_lleva == MIRAR && fl == 9) { + hablar(TEXT482, "482.als"); + hablar(TEXT483, "483.als"); + } else if (objeto_que_lleva == MIRAR && fl == 10) + hablar(TEXT485, "485.als"); + else if (objeto_que_lleva == MIRAR && fl == 11) + hablar(TEXT488, "488.als"); + else if (objeto_que_lleva == MIRAR && fl == 12) + hablar(TEXT486, "486.als"); + else if (objeto_que_lleva == MIRAR && fl == 13) + hablar(TEXT490, "490.als"); + else if (objeto_que_lleva == MIRAR && fl == 14) + hablar(TEXT122, "122.als"); + else if (objeto_que_lleva == MIRAR && fl == 15) + hablar(TEXT117, "117.als"); + else if (objeto_que_lleva == HABLAR && fl == 15) + hablar(TEXT118, "118.als"); + else if (objeto_que_lleva == ABRIR && fl == 15) + hablar(TEXT119, "119.als"); + else if (objeto_que_lleva == MIRAR && fl == 16) + hablar(TEXT491, "491.als"); + else if (objeto_que_lleva == MIRAR && fl == 17) + hablar(TEXT478, "478.als"); + else if (objeto_que_lleva == MIRAR && fl == 18) + hablar(TEXT493, "493.als"); + else if (objeto_que_lleva == MIRAR && fl == 19) { + hablar(TEXT494, "494.als"); + hablar(TEXT495, "495.als"); + } else if (objeto_que_lleva == MIRAR && fl == 20) + hablar(TEXT162, "162.als"); + else if (objeto_que_lleva == MIRAR && fl == 21) + hablar(TEXT496, "496.als"); + else if (objeto_que_lleva == MIRAR && fl == 22) + hablar(TEXT161, "161.als"); + else + hay_respuesta = 0; + } else if (num_ejec == 5) { + if (objeto_que_lleva == MIRAR && fl == 50) + hablar("Cuanto mas me miro, mas me gusto.", "54.als"); + else if (objeto_que_lleva == ABRIR && fl == 50) + hablar(".y luego como me cierro?.", "19.als"); + else if (objeto_que_lleva == CERRAR && fl == 50) + hablar("Tendre que abrirme primero .no?.", "19.als"); + else if (objeto_que_lleva == MOVER && fl == 50) + hablar("Estoy bien donde estoy.", "19.als"); + else if (objeto_que_lleva == COGER && fl == 50) + hablar("Ya me tengo.", "11.als"); + else if (objeto_que_lleva == HABLAR && fl == 50) + hablar("hola yo.", "16.als" ); + else if (objeto_que_lleva == 20 && fl == 50) + hablar(TEXT487, "487.als" ); + else if (!strcmp(num_room, "49.alg")) + pantalla_49(fl); + else if (!strcmp(num_room, "53.alg")) + pantalla_53(fl); + else if (!strcmp(num_room, "54.alg")) + pantalla_54(fl); + else if (!strcmp(num_room, "55.alg")) + pantalla_55(fl); + else if (!strcmp(num_room, "56.alg")) + pantalla_56(fl); + else + hay_respuesta = 0; + return; + } else if (num_ejec == 6) { + if (objeto_que_lleva == MIRAR && fl == 28) + hablar(TEXT328, "328.als"); + else if (objeto_que_lleva == MIRAR && fl == 9) { + hablar(TEXT482, "482.als"); + hablar(TEXT483, "483.als"); + } else if (objeto_que_lleva == MIRAR && fl == 20) + hablar(TEXT123, "123.als"); + else if (objeto_que_lleva == MIRAR && fl == 21) + hablar(TEXT441, "441.als"); + else + hay_respuesta = 0; + } } else { if (objeto_que_lleva == MIRAR && fl == 50) - hablar(TEXT308, "308.als"); + if (num_ejec == 3) + hablar(TEXT308, "308.als"); + else if (num_ejec == 6) + if (flags[0] == 1) + hablar(TEXT308, "308.als"); + else if (flags[0] == 0) + hablar(TEXT250, "250.als"); + else + hablar(TEXT309, "309.als"); else if (objeto_que_lleva == ABRIR && fl == 50) hablar(TEXT310, "310.als" ); else if (objeto_que_lleva == CERRAR && fl == 50) @@ -4022,11 +4485,23 @@ void DrasculaEngine::banderas(int fl) { else if (objeto_que_lleva == COGER && fl == 50) hablar(TEXT313, "313.als" ); else if (objeto_que_lleva == HABLAR && fl == 50) - hablar(TEXT314,"314.als" ); - else if (!strcmp(num_room, "62.alg")) + hablar(TEXT314, "314.als" ); + else if (!strcmp(num_room, "102.alg")) + pantalla_pendulo(fl); + else if (!strcmp(num_room, "58.alg")) + pantalla_58(fl); + else if (!strcmp(num_room, "59.alg")) + pantalla_59(fl); + else if (!strcmp(num_room, "60.alg")) + pantalla_60(fl); + else if (!strcmp(num_room, "61.alg")) + pantalla_61(fl); + else if (!strcmp(num_room, "62.alg")) pantalla_62(fl); else if (!strcmp(num_room, "63.alg")) pantalla_63(fl); + else if (!strcmp(num_room, "13.alg")) + pantalla_13(fl); else hay_respuesta = 0; } @@ -4196,29 +4671,52 @@ int DrasculaEngine::PlayFrameSSN() { mSesion += 1; } switch (CHUNK) { - case SET_PALET: - if (!UsingMem) - _Sesion->read(dacSSN, 768); - else { - memcpy(dacSSN, mSesion, 768); - mSesion += 768; - } - set_dacSSN(dacSSN); - break; - case EMPTY_FRAME: - WaitFrameSSN(); - break; - case INIT_FRAME: + case SET_PALET: + if (!UsingMem) + _Sesion->read(dacSSN, 768); + else { + memcpy(dacSSN, mSesion, 768); + mSesion += 768; + } + set_dacSSN(dacSSN); + break; + case EMPTY_FRAME: + WaitFrameSSN(); + break; + case INIT_FRAME: + if (!UsingMem) { + _Sesion->read(&CMP, 1); + _Sesion->read(&Lengt, 4); + } else { + memcpy(&CMP, mSesion, 1); + mSesion += 1; + memcpy(&Lengt, mSesion, 4); + mSesion += 4; + } + if (CMP == CMP_RLE) { if (!UsingMem) { - _Sesion->read(&CMP, 1); - _Sesion->read(&Lengt, 4); + BufferSSN = (byte *)malloc(Lengt); + _Sesion->read(BufferSSN, Lengt); } else { - memcpy(&CMP, mSesion, 1); - mSesion += 1; - memcpy(&Lengt, mSesion, 4); - mSesion += 4; + BufferSSN = (byte *)malloc(Lengt); + memcpy(BufferSSN, mSesion, Lengt); + mSesion += Lengt; } - if (CMP == CMP_RLE) { + Des_RLE(BufferSSN, MiVideoSSN); + free(BufferSSN); + if (FrameSSN) { + WaitFrameSSN(); + MixVideo(VGA, MiVideoSSN); + _system->copyRectToScreen((const byte *)VGA, 320, 0, 0, 320, 200); + } else { + WaitFrameSSN(); + memcpy(VGA, MiVideoSSN, 64000); + _system->copyRectToScreen((const byte *)VGA, 320, 0, 0, 320, 200); + } + _system->updateScreen(); + FrameSSN++; + } else { + if (CMP == CMP_OFF) { if (!UsingMem) { BufferSSN = (byte *)malloc(Lengt); _Sesion->read(BufferSSN, Lengt); @@ -4227,7 +4725,7 @@ int DrasculaEngine::PlayFrameSSN() { memcpy(BufferSSN, mSesion, Lengt); mSesion += Lengt; } - Des_RLE(BufferSSN, MiVideoSSN); + Des_OFF(BufferSSN, MiVideoSSN, Lengt); free(BufferSSN); if (FrameSSN) { WaitFrameSSN(); @@ -4240,39 +4738,17 @@ int DrasculaEngine::PlayFrameSSN() { } _system->updateScreen(); FrameSSN++; - } else { - if (CMP == CMP_OFF) { - if (!UsingMem) { - BufferSSN = (byte *)malloc(Lengt); - _Sesion->read(BufferSSN, Lengt); - } else { - BufferSSN = (byte *)malloc(Lengt); - memcpy(BufferSSN, mSesion, Lengt); - mSesion += Lengt; - } - Des_OFF(BufferSSN, MiVideoSSN, Lengt); - free(BufferSSN); - if (FrameSSN) { - WaitFrameSSN(); - MixVideo(VGA, MiVideoSSN); - _system->copyRectToScreen((const byte *)VGA, 320, 0, 0, 320, 200); - } else { - WaitFrameSSN(); - memcpy(VGA, MiVideoSSN, 64000); - _system->copyRectToScreen((const byte *)VGA, 320, 0, 0, 320, 200); - } - _system->updateScreen(); - FrameSSN++; - } } - break; - case END_ANIM: - Exit = 1; - break; - default: - Exit = 1; - break; } + break; + case END_ANIM: + Exit = 1; + break; + default: + Exit = 1; + break; + } + return (!Exit); } @@ -4348,7 +4824,8 @@ void DrasculaEngine::MixVideo(byte *OldScreen, byte *NewScreen) { } void DrasculaEngine::WaitFrameSSN() { - while (clock() < LastFrame + GlobalSpeed) {}; + while ((int)clock() < LastFrame + GlobalSpeed) + ; LastFrame = LastFrame + GlobalSpeed; } @@ -4387,6 +4864,11 @@ void DrasculaEngine::WaitForNext(int FPS) { } float DrasculaEngine::vez() { + // FIXME: This function is really silly. It first divides an int by an int (resulting + // in an *int*, loosing precision), *then* converts the result to a float and returns + // that -- only so that many calling functions have to convert it back to an int :-). + // So: Either divide by 20.0 / cast to float *first*, if you absolutly need the precision. + // Or: Just change this to return int! return _system->getMillis() / 20; // originaly was 1 } @@ -4405,8 +4887,8 @@ void DrasculaEngine::reduce_hare_chico(int xx1, int yy1, int xx2, int yy2, int a pixel_x = xx1; pixel_y = yy1; - for (n = 0;n < nuevo_alto; n++){ - for (m = 0; m < nuevo_ancho; m++){ + for (n = 0; n < nuevo_alto; n++) { + for (m = 0; m < nuevo_ancho; m++) { pos_pixel[0] = (int)pixel_x; pos_pixel[1] = (int)pixel_y; pos_pixel[2] = xx2 + m; @@ -4430,10 +4912,10 @@ char DrasculaEngine::codifica(char car) { void DrasculaEngine::cuadrante_1() { float distancia_x = 0, distancia_y; - if (num_ejec == 1) - distancia_x = hare_x + ancho_hare / 2 - sitio_x; - else if (num_ejec == 2) + if (num_ejec == 2) distancia_x = hare_x + ancho_hare - sitio_x; + else + distancia_x = hare_x + ancho_hare / 2 - sitio_x; distancia_y = (hare_y + alto_hare) - sitio_y; @@ -4451,10 +4933,10 @@ void DrasculaEngine::cuadrante_1() { void DrasculaEngine::cuadrante_2() { float distancia_x = 0, distancia_y; - if (num_ejec == 1) - distancia_x = abs(hare_x + ancho_hare / 2 - sitio_x); - else if (num_ejec == 2) + if (num_ejec == 2) distancia_x = abs(hare_x + ancho_hare - sitio_x); + else + distancia_x = abs(hare_x + ancho_hare / 2 - sitio_x); distancia_y = (hare_y + alto_hare) - sitio_y; @@ -4472,10 +4954,10 @@ void DrasculaEngine::cuadrante_2() { void DrasculaEngine::cuadrante_3() { float distancia_x = 0, distancia_y; - if (num_ejec == 1) - distancia_x = hare_x + ancho_hare / 2 - sitio_x; - else if (num_ejec == 2) + if (num_ejec == 2) distancia_x = hare_x + ancho_hare - sitio_x; + else + distancia_x = hare_x + ancho_hare / 2 - sitio_x; distancia_y = sitio_y - (hare_y + alto_hare); @@ -4493,10 +4975,10 @@ void DrasculaEngine::cuadrante_3() { void DrasculaEngine::cuadrante_4() { float distancia_x = 0, distancia_y; - if (num_ejec == 1) - distancia_x = abs(hare_x + ancho_hare / 2 - sitio_x); - else if (num_ejec == 2) + if (num_ejec == 2) distancia_x = abs(hare_x + ancho_hare - sitio_x); + else + distancia_x = abs(hare_x + ancho_hare / 2 - sitio_x); distancia_y = sitio_y - (hare_y + alto_hare); @@ -4527,7 +5009,7 @@ void DrasculaEngine::refresca_63() { } void DrasculaEngine::refresca_62_antes() { - int velas_y[] = { 158, 172, 186}; + int velas_y[] = { 158, 172, 186 }; int cirio_x[] = { 14, 19, 24 }; int pianista_x[] = {1, 91, 61, 31, 91, 31, 1, 61, 31 }; int borracho_x[] = {1, 42, 83, 124, 165, 206, 247, 1 }; @@ -4642,7 +5124,7 @@ void DrasculaEngine::aumenta_num_frame() { } } - if (num_ejec == 1) { + if (num_ejec != 2) { diferencia_y = alto_hare - (int)nuevo_alto; diferencia_x = ancho_hare - (int)nuevo_ancho; hare_y = hare_y + diferencia_y; @@ -4667,7 +5149,7 @@ int DrasculaEngine::sobre_que_objeto() { void DrasculaEngine::comprueba_banderas_menu() { int h, n; - for (n = 0; n < 43; n++){ + for (n = 0; n < 43; n++) { if (sobre_que_objeto() == n) { h = objetos_que_tengo[n]; if (h != 0) @@ -4677,6 +5159,77 @@ void DrasculaEngine::comprueba_banderas_menu() { } void DrasculaEngine::pantalla_0() { + if (num_ejec == 6) { + if (objeto_que_lleva == MIRAR) { + hablar(mirar_t[c_mirar], mirar_v[c_mirar]); + c_mirar++; + if (c_mirar == 3) + c_mirar = 0; + } else if (objeto_que_lleva == MOVER) + hablar(TEXT19, "19.als"); + else if (objeto_que_lleva == COGER) { + hablar(poder_t[c_poder], poder_v[c_poder]); + c_poder++; + if (c_poder == 6) + c_poder = 0; + } else if (objeto_que_lleva == ABRIR) + hablar(TEXT9, "9.als"); + else if (objeto_que_lleva == CERRAR) + hablar(TEXT9, "9.als"); + else if (objeto_que_lleva == HABLAR) + hablar(TEXT16, "16.als"); + else { + hablar(poder_t[c_poder], poder_v[c_poder]); + c_poder++; + if (c_poder == 6) + c_poder = 0; + } + } + if (num_ejec == 5) { + if (objeto_que_lleva == MIRAR) { + hablar(mirar_t[c_mirar], mirar_v[c_mirar]); + c_mirar++; + if (c_mirar == 3) + c_mirar = 0; + } else if (objeto_que_lleva == MOVER) + hablar(TEXT19, "19.als"); + else if (objeto_que_lleva == COGER) { + hablar(poder_t[c_poder], poder_v[c_poder]); + c_poder++; + if (c_poder == 6) + c_poder = 0; + } else if (objeto_que_lleva == ABRIR) + hablar(TEXT9, "9.als"); + else if (objeto_que_lleva == CERRAR) + hablar(TEXT9, "9.als"); + else if (objeto_que_lleva == HABLAR) + hablar(TEXT16, "16.als"); + else { + hablar(poder_t[c_poder], poder_v[c_poder]); + c_poder++; + if (c_poder == 6) + c_poder = 0; + } + return; + } + if (num_ejec == 3) { + if (objeto_que_lleva == MIRAR) + hablar(TEXT316, "316.als"); + else if (objeto_que_lleva == MOVER) + hablar(TEXT317, "317.als"); + else if (objeto_que_lleva == COGER) + hablar(TEXT318, "318.als"); + else if (objeto_que_lleva == ABRIR) + hablar(TEXT319, "319.als"); + else if (objeto_que_lleva == CERRAR) + hablar(TEXT319, "319.als"); + else if (objeto_que_lleva == HABLAR) + hablar(TEXT320, "320.als"); + else + hablar(TEXT318, "318.als"); + return; + } + if (objeto_que_lleva == MIRAR) { if (num_ejec == 1) hablar(TEXT54, "54.als"); @@ -4780,6 +5333,9 @@ void DrasculaEngine::conversa(const char *nom_fich) { strcpy(para_codificar, nom_fich); canal_p(para_codificar); + if (num_ejec == 5) + sin_verbo(); + ald = new Common::File; ald->open(nom_fich); if (!ald->isOpen()) { @@ -4818,6 +5374,18 @@ void DrasculaEngine::conversa(const char *nom_fich) { respuesta3 = 31; } + if (num_ejec == 6 && !strcmp(nom_fich, "op_5.cal") && flags[7] == 1) { + strcpy(frase3, TEXT273); + strcpy(suena3, "273.als"); + respuesta3 = 14; + } + + if (num_ejec == 6 && !strcmp(nom_fich, "op_5.cal") && flags[10] == 1) { + strcpy(frase3, ".cuanto.queda.para.que.acabe.el.partido?"); + strcpy(suena3, "274.als"); + respuesta3 = 15; + } + longitud = strlen(frase1); for (h = 0; h < longitud; h++) if (frase1[h] == (char)0xa7) @@ -4840,7 +5408,7 @@ void DrasculaEngine::conversa(const char *nom_fich) { lee_dibujos("car.alg"); descomprime_dibujo(dir_hare_fondo,1); -/* TODO +/* TODO this is limit for mouse, but we can't implement this ent.w.ax = 8; ent.w.cx = 1; ent.w.dx = 31; @@ -4858,10 +5426,19 @@ bucle_opc: else if (num_ejec == 2) if (music_status() == 0 && flags[11] == 0 && musica_room != 0) playmusic(musica_room); + else if (num_ejec == 3) + if (music_status() == 0) + playmusic(musica_room); + else if (num_ejec == 4) + if (music_status() == 0) + playmusic(musica_room); + else if (num_ejec == 5) + if (music_status() == 0) + playmusic(musica_room); MirarRaton(); - if ( y_raton > 0 && y_raton < 9) { + if (y_raton > 0 && y_raton < 9) { if (usado1 == 1 && _color != BLANCO) color_abc(BLANCO); else if (usado1 == 0 && _color != VERDE_CLARO) @@ -4898,15 +5475,24 @@ bucle_opc: if ((boton_izq == 1) && (juego1 == 2)) { usado1 = 1; hablar(frase1, suena1); - responde(respuesta1); + if (num_ejec == 3) + grr(); + else + responde(respuesta1); } else if ((boton_izq == 1) && (juego2 == 2)) { usado2 = 1; hablar(frase2, suena2); - responde(respuesta2); + if (num_ejec == 3) + grr(); + else + responde(respuesta2); } else if ((boton_izq == 1) && (juego3 == 2)) { usado3 = 1; hablar(frase3, suena3); - responde(respuesta3); + if (num_ejec == 3) + grr(); + else + responde(respuesta3); } else if ((boton_izq == 1) && (juego4 == 2)) { hablar(frase4, suena4); rompo_y_salgo = 1; @@ -4938,7 +5524,8 @@ bucle_opc: else if (num_ejec == 2) lee_dibujos(fondo_y_menu); descomprime_dibujo(dir_hare_fondo, 1); - sin_verbo(); + if (num_ejec < 5) + sin_verbo(); } void DrasculaEngine::animacion_3_1() { @@ -5196,7 +5783,51 @@ void DrasculaEngine::print_abc_opc(const char *dicho, int x_pantalla, int y_pant } void DrasculaEngine::responde(int funcion) { - if (funcion == 10) + if (num_ejec == 5) { + if (funcion == 2) + animacion_2_5(); + else if (funcion == 3) + animacion_3_5(); + else if (funcion == 6) + animacion_6_5(); + else if (funcion == 7) + animacion_7_5(); + else if (funcion == 8) + animacion_8_5(); + else if (funcion == 15) + animacion_15_5(); + else if (funcion == 16) + animacion_16_5(); + else if (funcion == 17) + animacion_17_5(); + return; + } + if (num_ejec == 6) { + if (funcion == 2) + animacion_2_6(); + else if (funcion == 3) + animacion_3_6(); + else if (funcion == 4) + animacion_4_6(); + else if (funcion == 11) + animacion_11_6(); + else if (funcion == 12) + animacion_12_6(); + else if (funcion == 13) + animacion_13_6(); + else if (funcion == 14) + animacion_14_6(); + else if (funcion == 15) + animacion_15_6(); + return; + } + if (funcion == 2) + animacion_2_4(); + else if (funcion == 3) + animacion_3_4(); + else if (funcion == 4) + animacion_4_4(); + else if (funcion == 10) habla_borracho(TEXTB1, "B1.als"); else if (funcion == 11) habla_borracho(TEXTB2, "B2.als"); @@ -5235,7 +5866,7 @@ void DrasculaEngine::responde(int funcion) { void DrasculaEngine::habla_pianista(const char *dicho, const char *filename) { int tiempou; long tiempol; - int x_habla[4] = { 97, 145, 193, 241}; + int x_habla[4] = { 97, 145, 193, 241 }; int cara; int longitud; longitud = strlen(dicho); @@ -5380,8 +6011,9 @@ bucless: lee_dibujos("96.alg"); descomprime_dibujo(dir_hare_frente, 1); - if (music_status() == 0 && flags[11] == 0) - playmusic(musica_room); + if (num_ejec <= 3) + if (music_status() == 0 && flags[11] == 0) + playmusic(musica_room); } void DrasculaEngine::suma_objeto(int osj) { @@ -5395,7 +6027,7 @@ void DrasculaEngine::suma_objeto(int osj) { if (puesto == 0) { for (h = 1; h < 43; h++) { if (objetos_que_tengo[h] == 0) { - objetos_que_tengo[h]=osj; + objetos_que_tengo[h] = osj; puesto = 1; break; } @@ -5473,6 +6105,29 @@ void DrasculaEngine::actualiza_datos() { visible[4] = 0; else if (!strcmp(num_room, "18.alg") && flags[28] == 1) visible[2] = 0; + if (!strcmp(num_room,"49.alg") && flags[6] == 1) + visible[2] = 0; + if (!strcmp(num_room,"49.alg") && flags[6] == 0) + visible[1] = 0; + if (!strcmp(num_room,"49.alg") && flags[6] == 1) + visible[1] = 1; + if (!strcmp(num_room,"45.alg") && flags[6] == 1) + visible[3] = 1; + if (!strcmp(num_room,"53.alg") && flags[2] == 1) + visible[3] = 0; + if (!strcmp(num_room,"54.alg") && flags[13] == 1) + visible[3] = 0; + if (!strcmp(num_room,"55.alg") && flags[8] == 1) + visible[1] = 0; + if ((!strcmp(num_room, "58.alg")) && flags[8] == 0) + espuerta[1] = 0; + if ((!strcmp(num_room, "58.alg")) && flags[8] == 1) + espuerta[1] = 1; + if (!strcmp(num_room, "59.alg")) + espuerta[1] = 0; + if (!strcmp(num_room, "60.alg")) { + sentido_dr = 0; x_dr = 155; y_dr = 69; + } } void DrasculaEngine::animacion_1_2() { @@ -5577,7 +6232,7 @@ void DrasculaEngine::animacion_4_2() { flags[9] = 1; pausa(12); - hablar(TEXTD56, "d56.als" ); + hablar(TEXTD56, "d56.als"); pausa(8); borra_pantalla(); @@ -5680,12 +6335,12 @@ void DrasculaEngine::animacion_14() { descomprime_dibujo(dir_hare_fondo, 1); lee_dibujos("an14_1.alg"); - pos_cabina[0]=150; - pos_cabina[1]=6; - pos_cabina[2]=69; - pos_cabina[3]=-160; - pos_cabina[4]=158; - pos_cabina[5]=161; + pos_cabina[0] = 150; + pos_cabina[1] = 6; + pos_cabina[2] = 69; + pos_cabina[3] = -160; + pos_cabina[4] = 158; + pos_cabina[5] = 161; for (n = -160; n <= 0; n = n + 5 + l) { DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla); @@ -5759,7 +6414,7 @@ void DrasculaEngine::animacion_16() { descomprime_dibujo(dir_dibujo1, MEDIA); DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla); centra_texto(HIS2, 180, 180); - VUELCA_PANTALLA(0,0,0,0, 320,200, dir_zona_pantalla); + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); key = getscan(); if (key != 0) goto asco; @@ -5809,10 +6464,10 @@ void DrasculaEngine::animacion_16() { if (key != 0) goto asco; - for (l = 1; l < 200; l++){ + for (l = 1; l < 200; l++) { DIBUJA_FONDO(0, 0, 0, l, 320, 200 - l, dir_dibujo3, dir_zona_pantalla); DIBUJA_FONDO(0, 200 - l, 0, 0, 320, l, dir_dibujo1, dir_zona_pantalla); - VUELCA_PANTALLA(0,0,0,0, 320,200, dir_zona_pantalla); + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); key = getscan(); if (key != 0) goto asco; @@ -5939,8 +6594,10 @@ void DrasculaEngine::animacion_23() { void DrasculaEngine::animacion_23_anexo() { int n, p_x = hare_x + 2, p_y = hare_y - 3; - int x[] = {1,38,75,112,75,112,75,112,149,112,149,112,149,186,223,260,1,38,75,112,149,112,149,112,149,112,149,186,223,260,260,260,260,223}; - int y[] = {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,76,76,76,76,76,76,76,76,76,76,76,76,76,76,1,1,1,1}; + int x[] = {1, 38, 75, 112, 75, 112, 75, 112, 149, 112, 149, 112, 149, 186, 223, 260, + 1, 38, 75, 112, 149, 112, 149, 112, 149, 112, 149, 186, 223, 260, 260, 260, 260, 223}; + int y[] = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 76, 76, 76, 76, 76, 76, 76, + 76, 76, 76, 76, 76, 76, 76, 1, 1, 1, 1}; lee_dibujos("an23.alg"); descomprime_dibujo(dir_hare_fondo, 1); @@ -5959,8 +6616,8 @@ void DrasculaEngine::animacion_23_anexo() { void DrasculaEngine::animacion_23_anexo2() { int n, p_x = hare_x + 4, p_y = hare_y; - int x[] = {1,35,69,103,137,171,205,239,273,1,35,69,103,137}; - int y[] = {1,1,1,1,1,1,1,1,1,73,73,73,73,73}; + int x[] = {1, 35, 69, 103, 137, 171, 205, 239, 273, 1, 35, 69, 103, 137}; + int y[] = {1, 1, 1, 1, 1, 1, 1, 1, 1, 73, 73, 73, 73, 73}; pausa(50); @@ -6010,7 +6667,7 @@ void DrasculaEngine::animacion_25() { DIBUJA_BLOQUE_CUT(pos_cabina, dir_hare_fondo, dir_zona_pantalla); actualiza_refresco(); - VUELCA_PANTALLA(0,0, 0,0, 320,200, dir_zona_pantalla); + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); } fin_sound(); @@ -6129,7 +6786,7 @@ void DrasculaEngine::animacion_31(){ suma_objeto(20); } -void DrasculaEngine::animacion_35() { +void DrasculaEngine::animacion_35_2() { int n, x = 0; lleva_al_hare(96, 165); @@ -6150,8 +6807,8 @@ void DrasculaEngine::animacion_35() { x = x + 46; pausa(3); } - x = 0; + x = 0; for (n = 0; n < 6; n++) { x++; DIBUJA_FONDO(x, 82, 70, 90, 46, 80, dir_hare_fondo, dir_zona_pantalla); @@ -6161,7 +6818,6 @@ void DrasculaEngine::animacion_35() { } x = 0; - for (n = 0; n < 6; n++) { x++; DIBUJA_FONDO(x, 1, 70, 90, 46, 80, dir_hare_frente, dir_zona_pantalla); @@ -6171,8 +6827,8 @@ void DrasculaEngine::animacion_35() { pausa(3); } - x = 0; + x = 0; for (n = 0; n < 2; n++) { x++; DIBUJA_FONDO(x, 82, 70, 90, 46, 80, dir_hare_frente, dir_zona_pantalla); @@ -6196,14 +6852,14 @@ void DrasculaEngine::animacion_35() { FundeAlNegro(2); // TODO - salir_al_dos(3); + error("hit part 3"); } void DrasculaEngine::habla_vb(const char *dicho, const char *filename) { int tiempou; long tiempol; - int x_habla[6] = {1,27,53,79,105,131}; + int x_habla[6] = {1, 27, 53, 79, 105, 131}; int cara; int longitud; @@ -6328,7 +6984,7 @@ bucless: void DrasculaEngine::habla_ciego(const char *dicho, const char *filename, const char *sincronia) { byte *num_cara; - int p; + int p = 0; int pos_ciego[6]; int cara = 0; @@ -6339,13 +6995,6 @@ void DrasculaEngine::habla_ciego(const char *dicho, const char *filename, const color_abc(VON_BRAUN); - // FIXME: We can't do this to a read-only string! -#if 0 - for (p = 0; sincronia[p]; p++) - sincronia[p] = toupper(sincronia[p]); -#endif - - p = 0; DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla); VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); @@ -6369,21 +7018,22 @@ void DrasculaEngine::habla_ciego(const char *dicho, const char *filename, const bucless: DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla); pos_ciego[5] = 149; - if (sincronia[p] == '0') + char c = toupper(sincronia[p]); + if (c == '0') cara = 0; - if (sincronia[p] == '1') + if (c == '1') cara = 1; - if (sincronia[p] == '2') + if (c == '2') cara = 2; - if (sincronia[p] == '3') + if (c == '3') cara = 3; - if (sincronia[p] == '4') + if (c == '4') cara = 4; - if (sincronia[p] == '5') + if (c == '5') cara = 5; - if (sincronia[p] == '6') + if (c == '6') cara = 6; - if (sincronia[p] == '7') + if (c == '7') cara = 7; if (cara == 0 || cara == 2 || cara == 4 || cara == 6) @@ -6468,7 +7118,7 @@ bucless: VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); int key = getscan(); - if (key!=0) + if (key != 0) ctvd_stop(); if (hay_sb == 1) { if (LookForFree() != 0) @@ -6560,22 +7210,33 @@ void DrasculaEngine::lleva_vb(int punto_x) { void DrasculaEngine::hipo_sin_nadie(int contador){ int y = 0, sentido = 0; - contador = contador; + if (num_ejec == 3) + y = -1; comienza: contador--; DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla); - VUELCA_PANTALLA(0, 1, 0, y, 320, 198, dir_zona_pantalla); + if (num_ejec <= 2) + VUELCA_PANTALLA(0, 1, 0, y, 320, 198, dir_zona_pantalla); + else + VUELCA_PANTALLA(0, 0, 0, y, 320, 200, dir_zona_pantalla); if (sentido == 0) y++; else y--; - if (y == 2) - sentido = 1; - if (y == 0) - sentido = 0; + if (num_ejec <= 2) { + if (y == 2) + sentido = 1; + if (y == 0) + sentido = 0; + } else if (num_ejec == 3) { + if (y == 1) + sentido = 1; + if (y == -1) + sentido = 0; + } if (contador > 0) goto comienza; @@ -6585,6 +7246,12 @@ comienza: void DrasculaEngine::abre_puerta(int nflag, int n_puerta) { if (flags[nflag] == 0) { + if (num_ejec == 5 || num_ejec == 6) { + comienza_sound("s3.als"); + flags[nflag] = 1; + } + if (num_ejec == 1 && nflag == 7) + return; comienza_sound("s3.als"); flags[nflag] = 1; if (n_puerta != NO_PUERTA) @@ -6592,7 +7259,8 @@ void DrasculaEngine::abre_puerta(int nflag, int n_puerta) { refresca_pantalla(); VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); fin_sound(); - sin_verbo(); + if (num_ejec != 5) + sin_verbo(); } } @@ -6601,11 +7269,11 @@ void DrasculaEngine::mapa() { for (l = 0; l < objs_room; l++) { if (x_raton > x1[l] && y_raton > y1[l] - && x_raton < x2[l] && y_raton < y2[l] - && visible[l] == 1) { - strcpy(texto_nombre, nombre_obj[l]); - hay_nombre = 1; - veo = 1; + && x_raton < x2[l] && y_raton < y2[l] + && visible[l] == 1) { + strcpy(texto_nombre, nombre_obj[l]); + hay_nombre = 1; + veo = 1; } } @@ -6633,21 +7301,21 @@ void DrasculaEngine::refresca_1_antes() { void DrasculaEngine::refresca_2(){ int pos_murci[6]; int diferencia; - int murci_x[] = {0,38,76,114,152,190,228,266, - 0,38,76,114,152,190,228,266, - 0,38,76,114,152,190, - 0,48,96,144,192,240, - 30,88,146,204,262, - 88,146,204,262, - 88,146,204,262}; - - int murci_y[] = {179,179,179,179,179,179,179,179, - 158,158,158,158,158,158,158,158, - 137,137,137,137,137,137, - 115,115,115,115,115,115, - 78,78,78,78,78, - 41,41,41,41, - 4,4,4,4}; + int murci_x[] = {0, 38, 76, 114, 152, 190, 228, 266, + 0, 38, 76, 114, 152, 190, 228, 266, + 0, 38, 76, 114, 152, 190, + 0, 48, 96, 144, 192, 240, + 30, 88, 146, 204, 262, + 88, 146, 204, 262, + 88, 146, 204, 262}; + + int murci_y[] = {179, 179, 179, 179, 179, 179, 179, 179, + 158, 158, 158, 158, 158, 158, 158, 158, + 137, 137, 137, 137, 137, 137, + 115, 115, 115, 115, 115, 115, + 78, 78, 78, 78, 78, + 41, 41, 41, 41, + 4, 4, 4, 4}; if (frame_murcielago == 41) frame_murcielago = 0; @@ -6670,10 +7338,10 @@ void DrasculaEngine::refresca_2(){ pos_murci[3] = 19; DIBUJA_BLOQUE_CUT(pos_murci, dir_dibujo3, dir_zona_pantalla); - diferencia = vez() - conta_ciego_vez; + diferencia = (int)vez() - conta_ciego_vez; if (diferencia >= 6) { frame_murcielago++; - conta_ciego_vez = vez(); + conta_ciego_vez = (int)vez(); } DIBUJA_BLOQUE(29, 37, 58, 114, 57, 39, dir_dibujo3, dir_zona_pantalla); @@ -6696,7 +7364,7 @@ void DrasculaEngine::refresca_4() { if (hare_x > 190) cambio_de_color = 1; else - cambio_de_color=0; + cambio_de_color = 0; if (cambio_col_antes != cambio_de_color && cambio_de_color == 1) hare_oscuro(); @@ -6728,13 +7396,13 @@ void DrasculaEngine::refresca_5_antes(){ } void DrasculaEngine::refresca_6_antes() { - int cambio_col_antes=cambio_de_color; + int cambio_col_antes = cambio_de_color; if ((hare_x > 149 && hare_y + alto_hare > 160 && hare_x < 220 && hare_y + alto_hare < 188) || (hare_x > 75 && hare_y + alto_hare > 183 && hare_x < 145)) cambio_de_color = 0; else - cambio_de_color=1; + cambio_de_color = 1; if (cambio_col_antes != cambio_de_color && cambio_de_color == 1) hare_oscuro(); @@ -6755,21 +7423,21 @@ void DrasculaEngine::refresca_7_antes() { } void DrasculaEngine::refresca_9_antes() { - int ciego_x[] = {26,68,110,152,194,236,278,26,68}; - int ciego_y[] = {51,51,51,51,51,51,51,127,127}; + int ciego_x[] = {26, 68, 110, 152, 194, 236, 278, 26, 68}; + int ciego_y[] = {51, 51, 51, 51, 51, 51, 51, 127, 127}; int diferencia; DIBUJA_BLOQUE(ciego_x[frame_ciego], ciego_y[frame_ciego], 122, 57, 41, 72, dir_dibujo3, dir_zona_pantalla); if (flags[9] == 0) { - diferencia = vez() - conta_ciego_vez; + diferencia = (int)vez() - conta_ciego_vez; if (diferencia >= 11) { frame_ciego++; - conta_ciego_vez = vez(); + conta_ciego_vez = (int)vez(); } if (frame_ciego == 9) frame_ciego = 0; } else - frame_ciego=3; + frame_ciego = 3; } void DrasculaEngine::refresca_12_antes() { @@ -6778,10 +7446,10 @@ void DrasculaEngine::refresca_12_antes() { } void DrasculaEngine::refresca_14_antes() { - int velas_y[] = {158,172,186}; - int cirio_x[] = {14,19,24}; - int pianista_x[] = {1,91,61,31,91,31,1,61,31}; - int borracho_x[] = {1,42,83,124,165,206,247,1}; + int velas_y[] = {158, 172, 186}; + int cirio_x[] = {14, 19, 24}; + int pianista_x[] = {1, 91, 61, 31, 91, 31, 1, 61, 31}; + int borracho_x[] = {1, 42, 83, 124, 165, 206, 247, 1}; int diferencia; DIBUJA_FONDO(123, velas_y[frame_velas], 142, 14, 39, 13, dir_dibujo3, dir_zona_pantalla); @@ -6800,7 +7468,7 @@ void DrasculaEngine::refresca_14_antes() { if (flags[12] == 1) DIBUJA_FONDO(borracho_x[frame_borracho], 82, 170, 50, 40, 53, dir_dibujo3, dir_zona_pantalla); - diferencia = vez() - conta_ciego_vez; + diferencia = (int)vez() - conta_ciego_vez; if (diferencia > 6) { if (flags[12] == 1) { frame_borracho++; @@ -6818,7 +7486,7 @@ void DrasculaEngine::refresca_14_antes() { if (frame_piano == 9) frame_piano = 0; parpadeo = _rnd->getRandomNumber(10); - conta_ciego_vez=vez(); + conta_ciego_vez = (int)vez(); } } @@ -6836,8 +7504,8 @@ void DrasculaEngine::refresca_17_antes() { void DrasculaEngine::refresca_18_antes() { int diferencia; - int ronquido_x[] = {95,136,95,136,95,95,95,95,136,95,95,95,95,95,95,95}; - int ronquido_y[] = {18,18,56,56,94,94,94,94,94,18,18,18,18,18,18,18}; + int ronquido_x[] = {95, 136, 95, 136, 95, 95, 95, 95, 136, 95, 95, 95, 95, 95, 95, 95}; + int ronquido_y[] = {18, 18, 56, 56, 94, 94, 94, 94, 94, 18, 18, 18, 18, 18, 18, 18}; if (flags[21] == 0) { DIBUJA_FONDO(1, 69, 120, 58, 56, 61, dir_dibujo3, dir_zona_pantalla); @@ -6845,15 +7513,2134 @@ void DrasculaEngine::refresca_18_antes() { } else pon_vb(); - diferencia = vez() - conta_ciego_vez; + diferencia = (int)vez() - conta_ciego_vez; if (diferencia > 9) { frame_ronquido++; if (frame_ronquido == 16) frame_ronquido = 0; - conta_ciego_vez = vez(); + conta_ciego_vez = (int)vez(); + } +} + +void DrasculaEngine::grr() { + int longitud; + longitud = 30; + + buffer_teclado(); + + color_abc(VERDE_OSCURO); + + if (hay_sb == 1) { + sku = new Common::File; + sku->open("s10.als"); + if (!sku->isOpen()) { + error("no puedo abrir archivo de voz"); + } + ctvd_init(4); + ctvd_speaker(1); + ctvd_output(sku); + } + + refresca_pantalla(); + DIBUJA_FONDO(253, 110, 150, 65, 20, 30, dir_dibujo3, dir_zona_pantalla); + + if (con_voces == 0) + centra_texto(".groaaarrrrgghhh!", 153, 65); + + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); + +bucless: + int key = getscan(); + if (key != 0) + ctvd_stop(); + buffer_teclado(); + if (hay_sb == 1) { + if (LookForFree() != 0) + goto bucless; + delete sku; + ctvd_terminate(); + } else { + longitud = longitud - 2; + if (longitud > 0) + goto bucless; } + + refresca_pantalla(); + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); +} + +void DrasculaEngine::pantalla_13(int fl) { + if (objeto_que_lleva == MIRAR && fl == 51) { + hablar(TEXT411, "411.als"); + sentido_hare = 3; + hablar(TEXT412, "412.als"); + strcpy(nombre_obj[1], "yoda"); + } else if (objeto_que_lleva == HABLAR && fl == 51) + conversa("op_7.cal"); + else if (objeto_que_lleva == 19 && fl == 51) + animacion_1_3(); + else if (objeto_que_lleva == 9 && fl == 51) + animacion_2_3(); + else + hay_respuesta = 0; +} + +void DrasculaEngine::refresca_13() { + if (hare_x > 55 && flags[3] == 0) + animacion_6(); + if (flags[1] == 0) + DIBUJA_BLOQUE(185, 110, 121, 65, 67, 88, dir_dibujo3, dir_zona_pantalla); + if (flags[2] == 0) + DIBUJA_BLOQUE(185, 21, 121, 63, 67, 88, dir_dibujo3, dir_zona_pantalla); + DIBUJA_BLOQUE(3, 127, 99, 102, 181, 71, dir_dibujo3, dir_zona_pantalla); +} + +void DrasculaEngine::refresca_20() { + DIBUJA_BLOQUE(1, 137, 106, 121, 213, 61, dir_dibujo3, dir_zona_pantalla); +} + +void DrasculaEngine::animacion_1_3() { + hablar(TEXT413, "413.als"); + grr(); + pausa(50); + hablar(TEXT414, "414.als"); +} + +void DrasculaEngine::animacion_2_3() { + flags[0] = 1; + playmusic(13); + animacion_3_3(); + playmusic(13); + animacion_4_3(); + flags[1] = 1; + refresca_pantalla(); + VUELCA_PANTALLA(120, 0, 120, 0, 200, 200, dir_zona_pantalla); + animacion_5(); + flags[0] = 0; + flags[1] = 1; + + lee_dibujos("96.alg"); + descomprime_dibujo(dir_hare_frente, 1); + lee_dibujos("97.alg"); + descomprime_dibujo(dir_hare_dch, 1); + lee_dibujos("99.alg"); + descomprime_dibujo(dir_hare_fondo, 1); + + lleva_al_hare(332, 127); + libera_memoria(); + // TODO + error("4 segment hit"); } +void DrasculaEngine::animacion_3_3() { + int n, x = 0; + int px = hare_x - 20, py = hare_y - 1; + + lee_dibujos("an2y_1.alg"); + descomprime_dibujo(dir_hare_frente, 1); + lee_dibujos("an2y_2.alg"); + descomprime_dibujo(dir_hare_dch, 1); + lee_dibujos("an2y_3.alg"); + descomprime_dibujo(dir_hare_fondo, 1); + + for (n = 0; n < 4; n++) { + x++; + DIBUJA_FONDO(px, py, px, py, 71, 72, dir_dibujo1, dir_zona_pantalla); + DIBUJA_BLOQUE(x, 2, px, py, 71, 72, dir_hare_frente, dir_zona_pantalla); + VUELCA_PANTALLA(px, py, px, py, 71, 72, dir_zona_pantalla); + x = x + 71; + pausa(3); + } + + x = 0; + + for (n = 0; n < 4; n++) { + x++; + DIBUJA_FONDO(px, py, px, py, 71, 72, dir_dibujo1, dir_zona_pantalla); + DIBUJA_BLOQUE(x, 75, px, py, 71, 72, dir_hare_frente, dir_zona_pantalla); + VUELCA_PANTALLA(px, py, px, py, 71, 72, dir_zona_pantalla); + x = x + 71; + pausa(3); + } + + x = 0; + + for (n = 0; n < 4; n++) { + x++; + DIBUJA_FONDO(px, py, px, py, 71, 72, dir_dibujo1, dir_zona_pantalla); + DIBUJA_BLOQUE(x, 2, px, py, 71, 72, dir_hare_dch, dir_zona_pantalla); + VUELCA_PANTALLA(px, py, px, py, 71, 72, dir_zona_pantalla); + x = x + 71; + pausa(3); + } + + x = 0; + + for (n = 0; n < 4; n++) { + x++; + DIBUJA_FONDO(px, py, px, py, 71, 72, dir_dibujo1, dir_zona_pantalla); + DIBUJA_BLOQUE(x, 75, px, py, 71, 72, dir_hare_dch, dir_zona_pantalla); + VUELCA_PANTALLA(px, py, px, py, 71, 72, dir_zona_pantalla); + x = x + 71; + pausa(3); + } + + x = 0; + + for (n = 0; n < 4; n++) { + x++; + DIBUJA_FONDO(px, py, px, py, 71, 72, dir_dibujo1, dir_zona_pantalla); + DIBUJA_BLOQUE(x, 2, px, py, 71, 72, dir_hare_fondo, dir_zona_pantalla); + VUELCA_PANTALLA(px, py, px, py, 71, 72, dir_zona_pantalla); + x = x + 71; + pausa(3); + } + + x = 0; + + for (n = 0; n < 4; n++) { + x++; + DIBUJA_FONDO(px, py, px, py, 71, 72, dir_dibujo1, dir_zona_pantalla); + DIBUJA_BLOQUE(x, 75, px, py, 71, 72, dir_hare_fondo, dir_zona_pantalla); + VUELCA_PANTALLA(px, py, px, py, 71, 72, dir_zona_pantalla); + x = x + 71; + pausa(3); + } +} + +void DrasculaEngine::animacion_4_3() { + int n, x = 0; + int px = 120, py = 63; + + lee_dibujos("any_1.alg"); + descomprime_dibujo(dir_hare_frente, 1); + lee_dibujos("any_2.alg"); + descomprime_dibujo(dir_hare_dch, 1); + lee_dibujos("any_3.alg"); + descomprime_dibujo(dir_hare_fondo, 1); + + for (n = 0; n < 4; n++){ + x++; + DIBUJA_FONDO(px, py, px, py, 77, 89, dir_dibujo1, dir_zona_pantalla); + DIBUJA_BLOQUE(x, 1, px, py, 77, 89, dir_hare_frente, dir_zona_pantalla); + VUELCA_PANTALLA(px, py, px, py, 77, 89, dir_zona_pantalla); + x = x + 77; + pausa(3); + } + + x = 0; + + for (n = 0; n < 4; n++) { + x++; + DIBUJA_FONDO(px, py, px, py, 77, 89, dir_dibujo1, dir_zona_pantalla); + DIBUJA_BLOQUE(x, 91, px, py, 77, 89, dir_hare_frente, dir_zona_pantalla); + VUELCA_PANTALLA(px, py, px, py, 77, 89, dir_zona_pantalla); + x = x + 77; + pausa(3); + } + + x = 0; + + for (n = 0; n < 4; n++) { + x++; + DIBUJA_FONDO(px, py, px, py, 77, 89, dir_dibujo1, dir_zona_pantalla); + DIBUJA_BLOQUE(x, 1, px, py, 77, 89, dir_hare_dch, dir_zona_pantalla); + VUELCA_PANTALLA(px, py, px, py, 77, 89, dir_zona_pantalla); + x = x + 77; + pausa(3); + } + + x = 0; + + for (n = 0; n < 4; n++) { + x++; + DIBUJA_FONDO(px, py, px, py, 77, 89, dir_dibujo1, dir_zona_pantalla); + DIBUJA_BLOQUE(x, 91, px, py, 77, 89, dir_hare_dch, dir_zona_pantalla); + VUELCA_PANTALLA(px, py, px, py, 77, 89, dir_zona_pantalla); + x = x + 77; + pausa(3); + } + + x = 0; + + for (n = 0; n < 4; n++) { + x++; + DIBUJA_FONDO(px, py, px, py, 77, 89, dir_dibujo1, dir_zona_pantalla); + DIBUJA_BLOQUE(x, 1, px, py, 77, 89, dir_hare_fondo, dir_zona_pantalla); + VUELCA_PANTALLA(px, py, px, py, 77, 89, dir_zona_pantalla); + x = x + 77; + pausa(3); + } + + x = 0; + + for (n = 0; n < 4; n++) { + x++; + DIBUJA_FONDO(px, py, px, py, 77, 89, dir_dibujo1, dir_zona_pantalla); + DIBUJA_BLOQUE(x, 91, px, py, 77, 89, dir_hare_fondo, dir_zona_pantalla); + VUELCA_PANTALLA(px, py, px, py, 77, 89, dir_zona_pantalla); + x = x + 77; + pausa(3); + } +} + +void DrasculaEngine::animacion_5() { + int n, x = 0; + int px = hare_x - 20, py = hare_y - 1; + + lee_dibujos("an3y_1.alg"); + descomprime_dibujo(dir_hare_frente, 1); + lee_dibujos("an3y_2.alg"); + descomprime_dibujo(dir_hare_dch, 1); + lee_dibujos("an3y_3.alg"); + descomprime_dibujo(dir_hare_fondo, 1); + + for (n = 0; n < 4; n++) { + x++; + DIBUJA_FONDO(px, py, px, py, 71, 72, dir_dibujo1, dir_zona_pantalla); + DIBUJA_BLOQUE(x, 2, px, py, 71, 72, dir_hare_frente, dir_zona_pantalla); + VUELCA_PANTALLA(px, py, px, py, 71, 72, dir_zona_pantalla); + x = x + 71; + pausa(3); + } + + x = 0; + + for (n = 0; n < 4; n++) { + x++; + DIBUJA_FONDO(px, py, px, py, 71, 72, dir_dibujo1, dir_zona_pantalla); + DIBUJA_BLOQUE(x, 75, px, py, 71, 72, dir_hare_frente, dir_zona_pantalla); + VUELCA_PANTALLA(px, py, px, py, 71, 72, dir_zona_pantalla); + x = x + 71; + pausa(3); + } + + x = 0; + + for (n = 0; n < 4; n++) { + x++; + DIBUJA_FONDO(px, py, px, py, 71, 72, dir_dibujo1, dir_zona_pantalla); + DIBUJA_BLOQUE(x, 2, px, py, 71, 72, dir_hare_dch, dir_zona_pantalla); + VUELCA_PANTALLA(px, py, px, py, 71, 72, dir_zona_pantalla); + x = x + 71; + pausa(3); + } + + x = 0; + + for (n = 0; n < 4; n++) { + x++; + DIBUJA_FONDO(px, py, px, py, 71, 72, dir_dibujo1, dir_zona_pantalla); + DIBUJA_BLOQUE(x, 75, px, py, 71, 72, dir_hare_dch, dir_zona_pantalla); + VUELCA_PANTALLA(px,py, px,py, 71,72, dir_zona_pantalla); + x = x + 71; + pausa(3); + } + + x = 0; + + for (n = 0; n < 4; n++) { + x++; + DIBUJA_FONDO(px, py, px, py, 71, 72, dir_dibujo1, dir_zona_pantalla); + DIBUJA_BLOQUE(x, 2, px, py, 71, 72, dir_hare_fondo, dir_zona_pantalla); + VUELCA_PANTALLA(px, py, px, py, 71, 72, dir_zona_pantalla); + x = x + 71; + pausa(3); + } + + x = 0; + + for (n = 0; n < 4; n++) { + x++; + DIBUJA_FONDO(px, py, px, py, 71, 72, dir_dibujo1, dir_zona_pantalla); + DIBUJA_BLOQUE(x, 75, px, py, 71, 72, dir_hare_fondo, dir_zona_pantalla); + VUELCA_PANTALLA(px, py, px, py, 71, 72, dir_zona_pantalla); + x = x + 71; + pausa(3); + } +} + +void DrasculaEngine::animacion_6() { + int frame = 0, px = 112, py = 62; + int yoda_x[] = { 3 ,82, 161, 240, 3, 82 }; + int yoda_y[] = { 3, 3, 3, 3, 94, 94 }; + + hare_se_mueve = 0; + flags[3] = 1; + refresca_pantalla(); + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); + + flags[1] = 0; + + lee_dibujos("an4y.alg"); + descomprime_dibujo(dir_hare_frente, 1); + + for (frame = 0; frame < 6; frame++) { + pausa(3); + DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla); + DIBUJA_BLOQUE(yoda_x[frame], yoda_y[frame], px, py, 78, 90, dir_hare_frente, dir_zona_pantalla); + VUELCA_PANTALLA(px, py, px, py, 78, 90, dir_zona_pantalla); + } + + flags[2] = 1; + + lee_dibujos("96.alg"); + descomprime_dibujo(dir_hare_frente, 1); + + refresca_pantalla(); + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); +} + +void DrasculaEngine::animacion_rayo() { + lee_dibujos("anr_1.alg"); + descomprime_dibujo(dir_hare_frente, MEDIA); + lee_dibujos("anr_2.alg"); + descomprime_dibujo(dir_hare_dch, 1); + lee_dibujos("anr_3.alg"); + descomprime_dibujo(dir_hare_fondo, 1); + lee_dibujos("anr_4.alg"); + descomprime_dibujo(dir_dibujo1, 1); + lee_dibujos("anr_5.alg"); + descomprime_dibujo(dir_dibujo3, 1); + + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_hare_frente); + + pausa(50); + + comienza_sound("s5.als"); + + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_hare_dch); + pausa(3); + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_hare_fondo); + pausa(3); + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_dibujo1); + pausa(3); + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_hare_fondo); + pausa(3); + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_dibujo3); + pausa(3); + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_hare_frente); + fin_sound(); +} + +void DrasculaEngine::animacion_2_4() { + habla_igor_sentado(TEXTI16, "I16.als"); + hablar(TEXT278, "278.als"); + habla_igor_sentado(TEXTI17, "I17.als"); + hablar(TEXT279, "279.als"); + habla_igor_sentado(TEXTI18, "I18.als"); +} + +void DrasculaEngine::animacion_3_4() { + habla_igor_sentado(TEXTI19, "I19.als"); + habla_igor_sentado(TEXTI20, "I20.als"); + hablar(TEXT281, "281.als"); +} + +void DrasculaEngine::animacion_4_4() { + hablar(TEXT287, "287.als"); + habla_igor_sentado(TEXTI21, "I21.als"); + hablar(TEXT284, "284.als"); + habla_igor_sentado(TEXTI22, "I22.als"); + hablar(TEXT285, "285.als"); + habla_igor_sentado(TEXTI23, "I23.als"); +} + +void DrasculaEngine::habla_igor_sentado(const char *dicho, const char *filename) { + int tiempou; + long tiempol; + + int x_habla[4] = { 80, 102, 124, 146 }; + int cara; + + int longitud; + longitud = strlen(dicho); + + tiempol = _system->getMillis(); + tiempou = (unsigned int)tiempol / 2; + _rnd->setSeed(tiempou); + + buffer_teclado(); + + color_abc(BLANCO); + + if (hay_sb == 1) { + sku = new Common::File; + sku->open(filename); + if (!sku->isOpen()) { + error("no puedo abrir archivo de voz"); + } + ctvd_init(2); + ctvd_speaker(1); + ctvd_output(sku); + } + +bucless: + + cara = _rnd->getRandomNumber(3); + + DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla); + + actualiza_refresco_antes(); + + DIBUJA_FONDO(x_habla[cara], 109, 207, 92, 21, 23, dir_dibujo3, dir_zona_pantalla); + pon_hare(); + actualiza_refresco(); + + if (con_voces == 0) + centra_texto(dicho, 221, 102); + + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); + + pausa(3); + + int key = getscan(); + if (key != 0) + ctvd_stop(); + buffer_teclado(); + if (hay_sb == 1) { + if (LookForFree() != 0) + goto bucless; + delete sku; + ctvd_terminate(); + } else { + longitud = longitud - 2; + if (longitud > 0) + goto bucless; + } + + refresca_pantalla(); + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); +} + +void DrasculaEngine::animacion_7_4() { + Negro(); + hablar(TEXT427, "427.als"); + FundeDelNegro(1); + resta_objeto(8); + resta_objeto(10); + resta_objeto(12); + resta_objeto(16); + suma_objeto(17); + flags[30] = 0; + flags[29] = 0; +} + +void DrasculaEngine::animacion_1_5() { + if (flags[0] == 0) { + hablar(TEXT430, "430.als"); + habla_bj(TEXTBJ16, "BJ16.als"); + habla_bj(TEXTBJ17, "BJ17.als"); + habla_bj(TEXTBJ18, "BJ18.als"); + hablar(TEXT217, "217.als"); + habla_bj(TEXTBJ19, "BJ19.als"); + hablar(TEXT229, "229.als"); + pausa(5); + lleva_al_hare(114, 170); + sentido_hare = 3; + hablar(TEXT431, "431.als"); + habla_bj(TEXTBJ20, "BJ20.als"); + sentido_hare = 2; + pausa(4); + hablar(TEXT438, "438.als"); + sitio_x = 120; + sitio_y = 157; + anda_a_objeto = 1; + sentido_final = 1; + empieza_andar(); + habla_bj(TEXTBJ21, "BJ21.als"); + + for (;;) { + if (hare_se_mueve == 0) + break; + refresca_pantalla(); + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); + } + + sentido_hare = 1; + hablar(TEXT229, "229.als"); + flags[0] = 1; + } + + sentido_hare = 1; + conversa("op_8.cal"); +} + +void DrasculaEngine::animacion_2_5() { + habla_bj(TEXTBJ22, "BJ22.als"); +} + +void DrasculaEngine::animacion_3_5() { + habla_bj(TEXTBJ23, "BJ23.als"); + agarra_objeto(10); + rompo_y_salgo = 1; +} + +void DrasculaEngine::animacion_4_5() { + flags[7] = 1; + refresca_pantalla(); + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); + hablar(TEXT228, "228.als"); + habla_lobo(TEXTL1, "L1.als"); + habla_lobo(TEXTL2, "L2.als"); + pausa(23); + hablar(TEXT229, "229.als"); + habla_lobo(TEXTL3, "L3.als"); + habla_lobo(TEXTL4, "L4.als"); + hablar(TEXT230, "230.als"); + habla_lobo(TEXTL5, "L5.als"); + hablar(TEXT231, "231.als"); + habla_lobo(TEXTL6, "L6.als"); + habla_lobo(TEXTL7, "L7.als"); + pausa(33); + hablar(TEXT232, "232.als"); + habla_lobo(TEXTL8, "L8.als"); +} + +void DrasculaEngine::animacion_5_5(){ + int h; + int frame = 0; + int hueso_x[] = {1, 99, 197, 1, 99, 197, 1, 99, 197}; + int hueso_y[] = {1, 1, 1, 66, 66, 66, 131, 131, 131}; + int vuela_x[] = {1, 63, 125, 187, 249}; + int pixel_x = hare_x - 53, pixel_y = hare_y - 9; + + sin_verbo(); + resta_objeto(8); + + lleva_al_hare(hare_x - 19, hare_y + alto_hare); + sentido_hare = 1; + refresca_pantalla(); + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); + + lee_dibujos("3an5_1.alg"); + descomprime_dibujo(dir_hare_fondo, 1); + lee_dibujos("3an5_2.alg"); + descomprime_dibujo(dir_hare_frente, 1); + + for (frame = 0; frame < 9; frame++) { + pausa(3); + DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla); + DIBUJA_BLOQUE(hueso_x[frame], hueso_y[frame], pixel_x, pixel_y, 97, 64, dir_hare_fondo, dir_zona_pantalla); + VUELCA_PANTALLA(pixel_x, pixel_y, pixel_x,pixel_y, 97,64, dir_zona_pantalla); + } + + DIBUJA_FONDO(52, 161, 198, 81, 26, 24, dir_dibujo3, dir_zona_pantalla); + VUELCA_PANTALLA(198, 81, 198, 81, 26, 24, dir_zona_pantalla); + + for (frame = 0; frame < 9; frame++) { + pausa(3); + DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla); + DIBUJA_BLOQUE(hueso_x[frame], hueso_y[frame], pixel_x, pixel_y, 97, 64, dir_hare_frente, dir_zona_pantalla); + VUELCA_PANTALLA(pixel_x, pixel_y, pixel_x,pixel_y, 97, 64, dir_zona_pantalla); + } + + flags[6] = 1; + actualiza_datos(); + pausa(12); + + lee_dibujos("96.alg"); + descomprime_dibujo(dir_hare_frente, 1); + for (h = 0; h < (200 - 18); h++) + DIBUJA_FONDO(0, 53, 0, h, 320, 19, dir_hare_frente, dir_zona_pantalla); + + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); + + lee_dibujos("101.alg"); + descomprime_dibujo(dir_dibujo1, MEDIA); + lee_dibujos("3an5_3.alg"); + descomprime_dibujo(dir_hare_fondo, 1); + lee_dibujos("3an5_4.alg"); + descomprime_dibujo(dir_hare_dch, 1); + + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_dibujo1); + pausa(9); + for (frame = 0; frame < 5; frame++) { + pausa(3); + DIBUJA_FONDO(vuela_x[frame], 1, 174, 79, 61, 109, dir_hare_fondo, dir_zona_pantalla); + VUELCA_PANTALLA(174, 79, 174, 79, 61, 109, dir_zona_pantalla); + } + for (frame = 0; frame < 5; frame++) { + pausa(3); + DIBUJA_FONDO(vuela_x[frame], 1, 174, 79, 61, 109, dir_hare_dch, dir_zona_pantalla); + VUELCA_PANTALLA(174, 79, 174, 79, 61, 109, dir_zona_pantalla); + } + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_dibujo1); + + comienza_sound("s1.als"); + fin_sound(); + + lee_dibujos("99.alg"); + descomprime_dibujo(dir_hare_fondo, 1); + lee_dibujos("97.alg"); + descomprime_dibujo(dir_hare_dch, 1); + + borra_pantalla(); + + lee_dibujos("49.alg"); + descomprime_dibujo(dir_dibujo1, MEDIA); +} + +void DrasculaEngine::animacion_6_5() { + habla_lobo(TEXTL9, "L9.als"); + hablar(TEXT234, "234.als"); +} + +void DrasculaEngine::animacion_7_5() { + habla_lobo(TEXTL10, "L10.als"); + hablar(TEXT236, "236.als"); + habla_lobo(TEXTL11, "L11.als"); + habla_lobo(TEXTL12, "L12.als"); + habla_lobo(TEXTL13, "L13.als"); + pausa(34); + habla_lobo(TEXTL14, "L14.als"); +} + +void DrasculaEngine::animacion_8_5() { + habla_lobo(TEXTL15, "L15.als"); + hablar(TEXT238, "238.als"); + habla_lobo(TEXTL16, "L16.als"); +} + +void DrasculaEngine::animacion_9_5() { + flags[4] = 1; + hablar(TEXT401, "401.als"); + sin_verbo(); + resta_objeto(15); +} + +void DrasculaEngine::animacion_10_5() { + flags[3] = 1; + hablar(TEXT401, "401.als"); + sin_verbo(); + resta_objeto(12); +} + +void DrasculaEngine::animacion_11_5() { + flags[9] = 1; + if (flags[2] == 1 && flags[3] == 1 && flags[4] == 1) + animacion_12_5(); + else { + flags[9] = 0; + hablar(TEXT33, "33.als"); + } +} + +void DrasculaEngine::animacion_12_5() { + DacPalette256 palFondo1; + DacPalette256 palFondo2; + DacPalette256 palFondo3; + + int frame; + const int rayo_x[] = {1, 46, 91, 136, 181, 226, 271, 181}; + const int frusky_x[] = {100, 139, 178, 217, 100, 178, 217, 139, 100, 139}; + const int elfrusky_x[] = {1, 68, 135, 1, 68, 135, 1, 68, 135, 68, 1, 135, 68, 135, 68}; + //const int humo_x[] = {1, 29, 57, 85, 113, 141, 169, 197, 225}; + int color, componente; + char fundido; + + playmusic(26); + refresca_pantalla(); + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); + pausa(27); + anima("rayo1.bin", 23); + comienza_sound("s5.als"); + anima("rayo2.bin", 17); + sentido_hare = 1; + refresca_pantalla(); + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); + + hare_oscuro(); + + for (color = 0; color < 255; color++) + for (componente = 0; componente < 3; componente++) { + palFondo1[color][componente] = palJuego[color][componente]; + palFondo2[color][componente] = palJuego[color][componente]; + palFondo3[color][componente] = palJuego[color][componente]; + } + + for (fundido = 1; fundido >= 0; fundido--) { + for (color = 0; color < 128; color++) + for (componente = 0; componente < 3; componente++) + palFondo1[color][componente] = LimitaVGA(palFondo1[color][componente] - 8 + fundido); + } + + for (fundido = 2; fundido >= 0; fundido--) { + for (color = 0; color < 128; color++) + for (componente = 0; componente < 3; componente++) + palFondo2[color][componente] = LimitaVGA(palFondo2[color][componente] - 8 + fundido); + } + + for (fundido = 3; fundido >= 0; fundido--) { + for (color = 0; color < 128; color++) + for (componente = 0; componente < 3; componente++) + palFondo3[color][componente] = LimitaVGA(palFondo3[color][componente] - 8 + fundido); + } + + lee_dibujos("3an11_1.alg"); + descomprime_dibujo(dir_hare_fondo, 1); + + for (frame = 0; frame < 8; frame++) { + if (frame == 2 || frame == 4 || frame == 8 || frame==10) + setvgapalette256((byte *)&palFondo1); + else if (frame == 1 || frame == 5 || frame == 7 || frame == 9) + setvgapalette256((byte *)&palFondo2); + else + setvgapalette256((byte *)&palFondo3); + + pausa(4); + refresca_pantalla(); + DIBUJA_BLOQUE(rayo_x[frame], 1, 41, 0, 44, 44, dir_hare_fondo, dir_zona_pantalla); + DIBUJA_BLOQUE(frusky_x[frame], 113, 205, 50, 38, 86, dir_dibujo3, dir_zona_pantalla); + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); + } + + fin_sound_corte(); + + for (frame = 0; frame < 15; frame++) { + if (frame == 2 || frame == 4 || frame == 7 || frame == 9) + setvgapalette256((byte *)&palFondo1); + else if (frame == 1 || frame == 5) + setvgapalette256((byte *)&palJuego); + else + setvgapalette256((byte *)&palFondo2); + + pausa(4); + refresca_pantalla(); + DIBUJA_BLOQUE(elfrusky_x[frame], 47, 192, 39, 66, 106, dir_hare_fondo, dir_zona_pantalla); + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); + } + + anima("frel.bin", 16); + borra_pantalla(); + hare_claro(); + ActualizaPaleta(); + + flags[1] = 1; + + animacion_13_5(); + comienza_sound("s1.als"); + hipo(12); + fin_sound(); + + lee_dibujos("99.alg"); + descomprime_dibujo(dir_hare_fondo, 1); + + lleva_al_hare(40, 169); + lleva_al_hare(-14, 175); + + rompo = 1; + musica_antes = musica_room; + hare_se_ve = 1; + borra_pantalla(); + sentido_hare = 1; + hare_se_mueve = 0; + hare_x = -1; + obj_saliendo = 104; + sin_verbo(); + carga_escoba("57.ald"); +} + +void DrasculaEngine::animacion_13_5() { + int frank_x = 199; + int frame = 0; + int frus_x[] = {1, 46, 91, 136, 181, 226, 271}; + int frus_y[] = {1, 1, 1, 1, 1, 1, 1, 89}; + int pos_frusky[6]; + + lee_dibujos("auxfr.alg"); + descomprime_dibujo(dir_hare_fondo, 1); + + pos_frusky[3] = 81; + pos_frusky[4] = 44; + pos_frusky[5] = 87; + pos_frusky[0] = 1; + pos_frusky[1] = 1; + pos_frusky[2] = frank_x; + refresca_pantalla(); + DIBUJA_BLOQUE_CUT(pos_frusky, dir_hare_fondo, dir_zona_pantalla); + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); + pausa(15); + + playmusic(18); + + for (;;) { + refresca_pantalla(); + pos_frusky[0] = frus_x[frame]; + pos_frusky[1] = frus_y[frame]; + pos_frusky[2] = frank_x; + DIBUJA_BLOQUE_CUT( pos_frusky, dir_hare_fondo, dir_zona_pantalla); + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); + frank_x = frank_x - 5; + frame++; + if (frank_x <= -45) + break; + if (frame == 7) { + frame = 0; + sentido_hare = 3; + } + pausa(6); + } +} + +void DrasculaEngine::animacion_14_5() { + flags[11] = 1; + comienza_sound("s3.als"); + refresca_pantalla(); + VUELCA_PANTALLA(0, 0, 0,0 , 320, 200, dir_zona_pantalla); + fin_sound(); + pausa(17); + sentido_hare = 3; + hablar(TEXT246,"246.als"); + lleva_al_hare(89, 160); + flags[10] = 1; + comienza_sound("s7.als"); + refresca_pantalla(); + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); + fin_sound(); + pausa(14); + sentido_hare = 3; + refresca_pantalla(); + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); + habla_solo(TEXTD18, "d18.als"); + FundeAlNegro(1); + error("part 6 hit"); +} + +void DrasculaEngine::animacion_15_5() { + habla_mus(TEXTE4, "E4.als"); + habla_mus(TEXTE5, "E5.als"); + habla_mus(TEXTE6, "E6.als"); + hablar(TEXT291, "291.als"); + habla_mus(TEXTE7, "E7.als"); +} + +void DrasculaEngine::animacion_16_5() { + habla_mus(TEXTE8, "E8.als"); +} + +void DrasculaEngine::animacion_17_5() { + habla_mus(TEXTE9, "E9.als"); +} + +void DrasculaEngine::refresca_49_antes() { + if (flags[6] == 0) + DIBUJA_FONDO(2, 136, 176, 81, 49, 62, dir_dibujo3, dir_zona_pantalla); +} + +void DrasculaEngine::refresca_53_antes() { + if (flags[1] == 0) + DIBUJA_BLOQUE(2, 113, 205, 50, 38, 86, dir_dibujo3, dir_zona_pantalla); + if (flags[2] == 0) + DIBUJA_FONDO(41, 159, 27, 117, 25, 40, dir_dibujo3, dir_zona_pantalla); + if (flags[9] == 1) + DIBUJA_FONDO(67, 184, 56, 93, 32, 15, dir_dibujo3, dir_zona_pantalla); +} + +void DrasculaEngine::refresca_54_antes() { + if (flags[5] == 1) + DIBUJA_FONDO(168, 156, 187, 111, 7, 11, dir_dibujo3, dir_zona_pantalla); + if (flags[12] == 1) + DIBUJA_FONDO(16, 156, 190, 64, 18, 24, dir_dibujo3, dir_zona_pantalla); +} + +void DrasculaEngine::refresca_56_antes() { + if (flags[10] == 0) + DIBUJA_FONDO(2, 126, 42, 67, 57, 67, dir_dibujo3, dir_zona_pantalla); + if (flags[11] == 1) + DIBUJA_FONDO(60, 160, 128, 97, 103, 38, dir_dibujo3, dir_zona_pantalla); +} + +void DrasculaEngine::refresca_50() { + DIBUJA_BLOQUE(4, 153, 118, 95, 67, 44, dir_dibujo3, dir_zona_pantalla); +} + +void DrasculaEngine::refresca_57() { + DIBUJA_BLOQUE(7, 113, 166, 61, 62, 82, dir_dibujo3, dir_zona_pantalla); +} + +void DrasculaEngine::pantalla_49(int fl){ + if (objeto_que_lleva == HABLAR && fl ==51) + conversa("op_9.cal"); + else if (objeto_que_lleva == MIRAR && fl == 51) + hablar(TEXT132, "132.als"); + else if ((objeto_que_lleva == 8 && fl == 51) || (objeto_que_lleva == 8 && fl == 203)) + animacion_5_5(); + else if (objeto_que_lleva == MIRAR && fl == 200) + hablar(TEXT133, "133.als"); + else if (objeto_que_lleva == HABLAR && fl == 200) + hablar(TEXT134, "134.als"); + else if (objeto_que_lleva == MIRAR && fl == 201) + hablar(TEXT135, "135.als"); + else if (objeto_que_lleva == MIRAR && fl == 203) + hablar(TEXT137, "137.als"); + else + hay_respuesta = 0; +} + +void DrasculaEngine::pantalla_53(int fl) { + if (objeto_que_lleva == COGER && fl == 120) { + agarra_objeto(16); + visible[3] = 0; + } else if (objeto_que_lleva == MIRAR && fl == 121) + hablar(TEXT128, "128.als"); + else if (objeto_que_lleva == MIRAR && fl == 209) + hablar(TEXT129, "129.als"); + else if (objeto_que_lleva == MOVER && fl == 123) + animacion_11_5(); + else if (objeto_que_lleva == MIRAR && fl == 52) + hablar(TEXT447, "447.als"); + else if (objeto_que_lleva == HABLAR && fl == 52) + hablar(TEXT131, "131.als"); + else if (objeto_que_lleva == 12 && fl == 52) + animacion_10_5(); + else if (objeto_que_lleva == 15 && fl == 52) + animacion_9_5(); + else if (objeto_que_lleva == 16 && fl == 121) { + flags[2] = 1; + sin_verbo(); + actualiza_datos(); + } else if (objeto_que_lleva == 16) { + hablar(TEXT439, "439.als"); + sin_verbo(); + visible[3] = 1; + } else + hay_respuesta = 0; +} + +void DrasculaEngine::pantalla_54(int fl) { + if ((objeto_que_lleva == HABLAR && fl == 118) || (objeto_que_lleva == MIRAR && fl == 118 && flags[0] == 0)) + animacion_1_5(); + else if (objeto_que_lleva == MIRAR && fl == 118 && flags[0]==1) + hablar(TEXT124, "124.als"); + else if (objeto_que_lleva == MIRAR && fl == 53) + hablar(TEXT127, "127.als"); + else if (objeto_que_lleva == HABLAR && fl == 53 && flags[14] == 0) { + hablar(TEXT288, "288.als"); + flags[12] = 1; + pausa(10); + habla_mus(TEXTE1, "E1.als"); + hablar(TEXT289, "289.als"); + habla_mus(TEXTE2, "E2.als"); + habla_mus(TEXTE3, "E3.als"); + conversa("op_10.cal"); + flags[12] = 0; + flags[14] = 1; + } else if (objeto_que_lleva == HABLAR && fl == 53 && flags[14] == 1) + hablar(TEXT109, "109.als"); + else if (objeto_que_lleva == COGER && fl == 9999 && flags[13] == 0) { + agarra_objeto(8); + flags[13] = 1; + habla_mus(TEXTE10, "e10.als"); + actualiza_datos(); + } else if (objeto_que_lleva == ABRIR && fl == 119) + hablar(TEXT125, "125.als"); + else if (objeto_que_lleva == MIRAR && fl == 119) + hablar(TEXT126, "126.als"); + else if (objeto_que_lleva == 10 && fl == 119) { + pausa(4); + hablar(TEXT436, "436.als"); + sin_verbo(); + resta_objeto(10); + } else + hay_respuesta = 0; +} + +void DrasculaEngine::pantalla_55(int fl) { + if (objeto_que_lleva == COGER && fl == 122) { + agarra_objeto(12); + flags[8] = 1; + actualiza_datos(); + } else if (objeto_que_lleva == MIRAR && fl == 122) + hablar(TEXT138, "138.als"); + else if (objeto_que_lleva == MIRAR && fl == 204) + hablar(TEXT139, "139.als"); + else if (objeto_que_lleva == MIRAR && fl == 205) + hablar(TEXT140, "140.als"); + else if (fl == 206) { + comienza_sound("s11.als"); + anima("det.bin", 17); + fin_sound(); + lleva_al_hare(hare_x - 3, hare_y + alto_hare + 6); + } else + hay_respuesta = 0; +} + +void DrasculaEngine::pantalla_56(int fl) { + if (objeto_que_lleva == ABRIR && fl == 124) + animacion_14_5(); + else if (objeto_que_lleva == MIRAR && fl == 124) + hablar(TEXT450, "450.als"); + else if (objeto_que_lleva == ABRIR && fl == 207) + hablar(TEXT141, "141.als"); + else if (objeto_que_lleva == MIRAR && fl == 208) + hablar(TEXT142, "142.als"); + else + hay_respuesta = 0; +} + +void DrasculaEngine::habla_lobo(const char *dicho, const char *filename) { + int tiempou; + long tiempol; + + int x_habla[9] = {52, 79, 106, 133, 160, 187, 214, 241, 268}; + int cara; + + int longitud; + longitud = strlen(dicho); + + tiempol = _system->getMillis(); + tiempou = (unsigned int)tiempol / 2; + _rnd->setSeed(tiempou); + + color_abc(ROJO); + + if (hay_sb == 1) { + sku = new Common::File; + sku->open(filename); + if (!sku->isOpen()) { + error("no puedo abrir archivo de voz"); + } + ctvd_init(2); + ctvd_speaker(1); + ctvd_output(sku); + } + +bucless: + + cara = _rnd->getRandomNumber(8); + + DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla); + + actualiza_refresco_antes(); + + DIBUJA_FONDO(x_habla[cara], 136, 198, 81, 26, 24, dir_dibujo3, dir_zona_pantalla); + pon_hare(); + actualiza_refresco(); + + if (con_voces == 0) + centra_texto(dicho, 203, 78); + + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); + + pausa(3); + + int key = getscan(); + if (key != 0) + ctvd_stop(); + buffer_teclado(); + if (hay_sb == 1) { + if (LookForFree() != 0) + goto bucless; + delete sku; + ctvd_terminate(); + } else { + longitud = longitud - 2; + if (longitud > 0) + goto bucless; + } + + refresca_pantalla(); + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); +} + +void DrasculaEngine::habla_mus(const char *dicho, const char *filename) { + int tiempou; + long tiempol; + + int x_habla[8] = { 16, 35, 54, 73, 92, 111, 130, 149}; + int cara; + + int longitud; + longitud = strlen(dicho); + + tiempol = _system->getMillis(); + tiempou = (unsigned int)tiempol / 2; + _rnd->setSeed(tiempou); + + buffer_teclado(); + + color_abc(BLANCO); + + if (hay_sb == 1) { + sku = new Common::File; + sku->open(filename); + if (!sku->isOpen()) { + error("no puedo abrir archivo de voz"); + } + ctvd_init(2); + ctvd_speaker(1); + ctvd_output(sku); + } + +bucless: + + cara = _rnd->getRandomNumber(7); + + DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla); + + actualiza_refresco_antes(); + + DIBUJA_FONDO(x_habla[cara], 156, 190, 64, 18, 24, dir_dibujo3, dir_zona_pantalla); + pon_hare(); + actualiza_refresco(); + + if (con_voces == 0) + centra_texto(dicho, 197, 64); + + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); + + pausa(3); + + int key = getscan(); + if (key != 0) + ctvd_stop(); + buffer_teclado(); + if (hay_sb == 1) { + if (LookForFree() != 0) + goto bucless; + delete sku; + ctvd_terminate(); + } else { + longitud = longitud - 2; + if (longitud > 0) + goto bucless; + } + + refresca_pantalla(); + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); +} + +void DrasculaEngine::animacion_1_6() { + int l; + + sentido_hare = 0; + hare_x = 103; + hare_y = 108; + flags[0] = 1; + for (l = 0; l < 200; l++) + factor_red[l] = 98; + + lee_dibujos("auxig2.alg"); + descomprime_dibujo(dir_hare_frente, 1); + lee_dibujos("auxdr.alg"); + descomprime_dibujo(dir_dibujo2, 1); + lee_dibujos("car.alg"); + descomprime_dibujo(dir_hare_fondo, 1); + habla_dr_dch(TEXTD19, "D19.als"); + hablar(TEXT247, "247.als"); + habla_dr_dch(TEXTD20, "d20.als"); + habla_dr_dch(TEXTD21, "d21.als"); + hablar(TEXT248, "248.als"); + habla_dr_dch(TEXTD22, "d22.als"); + hablar(TEXT249, "249.als"); + habla_dr_dch(TEXTD23, "d23.als"); + conversa("op_11.cal"); + habla_dr_dch(TEXTD26, "d26.als"); + + anima("fum.bin", 15); + + habla_dr_dch(TEXTD27, "d27.als"); + hablar(TEXT254, "254.als"); + habla_dr_dch(TEXTD28, "d28.als"); + hablar(TEXT255, "255.als"); + habla_dr_dch(TEXTD29, "d29.als"); + FundeAlNegro(1); + borra_pantalla(); + lee_dibujos("time1.alg"); + descomprime_dibujo(dir_zona_pantalla, 1); + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); + delay(930); + borra_pantalla(); + Negro(); + hare_se_ve = 0; + flags[0] = 0; + refresca_pantalla(); + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); + FundeDelNegro(1); + hablar(TEXT256, "256.als"); + habla_dr_dch(TEXTD30, "d30.als"); + hablar(TEXT257, "257.als"); + FundeAlNegro(0); + borra_pantalla(); + lee_dibujos("time1.alg"); + descomprime_dibujo(dir_zona_pantalla,1); + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); + delay(900); + borra_pantalla(); + Negro(); + refresca_pantalla(); + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); + FundeDelNegro(1); + hablar(TEXT258, "258.als"); + habla_dr_dch(TEXTD31, "d31.als"); + animacion_5_6(); + habla_dr_dch(TEXTD32, "d32.als"); + habla_igor_dch(TEXTI11, "I11.als"); + sentido_igor = 3; + habla_dr_dch(TEXTD33, "d33.als"); + habla_igor_frente(TEXTI12, "I12.als"); + habla_dr_dch(TEXTD34, "d34.als"); + sentido_dr = 0; + habla_dr_izq(TEXTD35,"d35.als"); + borra_pantalla(); + carga_escoba("102.ald"); + activa_pendulo(); +} + +void DrasculaEngine::animacion_2_6() { + habla_dr_dch(TEXTD24, "d24.als"); +} + +void DrasculaEngine::animacion_3_6() { + habla_dr_dch(TEXTD24, "d24.als"); +} + +void DrasculaEngine::animacion_4_6() { + habla_dr_dch(TEXTD25, "d25.als"); +} + +void DrasculaEngine::animacion_5_6() { + int n, pos_pen[6]; + + pos_pen[0] = 1; + pos_pen[1] = 29; + pos_pen[2] = 204; + pos_pen[3] = -125; + pos_pen[4] = 18; + pos_pen[5] = 125; + + anima("man.bin", 14); + + for (n = -125; n <= 0; n = n + 2) { + DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla); + actualiza_refresco_antes(); + pos_pen[3] = n; + DIBUJA_BLOQUE_CUT(pos_pen, dir_dibujo3, dir_zona_pantalla); + + actualiza_refresco(); + + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); + pausa(2); + } + + flags[3] = 1; +} + +void DrasculaEngine::animacion_6_6() { + anima("rct.bin", 11); + borra_pantalla(); + sin_verbo(); + resta_objeto(20); + lee_dibujos("96.alg"); + descomprime_dibujo(dir_hare_frente, 1); + lee_dibujos("97.alg"); + descomprime_dibujo(dir_hare_frente, 1); + lee_dibujos("97.alg"); + descomprime_dibujo(dir_hare_dch, 1); + lee_dibujos("99.alg"); + descomprime_dibujo(dir_hare_fondo, 1); + rompo = 1; + obj_saliendo = 104; + hare_x = -1; + sin_verbo(); + carga_escoba("58.ald"); + hare_se_ve = 1; + sentido_hare = 1; + anima("hbp.bin", 14); + + sentido_hare = 3; + flags[0] = 1; + flags[1] = 0; + flags[2] = 1; +} + +void DrasculaEngine::animacion_7_6() { + flags[8] = 1; + actualiza_datos(); +} + +void DrasculaEngine::animacion_9_6() { + int v_cd; + + anima("fin.bin", 14); + playmusic(13); + flags[5] = 1; + anima("drf.bin", 16); + FundeAlNegro(0); + borra_pantalla(); + hare_x = -1; + obj_saliendo = 108; + carga_escoba("59.ald"); + strcpy(num_room, "nada.alg"); + lee_dibujos("nota2.alg"); + descomprime_dibujo(dir_dibujo1, MEDIA); + Negro(); + sentido_hare = 1; + hare_x -= 21; + refresca_pantalla(); + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); + FundeDelNegro(0); + pausa(96); + lleva_al_hare(116, 178); + sentido_hare = 2; + refresca_pantalla(); + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); + playmusic(9); + borra_pantalla(); + lee_dibujos("nota.alg"); + descomprime_dibujo(dir_dibujo1, COMPLETA); + color_abc(BLANCO); + habla_solo(TEXTBJ24, "bj24.als"); + habla_solo(TEXTBJ25, "bj25.als"); + habla_solo(TEXTBJ26, "bj26.als"); + habla_solo(TEXTBJ27, "bj27.als"); + habla_solo(TEXTBJ28, "bj28.als"); + sentido_hare = 3; + borra_pantalla(); + lee_dibujos("96.alg"); + descomprime_dibujo(dir_hare_frente, COMPLETA); + lee_dibujos("nota2.alg"); + descomprime_dibujo(dir_dibujo1, MEDIA); + hablar(TEXT296, "296.als"); + hablar(TEXT297, "297.als"); + hablar(TEXT298, "298.als"); + sentido_hare = 1; + hablar(TEXT299, "299.als"); + hablar(TEXT300, "300.als"); + refresca_pantalla(); + DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_zona_pantalla, dir_dibujo1); + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); + color_abc(VERDE_CLARO); + habla_solo("GOOOOOOOOOOOOOOOL", "s15.als"); + lee_dibujos("nota2.alg"); + descomprime_dibujo(dir_dibujo1, 1); + sentido_hare = 0; + refresca_pantalla(); + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); + hablar(TEXT301, "301.als"); + v_cd = _mixer->getVolumeForSoundType(Audio::Mixer::kMusicSoundType) / 16; + v_cd = v_cd + 4; + playmusic(17); + FundeAlNegro(1); + borra_pantalla(); + fliplay("qpc.bin", 1); + MusicFadeout(); + stopmusic(); + borra_pantalla(); + _mixer->setVolumeForSoundType(Audio::Mixer::kMusicSoundType, v_cd * 16); + playmusic(3); + fliplay("crd.bin", 1); + stopmusic(); + error("end of game ?"); +} + +void DrasculaEngine::animacion_10_6() { + comienza_sound ("s14.als"); + DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla); + actualiza_refresco_antes(); + DIBUJA_FONDO(164, 85, 155, 48, 113, 114, dir_dibujo3, dir_zona_pantalla); + + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); + fin_sound(); + habla_taber2(TEXTT23, "t23.als"); + flags[7] = 1; + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); + FundeDelNegro(0); + pausa(96); + lleva_al_hare(116, 178); + sentido_hare = 2; + refresca_pantalla(); + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); + playmusic(9); + borra_pantalla(); + lee_dibujos("nota.alg"); + descomprime_dibujo(dir_dibujo1, COMPLETA); + color_abc(BLANCO); + habla_solo(TEXTBJ24, "bj24.als"); + habla_solo(TEXTBJ25, "bj25.als"); + habla_solo(TEXTBJ26, "bj26.als"); + habla_solo(TEXTBJ27, "bj27.als"); + habla_solo(TEXTBJ28, "bj28.als"); + sentido_hare = 3; + borra_pantalla(); + lee_dibujos("96.alg"); + descomprime_dibujo(dir_hare_frente, COMPLETA); + lee_dibujos("nota2.alg"); + descomprime_dibujo(dir_dibujo1, MEDIA); + hablar(TEXT296, "296.als"); + hablar(TEXT297, "297.als"); + hablar(TEXT298, "298.als"); + sentido_hare = 1; + hablar(TEXT299, "299.als"); + hablar(TEXT300, "300.als"); + refresca_pantalla(); + DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_zona_pantalla, dir_dibujo1); + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); + color_abc(VERDE_CLARO); + habla_solo("GOOOOOOOOOOOOOOOL", "s15.als"); + lee_dibujos("nota2.alg"); + descomprime_dibujo(dir_dibujo1, 1); +} + +void DrasculaEngine::animacion_11_6() { + habla_taber2(TEXTT10, "t10.als"); + hablar(TEXT268, "268.als"); + habla_taber2(TEXTT11, "t11.als"); +} + +void DrasculaEngine::animacion_12_6() { + habla_taber2(TEXTT12, "t12.als"); + hablar(TEXT270, "270.als"); + habla_taber2(TEXTT13, "t13.als"); + habla_taber2(TEXTT14, "t14.als"); +} + +void DrasculaEngine::animacion_13_6() { + habla_taber2(TEXTT15, "t15.als"); +} + +void DrasculaEngine::animacion_14_6() { + habla_taber2(TEXTT24, "t24.als"); + suma_objeto(21); + flags[10] = 1; + rompo_y_salgo = 1; +} + +void DrasculaEngine::animacion_15_6() { + habla_taber2(TEXTT16, "t16.als"); +} + +void DrasculaEngine::animacion_18_6() { + sin_verbo(); + resta_objeto(21); + anima("beb.bin", 10); +} + +void DrasculaEngine::animacion_19_6() { + DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla); + DIBUJA_FONDO(140, 23, 161, 69, 35, 80, dir_dibujo3, dir_zona_pantalla); + + actualiza_refresco_antes(); + pon_hare(); + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); + pausa(6); + refresca_pantalla(); + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); + comienza_sound("s4.als"); + pausa(6); + fin_sound(); +} + +void DrasculaEngine::activa_pendulo() { + flags[1] = 2; + hare_se_ve = 0; + strcpy(num_room, "102.alg"); + lee_dibujos("102.alg"); + descomprime_dibujo(dir_dibujo1, MEDIA); + lee_dibujos("an_p1.alg"); + descomprime_dibujo(dir_dibujo3, 1); + lee_dibujos("an_p2.alg"); + descomprime_dibujo(dir_hare_dch, 1); + lee_dibujos("an_p3.alg"); + descomprime_dibujo(dir_hare_frente, 1); + + DIBUJA_FONDO(0, 171, 0, 0, ANCHOBJ, ALTOBJ, dir_hare_fondo, dir_dibujo3); + + conta_ciego_vez = (int)vez(); +} + +void DrasculaEngine::habla_pen(const char *dicho, const char *filename) { + int tiempou; + long tiempol; + + int x_habla[8] = {112, 138, 164, 190, 216, 242, 268, 294}; + int cara; + + int longitud; + longitud = strlen(dicho); + + flags[1] = 1; + + refresca_pantalla(); + DIBUJA_BLOQUE(44, 145, 145, 105, 25, 29, dir_dibujo3, dir_zona_pantalla); + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); + + tiempol = _system->getMillis(); + tiempou = (unsigned int)tiempol / 2; + _rnd->setSeed(tiempou); + + buffer_teclado(); + + color_abc(AMARILLO); + + if (hay_sb == 1) { + sku = new Common::File; + sku->open(filename); + if (!sku->isOpen()) { + error("no puedo abrir archivo de voz"); + } + ctvd_init(2); + ctvd_speaker(1); + ctvd_output(sku); + } + +bucless: + + cara = _rnd->getRandomNumber(7); + + DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla); + + actualiza_refresco_antes(); + + DIBUJA_BLOQUE(x_habla[cara], 145, 145, 105, 25, 29, dir_dibujo3, dir_zona_pantalla); + + actualiza_refresco(); + + if (con_voces == 0) + centra_texto(dicho, 160, 105); + + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); + + pausa(3); + + int key = getscan(); + if (key != 0) + ctvd_stop(); + buffer_teclado(); + if (hay_sb == 1) { + if (LookForFree() != 0) + goto bucless; + delete sku; + ctvd_terminate(); + } else { + longitud = longitud - 2; + if (longitud > 0) + goto bucless; + } + + flags[1] = 0; + DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla); + actualiza_refresco_antes(); + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); +} + +void DrasculaEngine::habla_pen2(const char *dicho, const char *filename) { + int tiempou; + long tiempol; + + int x_habla[5]={122, 148, 174, 200, 226}; + int cara; + + int longitud; + longitud = strlen(dicho); + + flags[1] = 1; + + tiempol = _system->getMillis(); + tiempou = (unsigned int)tiempol / 2; + _rnd->setSeed(tiempou); + + buffer_teclado(); + + color_abc(AMARILLO); + + if (hay_sb == 1) { + sku = new Common::File; + sku->open(filename); + if (!sku->isOpen()) { + error("no puedo abrir archivo de voz"); + } + ctvd_init(2); + ctvd_speaker(1); + ctvd_output(sku); + } + +bucless: + + cara = _rnd->getRandomNumber(4); + + DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla); + + actualiza_refresco_antes(); + + DIBUJA_FONDO(x_habla[cara], 171, 173, 116, 25, 28, dir_dibujo3, dir_zona_pantalla); + + actualiza_refresco(); + + if (con_voces == 0) + centra_texto(dicho, 195, 107); + + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); + + pausa(3); + + int key = getscan(); + if (key != 0) + ctvd_stop(); + buffer_teclado(); + if (hay_sb == 1) { + if (LookForFree() != 0) + goto bucless; + delete sku; + ctvd_terminate(); + } else { + longitud = longitud - 2; + if (longitud > 0) + goto bucless; + } + + flags[1] = 0; + DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla); + actualiza_refresco_antes(); + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); +} + +void DrasculaEngine::habla_taber2(const char *dicho, const char *filename) { + int tiempou; + long tiempol; + + int x_habla[6] = {1, 23, 45, 67, 89, 111}; + int cara; + + int longitud; + longitud = strlen(dicho); + + tiempol = _system->getMillis(); + tiempou = (unsigned int)tiempol / 2; + _rnd->setSeed(tiempou); + + buffer_teclado(); + + color_abc(MARRON); + + if (hay_sb == 1) { + sku = new Common::File; + sku->open(filename); + if (!sku->isOpen()) { + error("no puedo abrir archivo de voz"); + } + ctvd_init(2); + ctvd_speaker(1); + ctvd_output(sku); + } + +bucless: + + cara = _rnd->getRandomNumber(5); + + DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla); + + actualiza_refresco_antes(); + + DIBUJA_FONDO(x_habla[cara], 130, 151, 43, 21, 24, dir_dibujo3, dir_zona_pantalla); + pon_hare(); + actualiza_refresco(); + + if (con_voces == 0) + centra_texto(dicho, 132, 45); + + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); + + pausa(3); + + int key = getscan(); + if (key != 0) + ctvd_stop(); + buffer_teclado(); + if (hay_sb == 1) { + if (LookForFree() != 0) + goto bucless; + delete sku; + ctvd_terminate(); + } else { + longitud = longitud - 2; + if (longitud > 0) + goto bucless; + } + + refresca_pantalla(); + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); +} + +void DrasculaEngine::refresca_58() { + if (hare_se_ve == 1) + DIBUJA_BLOQUE(67, 139, 140, 147, 12, 16, dir_dibujo3, dir_zona_pantalla); +} + +void DrasculaEngine::refresca_60() { + if (hare_y - 10 < y_dr && flags[5] == 0) + pon_dr(); +} + +void DrasculaEngine::refresca_61() { + DIBUJA_BLOQUE(1, 154, 83, 122, 131, 44, dir_dibujo3, dir_zona_pantalla); +} + +void DrasculaEngine::refresca_58_antes() { + if (flags[0] == 0) + DIBUJA_FONDO(1, 156, 143, 120, 120, 43, dir_dibujo3, dir_zona_pantalla); + if (flags[1] == 2) + DIBUJA_BLOQUE(252, 171, 173, 116, 25, 28, dir_dibujo3, dir_zona_pantalla); + if (flags[1] == 0 && flags[0] == 0) + DIBUJA_BLOQUE(278, 171, 173, 116, 25, 28, dir_dibujo3, dir_zona_pantalla); + if (flags[2] == 0) { + pon_igor(); + pon_dr(); + } + if (flags[3] == 1) + DIBUJA_BLOQUE(1, 29, 204, 0, 18, 125, dir_dibujo3, dir_zona_pantalla); + if (flags[8] == 1) + DIBUJA_FONDO(20, 60, 30, 64, 46, 95, dir_dibujo3, dir_zona_pantalla); +} + +void DrasculaEngine::refresca_59_antes() { + if (flags[4] == 0) + DIBUJA_BLOQUE(1, 146, 65, 106, 83, 40, dir_dibujo3, dir_zona_pantalla); + if (flags[9] == 1) { + DIBUJA_FONDO(65, 103, 65, 103, 49, 38, dir_dibujo1, dir_zona_pantalla); + DIBUJA_BLOQUE(1, 105, 65, 103, 49, 38, dir_dibujo3, dir_zona_pantalla); + } +} + +void DrasculaEngine::refresca_60_antes() { + int velas_y[] = {158, 172, 186}; + int diferencia; + + if (flags[5] == 0) + pon_dr(); + + DIBUJA_FONDO(123, velas_y[frame_velas], 142, 14, 39, 13, dir_dibujo3, dir_zona_pantalla); + + if (flag_tv == 1) + DIBUJA_FONDO(114, 158, 8, 30, 8, 23, dir_dibujo3, dir_zona_pantalla); + + diferencia = (int)vez() - conta_ciego_vez; + parpadeo = _rnd->getRandomNumber(7); + if (parpadeo == 5 && flag_tv == 0) + flag_tv = 1; + else if (parpadeo == 5 && flag_tv == 1) + flag_tv = 0; + if (diferencia > 6) { + frame_velas++; + if (frame_velas == 3) + frame_velas = 0; + conta_ciego_vez = (int)vez(); + } +} + +void DrasculaEngine::pantalla_58(int fl) { + if (objeto_que_lleva == MOVER && fl == 103) + animacion_7_6(); + else if (objeto_que_lleva == MIRAR && fl == 104) + hablar(TEXT454, "454.als"); + else + hay_respuesta = 0; +} + +void DrasculaEngine::pantalla_59(int fl) { + if ((objeto_que_lleva == HABLAR && fl == 51) || (objeto_que_lleva == MIRAR && fl == 51)) { + flags[9] = 1; + hablar(TEXT259, "259.als"); + habla_bj_cama(TEXTBJ13, "bj13.als"); + hablar(TEXT263, "263.als"); + habla_bj_cama(TEXTBJ14, "bj14.als"); + pausa(40); + hablar(TEXT264, "264.als"); + habla_bj_cama(TEXTBJ15, "BJ15.als"); + hablar(TEXT265, "265.als"); + flags[9] = 0; + if (flags[11] == 0) { + comienza_sound("s12.als"); + delay(40); + fin_sound(); + delay(10); + lleva_al_hare(174, 168); + sentido_hare = 2; + refresca_pantalla(); + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); + pausa(40); + comienza_sound("s12.als"); + pausa(19); + fin_sound_corte(); + hare_se_ve = 0; + refresca_pantalla(); + DIBUJA_BLOQUE(101, 34, hare_x - 4, hare_y - 1, 37, 70, dir_dibujo3, dir_zona_pantalla); + DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_zona_pantalla, dir_dibujo1); + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); + hare_se_ve = 1; + borra_pantalla(); + lee_dibujos("tlef0.alg"); + descomprime_dibujo(dir_dibujo1, COMPLETA); + lee_dibujos("tlef1.alg"); + descomprime_dibujo(dir_dibujo3, 1); + lee_dibujos("tlef2.alg"); + descomprime_dibujo(dir_hare_frente, 1); + lee_dibujos("tlef3.alg"); + descomprime_dibujo(dir_hare_fondo, 1); + habla_htel(TEXT240, "240.als"); + + color_abc(VON_BRAUN); + habla_solo(TEXTVB58, "VB58.als"); + habla_htel(TEXT241, "241.als"); + color_abc(VON_BRAUN); + habla_solo(TEXTVB59, "VB59.als"); + habla_htel(TEXT242, "242.als"); + color_abc(VON_BRAUN); + habla_solo(TEXTVB60, "VB60.als"); + habla_htel(TEXT196, "196.als"); + color_abc(VON_BRAUN); + habla_solo(TEXTVB61,"VB61.als"); + habla_htel(TEXT244, "244.als"); + color_abc(VON_BRAUN); + habla_solo(TEXTVB62, "VB62.als"); + borra_pantalla(); + lee_dibujos("aux59.alg"); + descomprime_dibujo(dir_dibujo3, 1); + lee_dibujos("96.alg"); + descomprime_dibujo(dir_hare_frente, COMPLETA); + lee_dibujos("99.alg"); + descomprime_dibujo(dir_hare_fondo, 1); + lee_dibujos("59.alg"); + descomprime_dibujo(dir_dibujo1, MEDIA); + sentido_hare = 3; + hablar(TEXT245, "245.als"); + sin_verbo(); + flags[11] = 1; + } + } else + hay_respuesta = 0; +} + +void DrasculaEngine::pantalla_60(int fl) { + if (objeto_que_lleva == MOVER && fl == 112) + animacion_10(); + else if (objeto_que_lleva == MIRAR && fl == 112) + hablar(TEXT440, "440.als"); + else if (objeto_que_lleva == HABLAR && fl == 52) { + hablar(TEXT266, "266.als"); + habla_taber2(TEXTT1, "t1.als"); + conversa("op_12.cal"); + sin_verbo(); + objeto_que_lleva = 0; + } else if (objeto_que_lleva == HABLAR && fl == 115) + hablar(TEXT455, "455.als"); + else if (objeto_que_lleva == HABLAR && fl == 56) + hablar(TEXT455, "455.als"); + else if (objeto_que_lleva == MIRAR && fl == 114) + hablar(TEXT167, "167.als"); + else if (objeto_que_lleva == MIRAR && fl == 113) + hablar(TEXT168, "168.als"); + else if (objeto_que_lleva == COGER && fl == 113) + hablar(TEXT170, "170.als"); + else if (objeto_que_lleva == MOVER && fl == 113) + hablar(TEXT170, "170.als"); + else if (objeto_que_lleva == HABLAR && fl == 113) + hablar(TEXT169, "169.als"); + else if (objeto_que_lleva == 21 && fl == 56) + animacion_18_6(); + else if (objeto_que_lleva == 9 && fl == 56 && flags[6] == 1) + animacion_9(); + else if (objeto_que_lleva == 9 && fl == 56 && flags[6] == 0) { + anima("cnf.bin", 14); + hablar(TEXT455, "455.als"); + } else + hay_respuesta = 0; +} + +void DrasculaEngine::pantalla_61(int fl) { + if (objeto_que_lleva == MIRAR && fl == 116) + hablar(TEXT172, "172.als"); + else if (objeto_que_lleva == MIRAR && fl == 117) + hablar(TEXT173, "173.als"); + else if (objeto_que_lleva == MOVER && fl == 117) + hablar(TEXT174, "174.als"); + else if (objeto_que_lleva == ABRIR && fl == 117) + hablar(TEXT174, "174.als"); + else + hay_respuesta = 0; +} + +void DrasculaEngine::habla_bj_cama(const char *dicho, const char *filename) { + int tiempou; + long tiempol; + + int x_habla[5] = {51, 101, 151, 201, 251}; + int cara; + + int longitud; + longitud = strlen(dicho); + + tiempol = _system->getMillis(); + tiempou = (unsigned int)tiempol / 2; + _rnd->setSeed(tiempou); + + buffer_teclado(); + + color_abc(BLANCO); + + if (hay_sb == 1) { + sku = new Common::File; + sku->open(filename); + if (!sku->isOpen()) { + error("no puedo abrir archivo de voz"); + } + ctvd_init(2); + ctvd_speaker(1); + ctvd_output(sku); + } + +bucless: + + cara = _rnd->getRandomNumber(4); + + DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla); + + actualiza_refresco_antes(); + + DIBUJA_FONDO(65, 103, 65, 103, 49, 38, dir_dibujo1, dir_zona_pantalla); + DIBUJA_BLOQUE(x_habla[cara], 105, 65, 103, 49, 38, dir_dibujo3, dir_zona_pantalla); + pon_hare(); + actualiza_refresco(); + + if (con_voces == 0) + centra_texto(dicho, 104, 102); + + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); + + pausa(3); + + int key = getscan(); + if (key != 0) + ctvd_stop(); + buffer_teclado(); + if (hay_sb == 1) { + if (LookForFree() != 0) + goto bucless; + delete sku; + ctvd_terminate(); + } else { + longitud = longitud - 2; + if (longitud > 0) + goto bucless; + } + refresca_pantalla(); + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); +} + +void DrasculaEngine::habla_htel(const char *dicho, const char *filename) { + int tiempou; + long tiempol; + char *num_cara; + + int x_habla[3] = {1, 94, 187}; + int cara, pantalla; + + int longitud; + longitud = strlen(dicho); + + tiempol = _system->getMillis(); + tiempou = (unsigned int)tiempol / 2; + _rnd->setSeed(tiempou); + + buffer_teclado(); + + color_abc(AMARILLO); + + if (hay_sb == 1) { + sku = new Common::File; + sku->open(filename); + if (!sku->isOpen()) { + error("no puedo abrir archivo de voz"); + } + ctvd_init(2); + ctvd_speaker(1); + ctvd_output(sku); + } + +bucless: + + cara = _rnd->getRandomNumber(2); + pantalla = _rnd->getRandomNumber(2); + + if (cara == 0 && pantalla == 0) + num_cara = (char *)dir_dibujo3; + else if (pantalla == 1) + num_cara = (char *)dir_hare_frente; + else + num_cara = (char *)dir_hare_fondo; + + DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla); + + DIBUJA_FONDO(x_habla[cara], 1, 45, 24, 92, 108, (byte *)num_cara, dir_zona_pantalla); + + if (con_voces == 0) + centra_texto(dicho, 90, 50); + + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); + pausa(3); + + int key = getscan(); + if (key != 0) + ctvd_stop(); + buffer_teclado(); + if (hay_sb == 1) { + if (LookForFree() != 0) + goto bucless; + delete sku; + ctvd_terminate(); + } else { + longitud = longitud - 2; + if (longitud > 0) + goto bucless; + } + + DIBUJA_FONDO(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla); + VUELCA_PANTALLA(0, 0, 0, 0, 320, 200, dir_zona_pantalla); +} + +void DrasculaEngine::refresca_pendulo() { + int pendulo_x[] = {40, 96, 152, 208, 264, 40, 96, 152, 208, 208, 152, 264, 40, 96, 152, 208, 264}; + int diferencia; + + if (frame_pen <= 4) + dir_pendulo = dir_dibujo3; + else if (frame_pen <= 11) + dir_pendulo = dir_hare_dch; + else + dir_pendulo = dir_hare_frente; + + DIBUJA_FONDO(pendulo_x[frame_pen], 19, 152, 0, 55, 125, dir_pendulo, dir_zona_pantalla); + + if (flags[1] == 2) + DIBUJA_BLOQUE(18, 145, 145, 105, 25, 29, dir_dibujo3, dir_zona_pantalla); + + if (flags[1] == 0) + DIBUJA_BLOQUE(44, 145, 145, 105, 25, 29, dir_dibujo3, dir_zona_pantalla); + + diferencia = (int)vez() - conta_ciego_vez; + if (diferencia > 8) { + frame_pen++; + if (frame_pen == 17) + frame_pen = 0; + conta_ciego_vez = (int)vez(); + } +} + +void DrasculaEngine::pantalla_pendulo(int fl) { + if (objeto_que_lleva == MIRAR && fl == 100) + hablar(TEXT452, "452.als"); + else if (objeto_que_lleva == MIRAR && fl == 101) + hablar (TEXT123, "123.als"); + else if (objeto_que_lleva == COGER && fl == 101) + agarra_objeto(20); + else if (objeto_que_lleva == 20 && fl == 100) + animacion_6_6(); + else if (objeto_que_lleva == COGER || objeto_que_lleva == ABRIR) + hablar(TEXT453, "453.als"); + else + hay_respuesta = 0; +} } // End of namespace Drascula diff --git a/engines/drascula/drascula.h b/engines/drascula/drascula.h index d8e49ba930..229e6d71b3 100644 --- a/engines/drascula/drascula.h +++ b/engines/drascula/drascula.h @@ -419,7 +419,7 @@ public: char alapantallakeva[40][20]; int x_alakeva[40], y_alakeva[40], sentido_alkeva[40], alapuertakeva[40]; int x1[40], y1[40], x2[40], y2[40]; - int lleva_objeto , objeto_que_lleva; + int lleva_objeto, objeto_que_lleva; int con_voces; int menu_bar, menu_scr, hay_nombre; char texto_nombre[20]; @@ -462,7 +462,7 @@ public: int cont_sv; int term_int; int num_ejec; - int cual_ejec, hay_que_load; + int hay_que_load; char nom_partida[13]; int _color; int corta_musica; @@ -497,7 +497,6 @@ public: void animacion_4_1(); void animacion_3_2(); void animacion_4_2(); - void animacion_7(); void animacion_8(); void animacion_9(); void animacion_10(); @@ -508,7 +507,6 @@ public: void animacion_15(); void animacion_16(); void animacion_17(); - void animacion_18(); void animacion_19(); void animacion_20(); void animacion_21(); @@ -527,7 +525,7 @@ public: void animacion_32(); void animacion_33(); void animacion_34(); - void animacion_35(); + void animacion_35_2(); void animacion_36(); void refresca_1_antes(); @@ -553,8 +551,7 @@ public: void sin_verbo(); void para_cargar(char[]); - void carga_escoba_1(const char *); - void carga_escoba_2(const char *); + void carga_escoba(const char *); void borra_pantalla(); void lleva_al_hare(int, int); void mueve_cursor(); @@ -654,6 +651,9 @@ public: int GlobalSpeed; int LastFrame; + int frame_pen; + int flag_tv; + byte *carga_pcx(byte *NamePcc); void set_dac(byte *dac); void WaitForNext(int FPS); @@ -687,9 +687,86 @@ public: void ctvd_speaker(int flag); void ctvd_output(Common::File *file_handle); void ctvd_init(int b); - - - + void grr(); + void pantalla_13(int fl); + void refresca_13(); + void refresca_20(); + void animacion_1_3(); + void animacion_2_3(); + void animacion_3_3(); + void animacion_4_3(); + void animacion_5(); + void animacion_6(); + void animacion_7_4(); + void animacion_rayo(); + void animacion_2_4(); + void animacion_3_4(); + void animacion_4_4(); + void animacion_1_5(); + void animacion_2_5(); + void animacion_3_5(); + void animacion_4_5(); + void animacion_5_5(); + void animacion_6_5(); + void animacion_7_5(); + void animacion_8_5(); + void animacion_9_5(); + void animacion_10_5(); + void animacion_11_5(); + void animacion_12_5(); + void animacion_13_5(); + void animacion_14_5(); + void animacion_15_5(); + void animacion_16_5(); + void animacion_17_5(); + void pantalla_49(int); + void pantalla_53(int); + void pantalla_54(int); + void pantalla_55(int); + void pantalla_56(int); + void refresca_53_antes(); + void refresca_54_antes(); + void refresca_49_antes(); + void refresca_56_antes(); + void refresca_50(); + void refresca_57(); + void habla_igor_sentado(const char *, const char *); + void habla_lobo(const char *dicho, const char *filename); + void habla_mus(const char *dicho, const char *filename); + void pantalla_58(int); + void pantalla_59(int); + void pantalla_60(int); + void pantalla_61(int); + void pantalla_pendulo(int); + void refresca_pendulo(); + void refresca_58(); + void refresca_58_antes(); + void refresca_59_antes(); + void refresca_60_antes(); + void refresca_60(); + void refresca_61(); + void animacion_1_6(); + void animacion_2_6(); + void animacion_3_6(); + void animacion_4_6(); + void animacion_5_6(); + void animacion_6_6(); + void animacion_7_6(); + void animacion_9_6(); + void animacion_10_6(); + void animacion_11_6(); + void animacion_12_6(); + void animacion_13_6(); + void animacion_14_6(); + void animacion_15_6(); + void animacion_18_6(); + void animacion_19_6(); + void activa_pendulo(); + void habla_pen(const char *, const char *); + void habla_pen2(const char *, const char *); + void habla_taber2(const char *, const char *); + void habla_bj_cama(const char *dicho, const char * filename); + void habla_htel(const char *dicho, const char *filename); private: diff --git a/engines/engine.cpp b/engines/engine.cpp index f2b7198510..9750812f5e 100644 --- a/engines/engine.cpp +++ b/engines/engine.cpp @@ -43,7 +43,7 @@ extern bool isSmartphone(void); #endif -// FIXME - BIG HACK for MidiEmu & error() +// FIXME: HACK for MidiEmu & error() Engine *g_engine = 0; diff --git a/engines/gob/cdrom.cpp b/engines/gob/cdrom.cpp index 2ee8595ad3..1c26199bc1 100644 --- a/engines/gob/cdrom.cpp +++ b/engines/gob/cdrom.cpp @@ -151,40 +151,27 @@ void CDROM::playMultMusic() { } } -void CDROM::startTrack(const char *trackname) { - byte *curPtr, *matchPtr; - +void CDROM::startTrack(const char *trackName) { if (!_LICbuffer) return; - debugC(1, kDebugMusic, "CDROM::startTrack(%s)", trackname); - - matchPtr = 0; - curPtr = _LICbuffer; - - for (int i = 0; i < _numTracks; i++) { - if (!scumm_stricmp((char *)curPtr, trackname)) { - matchPtr = curPtr; - break; - } - curPtr += 22; - } + debugC(1, kDebugMusic, "CDROM::startTrack(%s)", trackName); + byte *matchPtr = getTrackBuffer(trackName); if (!matchPtr) { - warning("Track \"%s\" not found", trackname); + warning("Track \"%s\" not found", trackName); return; } - strncpy0(_curTrack, trackname, 15); + strncpy0(_curTrack, trackName, 15); stopPlaying(); + _curTrackBuffer = matchPtr; - while (getTrackPos() != -1); - - uint32 start, end; + while (getTrackPos() >= 0); - start = READ_LE_UINT32(matchPtr + 12); - end = READ_LE_UINT32(matchPtr + 16); + uint32 start = READ_LE_UINT32(matchPtr + 12); + uint32 end = READ_LE_UINT32(matchPtr + 16); play(start, end); @@ -205,12 +192,27 @@ void CDROM::play(uint32 from, uint32 to) { _cdPlaying = true; } -int32 CDROM::getTrackPos() { - uint32 curPos = _vm->_util->getTimeKey() - _startTime; +int32 CDROM::getTrackPos(const char *keyTrack) { + byte *keyBuffer = getTrackBuffer(keyTrack); + uint32 curPos = (_vm->_util->getTimeKey() - _startTime) * 3 / 40; + + if (_cdPlaying && (_vm->_util->getTimeKey() < _trackStop)) { + if (keyBuffer && _curTrackBuffer && (keyBuffer != _curTrackBuffer)) { + uint32 kStart = READ_LE_UINT32(keyBuffer + 12); + uint32 kEnd = READ_LE_UINT32(keyBuffer + 16); + uint32 cStart = READ_LE_UINT32(_curTrackBuffer + 12); + uint32 cEnd = READ_LE_UINT32(_curTrackBuffer + 16); + + if ((kStart >= cStart) && (kEnd <= cEnd)) { + if ((kStart - cStart) > curPos) + return -2; + if ((kEnd - cStart) < curPos) + return -1; + } + } - if (_cdPlaying && (_vm->_util->getTimeKey() < _trackStop)) - return curPos * 3 / 40; - else + return curPos; + } else return -1; } @@ -227,6 +229,7 @@ void CDROM::stopPlaying() { void CDROM::stop() { debugC(1, kDebugMusic, "CDROM::stop()"); + _curTrackBuffer = 0; AudioCD.stop(); _cdPlaying = false; } @@ -245,4 +248,22 @@ void CDROM::testCD(int trySubst, const char *label) { // CD secor reading } +byte *CDROM::getTrackBuffer(const char *trackName) { + if (!_LICbuffer || !trackName) + return 0; + + byte *matchPtr = 0; + byte *curPtr = _LICbuffer; + + for (int i = 0; i < _numTracks; i++) { + if (!scumm_stricmp((char *) curPtr, trackName)) { + matchPtr = curPtr; + break; + } + curPtr += 22; + } + + return matchPtr; +} + } // End of namespace Gob diff --git a/engines/gob/cdrom.h b/engines/gob/cdrom.h index e977adcd6d..f847addaeb 100644 --- a/engines/gob/cdrom.h +++ b/engines/gob/cdrom.h @@ -35,11 +35,11 @@ public: void readLIC(const char *fname); void freeLICbuffer(); - void startTrack(const char *s); + void startTrack(const char *trackName); void playBgMusic(); void playMultMusic(); void play(uint32 from, uint32 to); - int32 getTrackPos(); + int32 getTrackPos(const char *keyTrack = 0); const char *getCurTrack(); void stopPlaying(); void stop(); @@ -49,11 +49,14 @@ public: protected: byte *_LICbuffer; + byte *_curTrackBuffer; char _curTrack[16]; uint16 _numTracks; uint32 _trackStop; uint32 _startTime; GobEngine *_vm; + + byte *getTrackBuffer(const char *trackName); }; } // End of namespace Gob diff --git a/engines/gob/coktelvideo.cpp b/engines/gob/coktelvideo.cpp index 16df54d85f..b3056a5ea3 100644 --- a/engines/gob/coktelvideo.cpp +++ b/engines/gob/coktelvideo.cpp @@ -885,9 +885,9 @@ bool Vmd::load(Common::SeekableReadStream &stream) { _vidBufferSize = _stream->readUint32LE(); if (_hasVideo) { - if (_frameDataSize == 0) + if ((_frameDataSize == 0) || (_frameDataSize > 1048576)) _frameDataSize = _width * _height + 500; - if (_vidBufferSize == 0) + if ((_vidBufferSize == 0) || (_vidBufferSize > 1048576)) _vidBufferSize = _frameDataSize; _frameData = new byte[_frameDataSize]; @@ -949,7 +949,7 @@ bool Vmd::load(Common::SeekableReadStream &stream) { if (_frames[i].parts[j].type == kPartTypeAudio) { _frames[i].parts[j].flags = _stream->readByte(); - _stream->skip(9); // Unknow + _stream->skip(9); // Unknown } else if (_frames[i].parts[j].type == kPartTypeVideo) { @@ -1068,9 +1068,13 @@ CoktelVideo::State Vmd::processFrame(uint16 frame) { // Next sound slice data if (part.flags == 1) { - if (_soundEnabled) + if (_soundEnabled) { filledSoundSlice(part.size); - else + + if (_soundStage == 1) + startSound = true; + + } else _stream->skip(part.size); // Initial sound data (all slices) @@ -1089,11 +1093,17 @@ CoktelVideo::State Vmd::processFrame(uint16 frame) { // Empty sound slice } else if (part.flags == 3) { - if (_soundEnabled && (part.size > 0)) - emptySoundSlice(part.size); - else - _stream->skip(part.size); + if (_soundEnabled) { + emptySoundSlice(_soundSliceSize * _soundBytesPerSample); + if (_soundStage == 1) + startSound = true; + } + + _stream->skip(part.size); + } else { + warning("Unknown sound part type %d", part.flags); + _stream->skip(part.size); } } else if (part.type == kPartTypeVideo) { @@ -1252,23 +1262,18 @@ void Vmd::filledSoundSlice(uint32 size) { } void Vmd::filledSoundSlices(uint32 size, uint32 mask) { - if (_soundBytesPerSample == 1) { - soundSlice8bit(size); - return; - } - - for (int i = 0; i < (_soundSlicesCount - 1); i++) { + int n = MIN<int>(_soundSlicesCount - 1, 31); + for (int i = 0; i < n; i++) { if (mask & 1) - emptySoundSlice(_soundSliceSize * 2); - else { - int16 init = _stream->readSint16LE(); - soundSlice16bit(_soundSliceSize, init); - } + emptySoundSlice(_soundSliceSize * _soundBytesPerSample); + else + filledSoundSlice(_soundSliceSize); mask >>= 1; } - + if (_soundSlicesCount > 32) + filledSoundSlice((_soundSlicesCount - 32) * _soundSliceSize); } void Vmd::deDPCM(byte *soundBuf, byte *dataBuf, int16 &init, uint32 n) { diff --git a/engines/gob/dataio.cpp b/engines/gob/dataio.cpp index 361627caf4..7fd461b93c 100644 --- a/engines/gob/dataio.cpp +++ b/engines/gob/dataio.cpp @@ -273,28 +273,27 @@ int32 DataIO::readChunk(int16 handle, byte *buf, uint16 size) { file = (handle - 50) / 10; slot = (handle - 50) % 10; - if (!_isCurrentSlot[file * MAX_SLOT_COUNT + slot]) { + int index = file * MAX_SLOT_COUNT + slot; + + _chunkPos[index] = CLIP<int32>(_chunkPos[index], 0, _chunkSize[index]); + + if (!_isCurrentSlot[index]) { for (i = 0; i < MAX_SLOT_COUNT; i++) _isCurrentSlot[file * MAX_SLOT_COUNT + i] = false; - offset = _chunkOffset[file * MAX_SLOT_COUNT + slot] + - _chunkPos[file * MAX_SLOT_COUNT + slot]; + offset = _chunkOffset[index] + _chunkPos[index]; - debugC(7, kDebugFileIO, "seek: %d, %d", - _chunkOffset[file * MAX_SLOT_COUNT + slot], - _chunkPos[file * MAX_SLOT_COUNT + slot]); + debugC(7, kDebugFileIO, "seek: %d, %d", _chunkOffset[index], _chunkPos[index]); file_getHandle(_dataFileHandles[file])->seek(offset, SEEK_SET); } - _isCurrentSlot[file * MAX_SLOT_COUNT + slot] = true; - if ((_chunkPos[file * MAX_SLOT_COUNT + slot] + size) > - (_chunkSize[file * MAX_SLOT_COUNT + slot])) - size = _chunkSize[file * MAX_SLOT_COUNT + slot] - - _chunkPos[file * MAX_SLOT_COUNT + slot]; + _isCurrentSlot[index] = true; + if ((_chunkPos[index] + size) > (_chunkSize[index])) + size = _chunkSize[index] - _chunkPos[index]; file_getHandle(_dataFileHandles[file])->read(buf, size); - _chunkPos[file * MAX_SLOT_COUNT + slot] += size; + _chunkPos[index] += size; return size; } @@ -307,13 +306,15 @@ int16 DataIO::seekChunk(int16 handle, int32 pos, int16 from) { file = (handle - 50) / 10; slot = (handle - 50) % 10; - _isCurrentSlot[file * MAX_SLOT_COUNT + slot] = false; + int index = file * MAX_SLOT_COUNT + slot; + + _isCurrentSlot[index] = false; if (from == SEEK_SET) - _chunkPos[file * MAX_SLOT_COUNT + slot] = pos; + _chunkPos[index] = pos; else - _chunkPos[file * MAX_SLOT_COUNT + slot] += pos; + _chunkPos[index] += pos; - return _chunkPos[file * MAX_SLOT_COUNT + slot]; + return _chunkPos[index]; } uint32 DataIO::getChunkPos(int16 handle) const { diff --git a/engines/gob/detection.cpp b/engines/gob/detection.cpp index 7faef57cc1..bfd2a0edfc 100644 --- a/engines/gob/detection.cpp +++ b/engines/gob/detection.cpp @@ -955,6 +955,19 @@ static const GOBGameDescription gameDescriptions[] = { }, { { + "lostintime", + "Demo", + AD_ENTRY1("demo.stk", "c06f8cc20eb239d4c71f225ce3093edf"), + UNK_LANG, + kPlatformPC, + Common::ADGF_DEMO + }, + kGameTypeLostInTime, + kFeaturesAdlib, + "demo" + }, + { + { "gob3", "", AD_ENTRY1s("intro.stk", "32b0f57f5ae79a9ae97e8011df38af42", 157084), diff --git a/engines/gob/driver_vga.cpp b/engines/gob/driver_vga.cpp index 13e6aca4a8..ef1c9c328c 100644 --- a/engines/gob/driver_vga.cpp +++ b/engines/gob/driver_vga.cpp @@ -113,18 +113,23 @@ void VGAVideoDriver::drawSprite(SurfaceDesc *source, SurfaceDesc *dest, byte *srcPos = source->getVidMem() + (top * source->getWidth()) + left; byte *destPos = dest->getVidMem() + (y * dest->getWidth()) + x; - while (height--) { - if (transp) { + if (transp) { + while (height--) { for (int16 i = 0; i < width; ++i) { if (srcPos[i]) destPos[i] = srcPos[i]; - } - } else - for (int16 i = 0; i < width; ++i) - destPos[i] = srcPos[i]; + } + + srcPos += source->getWidth(); + destPos += dest->getWidth(); + } + } else { + while (height--) { + memcpy(destPos, srcPos, width); - srcPos += source->getWidth(); - destPos += dest->getWidth(); + srcPos += source->getWidth(); + destPos += dest->getWidth(); + } } } diff --git a/engines/gob/game_v1.cpp b/engines/gob/game_v1.cpp index 9c18ec1151..3f681ddd1f 100644 --- a/engines/gob/game_v1.cpp +++ b/engines/gob/game_v1.cpp @@ -345,6 +345,7 @@ int16 Game_v1::checkCollisions(byte handleMouse, int16 deltaTime, int16 oldIndex; int16 oldId; uint32 timeKey; + bool firstIteration = true; if (deltaTime >= -1) { _lastCollKey = 0; @@ -357,6 +358,8 @@ int16 Game_v1::checkCollisions(byte handleMouse, int16 deltaTime, resIndex = 0; + timeKey = _vm->_util->getTimeKey(); + if ((_vm->_draw->_cursorIndex == -1) && (handleMouse != 0) && (_lastCollKey == 0)) { _lastCollKey = checkMousePoint(1, &_lastCollId, &_lastCollAreaIndex); @@ -374,7 +377,6 @@ int16 Game_v1::checkCollisions(byte handleMouse, int16 deltaTime, if (handleMouse != 0) _vm->_draw->animateCursor(-1); - timeKey = _vm->_util->getTimeKey(); while (1) { if (_vm->_inter->_terminate) { if (handleMouse) @@ -397,7 +399,7 @@ int16 Game_v1::checkCollisions(byte handleMouse, int16 deltaTime, // and the return value is then discarded. if (deltaTime < 0) { uint32 curtime = _vm->_util->getTimeKey(); - if ((deltaTime == -1) || ((curtime + deltaTime) > timeKey)) { + if ((deltaTime == -1) || (((curtime + deltaTime) > timeKey) && !firstIteration)) { if (pResId != 0) *pResId = 0; @@ -538,7 +540,10 @@ int16 Game_v1::checkCollisions(byte handleMouse, int16 deltaTime, if (handleMouse != 0) _vm->_draw->animateCursor(-1); - _vm->_util->delay(10); + if (deltaTime < -10) + _vm->_util->delay(10); + + firstIteration = false; } } @@ -617,7 +622,7 @@ void Game_v1::collisionsBlock(void) { int16 var_26; int16 collStackPos; Collision *collPtr; - int16 timeKey; + uint32 timeKey; byte *savedIP; if (_shouldPushColls) @@ -910,9 +915,9 @@ void Game_v1::collisionsBlock(void) { _shouldPushColls = 0; _vm->_global->_inter_execPtr = savedIP; + deltaTime = timeVal - - ((_vm->_util->getTimeKey() - timeKey) - - _vm->_video->_lastRetraceLength); + (_vm->_util->getTimeKey() - timeKey); if (deltaTime < 2) deltaTime = 2; diff --git a/engines/gob/game_v2.cpp b/engines/gob/game_v2.cpp index 7e87b9e8f8..8a528a96f5 100644 --- a/engines/gob/game_v2.cpp +++ b/engines/gob/game_v2.cpp @@ -1259,7 +1259,7 @@ int16 Game_v2::multiEdit(int16 time, int16 index, int16 *pCurPos, if ((collArea->left > _vm->_global->_inter_mouseX) || (collArea->right < _vm->_global->_inter_mouseX) || (collArea->top > _vm->_global->_inter_mouseY) || - (collArea->bottom < _vm->_global->_inter_mouseY)); + (collArea->bottom < _vm->_global->_inter_mouseY)) continue; if ((collArea->id & 0xF000)) diff --git a/engines/gob/gob.cpp b/engines/gob/gob.cpp index d9385b1b0f..8dee9c9e32 100644 --- a/engines/gob/gob.cpp +++ b/engines/gob/gob.cpp @@ -333,7 +333,7 @@ bool GobEngine::initGameParts() { _mult = new Mult_v2(this); _draw = new Draw_v2(this); _game = new Game_v2(this); - _map = new Map_v2(this); + _map = new Map_v4(this); _goblin = new Goblin_v3(this); _scenery = new Scenery_v2(this); _saveLoad = new SaveLoad_v3(this, _targetName.c_str()); @@ -349,8 +349,6 @@ bool GobEngine::initGameParts() { if (!_noMusic && hasAdlib()) _adlib = new Adlib(this); - _map->init(); - if (is640()) { _video->_surfWidth = _width = 640; _video->_surfHeight = _video->_splitHeight1 = _height = 480; diff --git a/engines/gob/init.cpp b/engines/gob/init.cpp index 4712a19a5d..1c6d7faa3b 100644 --- a/engines/gob/init.cpp +++ b/engines/gob/init.cpp @@ -60,14 +60,23 @@ void Init::initGame(const char *totName) { int16 handle2; int16 handle; int16 imdHandle; - char *infBuf; + byte *infBuf; char *infPtr; char *infEnd; - char buffer[20]; + char buffer[128]; int32 varsCount; initVideo(); + // The Lost In Time demo uses different file prefix + if (_vm->getGameType() == kGameTypeLostInTime) { + handle2 = _vm->_dataIO->openData("demo.stk"); + if (handle2 >= 0) { + _vm->_dataIO->closeData(handle2); + _vm->_dataIO->openDataFile("demo.stk"); + } + } + handle2 = _vm->_dataIO->openData("intro.stk"); if (handle2 >= 0) { _vm->_dataIO->closeData(handle2); @@ -111,10 +120,10 @@ void Init::initGame(const char *totName) { } else { _vm->_dataIO->closeData(handle); - infPtr = (char *) _vm->_dataIO->getData("intro.inf"); - infBuf = infPtr; + infBuf = _vm->_dataIO->getData("intro.inf"); + infPtr = (char *) infBuf; - infEnd = infBuf + _vm->_dataIO->getDataSize("intro.inf"); + infEnd = (char *) (infBuf + _vm->_dataIO->getDataSize("intro.inf")); for (int i = 0; i < 4; i++, infPtr++) { int j; diff --git a/engines/gob/init_v3.cpp b/engines/gob/init_v3.cpp index 6f1af258ca..61e7fb61d0 100644 --- a/engines/gob/init_v3.cpp +++ b/engines/gob/init_v3.cpp @@ -18,8 +18,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL:https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/branches/gsoc2007-fsnode/engines/gob/init_v3.cpp $ - * $Id:init_v3.cpp 26949 2007-05-26 20:23:24Z david_corrales $ + * $URL$ + * $Id$ * */ diff --git a/engines/gob/inter_v2.cpp b/engines/gob/inter_v2.cpp index 376aef75d9..b2ca8716be 100644 --- a/engines/gob/inter_v2.cpp +++ b/engines/gob/inter_v2.cpp @@ -1105,7 +1105,7 @@ void Inter_v2::o2_getCDTrackPos() { varPos = _vm->_parse->parseVarIndex(); varName = _vm->_parse->parseVarIndex(); - WRITE_VAR_OFFSET(varPos, _vm->_cdrom->getTrackPos()); + WRITE_VAR_OFFSET(varPos, _vm->_cdrom->getTrackPos(GET_VARO_STR(varName))); WRITE_VARO_STR(varName, _vm->_cdrom->getCurTrack()); } @@ -1561,7 +1561,8 @@ void Inter_v2::o2_openItk() { evalExpr(0); strncpy0(fileName, _vm->_global->_inter_resStr, 27); - strcat(fileName, ".ITK"); + if (!strchr(fileName, '.')) + strcat(fileName, ".ITK"); _vm->_dataIO->openDataFile(fileName, true); } diff --git a/engines/gob/map.cpp b/engines/gob/map.cpp index 5485d66987..d467348039 100644 --- a/engines/gob/map.cpp +++ b/engines/gob/map.cpp @@ -34,9 +34,11 @@ namespace Gob { Map::Map(GobEngine *vm) : _vm(vm) { + _widthByte = 0; _mapWidth = -1; _mapHeight = -1; _screenWidth = 0; + _screenHeight = 0; _tilesWidth = 0; _tilesHeight = 0; _passWidth = 0; diff --git a/engines/gob/map.h b/engines/gob/map.h index 0e0a80aad3..acfe8b675e 100644 --- a/engines/gob/map.h +++ b/engines/gob/map.h @@ -63,9 +63,11 @@ public: #include "common/pack-end.h" // END STRUCT PACKING + byte _widthByte; int16 _mapWidth; int16 _mapHeight; int16 _screenWidth; + int16 _screenHeight; int16 _tilesWidth; int16 _tilesHeight; int16 _passWidth; @@ -107,7 +109,6 @@ public: virtual void findNearestToDest(Mult::Mult_Object *obj) = 0; virtual void optimizePoints(Mult::Mult_Object *obj, int16 x, int16 y) = 0; - virtual void init(void) = 0; Map(GobEngine *vm); virtual ~Map(); @@ -127,18 +128,24 @@ public: virtual void optimizePoints(Mult::Mult_Object *obj, int16 x, int16 y); virtual int8 getPass(int x, int y, int heightOff = -1) { + if (!_passMap) + return 0; + return _passMap[y * _mapWidth + x]; } virtual void setPass(int x, int y, int8 pass, int heightOff = -1) { + if (!_passMap) + return; + _passMap[y * _mapWidth + x] = pass; } - virtual void init(void); Map_v1(GobEngine *vm); virtual ~Map_v1(); protected: + void init(void); void loadSounds(Common::SeekableReadStream &data); void loadGoblins(Common::SeekableReadStream &data, uint32 gobsPos); void loadObjects(Common::SeekableReadStream &data, uint32 objsPos); @@ -153,18 +160,23 @@ public: virtual void optimizePoints(Mult::Mult_Object *obj, int16 x, int16 y); virtual int8 getPass(int x, int y, int heightOff = -1) { + if (!_passMap) + return 0; + if (heightOff == -1) heightOff = _passWidth; return _passMap[y * heightOff + x]; } virtual void setPass(int x, int y, int8 pass, int heightOff = -1) { + if (!_passMap) + return; + if (heightOff == -1) heightOff = _passWidth; _passMap[y * heightOff + x] = pass; } - virtual void init(void); Map_v2(GobEngine *vm); virtual ~Map_v2(); @@ -172,6 +184,14 @@ protected: void loadGoblinStates(Common::SeekableReadStream &data, int index); }; +class Map_v4 : public Map_v2 { +public: + virtual void loadMapObjects(const char *avjFile); + + Map_v4(GobEngine *vm); + virtual ~Map_v4(); +}; + } // End of namespace Gob #endif // GOB_MAP_H diff --git a/engines/gob/map_v1.cpp b/engines/gob/map_v1.cpp index c5a2622e44..7134527592 100644 --- a/engines/gob/map_v1.cpp +++ b/engines/gob/map_v1.cpp @@ -42,6 +42,9 @@ Map_v1::~Map_v1() { } void Map_v1::init(void) { + if (_passMap || _itemsMap) + return; + _mapWidth = 26; _mapHeight = 28; @@ -84,6 +87,8 @@ void Map_v1::loadMapObjects(const char *avjFile) { } Common::MemoryReadStream mapData(dataBuf, 4294967295U); + init(); + if (_loadFromAvo) { mapData.read(_passMap, _mapHeight * _mapWidth); diff --git a/engines/gob/map_v2.cpp b/engines/gob/map_v2.cpp index e1ed11c607..5133ac1286 100644 --- a/engines/gob/map_v2.cpp +++ b/engines/gob/map_v2.cpp @@ -38,15 +38,13 @@ namespace Gob { Map_v2::Map_v2(GobEngine *vm) : Map_v1(vm) { + _screenHeight = 200; } Map_v2::~Map_v2() { _passMap = 0; } -void Map_v2::init(void) { -} - void Map_v2::loadMapObjects(const char *avjFile) { uint8 wayPointsCount; int16 var; @@ -86,7 +84,7 @@ void Map_v2::loadMapObjects(const char *avjFile) { _tilesHeight &= 0xFF; _mapWidth = _screenWidth / _tilesWidth; - _mapHeight = 200 / _tilesHeight; + _mapHeight = _screenHeight / _tilesHeight; passPos = mapData.pos(); mapData.skip(_mapWidth * _mapHeight); @@ -96,9 +94,7 @@ void Map_v2::loadMapObjects(const char *avjFile) { else wayPointsCount = _wayPointsCount == 0 ? 1 : _wayPointsCount; - if (_wayPoints) - delete[] _wayPoints; - + delete[] _wayPoints; _wayPoints = new Point[wayPointsCount]; for (int i = 0; i < _wayPointsCount; i++) { _wayPoints[i].x = mapData.readSByte(); @@ -113,7 +109,7 @@ void Map_v2::loadMapObjects(const char *avjFile) { byte *sizes; _passMap = (int8 *) variables; - mapHeight = 200 / _tilesHeight; + mapHeight = _screenHeight / _tilesHeight; mapWidth = _screenWidth / _tilesWidth; sizes = _vm->_global->_inter_variablesSizes + (((byte *) _passMap) - _vm->_global->_inter_variables); diff --git a/engines/gob/map_v4.cpp b/engines/gob/map_v4.cpp new file mode 100644 index 0000000000..fb398ecbaf --- /dev/null +++ b/engines/gob/map_v4.cpp @@ -0,0 +1,158 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * $URL$ + * $Id$ + * + */ + +#include "common/stdafx.h" +#include "common/stream.h" + +#include "gob/gob.h" +#include "gob/map.h" +#include "gob/global.h" +#include "gob/goblin.h" +#include "gob/inter.h" +#include "gob/game.h" +#include "gob/parse.h" +#include "gob/mult.h" + +namespace Gob { + +Map_v4::Map_v4(GobEngine *vm) : Map_v2(vm) { +} + +Map_v4::~Map_v4() { +} + +void Map_v4::loadMapObjects(const char *avjFile) { + uint8 wayPointsCount; + int16 var; + int16 id; + int16 mapWidth, mapHeight; + int16 tmp; + byte *variables; + byte *extData; + uint32 tmpPos; + uint32 passPos; + + var = _vm->_parse->parseVarIndex(); + variables = _vm->_global->_inter_variables + var; + + id = _vm->_inter->load16(); + + if (((uint16) id) >= 65520) { + warning("Woodruff Stub: loadMapObjects ID >= 65520"); + return; + } else if (id == -1) { + _passMap = (int8 *)(_vm->_global->_inter_variables + var); + return; + } + + extData = _vm->_game->loadExtData(id, 0, 0); + Common::MemoryReadStream mapData(extData, 4294967295U); + + _widthByte = mapData.readByte(); + if (_widthByte == 4) { + _screenWidth = 640; + _screenHeight = 400; + } else if (_widthByte == 3) { + _screenWidth = 640; + _screenHeight = 200; + } else { + _screenWidth = 320; + _screenHeight = 200; + } + + _wayPointsCount = mapData.readByte(); + _tilesWidth = mapData.readSint16LE(); + _tilesHeight = mapData.readSint16LE(); + + _bigTiles = !(_tilesHeight & 0xFF00); + _tilesHeight &= 0xFF; + + if (_widthByte == 4) { + _screenWidth = mapData.readSint16LE(); + _screenHeight = mapData.readSint16LE(); + } + + _mapWidth = _screenWidth / _tilesWidth; + _mapHeight = _screenHeight / _tilesHeight; + + passPos = mapData.pos(); + mapData.skip(_mapWidth * _mapHeight); + + if (*extData == 1) + wayPointsCount = _wayPointsCount = 40; + else + wayPointsCount = _wayPointsCount == 0 ? 1 : _wayPointsCount; + + delete[] _wayPoints; + _wayPoints = new Point[wayPointsCount]; + for (int i = 0; i < _wayPointsCount; i++) { + _wayPoints[i].x = mapData.readSByte(); + _wayPoints[i].y = mapData.readSByte(); + _wayPoints[i].notWalkable = mapData.readSByte(); + } + + if (_widthByte == 4) + _mapWidth = (int16) READ_VARO_UINT16(68); + + _passWidth = _mapWidth; + + // In the original asm, this writes byte-wise into the variables-array + tmpPos = mapData.pos(); + mapData.seek(passPos); + if (variables != _vm->_global->_inter_variables) { + byte *sizes; + + _passMap = (int8 *) variables; + mapHeight = _screenHeight / _tilesHeight; + mapWidth = _screenWidth / _tilesWidth; + sizes = _vm->_global->_inter_variablesSizes + + (((byte *) _passMap) - _vm->_global->_inter_variables); + for (int i = 0; i < mapHeight; i++) { + for (int j = 0; j < mapWidth; j++) + setPass(j, i, mapData.readSByte()); + memset(sizes + i * _passWidth, 0, mapWidth); + } + } + mapData.seek(tmpPos); + + tmp = mapData.readSint16LE(); + mapData.skip(tmp * 14); + tmp = mapData.readSint16LE(); + mapData.skip(tmp * 14 + 28); + tmp = mapData.readSint16LE(); + mapData.skip(tmp * 14); + + _vm->_goblin->_gobsCount = tmp; + for (int i = 0; i < _vm->_goblin->_gobsCount; i++) + loadGoblinStates(mapData, i); + + _vm->_goblin->_soundSlotsCount = _vm->_inter->load16(); + for (int i = 0; i < _vm->_goblin->_soundSlotsCount; i++) + _vm->_goblin->_soundSlots[i] = _vm->_inter->loadSound(1); + + delete[] extData; +} + +} // End of namespace Gob diff --git a/engines/gob/module.mk b/engines/gob/module.mk index 7571853f27..b51de90656 100644 --- a/engines/gob/module.mk +++ b/engines/gob/module.mk @@ -33,6 +33,7 @@ MODULE_OBJS := \ map.o \ map_v1.o \ map_v2.o \ + map_v4.o \ mult.o \ mult_v1.o \ mult_v2.o \ diff --git a/engines/gob/mult_v2.cpp b/engines/gob/mult_v2.cpp index cced4aac63..ddce90df0c 100644 --- a/engines/gob/mult_v2.cpp +++ b/engines/gob/mult_v2.cpp @@ -259,8 +259,11 @@ void Mult_v2::loadImds(Common::SeekableReadStream &data) { return; size = data.readSint16LE(); - _multData->somepointer10 = new char[size * 20]; - data.read(_multData->somepointer10, size * 20); + if (size > 0) { + _multData->somepointer10 = new char[size * 20]; + data.read(_multData->somepointer10, size * 20); + } + size = _vm->_inter->load16(); if (size <= 0) return; @@ -474,12 +477,11 @@ void Mult_v2::multSub(uint16 multIndex) { } if (_multData->animDirection == -1) { - for (int i = 0; i < _multData->imdKeysCount[i]; i++) { - if (_multData->imdKeys[index][i].frame > startFrame) - break; + int i = 0; + while (_multData->imdKeys[index][i].frame <= startFrame) + i++; - _multData->imdIndices[index] = i - 1; - } + _multData->imdIndices[index] = i - 1; } firstFrame = (_multData->animDirection == 1) ? startFrame : stopFrame; @@ -1091,15 +1093,11 @@ void Mult_v2::advanceObjects(int16 index) { for (int i = 0; i < 4; i++) { int obj = _multData->animObjs[index][i]; - if (_multData->animObjs[index][i] != -1) { + if ((obj != -1) && (obj != 1024)) { int keyIndex = _multData->animKeysIndices[index][i]; int count = _multData->animKeysCount[i]; for (int j = keyIndex; j < count; j++) { - - if ((obj == -1) || (obj == 1024)) - continue; - Mult_AnimKey &key = _multData->animKeys[i][j]; Mult_Object &animObj = _objects[obj]; Mult_AnimData &animData = *(animObj.pAnimData); @@ -1161,7 +1159,7 @@ void Mult_v2::advanceObjects(int16 index) { _multData->imdIndices[1] = -1; _multData->imdIndices[2] = -1; _multData->imdIndices[3] = -1; - if ((_multData->animDirection == 1) || (key2.imdFile == 1)) + if ((_multData->animDirection == 1) || (key2.imdFile == -1)) _multData->imdIndices[i] = j; else if (_multData->animKeysStopFrames[index] == frame) _multData->imdIndices[i] = -1; @@ -1187,7 +1185,8 @@ void Mult_v2::advanceObjects(int16 index) { imdFile = _multData->imdFiles + fileN * 14; dir = _multData->animDirection; startFrame = frame - key.frame; - if ((dir != 1) && (--startFrame > 0)) + + if ((dir != 1) && (--startFrame < 0)) startFrame = 0; hasImds = true; diff --git a/engines/gob/saveload.cpp b/engines/gob/saveload.cpp index f4cb7bcf7a..ea22ede7b6 100644 --- a/engines/gob/saveload.cpp +++ b/engines/gob/saveload.cpp @@ -62,9 +62,11 @@ SaveLoad::SaveLoad(GobEngine *vm, const char *targetName) : _vm(vm) { } SaveLoad::~SaveLoad() { - for (int i = 0; i < _stagesCount; i++) - delete[] _buffer[i]; - delete[] _buffer; + if (_buffer) { + for (int i = 0; i < _stagesCount; i++) + delete[] _buffer[i]; + delete[] _buffer; + } delete _tempSprite; diff --git a/engines/gob/saveload.h b/engines/gob/saveload.h index d7e45246ad..84a6a643e9 100644 --- a/engines/gob/saveload.h +++ b/engines/gob/saveload.h @@ -130,6 +130,8 @@ protected: virtual bool saveGame(int16 dataVar, int32 size, int32 offset); virtual bool saveNotes(int16 dataVar, int32 size, int32 offset); virtual bool saveScreenshot(int16 dataVar, int32 size, int32 offset); + + void initBuffer(); }; class SaveLoad_v3 : public SaveLoad_v2 { @@ -160,6 +162,7 @@ protected: virtual bool saveScreenshot(int16 dataVar, int32 size, int32 offset); bool saveGame(int32 screenshotSize); + void initBuffer(); }; } // End of namespace Gob diff --git a/engines/gob/saveload_v2.cpp b/engines/gob/saveload_v2.cpp index 13f23cccb6..b8d8d44557 100644 --- a/engines/gob/saveload_v2.cpp +++ b/engines/gob/saveload_v2.cpp @@ -38,12 +38,6 @@ SaveLoad_v2::SaveLoad_v2(GobEngine *vm, const char *targetName) : SaveLoad(vm, targetName) { _stagesCount = 1; - - _buffer = new byte*[_stagesCount]; - - assert(_buffer); - - _buffer[0] = 0; } SaveType SaveLoad_v2::getSaveType(const char *fileName) { @@ -190,6 +184,8 @@ bool SaveLoad_v2::loadScreenshot(int16 dataVar, int32 size, int32 offset) { bool SaveLoad_v2::saveGame(int16 dataVar, int32 size, int32 offset) { int32 varSize = READ_LE_UINT32(_vm->_game->_totFileData + 0x2C) * 4; + initBuffer(); + if (size == 0) { dataVar = 0; size = varSize; @@ -289,4 +285,13 @@ bool SaveLoad_v2::saveScreenshot(int16 dataVar, int32 size, int32 offset) { return false; } +void SaveLoad_v2::initBuffer() { + if (_buffer) + return; + + _buffer = new byte*[_stagesCount]; + assert(_buffer); + _buffer[0] = 0; +} + } // End of namespace Gob diff --git a/engines/gob/saveload_v3.cpp b/engines/gob/saveload_v3.cpp index d0f791d8df..f8f69342fe 100644 --- a/engines/gob/saveload_v3.cpp +++ b/engines/gob/saveload_v3.cpp @@ -45,19 +45,6 @@ SaveLoad_v3::SaveLoad_v3(GobEngine *vm, const char *targetName, _saveSlot = -1; _stagesCount = 3; - _buffer = new byte*[_stagesCount]; - - assert(_buffer); - - _buffer[0] = new byte[1000]; - _buffer[1] = new byte[1200]; - _buffer[2] = 0; - - assert(_buffer[0] && _buffer[1]); - - memset(_buffer[0], 0, 1000); - memset(_buffer[1], 0, 1200); - _useScreenshots = false; _firstSizeGame = true; } @@ -146,6 +133,8 @@ bool SaveLoad_v3::loadGame(int16 dataVar, int32 size, int32 offset) { int slot = (offset - 1700) / varSize; int slotR = (offset - 1700) % varSize; + initBuffer(); + if ((size > 0) && (offset < 500) && ((size + offset) <= 500)) { memcpy(_vm->_global->_inter_variables + dataVar, @@ -279,6 +268,8 @@ bool SaveLoad_v3::saveGame(int16 dataVar, int32 size, int32 offset) { int slot = (offset - 1700) / varSize; int slotR = (offset - 1700) % varSize; + initBuffer(); + if ((size > 0) && (offset < 500) && ((size + offset) <= 500)) { memcpy(_buffer[0] + offset, @@ -360,6 +351,8 @@ bool SaveLoad_v3::saveGame(int32 screenshotSize) { _saveSlot = -1; + initBuffer(); + if ((slot < 0) || (slot > 29)) { warning("Can't save to slot %d: Out of range", slot); delete[] _buffer[2]; @@ -433,4 +426,22 @@ bool SaveLoad_v3::saveGame(int32 screenshotSize) { return true; } +void SaveLoad_v3::initBuffer() { + if (_buffer) + return; + + _buffer = new byte*[_stagesCount]; + + assert(_buffer); + + _buffer[0] = new byte[1000]; + _buffer[1] = new byte[1200]; + _buffer[2] = 0; + + assert(_buffer[0] && _buffer[1]); + + memset(_buffer[0], 0, 1000); + memset(_buffer[1], 0, 1200); +} + } // End of namespace Gob diff --git a/engines/gob/video.cpp b/engines/gob/video.cpp index 0dc15a8657..ffedd6d1f6 100644 --- a/engines/gob/video.cpp +++ b/engines/gob/video.cpp @@ -94,7 +94,6 @@ Video::Video(GobEngine *vm) : _vm(vm) { _splitHeight1 = 200; _splitHeight2 = 0; _splitStart = 0; - _lastRetraceLength = 0; _curSparse = 0; _lastSparse = 0xFFFFFFFF; @@ -162,8 +161,6 @@ SurfaceDesc *Video::initSurfDesc(int16 vidMode, int16 width, int16 height, } void Video::retrace(bool mouse) { - uint32 time = _vm->_util->getTimeKey(); - if (mouse) CursorMan.showMouse((_vm->_draw->_showCursor & 2) != 0); if (_vm->_global->_primarySurfDesc) { @@ -176,13 +173,12 @@ void Video::retrace(bool mouse) { _vm->_height - _splitHeight2, _vm->_width, _splitHeight2); g_system->updateScreen(); } - - _lastRetraceLength = _vm->_util->getTimeKey() - time; } void Video::waitRetrace(bool mouse) { + uint32 time = _vm->_util->getTimeKey(); retrace(mouse); - _vm->_util->delay(MAX(1, 10 - (int) _lastRetraceLength)); + _vm->_util->delay(MAX(1, 10 - (int)(_vm->_util->getTimeKey() - time))); } void Video::sparseRetrace(int max) { diff --git a/engines/gob/video.h b/engines/gob/video.h index dc23bda81e..51d02bd219 100644 --- a/engines/gob/video.h +++ b/engines/gob/video.h @@ -104,7 +104,6 @@ public: int16 _splitHeight1; int16 _splitHeight2; int16 _splitStart; - uint32 _lastRetraceLength; void freeDriver(); void initPrimary(int16 mode); diff --git a/engines/gob/videoplayer.cpp b/engines/gob/videoplayer.cpp index e72354a169..5d31c31b7b 100644 --- a/engines/gob/videoplayer.cpp +++ b/engines/gob/videoplayer.cpp @@ -53,7 +53,13 @@ bool VideoPlayer::openVideo(const char *video, int16 x, int16 y, int16 flags, Ty strncpy0(fileName, video, 250); - char *extStart = strchr(fileName, '.'); + char *extStart = strrchr(fileName, '.'); + // There's no empty extension + if (extStart == (fileName + strlen(fileName) - 1)) { + *extStart = 0; + extStart = 0; + } + if (extStart) { // The requested file already has an extension. Verifying. @@ -132,7 +138,7 @@ bool VideoPlayer::openVideo(const char *video, int16 x, int16 y, int16 flags, Ty return false; } - _video->setXY(x, y); + strcpy(_curFile, fileName); if (!(flags & kFlagNoVideo)) { _backSurf = ((flags & kFlagFrontSurface) == 0); @@ -147,6 +153,7 @@ bool VideoPlayer::openVideo(const char *video, int16 x, int16 y, int16 flags, Ty if (!_video) return false; + _video->setXY(x, y); WRITE_VAR(7, _video->getFramesCount()); return true; @@ -170,8 +177,12 @@ void VideoPlayer::play(int16 startFrame, int16 lastFrame, int16 breakKey, endFrame = lastFrame; palCmd &= 0x3F; - if (_video->getCurrentFrame() != startFrame) - _video->seekFrame(startFrame); + if (_video->getCurrentFrame() != startFrame) { + if (_video->getFeatures() & CoktelVideo::kFeaturesSound) + startFrame = _video->getCurrentFrame(); + else + _video->seekFrame(startFrame); + } _vm->_draw->_showCursor = 0; _vm->_util->setFrameRate(12); @@ -328,6 +339,7 @@ void VideoPlayer::closeVideo() { _video = 0; _stream = 0; + *_curFile = 0; } } // End of namespace Gob diff --git a/engines/kyra/detection.cpp b/engines/kyra/detection.cpp index 02b505b177..58622b3514 100644 --- a/engines/kyra/detection.cpp +++ b/engines/kyra/detection.cpp @@ -18,8 +18,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL:https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/branches/gsoc2007-fsnode/engines/kyra/detection.cpp $ - * $Id:detection.cpp 26949 2007-05-26 20:23:24Z david_corrales $ + * $URL$ + * $Id$ */ #include "kyra/kyra.h" @@ -55,37 +55,315 @@ namespace { #define KYRA3_CD_FLAGS FLAGS(false, false, true, false, Kyra::GI_KYRA3) const KYRAGameDescription adGameDescs[] = { - { { "kyra1", 0, AD_ENTRY1("GEMCUT.EMC", "3c244298395520bb62b5edfe41688879"), Common::EN_ANY, Common::kPlatformPC, Common::ADGF_NO_FLAGS }, KYRA1_FLOPPY_FLAGS }, - { { "kyra1", 0, AD_ENTRY1("GEMCUT.EMC", "796e44863dd22fa635b042df1bf16673"), Common::EN_ANY, Common::kPlatformPC, Common::ADGF_NO_FLAGS }, KYRA1_FLOPPY_FLAGS }, - { { "kyra1", 0, AD_ENTRY1("GEMCUT.EMC", "abf8eb360e79a6c2a837751fbd4d3d24"), Common::FR_FRA, Common::kPlatformPC, Common::ADGF_NO_FLAGS }, KYRA1_FLOPPY_FLAGS }, - { { "kyra1", 0, AD_ENTRY1("GEMCUT.EMC", "6018e1dfeaca7fe83f8d0b00eb0dd049"), Common::DE_DEU, Common::kPlatformPC, Common::ADGF_NO_FLAGS }, KYRA1_FLOPPY_FLAGS }, - { { "kyra1", 0, AD_ENTRY1("GEMCUT.EMC", "f0b276781f47c130f423ec9679fe9ed9"), Common::DE_DEU, Common::kPlatformPC, Common::ADGF_NO_FLAGS }, KYRA1_FLOPPY_FLAGS }, // from Arne.F - { { "kyra1", 0, AD_ENTRY1("GEMCUT.EMC", "8909b41596913b3f5deaf3c9f1017b01"), Common::ES_ESP, Common::kPlatformPC, Common::ADGF_NO_FLAGS }, KYRA1_FLOPPY_FLAGS }, // from VooD - { { "kyra1", 0, AD_ENTRY1("GEMCUT.EMC", "747861d2a9c643c59fdab570df5b9093"), Common::ES_ESP, Common::kPlatformPC, Common::ADGF_NO_FLAGS }, KYRA1_FLOPPY_FLAGS }, // floppy 1.8 from clemmy - { { "kyra1", 0, AD_ENTRY1("GEMCUT.EMC", "ef08c8c237ee1473fd52578303fc36df"), Common::IT_ITA, Common::kPlatformPC, Common::ADGF_NO_FLAGS }, KYRA1_FLOPPY_FLAGS }, // from gourry + { + { + "kyra1", + 0, + AD_ENTRY1("GEMCUT.EMC", "3c244298395520bb62b5edfe41688879"), + Common::EN_ANY, + Common::kPlatformPC, + Common::ADGF_NO_FLAGS + }, + KYRA1_FLOPPY_FLAGS + }, + { + { + "kyra1", + 0, + AD_ENTRY1("GEMCUT.EMC", "796e44863dd22fa635b042df1bf16673"), + Common::EN_ANY, + Common::kPlatformPC, + Common::ADGF_NO_FLAGS + }, + KYRA1_FLOPPY_FLAGS + }, + { + { + "kyra1", + 0, + AD_ENTRY1("GEMCUT.EMC", "abf8eb360e79a6c2a837751fbd4d3d24"), + Common::FR_FRA, + Common::kPlatformPC, + Common::ADGF_NO_FLAGS + }, + KYRA1_FLOPPY_FLAGS + }, + { + { + "kyra1", + 0, + AD_ENTRY1("GEMCUT.EMC", "6018e1dfeaca7fe83f8d0b00eb0dd049"), + Common::DE_DEU, + Common::kPlatformPC, + Common::ADGF_NO_FLAGS + }, + KYRA1_FLOPPY_FLAGS + }, + { // from Arne.F + { + "kyra1", + 0, + AD_ENTRY1("GEMCUT.EMC", "f0b276781f47c130f423ec9679fe9ed9"), + Common::DE_DEU, + Common::kPlatformPC, + Common::ADGF_NO_FLAGS + }, + KYRA1_FLOPPY_FLAGS + }, + { // from VooD + { + "kyra1", + 0, + AD_ENTRY1("GEMCUT.EMC", "8909b41596913b3f5deaf3c9f1017b01"), + Common::ES_ESP, + Common::kPlatformPC, + Common::ADGF_NO_FLAGS + }, + KYRA1_FLOPPY_FLAGS + }, + { // floppy 1.8 from clemmy + { + "kyra1", + 0, + AD_ENTRY1("GEMCUT.EMC", "747861d2a9c643c59fdab570df5b9093"), + Common::ES_ESP, + Common::kPlatformPC, + Common::ADGF_NO_FLAGS + }, + KYRA1_FLOPPY_FLAGS + }, + { // from gourry + { + "kyra1", + 0, + AD_ENTRY1("GEMCUT.EMC", "ef08c8c237ee1473fd52578303fc36df"), + Common::IT_ITA, + Common::kPlatformPC, + Common::ADGF_NO_FLAGS + }, + KYRA1_FLOPPY_FLAGS + }, + + { + { + "kyra1", + 0, + AD_ENTRY1("GEMCUT.PAK", "2bd1da653eaefd691e050e4a9eb68a64"), + Common::EN_ANY, + Common::kPlatformAmiga, + Common::ADGF_NO_FLAGS + }, + KYRA1_AMIGA_FLAGS + }, + + { + { + "kyra1", + 0, + { + { "GEMCUT.EMC", 0, "796e44863dd22fa635b042df1bf16673", -1 }, + { "BEAD.CPS", 0, "3038466f65b7751451844707187aa401", -1 }, + { NULL, 0, NULL, 0 } + }, + Common::EN_ANY, + Common::kPlatformMacintosh, + Common::ADGF_NO_FLAGS + }, + KYRA1_FLOPPY_FLAGS + }, + + { // FM-Towns version + { + "kyra1", + 0, + AD_ENTRY1("TWMUSIC.PAK", "e53bca3a3e3fb49107d59463ec387a59"), + Common::EN_ANY, + Common::kPlatformFMTowns, + Common::ADGF_NO_FLAGS + }, + KYRA1_TOWNS_FLAGS + }, + { + { + "kyra1", + 0, + AD_ENTRY1("TWMUSIC.PAK", "e53bca3a3e3fb49107d59463ec387a59"), + Common::JA_JPN, + Common::kPlatformFMTowns, + Common::ADGF_NO_FLAGS + }, + KYRA1_TOWNS_SJIS_FLAGS + }, + + { // PC-9821 version + { + "kyra1", + 0, + { + { "EMC.PAK", 0, "a046bb0b422061aab8e4c4689400343a", -1 }, + { "MUSIC98.PAK", 0, "02fc212f799331b769b274e33d87b37f", -1 }, + { NULL, 0, NULL, 0 } + }, + Common::EN_ANY, + Common::kPlatformPC98, + Common::ADGF_NO_FLAGS + }, + KYRA1_TOWNS_FLAGS + }, + { + { + "kyra1", + 0, + { + { "JMC.PAK", 0, "9c5707a2a478e8167e44283246612d2c", -1 }, + { "MUSIC98.PAK", 0, "02fc212f799331b769b274e33d87b37f", -1 }, + { NULL, 0, NULL, 0 } + }, + Common::JA_JPN, + Common::kPlatformPC98, + Common::ADGF_NO_FLAGS + }, + KYRA1_TOWNS_SJIS_FLAGS + }, + + { + { + "kyra1", + "CD", + AD_ENTRY1("GEMCUT.PAK", "fac399fe62f98671e56a005c5e94e39f"), + Common::EN_ANY, + Common::kPlatformPC, + Common::ADGF_NO_FLAGS + }, + KYRA1_CD_FLAGS + }, + { + { + "kyra1", + "CD", + AD_ENTRY1("GEMCUT.PAK", "230f54e6afc007ab4117159181a1c722"), + Common::DE_DEU, + Common::kPlatformPC, + Common::ADGF_NO_FLAGS + }, + KYRA1_CD_FLAGS + }, + { + { + "kyra1", + "CD", + AD_ENTRY1("GEMCUT.PAK", "b037c41768b652a040360ffa3556fd2a"), + Common::FR_FRA, + Common::kPlatformPC, + Common::ADGF_NO_FLAGS + }, + KYRA1_CD_FLAGS + }, + + { // italian fan translation see fr#1727941 "KYRA: add Italian CD Version to kyra.dat" + { + "kyra1", + "CD", + AD_ENTRY1("GEMCUT.PAK", "d8327fc4b7a72b23c900fa13aef4093a"), + Common::IT_ITA, + Common::kPlatformPC, + Common::ADGF_NO_FLAGS + }, + KYRA1_CD_FLAGS + }, + + { + { + "kyra1", + "Demo", + AD_ENTRY1("DEMO1.WSA", "fb722947d94897512b13b50cc84fd648"), + Common::EN_ANY, + Common::kPlatformPC, + Common::ADGF_DEMO + }, + KYRA1_DEMO_FLAGS + }, + + { // CD version + { + "kyra2", + 0, + AD_ENTRY1("FATE.PAK", "28cbad1c5bf06b2d3825ae57d760d032"), + Common::EN_ANY, + Common::kPlatformPC, + Common::ADGF_NO_FLAGS + }, + KYRA2_CD_FLAGS + }, + { // CD version + { + "kyra2", + 0, + AD_ENTRY1("FATE.PAK", "28cbad1c5bf06b2d3825ae57d760d032"), + Common::DE_DEU, + Common::kPlatformPC, + Common::ADGF_NO_FLAGS + }, + KYRA2_CD_FLAGS + }, + { // CD version + { + "kyra2", + 0, + AD_ENTRY1("FATE.PAK", "28cbad1c5bf06b2d3825ae57d760d032"), + Common::FR_FRA, + Common::kPlatformPC, + Common::ADGF_NO_FLAGS + }, + KYRA2_CD_FLAGS + }, + + { + { + "kyra2", + "Demo", + AD_ENTRY1("GENERAL.PAK", "35825783e5b60755fd520360079f9c15"), + Common::EN_ANY, + Common::kPlatformPC, + Common::ADGF_DEMO + }, + KYRA2_DEMO_FLAGS + }, + + { + { + "kyra3", + 0, + AD_ENTRY1("ONETIME.PAK", "3833ff312757b8e6147f464cca0a6587"), + Common::EN_ANY, + Common::kPlatformPC, + Common::ADGF_NO_FLAGS + }, + KYRA3_CD_FLAGS + }, + { + { + "kyra3", + 0, + AD_ENTRY1("ONETIME.PAK", "3833ff312757b8e6147f464cca0a6587"), + Common::DE_DEU, + Common::kPlatformPC, + Common::ADGF_NO_FLAGS + }, + KYRA3_CD_FLAGS + }, + { + { + "kyra3", + 0, + AD_ENTRY1("ONETIME.PAK", "3833ff312757b8e6147f464cca0a6587"), + Common::FR_FRA, + Common::kPlatformPC, + Common::ADGF_NO_FLAGS + }, + KYRA3_CD_FLAGS + }, - { { "kyra1", 0, AD_ENTRY1("GEMCUT.PAK", "2bd1da653eaefd691e050e4a9eb68a64"), Common::EN_ANY, Common::kPlatformAmiga, Common::ADGF_NO_FLAGS }, KYRA1_AMIGA_FLAGS }, - - { { "kyra1", 0, AD_ENTRY1("TWMUSIC.PAK", "e53bca3a3e3fb49107d59463ec387a59"), Common::EN_ANY, Common::kPlatformFMTowns, Common::ADGF_NO_FLAGS }, KYRA1_TOWNS_FLAGS }, - { { "kyra1", 0, AD_ENTRY1("TWMUSIC.PAK", "e53bca3a3e3fb49107d59463ec387a59"), Common::JA_JPN, Common::kPlatformFMTowns, Common::ADGF_NO_FLAGS }, KYRA1_TOWNS_SJIS_FLAGS }, - - { { "kyra1", "CD", AD_ENTRY1("GEMCUT.PAK", "fac399fe62f98671e56a005c5e94e39f"), Common::EN_ANY, Common::kPlatformPC, Common::ADGF_NO_FLAGS }, KYRA1_CD_FLAGS }, - { { "kyra1", "CD", AD_ENTRY1("GEMCUT.PAK", "230f54e6afc007ab4117159181a1c722"), Common::DE_DEU, Common::kPlatformPC, Common::ADGF_NO_FLAGS }, KYRA1_CD_FLAGS }, - { { "kyra1", "CD", AD_ENTRY1("GEMCUT.PAK", "b037c41768b652a040360ffa3556fd2a"), Common::FR_FRA, Common::kPlatformPC, Common::ADGF_NO_FLAGS }, KYRA1_CD_FLAGS }, - - { { "kyra1", "CD", AD_ENTRY1("GEMCUT.PAK", "d8327fc4b7a72b23c900fa13aef4093a"), Common::IT_ITA, Common::kPlatformPC, Common::ADGF_NO_FLAGS }, KYRA1_CD_FLAGS }, // italian fan translation see fr#1727941 "KYRA: add Italian CD Version to kyra.dat" - - { { "kyra1", "Demo", AD_ENTRY1("DEMO1.WSA", "fb722947d94897512b13b50cc84fd648"), Common::EN_ANY, Common::kPlatformPC, Common::ADGF_DEMO }, KYRA1_DEMO_FLAGS }, - - { { "kyra2", 0, AD_ENTRY1("FATE.PAK", "28cbad1c5bf06b2d3825ae57d760d032"), Common::EN_ANY, Common::kPlatformPC, Common::ADGF_NO_FLAGS }, KYRA2_CD_FLAGS }, // CD version - { { "kyra2", 0, AD_ENTRY1("FATE.PAK", "28cbad1c5bf06b2d3825ae57d760d032"), Common::DE_DEU, Common::kPlatformPC, Common::ADGF_NO_FLAGS }, KYRA2_CD_FLAGS }, // CD version - { { "kyra2", 0, AD_ENTRY1("FATE.PAK", "28cbad1c5bf06b2d3825ae57d760d032"), Common::FR_FRA, Common::kPlatformPC, Common::ADGF_NO_FLAGS }, KYRA2_CD_FLAGS }, // CD version - - { { "kyra2", "Demo", AD_ENTRY1("GENERAL.PAK", "35825783e5b60755fd520360079f9c15"), Common::EN_ANY, Common::kPlatformPC, Common::ADGF_DEMO }, KYRA2_DEMO_FLAGS }, - - { { "kyra3", 0, AD_ENTRY1("ONETIME.PAK", "3833ff312757b8e6147f464cca0a6587"), Common::EN_ANY, Common::kPlatformPC, Common::ADGF_NO_FLAGS }, KYRA3_CD_FLAGS }, - { { "kyra3", 0, AD_ENTRY1("ONETIME.PAK", "3833ff312757b8e6147f464cca0a6587"), Common::DE_DEU, Common::kPlatformPC, Common::ADGF_NO_FLAGS }, KYRA3_CD_FLAGS }, - { { "kyra3", 0, AD_ENTRY1("ONETIME.PAK", "3833ff312757b8e6147f464cca0a6587"), Common::FR_FRA, Common::kPlatformPC, Common::ADGF_NO_FLAGS }, KYRA3_CD_FLAGS }, { AD_TABLE_END_MARKER, FLAGS(0, 0, 0, 0, 0) } }; @@ -119,29 +397,9 @@ const Common::ADParams detectionParams = { } // End of anonymous namespace -GameList Engine_KYRA_gameIDList() { - return GameList(gameList); -} - -GameDescriptor Engine_KYRA_findGameID(const char *gameid) { - return Common::AdvancedDetector::findGameID(gameid, gameList); -} - -GameList Engine_KYRA_detectGames(const FSList &fslist) { - return Common::AdvancedDetector::detectAllGames(fslist, detectionParams); -} - -PluginError Engine_KYRA_create(OSystem *syst, Engine **engine) { - assert(engine); - const char *gameid = ConfMan.get("gameid").c_str(); - - Common::EncapsulatedADGameDesc encapsulatedDesc = Common::AdvancedDetector::detectBestMatchingGame(detectionParams); +bool engineCreateKyra(OSystem *syst, Engine **engine, Common::EncapsulatedADGameDesc encapsulatedDesc) { const KYRAGameDescription *gd = (const KYRAGameDescription *)(encapsulatedDesc.realDesc); - - if (gd == 0) { - // maybe add non md5 based detection again? - return kNoGameDataFoundError; - } + bool res = true; Kyra::GameFlags flags = gd->flags; @@ -160,17 +418,25 @@ PluginError Engine_KYRA_create(OSystem *syst, Engine **engine) { flags.lang = Common::EN_ANY; } - if (!scumm_stricmp("kyra1", gameid)) { + switch (flags.gameID) { + case Kyra::GI_KYRA1: *engine = new Kyra::KyraEngine_v1(syst, flags); - } else if (!scumm_stricmp("kyra2", gameid)) { + break; + case Kyra::GI_KYRA2: *engine = new Kyra::KyraEngine_v2(syst, flags); - } else if (!scumm_stricmp("kyra3", gameid)) { + break; + case Kyra::GI_KYRA3: *engine = new Kyra::KyraEngine_v3(syst, flags); - } else - error("Kyra engine created with invalid gameid ('%s')", gameid); + break; + default: + res = false; + error("Kyra engine: unknown gameID"); + } - return kNoError; + return res; } +ADVANCED_DETECTOR_DEFINE_PLUGIN_WITH_COMPLEX_CREATION(KYRA, engineCreateKyra, detectionParams); + REGISTER_PLUGIN(KYRA, "Legend of Kyrandia Engine", "The Legend of Kyrandia (C) Westwood Studios"); diff --git a/engines/kyra/gui_v1.cpp b/engines/kyra/gui_v1.cpp index b7692cc97d..0d9d8224cd 100644 --- a/engines/kyra/gui_v1.cpp +++ b/engines/kyra/gui_v1.cpp @@ -41,7 +41,7 @@ void KyraEngine_v1::registerDefaultSettings() { // Most settings already have sensible defaults. This one, however, is // specific to the Kyra engine. ConfMan.registerDefault("walkspeed", 2); - ConfMan.registerDefault("cdaudio", _flags.platform == Common::kPlatformFMTowns); + ConfMan.registerDefault("cdaudio", (_flags.platform == Common::kPlatformFMTowns || _flags.platform == Common::kPlatformPC98)); } void KyraEngine_v1::readSettings() { @@ -59,7 +59,7 @@ void KyraEngine_v1::readSettings() { _configTextspeed = 2; // Fast _configWalkspeed = ConfMan.getInt("walkspeed"); - _configMusic = ConfMan.getBool("music_mute") ? 0 : ((ConfMan.getBool("cdaudio") && _flags.platform == Common::kPlatformFMTowns) ? 2 : 1); + _configMusic = ConfMan.getBool("music_mute") ? 0 : ((ConfMan.getBool("cdaudio") && (_flags.platform == Common::kPlatformFMTowns || _flags.platform == Common::kPlatformPC98)) ? 2 : 1); _configSounds = ConfMan.getBool("sfx_mute") ? 0 : 1; _sound->enableMusic(_configMusic); @@ -494,7 +494,7 @@ void KyraEngine_v1::setGUILabels() { menuLabelGarbageOffset = 72; } else if (_flags.lang == Common::DE_DEU) { offset = offsetMainMenu = offsetOn = offsetOptions = 24; - } else if (_flags.platform == Common::kPlatformFMTowns) { + } else if (_flags.platform == Common::kPlatformFMTowns || _flags.platform == Common::kPlatformPC98) { offset = 1; offsetOptions = 10; offsetOn = 0; @@ -1303,7 +1303,7 @@ int KyraEngine_v1::gui_controlsChangeMusic(Button *button) { debugC(9, kDebugLevelGUI, "KyraEngine_v1::gui_controlsChangeMusic()"); processMenuButton(button); - _configMusic = ++_configMusic % (_flags.platform == Common::kPlatformFMTowns ? 3 : 2); + _configMusic = ++_configMusic % ((_flags.platform == Common::kPlatformFMTowns || _flags.platform == Common::kPlatformPC98) ? 3 : 2); gui_setupControls(_menu[5]); return 0; } diff --git a/engines/kyra/kyra.cpp b/engines/kyra/kyra.cpp index 1d8d7440f0..0c2524327e 100644 --- a/engines/kyra/kyra.cpp +++ b/engines/kyra/kyra.cpp @@ -86,8 +86,13 @@ int KyraEngine::init() { int midiDriver = MidiDriver::detectMusicDriver(MDT_MIDI | MDT_ADLIB/* | MDT_PREFER_MIDI*/); if (_flags.platform == Common::kPlatformFMTowns) { - // no sfx enabled for CD audio music atm - // later on here should be a usage of MixedSoundDriver + // TODO: later on here should be a usage of MixedSoundDriver + _sound = new SoundTowns(this, _mixer); + } else if (_flags.platform == Common::kPlatformPC98) { + // TODO: currently we don't support the PC98 sound data, + // but since it has the FM-Towns data files, we just use the + // FM-Towns driver + // TODO: later on here should be a usage of MixedSoundDriver _sound = new SoundTowns(this, _mixer); } else if (midiDriver == MD_ADLIB) { _sound = new SoundAdlibPC(this, _mixer); diff --git a/engines/kyra/kyra_v1.cpp b/engines/kyra/kyra_v1.cpp index 3c6e257376..c994325ca9 100644 --- a/engines/kyra/kyra_v1.cpp +++ b/engines/kyra/kyra_v1.cpp @@ -18,8 +18,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL:https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/branches/gsoc2007-fsnode/engines/kyra/kyra_v1.cpp $ - * $Id:kyra_v1.cpp 26949 2007-05-26 20:23:24Z david_corrales $ + * $URL$ + * $Id$ * */ @@ -180,7 +180,7 @@ int KyraEngine_v1::init() { initStaticResource(); - if (_flags.platform == Common::kPlatformFMTowns) + if (_flags.platform == Common::kPlatformFMTowns || _flags.platform == Common::kPlatformPC98) _sound->setSoundFileList(_soundFilesTowns, _soundFilesTownsCount); else _sound->setSoundFileList(_soundFiles, _soundFilesCount); diff --git a/engines/kyra/kyra_v1.h b/engines/kyra/kyra_v1.h index 8c9437b6fe..6e5ba98d3c 100644 --- a/engines/kyra/kyra_v1.h +++ b/engines/kyra/kyra_v1.h @@ -18,8 +18,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL:https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/branches/gsoc2007-fsnode/engines/kyra/kyra_v1.h $ - * $Id:kyra_v1.h 26949 2007-05-26 20:23:24Z david_corrales $ + * $URL$ + * $Id$ * */ diff --git a/engines/kyra/kyra_v2.cpp b/engines/kyra/kyra_v2.cpp index 317fd218b2..e27f31b691 100644 --- a/engines/kyra/kyra_v2.cpp +++ b/engines/kyra/kyra_v2.cpp @@ -18,8 +18,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL:https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/branches/gsoc2007-fsnode/engines/kyra/kyra_v2.cpp $ - * $Id:kyra_v2.cpp 26949 2007-05-26 20:23:24Z david_corrales $ + * $URL$ + * $Id$ * */ diff --git a/engines/kyra/kyra_v2.h b/engines/kyra/kyra_v2.h index c87eeb66d4..fb8fd2c454 100644 --- a/engines/kyra/kyra_v2.h +++ b/engines/kyra/kyra_v2.h @@ -18,8 +18,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL:https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/branches/gsoc2007-fsnode/engines/kyra/kyra_v2.h $ - * $Id:kyra_v2.h 26949 2007-05-26 20:23:24Z david_corrales $ + * $URL$ + * $Id$ * */ diff --git a/engines/kyra/kyra_v3.cpp b/engines/kyra/kyra_v3.cpp index 32754ecf2f..9aa4b1f4da 100644 --- a/engines/kyra/kyra_v3.cpp +++ b/engines/kyra/kyra_v3.cpp @@ -18,8 +18,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL:https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/branches/gsoc2007-fsnode/engines/kyra/kyra_v3.cpp $ - * $Id:kyra_v3.cpp 26949 2007-05-26 20:23:24Z david_corrales $ + * $URL$ + * $Id$ * */ diff --git a/engines/kyra/kyra_v3.h b/engines/kyra/kyra_v3.h index f9b81b5126..79c48b0dcb 100644 --- a/engines/kyra/kyra_v3.h +++ b/engines/kyra/kyra_v3.h @@ -18,8 +18,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL:https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/branches/gsoc2007-fsnode/engines/kyra/kyra_v3.h $ - * $Id:kyra_v3.h 26949 2007-05-26 20:23:24Z david_corrales $ + * $URL$ + * $Id$ * */ diff --git a/engines/kyra/resource.cpp b/engines/kyra/resource.cpp index cb484b6183..32c090dc57 100644 --- a/engines/kyra/resource.cpp +++ b/engines/kyra/resource.cpp @@ -109,7 +109,7 @@ Resource::Resource(KyraEngine *vm) { } } - if (_vm->gameFlags().platform == Common::kPlatformFMTowns) { + if (_vm->gameFlags().platform == Common::kPlatformFMTowns || _vm->gameFlags().platform == Common::kPlatformPC98) { uint unloadHash = (_vm->gameFlags().lang == Common::EN_ANY) ? Common::hashit_lower("JMC.PAK") : Common::hashit_lower("EMC.PAK"); ResIterator file = Common::find_if(_pakfiles.begin(), _pakfiles.end(), ResFilenameEqual(unloadHash)); diff --git a/engines/kyra/saveload_v1.cpp b/engines/kyra/saveload_v1.cpp index c2ceee1d3b..e9001968e9 100644 --- a/engines/kyra/saveload_v1.cpp +++ b/engines/kyra/saveload_v1.cpp @@ -84,8 +84,8 @@ void KyraEngine_v1::loadGame(const char *fileName) { warning("Can not load cdrom savefile for this (non cdrom) gameversion"); delete in; return; - } else if ((flags & GF_FMTOWNS) && !(_flags.platform == Common::kPlatformFMTowns)) { - warning("can not load FM-Towns savefile for this (non FM-Towns) gameversion"); + } else if ((flags & GF_FMTOWNS) && !(_flags.platform == Common::kPlatformFMTowns || _flags.platform == Common::kPlatformPC98)) { + warning("can not load FM-Towns/PC98 savefile for this (non FM-Towns/PC98) gameversion"); delete in; return; } @@ -206,7 +206,7 @@ void KyraEngine_v1::loadGame(const char *fileName) { if (_curSfxFile >= _soundFilesTownsCount || _curSfxFile < 0) _curSfxFile = 0; - if (_flags.platform == Common::kPlatformFMTowns) + if (_flags.platform == Common::kPlatformFMTowns || _flags.platform == Common::kPlatformPC98) _sound->loadSoundFile(_curSfxFile); } @@ -276,7 +276,7 @@ void KyraEngine_v1::saveGame(const char *fileName, const char *saveName) { out->write(saveName, 31); if (_flags.isTalkie) out->writeUint32BE(GF_TALKIE); - else if (_flags.platform == Common::kPlatformFMTowns) + else if (_flags.platform == Common::kPlatformFMTowns || _flags.platform == Common::kPlatformPC98) out->writeUint32BE(GF_FMTOWNS); else out->writeUint32BE(GF_FLOPPY); diff --git a/engines/kyra/scene.cpp b/engines/kyra/scene.cpp index bf85ab1474..22cf2e0f2b 100644 --- a/engines/kyra/scene.cpp +++ b/engines/kyra/scene.cpp @@ -65,11 +65,11 @@ int KyraEngine::findWay(int x, int y, int toX, int toY, int *moveTable, int move return 0x7D00; } // debug drawing - //if (curX >= 0 && curY >= 0 && curX < 320 && curY < 200) { - // _screen->setPagePixel(0, curX, curY, 11); - // _screen->updateScreen(); - // waitTicks(5); - //} + /*if (curX >= 0 && curY >= 0 && curX < 320 && curY < 200) { + screen()->setPagePixel(0, curX, curY, 11); + screen()->updateScreen(); + //waitTicks(5); + }*/ moveTable[lastUsedEntry++] = newFacing; x = curX; y = curY; @@ -81,11 +81,11 @@ int KyraEngine::findWay(int x, int y, int toX, int toY, int *moveTable, int move newFacing = getFacingFromPointToPoint(curX, curY, toX, toY); changePosTowardsFacing(curX, curY, newFacing); // debug drawing - //if (curX >= 0 && curY >= 0 && curX < 320 && curY < 200) { - // _screen->setPagePixel(0, curX, curY, 8); - // _screen->updateScreen(); - // waitTicks(5); - //} + /*if (curX >= 0 && curY >= 0 && curX < 320 && curY < 200) { + screen()->setPagePixel(0, curX, curY, 8); + screen()->updateScreen(); + //waitTicks(5); + }*/ if (!lineIsPassable(curX, curY)) { if (curX != toX || curY != toY) diff --git a/engines/kyra/scene_v1.cpp b/engines/kyra/scene_v1.cpp index 3754d5e2ab..af7ee89fec 100644 --- a/engines/kyra/scene_v1.cpp +++ b/engines/kyra/scene_v1.cpp @@ -48,7 +48,7 @@ void KyraEngine_v1::enterNewScene(int sceneId, int facing, int unk1, int unk2, i _abortWalkFlag = false; _abortWalkFlag2 = false; - if (_flags.platform == Common::kPlatformFMTowns) { + if (_flags.platform == Common::kPlatformFMTowns || _flags.platform == Common::kPlatformPC98) { int newSfxFile = -1; if (_currentCharacter->sceneId == 7 && sceneId == 24) newSfxFile = 2; @@ -1166,7 +1166,9 @@ void KyraEngine_v1::setCharactersPositions(int character) { int KyraEngine_v1::findWay(int x, int y, int toX, int toY, int *moveTable, int moveTableSize) { debugC(9, kDebugLevelMain, "KyraEngine_v1::findWay(%d, %d, %d, %d, %p, %d)", x, y, toX, toY, (const void *)moveTable, moveTableSize); - KyraEngine::findWay(x, y, toX, toY, moveTable, moveTableSize); + int ret = KyraEngine::findWay(x, y, toX, toY, moveTable, moveTableSize); + if (ret == 0x7D00) + return 0; return getMoveTableSize(moveTable); } diff --git a/engines/kyra/script.cpp b/engines/kyra/script.cpp index 5966fa2c25..0778e1abd6 100644 --- a/engines/kyra/script.cpp +++ b/engines/kyra/script.cpp @@ -167,7 +167,7 @@ bool ScriptHelper::startScript(ScriptState *script, int function) { return false; if (_vm->game() == GI_KYRA1) { - if (_vm->gameFlags().platform == Common::kPlatformFMTowns) + if (_vm->gameFlags().platform == Common::kPlatformFMTowns || _vm->gameFlags().platform == Common::kPlatformPC98) script->ip = &script->dataPtr->data[functionOffset+1]; else script->ip = &script->dataPtr->data[functionOffset]; diff --git a/engines/kyra/script_v1.cpp b/engines/kyra/script_v1.cpp index bd776e2046..7a4f844400 100644 --- a/engines/kyra/script_v1.cpp +++ b/engines/kyra/script_v1.cpp @@ -52,7 +52,7 @@ int KyraEngine_v1::o1_characterSays(ScriptState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1characterSays(%p) ('%s', %d, %d)", (const void *)script, stackPosString(0), stackPos(1), stackPos(2)); const char *string = stackPosString(0); - if (_flags.platform == Common::kPlatformFMTowns && _flags.lang == Common::JA_JPN) { + if ((_flags.platform == Common::kPlatformFMTowns || _flags.platform == Common::kPlatformPC98) && _flags.lang == Common::JA_JPN) { static const uint8 townsString1[] = { 0x83, 0x75, 0x83, 0x89, 0x83, 0x93, 0x83, 0x83, 0x93, 0x81, 0x41, 0x82, 0xDC, 0x82, 0xBD, 0x97, 0x88, 0x82, 0xBD, 0x82, diff --git a/engines/kyra/seqplayer.cpp b/engines/kyra/seqplayer.cpp index 20a98c66c1..2136c2830d 100644 --- a/engines/kyra/seqplayer.cpp +++ b/engines/kyra/seqplayer.cpp @@ -435,7 +435,7 @@ void SeqPlayer::s1_playTrack() { _sound->beginFadeOut(); } else { _sound->haltTrack(); - if (_vm->gameFlags().platform == Common::kPlatformFMTowns) + if (_vm->gameFlags().platform == Common::kPlatformFMTowns || _vm->gameFlags().platform == Common::kPlatformPC98) msg += 2; _sound->playTrack(msg); } diff --git a/engines/kyra/sequences_v1.cpp b/engines/kyra/sequences_v1.cpp index 3bba3406a8..00aac6cfb4 100644 --- a/engines/kyra/sequences_v1.cpp +++ b/engines/kyra/sequences_v1.cpp @@ -113,7 +113,7 @@ void KyraEngine_v1::seq_intro() { _seq->setCopyViewOffs(true); _screen->setFont(Screen::FID_8_FNT); - if (_flags.platform != Common::kPlatformFMTowns) + if (_flags.platform != Common::kPlatformFMTowns && _flags.platform != Common::kPlatformPC98) snd_playTheme(0, 2); _text->setTalkCoords(144); @@ -133,7 +133,7 @@ void KyraEngine_v1::seq_intro() { void KyraEngine_v1::seq_introLogos() { debugC(9, kDebugLevelMain, "KyraEngine_v1::seq_introLogos()"); - if (_flags.platform == Common::kPlatformFMTowns) { + if (_flags.platform == Common::kPlatformFMTowns || _flags.platform == Common::kPlatformPC98) { _screen->loadBitmap("LOGO.CPS", 3, 3, _screen->_currentPalette); _screen->copyRegion(0, 0, 0, 0, 320, 200, 2, 0); _screen->updateScreen(); @@ -1083,13 +1083,13 @@ void KyraEngine_v1::seq_playCredits() { _screen->_charWidth = -1; // we only need this for the fm-towns version - if (_flags.platform == Common::kPlatformFMTowns) + if (_flags.platform == Common::kPlatformFMTowns || _flags.platform == Common::kPlatformPC98) snd_playWanderScoreViaMap(53, 1); uint8 *buffer = 0; uint32 size = 0; - if (_flags.platform == Common::kPlatformFMTowns) { + if (_flags.platform == Common::kPlatformFMTowns || _flags.platform == Common::kPlatformPC98) { int sizeTmp = 0; const uint8 *bufferTmp = _staticres->loadRawData(kCreditsStrings, sizeTmp); buffer = new uint8[sizeTmp]; @@ -1676,6 +1676,7 @@ int KyraEngine_v1::processBead(int x, int y, int &x2, int &y2, BeadState *ptr) { void KyraEngine_v1::setupPanPages() { debugC(9, kDebugLevelMain, "KyraEngine_v1::setupPanPages()"); + _screen->savePageToDisk("BKGD.PG", 2); _screen->loadBitmap("BEAD.CPS", 3, 3, 0); if (_flags.platform == Common::kPlatformMacintosh || _flags.platform == Common::kPlatformAmiga) { int pageBackUp = _screen->_curPage; @@ -1701,6 +1702,7 @@ void KyraEngine_v1::setupPanPages() { assert(_panPagesTable[i]); } } + _screen->loadPageFromDisk("BKGD.PG", 2); } void KyraEngine_v1::freePanPages() { diff --git a/engines/kyra/sound_v1.cpp b/engines/kyra/sound_v1.cpp index 3ea86189b2..032e3eda44 100644 --- a/engines/kyra/sound_v1.cpp +++ b/engines/kyra/sound_v1.cpp @@ -45,7 +45,7 @@ void KyraEngine_v1::snd_playTheme(int file, int track) { void KyraEngine_v1::snd_playSoundEffect(int track) { debugC(9, kDebugLevelMain | kDebugLevelSound, "KyraEngine_v1::snd_playSoundEffect(%d)", track); - if (_flags.platform == Common::kPlatformFMTowns && track == 49) { + if ((_flags.platform == Common::kPlatformFMTowns || _flags.platform == Common::kPlatformPC98) && track == 49) { snd_playWanderScoreViaMap(56, 1); return; } @@ -57,7 +57,7 @@ void KyraEngine_v1::snd_playWanderScoreViaMap(int command, int restart) { if (restart) _lastMusicCommand = -1; - if (_flags.platform == Common::kPlatformFMTowns) { + if (_flags.platform == Common::kPlatformFMTowns || _flags.platform == Common::kPlatformPC98) { if (command == 1) { _sound->beginFadeOut(); } else if (command >= 35 && command <= 38) { diff --git a/engines/kyra/staticres.cpp b/engines/kyra/staticres.cpp index 3cf8648aa8..2ffa7aee09 100644 --- a/engines/kyra/staticres.cpp +++ b/engines/kyra/staticres.cpp @@ -86,7 +86,7 @@ uint32 createFeatures(const GameFlags &flags) { return GF_TALKIE; if (flags.isDemo) return GF_DEMO; - if (flags.platform == Common::kPlatformFMTowns) + if (flags.platform == Common::kPlatformFMTowns || flags.platform == Common::kPlatformPC98) return GF_FMTOWNS; if (flags.platform == Common::kPlatformAmiga) return GF_AMIGA; @@ -605,7 +605,7 @@ uint8 *StaticResource::getFile(const char *name, int &size) { ext = ".CD"; else if (_vm->gameFlags().isDemo) ext = ".DEM"; - else if (_vm->gameFlags().platform == Common::kPlatformFMTowns) + else if (_vm->gameFlags().platform == Common::kPlatformFMTowns || _vm->gameFlags().platform == Common::kPlatformPC98) ext = ".TNS"; else if (_vm->gameFlags().platform == Common::kPlatformAmiga) ext = ".AMG"; diff --git a/engines/kyra/text_v1.cpp b/engines/kyra/text_v1.cpp index c04aa2105f..ae18d793ef 100644 --- a/engines/kyra/text_v1.cpp +++ b/engines/kyra/text_v1.cpp @@ -302,7 +302,7 @@ void KyraEngine_v1::characterSays(int vocFile, const char *chatStr, int8 charNum if (textEnabled()) { _animator->restoreAllObjectBackgrounds(); - _screen->copyRegion(12, _text->_talkMessageY, 12, 136, 308, _text->_talkMessageH, 2, 2); + _screen->copyRegion(12, _text->_talkMessageY, 12, 136, 296, _text->_talkMessageH, 2, 2); _screen->hideMouse(); _text->printCharacterText(processedString, charNum, _characterList[charNum].x1); @@ -321,12 +321,12 @@ void KyraEngine_v1::characterSays(int vocFile, const char *chatStr, int8 charNum if (textEnabled()) { _animator->restoreAllObjectBackgrounds(); - _screen->copyRegion(12, 136, 12, _text->_talkMessageY, 308, _text->_talkMessageH, 2, 2); + _screen->copyRegion(12, 136, 12, _text->_talkMessageY, 296, _text->_talkMessageH, 2, 2); _animator->preserveAllBackgrounds(); _animator->prepDrawAllObjects(); _screen->hideMouse(); - _screen->copyRegion(12, _text->_talkMessageY, 12, _text->_talkMessageY, 308, _text->_talkMessageH, 2, 0); + _screen->copyRegion(12, _text->_talkMessageY, 12, _text->_talkMessageY, 296, _text->_talkMessageH, 2, 0); _screen->showMouse(); _animator->flagAllObjectsForRefresh(); _animator->copyChangedObjectsForward(0); diff --git a/engines/lure/animseq.cpp b/engines/lure/animseq.cpp index 39d74e5ec8..1dc2abe341 100644 --- a/engines/lure/animseq.cpp +++ b/engines/lure/animseq.cpp @@ -104,14 +104,14 @@ AnimationSequence::AnimationSequence(Screen &screen, OSystem &system, uint16 scr _lineRefs = d.getEntry(_screenId + 1); - // Show the screen that preceeds the start of the animation data - _screen.setPaletteEmpty(); + // Reset the palette and set the initial starting screen + _screen.setPaletteEmpty(RES_PALETTE_ENTRIES); _screen.screen().data().copyFrom(_decodedData, 0, 0, FULL_SCREEN_HEIGHT * FULL_SCREEN_WIDTH); _screen.update(); // Set the palette if (fadeIn) _screen.paletteFadeIn(&_palette); - else _screen.setPalette(&_palette); + else _screen.setPalette(&_palette, 0, _palette.numEntries()); // Set up frame poitners _pPixels = _decodedData->data() + SCREEN_SIZE; @@ -135,7 +135,7 @@ AnimAbortType AnimationSequence::show() { while ((_pPixels < _pPixelsEnd) && (_pLines < _pLinesEnd)) { decodeFrame(_pPixels, _pLines); - result = delay(130); + result = delay(7 * 1000 / 50); if (result != ABORT_NONE) return result; } diff --git a/engines/lure/detection.cpp b/engines/lure/detection.cpp index d072a009d5..4291b9aedb 100644 --- a/engines/lure/detection.cpp +++ b/engines/lure/detection.cpp @@ -18,8 +18,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL:https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/branches/gsoc2007-fsnode/engines/lure/detection.cpp $ - * $Id:detection.cpp 26949 2007-05-26 20:23:24Z david_corrales $ + * $URL$ + * $Id$ * */ @@ -97,7 +97,7 @@ GameList Engine_LURE_detectGames(const FSList &fslist) { continue; for (g = lure_games; g->gameid; g++) { - if (scumm_stricmp(file->name().c_str(), g->checkFile) == 0) + if (scumm_stricmp(file->getName().c_str(), g->checkFile) == 0) isFound = true; } if (isFound) @@ -152,8 +152,7 @@ void LureEngine::detectGame() { "Lure of the Temptress executable. See the documentation for creating it.", SUPPORT_FILENAME); - for (uint8 fileNum = 1; fileNum <= 4; ++fileNum) - { + for (uint8 fileNum = 1; fileNum <= 4; ++fileNum) { char sFilename[10]; sprintf(sFilename, "disk%d.vga", fileNum); diff --git a/engines/lure/disk.cpp b/engines/lure/disk.cpp index 8f0714c42e..b5465df8d9 100644 --- a/engines/lure/disk.cpp +++ b/engines/lure/disk.cpp @@ -31,6 +31,7 @@ #include "lure/disk.h" #include "lure/luredefs.h" +#include "lure/res.h" namespace Lure { @@ -125,6 +126,14 @@ void Disk::openFile(uint8 fileNum) { } uint32 Disk::getEntrySize(uint16 id) { + // Special room area check + uint16 tempId = id & 0x3fff; + if ((tempId == 0x120) || (tempId == 0x311) || (tempId == 8) || (tempId == 0x410)) { + ValueTableData &fieldList = Resources::getReference().fieldList(); + if (fieldList.getField(AREA_FLAG) != 0) + id ^= 0x8000; + } + // Get the index of the resource, if necessary opening the correct file uint8 index = indexOf(id); @@ -135,8 +144,15 @@ uint32 Disk::getEntrySize(uint16 id) { return size; } -MemoryBlock *Disk::getEntry(uint16 id) -{ +MemoryBlock *Disk::getEntry(uint16 id) { + // Special room area check + uint16 tempId = id & 0x3fff; + if ((tempId == 0x120) || (tempId == 0x311) || (tempId == 8) || (tempId == 0x410)) { + ValueTableData &fieldList = Resources::getReference().fieldList(); + if (fieldList.getField(AREA_FLAG) != 0) + id ^= 0x8000; + } + // Get the index of the resource, if necessary opening the correct file uint8 index = indexOf(id); diff --git a/engines/lure/fights.cpp b/engines/lure/fights.cpp index 4c478bbc17..836c109ca7 100644 --- a/engines/lure/fights.cpp +++ b/engines/lure/fights.cpp @@ -335,8 +335,7 @@ void FightsManager::fightHandler(Hotspot &h, uint16 moveOffset) { return; } - switch (moveValue) - { + switch (moveValue) { case 0xFFFA: // Walk left if ((fighter.fwmove_number == 5) || (fighter.fwmove_number == 10)) { @@ -466,7 +465,7 @@ void FightsManager::fightHandler(Hotspot &h, uint16 moveOffset) { moveOffset += 2 * sizeof(uint16); if (v1 == opponent.fwblocking) { - Sound.playSound(42); + Sound.addSound(42); moveOffset = v2; } break; @@ -478,7 +477,7 @@ void FightsManager::fightHandler(Hotspot &h, uint16 moveOffset) { if (fighter.fwdist <= FIGHT_DISTANCE) { if (h.hotspotId() == PLAYER_ID) { // Player hits opponent - Sound.playSound(52); + Sound.addSound(52); if (opponent.fwhits != 5) { opponent.fwseq_ad = v1; @@ -490,13 +489,13 @@ void FightsManager::fightHandler(Hotspot &h, uint16 moveOffset) { } } else { // Opponent hit player - Sound.playSound(37); + Sound.addSound(37); opponent.fwseq_ad = v1; if (++opponent.fwhits == 10) { // Player has been killed fighter.fwhits = 10; opponent.fwseq_ad = FIGHT_PLAYER_DIES; - Sound.playSound(36); + Sound.addSound(36); } } } @@ -526,7 +525,7 @@ void FightsManager::fightHandler(Hotspot &h, uint16 moveOffset) { case 0xFFEA: // Fight sound - Sound.playSound(getWord(moveOffset)); + Sound.addSound(getWord(moveOffset) & 0xff); moveOffset += sizeof(uint16); break; diff --git a/engines/lure/game.cpp b/engines/lure/game.cpp index 5bffc6ade8..e4aeef2253 100644 --- a/engines/lure/game.cpp +++ b/engines/lure/game.cpp @@ -24,14 +24,16 @@ */ #include "lure/game.h" -#include "lure/strings.h" -#include "lure/room.h" -#include "lure/scripts.h" -#include "lure/res_struct.h" #include "lure/animseq.h" #include "lure/fights.h" +#include "lure/res_struct.h" +#include "lure/room.h" +#include "lure/scripts.h" +#include "lure/sound.h" +#include "lure/strings.h" #include "common/config-manager.h" +#include "common/system.h" namespace Lure { @@ -45,6 +47,7 @@ Game::Game() { int_game = this; _debugger = new Debugger(); _slowSpeedFlag = true; + _preloadFlag = false; _soundFlag = true; } @@ -52,7 +55,7 @@ Game::~Game() { delete _debugger; } -void Game::tick(bool fastSpeed) { +void Game::tick() { // Call the tick method for each hotspot - this is somewaht complicated // by the fact that a tick proc can unload both itself and/or others, // so we first get a list of the Ids, and call the tick proc for each @@ -66,7 +69,7 @@ void Game::tick(bool fastSpeed) { for (i = res.activeHotspots().begin(); i != res.activeHotspots().end(); ++i) { Hotspot *hotspot = *i; - if (!fastSpeed || ((hotspot->layer() != 0xff) && + if (!_preloadFlag || ((hotspot->layer() != 0xff) && (hotspot->hotspotId() < FIRST_NONCHARACTER_ID))) // Add hotspot to list to execute idList[idSize++] = hotspot->hotspotId(); @@ -85,6 +88,21 @@ void Game::tick(bool fastSpeed) { delete[] idList; } +void Game::tickCheck() { + Resources &res = Resources::getReference(); + Room &room = Room::getReference(); + bool remoteFlag = res.fieldList().getField(OLD_ROOM_NUMBER) != 0; + + _state |= GS_TICK; + if ((room.roomNumber() == ROOMNUM_VILLAGE_SHOP) && !remoteFlag && ((_state & GS_TICK) != 0)) { + // In the village shop, + bool tockFlag = (_state & GS_TOCK) != 0; + Sound.addSound(tockFlag ? 16 : 50); + + _state = _state ^ (GS_TICK | GS_TOCK); + } +} + void Game::nextFrame() { Resources &res = Resources::getReference(); Room &room = Room::getReference(); @@ -110,31 +128,48 @@ void Game::execute() { ValueTableData &fields = res.fieldList(); uint32 timerVal = system.getMillis(); + uint32 timerVal2 = system.getMillis(); screen.empty(); - //_screen.resetPalette(); screen.setPaletteEmpty(); - setState(0); + // Flag for starting game + setState(GS_RESTART); - Script::execute(STARTUP_SCRIPT); + while (!events.quitFlag) { + + if ((_state & GS_RESTART) != 0) { + res.reset(); - int bootParam = ConfMan.getInt("boot_param"); - handleBootParam(bootParam); + setState(0); + Script::execute(STARTUP_SCRIPT); - // Set the player direction - res.getActiveHotspot(PLAYER_ID)->setDirection(UP); + int bootParam = ConfMan.getInt("boot_param"); + handleBootParam(bootParam); +if (bootParam == 1) _state = GS_RESTORE_RESTART; //******DEBUG****** + } - room.update(); - mouse.setCursorNum(CURSOR_ARROW); - mouse.cursorOn(); - - while (!events.quitFlag) { - while (!events.quitFlag && (_state == 0)) { + // Set the player direction +// res.getActiveHotspot(PLAYER_ID)->setDirection(UP); + + room.update(); + mouse.setCursorNum(CURSOR_ARROW); + mouse.cursorOn(); + + // Main game loop + while (!events.quitFlag && ((_state & GS_RESTART) == 0)) { // If time for next frame, allow everything to update if (system.getMillis() > timerVal + GAME_FRAME_DELAY) { timerVal = system.getMillis(); nextFrame(); + + Sound.musicInterface_ContinuePlaying(); + } + + // Also check if time to do another village shop tick check + if (system.getMillis() > timerVal2 + GAME_TICK_DELAY) { + timerVal2 = system.getMillis(); + tickCheck(); } res.delayList().tick(); @@ -161,48 +196,46 @@ void Game::execute() { SaveRestoreDialog::show(false); break; - default: - handled = false; - } - if (handled) - continue; + case Common::KEYCODE_F9: + doRestart(); + break; - // Handle any remaining standard keys - switch (events.event().kbd.keycode) { - case Common::KEYCODE_ESCAPE: - events.quitFlag = true; - break; + case Common::KEYCODE_KP_PLUS: + while (++roomNum <= 51) + if (res.getRoom(roomNum) != NULL) break; + if (roomNum == 52) roomNum = 1; - case '+': - while (++roomNum <= 51) - if (res.getRoom(roomNum) != NULL) break; - if (roomNum == 52) roomNum = 1; + room.leaveRoom(); + room.setRoomNumber(roomNum); + break; - room.leaveRoom(); - room.setRoomNumber(roomNum); - break; + case Common::KEYCODE_KP_MINUS: + if (roomNum == 1) roomNum = 55; + while (res.getRoom(--roomNum) == NULL) ; - case '-': - if (roomNum == 1) roomNum = 55; - while (res.getRoom(--roomNum) == NULL) ; + room.leaveRoom(); + room.setRoomNumber(roomNum); + break; - room.leaveRoom(); - room.setRoomNumber(roomNum); - break; + case Common::KEYCODE_KP_MULTIPLY: + res.getActiveHotspot(PLAYER_ID)->setRoomNumber( + room.roomNumber()); + break; - case '*': - res.getActiveHotspot(PLAYER_ID)->setRoomNumber( - room.roomNumber()); - break; + case Common::KEYCODE_KP_DIVIDE: + case Common::KEYCODE_SLASH: + room.setShowInfo(!room.showInfo()); + break; - case Common::KEYCODE_KP_DIVIDE: - case Common::KEYCODE_SLASH: - room.setShowInfo(!room.showInfo()); - break; + case Common::KEYCODE_ESCAPE: + doQuit(); + break; - default: - break; + default: + handled = false; } + if (handled) + continue; } if ((events.type() == Common::EVENT_LBUTTONDOWN) || @@ -232,24 +265,31 @@ void Game::execute() { _debugger->onFrame(); } + room.leaveRoom(); + // If Skorl catches player, show the catching animation if ((_state & GS_CAUGHT) != 0) { Palette palette(SKORL_CATCH_PALETTE_ID); AnimationSequence *anim = new AnimationSequence(screen, system, SKORL_CATCH_ANIM_ID, palette, false); mouse.cursorOff(); + Sound.addSound(0x33); anim->show(); - mouse.cursorOn(); + delete anim; } // If the Restart/Restore dialog is needed, show it - if ((_state & GS_RESTORE_RESTART) != 0) { - // TODO: Restore/Restart dialog - for now, simply flag for exit + if ((_state & GS_RESTORE) != 0) { + // Show the Restore/Restart dialog + bool restartFlag = RestartRestoreDialog::show(); + + if (restartFlag) + setState(GS_RESTART); + + } else if ((_state & GS_RESTART) == 0) + // Exiting game events.quitFlag = true; - } } - - room.leaveRoom(); } void Game::handleMenuResponse(uint8 selection) { @@ -261,6 +301,7 @@ void Game::handleMenuResponse(uint8 selection) { break; case MENUITEM_RESTART_GAME: + doRestart(); break; case MENUITEM_SAVE_GAME: @@ -296,6 +337,8 @@ void Game::playerChangeRoom() { delayList.clear(); + Sound.removeSounds(); + RoomData *roomData = res.getRoom(roomNum); assert(roomData); roomData->flags |= HOTSPOTFLAG_FOUND; @@ -332,8 +375,7 @@ void Game::playerChangeRoom() { } } -void Game::displayChuteAnimation() -{ +void Game::displayChuteAnimation() { OSystem &system = *g_system; Resources &res = Resources::getReference(); Screen &screen = Screen::getReference(); @@ -361,11 +403,10 @@ void Game::displayChuteAnimation() delete anim; mouse.cursorOn(); - fields.setField(82, 1); + fields.setField(AREA_FLAG, 1); } -void Game::displayBarrelAnimation() -{ +void Game::displayBarrelAnimation() { OSystem &system = *g_system; Screen &screen = Screen::getReference(); Mouse &mouse = Mouse::getReference(); @@ -631,8 +672,7 @@ bool Game::GetTellActions() { --_numTellCommands; if (_numTellCommands < 0) paramIndex = -1; - else - { + else { paramIndex = 3; statusLine = statusLinePos[_numTellCommands][paramIndex]; *statusLine = '\0'; @@ -791,14 +831,12 @@ void Game::doAction(Action action, uint16 hotspotId, uint16 usedId) { room.setCursorState(CS_ACTION); // Set the action - if (action == TELL) - { + if (action == TELL) { // Tell action needs special handling because of the variable length parameter list - add in a // placeholder entry, and then replace it's details with the TELL command data player->currentActions().addFront(NONE, player->roomNumber(), 0, 0); player->currentActions().top().supportData().setDetails2(TELL, _numTellCommands * 3 + 1, &_tellCommands[0]); - } - else + } else // All other action types player->currentActions().addFront(action, player->roomNumber(), hotspotId, usedId); } @@ -823,31 +861,13 @@ void Game::doShowCredits() { } void Game::doQuit() { - Mouse &mouse = Mouse::getReference(); - Events &events = Events::getReference(); - Screen &screen = Screen::getReference(); - - mouse.cursorOff(); - Surface *s = Surface::newDialog(190, "Are you sure (y/n)?"); - s->centerOnScreen(); - delete s; - - Common::KeyCode key = Common::KEYCODE_INVALID; - do { - if (events.pollEvent()) { - if (events.event().type == Common::EVENT_KEYDOWN) { - key = events.event().kbd.keycode; - } - } - } while ((key != Common::KEYCODE_ESCAPE) && - (key != Common::KEYCODE_y) && - (key != Common::KEYCODE_n)); + if (getYN()) + Events::getReference().quitFlag = true; +} - events.quitFlag = (key == Common::KEYCODE_n); - if (!events.quitFlag) { - screen.update(); - mouse.cursorOn(); - } +void Game::doRestart() { + if (getYN()) + setState(GS_RESTART); } void Game::doTextSpeed() { @@ -864,6 +884,7 @@ void Game::doSound() { _soundFlag = !_soundFlag; menu.getMenu(2).entries()[2] = sl.getString(_soundFlag ? S_SOUND_ON : S_SOUND_OFF); + Sound.setVolume(_soundFlag ? DEFAULT_VOLUME : 0); } void Game::handleBootParam(int value) { @@ -908,7 +929,53 @@ void Game::handleBootParam(int value) { room.setRoomNumber(2); break; + + default: + room.setRoomNumber(value); + break; } } +bool Game::getYN() { + Mouse &mouse = Mouse::getReference(); + Events &events = Events::getReference(); + Screen &screen = Screen::getReference(); + + mouse.cursorOff(); + Surface *s = Surface::newDialog(190, "Are you sure (y/n)?"); + s->centerOnScreen(); + delete s; + + bool breakFlag = false; + bool result = false; + + do { + if (events.pollEvent()) { + if (events.event().type == Common::EVENT_KEYDOWN) { + Common::KeyCode key = events.event().kbd.keycode; + if ((key == Common::KEYCODE_y) || (key == Common::KEYCODE_n) || + (key == Common::KEYCODE_ESCAPE)) { + breakFlag = true; + result = key == Common::KEYCODE_y; + } + } + if (events.event().type == Common::EVENT_LBUTTONUP) { + breakFlag = true; + result = true; + } + if (events.event().type == Common::EVENT_RBUTTONUP) { + breakFlag = true; + result = false; + } + } + + g_system->delayMillis(10); + } while (!events.quitFlag && !breakFlag); + + screen.update(); + mouse.cursorOn(); + + return result; +} + } // end of namespace Lure diff --git a/engines/lure/game.h b/engines/lure/game.h index 20e56df776..50b730e354 100644 --- a/engines/lure/game.h +++ b/engines/lure/game.h @@ -39,7 +39,9 @@ namespace Lure { -enum GameState {GS_RESTORE_RESTART = 1, GS_CAUGHT = 2, GS_EXIT = 3}; +enum GameState {GS_ERROR = 1, GS_TICK = 2, GS_TOCK = 4, GS_PROT = 8, GS_RESTART = 0x10, + GS_CAUGHT = 0x20, GS_RESTORE = 0x40, GS_FLOPPY = 0x80, + GS_RESTORE_RESTART = 0x50}; class Game { private: @@ -48,6 +50,7 @@ private: uint8 _state; uint16 _tellCommands[MAX_TELL_COMMANDS * 3 + 1]; int _numTellCommands; + bool _preloadFlag; void handleMenuResponse(uint8 selection); void handleClick(); @@ -60,21 +63,25 @@ private: void displayChuteAnimation(); void displayBarrelAnimation(); void handleBootParam(int value); + bool getYN(); public: Game(); virtual ~Game(); static Game &getReference(); - void tick(bool fastSpeed = false); + void tick(); + void tickCheck(); void nextFrame(); void execute(); void setState(uint8 flags) { _state = flags; } + bool &preloadFlag() { return _preloadFlag; } // Menu item support methods void doDebugMenu(); void doShowCredits(); void doQuit(); + void doRestart(); void doTextSpeed(); void doSound(); }; diff --git a/engines/lure/hotspots.cpp b/engines/lure/hotspots.cpp index 7def0be9ab..93860bbd3e 100644 --- a/engines/lure/hotspots.cpp +++ b/engines/lure/hotspots.cpp @@ -35,6 +35,7 @@ #include "lure/events.h" #include "lure/game.h" #include "lure/fights.h" +#include "lure/sound.h" #include "common/endian.h" namespace Lure { @@ -69,12 +70,19 @@ Hotspot::Hotspot(HotspotData *res): _pathFinder(this) { _hotspotScriptOffset = res->hotspotScriptOffset; _tickCtr = res->tickTimeout; _colourOffset = res->colourOffset; + _tempDest.counter = 0; _override = resources.getHotspotOverride(res->hotspotId); setAnimation(_data->animRecordId); _tickHandler = HotspotTickHandlers::getHandler(_data->tickProcOffset); _nameBuffer[0] = '\0'; + if (_hotspotId < FIRST_NONCHARACTER_ID) { + // Default characters to facing upwards until they start moving + _direction = UP; + setFrameNumber(_anim->upFrame); + } + _frameCtr = 0; _skipFlag = false; _charRectY = 0; @@ -165,6 +173,40 @@ Hotspot::Hotspot(Hotspot *character, uint16 objType): _pathFinder(this) { _nameBuffer[0] = '\0'; } +Hotspot::Hotspot(): _pathFinder(NULL) { + _data = NULL; + _anim = NULL; + _frames = NULL; + _numFrames = 0; + _persistant = false; + _hotspotId = 0xffff; + _override = NULL; + _colourOffset = 0; + _destHotspotId = 0; + _blockedOffset = 0; + _exitCtr = 0; + _voiceCtr = 0; + _walkFlag = false; + _skipFlag = false; + _roomNumber = 0; + _destHotspotId = 0; + _startX = 0; + _startY = 0; + _destX = 0; + _destY = 0; + _layer = 0; + _height = 0; + _width = 0; + _heightCopy = 0; + _widthCopy = 0; + _yCorrection = 0; + _tickCtr = 0; + _tickHandler = NULL; + _frameWidth = _width; + _frameStartsUsed = false; + _tempDest.counter = 0; +} + Hotspot::~Hotspot() { if (_frames) delete _frames; } @@ -386,8 +428,7 @@ uint16 Hotspot::nameId() { return _data->nameId; } -const char *Hotspot::getName() -{ +const char *Hotspot::getName() { // If name hasn't been loaded yet, then do so if (!_nameBuffer[0] && (nameId() != 0)) StringData::getReference().getString(nameId(), _nameBuffer); @@ -658,6 +699,8 @@ void Hotspot::updateMovement() { setOccupied(true); } } + + resetDirection(); } void Hotspot::updateMovement2(CharacterMode value) { @@ -810,12 +853,12 @@ void Hotspot::startTalkDialog() { /* */ /*-------------------------------------------------------------------------*/ -uint16 validRoomExitHotspots[] = {0x2711, 0x2712, 0x2714, 0x2715, 0x2716, 0x2717, +static const uint16 validRoomExitHotspots[] = {0x2711, 0x2712, 0x2714, 0x2715, 0x2716, 0x2717, 0x2718, 0x2719, 0x271A, 0x271E, 0x271F, 0x2720, 0x2721, 0x2722, 0x2725, 0x2726, 0x2729, 0x272A, 0x272B, 0x272C, 0x272D, 0x272E, 0x272F, 0}; bool Hotspot::isRoomExit(uint16 id) { - for (uint16 *p = &validRoomExitHotspots[0]; *p != 0; ++p) + for (const uint16 *p = &validRoomExitHotspots[0]; *p != 0; ++p) if (*p == id) return true; return false; } @@ -869,7 +912,7 @@ HotspotPrecheckResult Hotspot::actionPrecheck(HotspotData *hotspot) { return PC_WAIT; } else if (hotspot->actionHotspotId != _hotspotId) { - if (fields.getField(82) != 2) { + if (fields.getField(AREA_FLAG) != 2) { showMessage(5, hotspot->hotspotId); setDelayCtr(4); } @@ -1056,6 +1099,29 @@ bool Hotspot::doorCloseCheck(uint16 doorId) { return true; } +void Hotspot::resetDirection() { + uint16 newFrameNumber; + switch (_direction) { + case UP: + newFrameNumber = _anim->upFrame; + break; + case DOWN: + newFrameNumber = _anim->downFrame; + break; + case LEFT: + newFrameNumber = _anim->leftFrame; + break; + case RIGHT: + newFrameNumber = _anim->rightFrame; + break; + default: + // No need to change + return; + } + + setFrameNumber(newFrameNumber); +} + /*-------------------------------------------------------------------------*/ typedef void (Hotspot::*ActionProcPtr)(HotspotData *hotspot); @@ -1121,12 +1187,10 @@ void Hotspot::doAction(Action action, HotspotData *hotspot) { void Hotspot::doNothing(HotspotData *hotspot) { _currentActions.pop(); - if (!_currentActions.isEmpty()) - { + if (!_currentActions.isEmpty()) { setBlockedFlag(false); currentActions().top().setAction(DISPATCH_ACTION); - } - else if (hotspotId() == PLAYER_ID) { + } else if (hotspotId() == PLAYER_ID) { Room::getReference().setCursorState(CS_NONE); } } @@ -1294,8 +1358,8 @@ void Hotspot::doClose(HotspotData *hotspot) { joinRec = res.getExitJoin(hotspot->hotspotId); if (!joinRec->blocked) { // Close the door - if (!doorCloseCheck(joinRec->hotspot1Id) || - !doorCloseCheck(joinRec->hotspot2Id)) { + if (!doorCloseCheck(joinRec->hotspots[0].hotspotId) || + !doorCloseCheck(joinRec->hotspots[1].hotspotId)) { // A character is preventing the door from closing showMessage(2); } else { @@ -1486,59 +1550,32 @@ void Hotspot::doLook(HotspotData *hotspot) { Dialog::show(Room::getReference().descId()); } -uint16 hotspotLookAtList[] = {0x411, 0x412, 0x41F, 0x420, 0x421, 0x422, 0x426, +static const uint16 hotspotLookAtList[] = {0x411, 0x412, 0x41F, 0x420, 0x421, 0x422, 0x426, 0x427, 0x428, 0x429, 0x436, 0x437, 0}; void Hotspot::doLookAt(HotspotData *hotspot) { - Resources &res = Resources::getReference(); - uint16 sequenceOffset = res.getHotspotAction(hotspot->actionsOffset, LOOK_AT); - - if (hotspot->hotspotId >= FIRST_NONCHARACTER_ID) { - // Check if the hotspot appears in the list of hotspots that don't - // need to be walked to before being looked at - uint16 *tempId = &hotspotLookAtList[0]; - while ((*tempId != 0) && (*tempId != hotspot->hotspotId)) ++tempId; - if (!*tempId) { - // Hotspot wasn't in the list - HotspotPrecheckResult result = actionPrecheck(hotspot); - if (result == PC_WAIT) return; - else if (result != PC_EXECUTE) { - endAction(); - return; - } - } - } - - faceHotspot(hotspot); - setActionCtr(0); - endAction(); - - if (sequenceOffset >= 0x8000) { - showMessage(sequenceOffset); - } else { - if (sequenceOffset != 0) - sequenceOffset = Script::execute(sequenceOffset); - - if (sequenceOffset == 0) { - uint16 descId = (hotspot->descId2 != 0) ? hotspot->descId2 : hotspot->descId; - Dialog::show(descId); - } - } + doLookAction(hotspot, LOOK_AT); } void Hotspot::doLookThrough(HotspotData *hotspot) { + doLookAction(hotspot, LOOK_THROUGH); +} + +void Hotspot::doLookAction(HotspotData *hotspot, Action action) { Resources &res = Resources::getReference(); - uint16 sequenceOffset = res.getHotspotAction(hotspot->actionsOffset, LOOK_THROUGH); + uint16 sequenceOffset = res.getHotspotAction(hotspot->actionsOffset, action); if (hotspot->hotspotId >= FIRST_NONCHARACTER_ID) { // Check if the hotspot appears in the list of hotspots that don't // need to be walked to before being looked at - uint16 *tempId = &hotspotLookAtList[0]; - while ((*tempId != 0) && (*tempId != hotspot->hotspotId)) ++tempId; + const uint16 *tempId = &hotspotLookAtList[0]; + while ((*tempId != 0) && (*tempId != hotspot->hotspotId)) + ++tempId; if (!*tempId) { // Hotspot wasn't in the list HotspotPrecheckResult result = actionPrecheck(hotspot); - if (result == PC_WAIT) return; + if (result == PC_WAIT) + return; else if (result != PC_EXECUTE) { endAction(); return; @@ -1701,7 +1738,7 @@ void Hotspot::doReturn(HotspotData *hotspot) { endAction(); } -uint16 bribe_hotspot_list[] = {0x421, 0x879, 0x3E9, 0x8C7, 0x429, 0x8D1, +static const uint16 bribe_hotspot_list[] = {0x421, 0x879, 0x3E9, 0x8C7, 0x429, 0x8D1, 0x422, 0x8D4, 0x420, 0x8D6, 0x42B, 0x956, 0x3F2, 0xBE6, 0}; void Hotspot::doBribe(HotspotData *hotspot) { @@ -1717,7 +1754,7 @@ void Hotspot::doBribe(HotspotData *hotspot) { return; } - uint16 *tempId = &bribe_hotspot_list[0]; + const uint16 *tempId = &bribe_hotspot_list[0]; uint16 sequenceOffset = 0x14B; // Default sequence offset while (*tempId != 0) { if (*tempId++ == hotspotId()) { @@ -2010,8 +2047,7 @@ uint16 Hotspot::getTalkId(HotspotData *charHotspot) { TalkHeaderData *headerEntry; // If the hotspot has a talk data override, return it - if (charHotspot->talkOverride != 0) - { + if (charHotspot->talkOverride != 0) { // Has an override, so return it and reset back to zero uint16 result = charHotspot->talkOverride; charHotspot->talkOverride = 0; @@ -2384,7 +2420,7 @@ void HotspotTickHandlers::standardCharacterAnimHandler(Hotspot &h) { switch (action) { case NO_ACTION: - h.setCharacterMode(CHARMODE_IDLE); + h.updateMovement2(CHARMODE_IDLE); break; case DISPATCH_ACTION: @@ -2479,8 +2515,7 @@ void HotspotTickHandlers::standardCharacterAnimHandler(Hotspot &h) { // Increment the blocked state h.setBlockedState((BlockedState) ((int) h.blockedState() + 1)); - if (!h.blockedFlag()) - { + if (!h.blockedFlag()) { // Not already handling blocked, so add a new dummy action so that the new // action set below will not replace the existing one h.currentActions().addFront(DISPATCH_ACTION, 0); @@ -2587,38 +2622,37 @@ void HotspotTickHandlers::puzzledAnimHandler(Hotspot &h) { void HotspotTickHandlers::roomExitAnimHandler(Hotspot &h) { Resources &res = Resources::getReference(); -// ValueTableData &fields = res.fieldList(); + ValueTableData &fields = res.fieldList(); + Room &room = Room::getReference(); + RoomExitJoinData *rec = res.getExitJoin(h.hotspotId()); if (!rec) return; - byte *currentFrame, *destFrame; + RoomExitJoinStruct &rs = (rec->hotspots[0].hotspotId == h.hotspotId()) ? + rec->hotspots[0] : rec->hotspots[1]; - if (rec->hotspot1Id == h.hotspotId()) { - currentFrame = &rec->h1CurrentFrame; - destFrame = &rec->h1DestFrame; - } else { - currentFrame = &rec->h2CurrentFrame; - destFrame = &rec->h2DestFrame; - } - - if ((rec->blocked != 0) && (*currentFrame != *destFrame)) { + if ((rec->blocked != 0) && (rs.currentFrame != rs.destFrame)) { // Closing the door h.setOccupied(true); - ++*currentFrame; - if (*currentFrame == *destFrame) { - // TODO: play closed door sound - } - } else if ((rec->blocked == 0) && (*currentFrame != 0)) { + ++rs.currentFrame; + if ((rs.currentFrame == rs.destFrame) && (h.hotspotId() == room.roomNumber())) + Sound.addSound(rs.closeSound); + + } else if ((rec->blocked == 0) && (rs.currentFrame != 0)) { // Opening the door h.setOccupied(false); - --*currentFrame; - if (*currentFrame == *destFrame) { - //TODO: Check against script val 88 and play sound + --rs.currentFrame; + if ((rs.currentFrame == rs.destFrame) && (h.hotspotId() == room.roomNumber())) { + Sound.addSound(rs.openSound); + + // If in the outside village, trash reverb + if (fields.getField(AREA_FLAG) == 1) + Sound.musicInterface_TrashReverb(); } } - h.setFrameNumber(*currentFrame); + h.setFrameNumber(rs.currentFrame); } void HotspotTickHandlers::playerAnimHandler(Hotspot &h) { @@ -2859,7 +2893,7 @@ void HotspotTickHandlers::followerAnimHandler(Hotspot &h) { h.currentActions().addFront(DISPATCH_ACTION, player->roomNumber()); else { // Scan through the translation list for an alternate destination room - RoomTranslationRecord *p = &roomTranslations[0]; + const RoomTranslationRecord *p = &roomTranslations[0]; while ((p->srcRoom != 0) && (p->srcRoom != player->roomNumber())) ++p; h.currentActions().addFront(DISPATCH_ACTION, @@ -2931,10 +2965,11 @@ void HotspotTickHandlers::followerAnimHandler(Hotspot &h) { void HotspotTickHandlers::jailorAnimHandler(Hotspot &h) { Resources &res = Resources::getReference(); ValueTableData &fields = res.fieldList(); + Game &game = Game::getReference(); HotspotData *player = res.getHotspot(PLAYER_ID); if ((fields.getField(11) != 0) || (h.hotspotId() == CASTLE_SKORL_ID)) { - if (!h.skipFlag() && (h.roomNumber() == player->roomNumber)) { + if (!h.skipFlag() && !game.preloadFlag() && (h.roomNumber() == player->roomNumber)) { if (Support::charactersIntersecting(h.resource(), player)) { // Skorl has caught the player Game::getReference().setState(GS_RESTORE_RESTART | GS_CAUGHT); @@ -2966,6 +3001,9 @@ void HotspotTickHandlers::droppingTorchAnimHandler(Hotspot &h) { res.deactivateHotspot(h.hotspotId()); res.activateHotspot(0x41C); + // Add sound + Sound.addSound(8); + // Enable the fire and activate its animation HotspotData *fire = res.getHotspot(0x418); fire->flags |= 0x80; @@ -2976,12 +3014,9 @@ void HotspotTickHandlers::droppingTorchAnimHandler(Hotspot &h) { } void HotspotTickHandlers::playerSewerExitAnimHandler(Hotspot &h) { - if (h.frameCtr() > 0) - { + if (h.frameCtr() > 0) { h.decrFrameCtr(); - } - else if (h.executeScript()) - { + } else if (h.executeScript()) { Resources &res = Resources::getReference(); // Deactive the dropping animation @@ -3484,7 +3519,7 @@ void HotspotTickHandlers::barmanAnimHandler(Hotspot &h) { // All other actions uint16 xp, id; - uint16 *frameList; + const uint16 *frameList; uint16 frameNumber; BarmanAction action = (BarmanAction) (h.frameCtr() & 0x3F); @@ -3518,12 +3553,10 @@ void HotspotTickHandlers::barmanAnimHandler(Hotspot &h) { HotspotData *gwyn = res.getHotspot(GOEWIN_ID); HotspotData *wayne = res.getHotspot(WAYNE_ID); - if ((player->roomNumber != 35) && (gwyn->roomNumber != 35) && (wayne->roomNumber != 35)) - { + if ((player->roomNumber != 35) && (gwyn->roomNumber != 35) && (wayne->roomNumber != 35)) { if (rnd.getRandomNumber(1) == 1) id = BG_EXTRA1 << 8; - else - { + else { // Set up alternate animation h.setWidth(32); h.setAnimation(EWAN_ALT_ANIM_ID); @@ -3544,15 +3577,13 @@ void HotspotTickHandlers::barmanAnimHandler(Hotspot &h) { frameList = barEntry.graphics[h.supportValue() >> 8]; frameNumber = frameList[h.supportValue() & 0xff]; - if (frameNumber != 0) - { + if (frameNumber != 0) { h.setActionCtr(frameNumber); h.setFrameNumber(frameNumber); return; } - if (h.hotspotId() == EWAN_ID) - { + if (h.hotspotId() == EWAN_ID) { // Make sure Ewan is back to his standard animation h.setWidth(16); h.setAnimation(EWAN_ANIM_ID); @@ -4261,16 +4292,13 @@ void CurrentActionEntry::saveToStream(WriteStream *stream) { if (hasSupportData()) { // Handle the support data stream->writeByte(_dynamicSupportData); - if (_dynamicSupportData) - { + if (_dynamicSupportData) { // Write out the dynamic data stream->writeByte(supportData().action()); stream->writeSint16LE(supportData().numParams()); for (int index = 0; index < supportData().numParams(); ++index) stream->writeUint16LE(supportData().param(index)); - } - else - { + } else { // Write out the Id for the static entry stream->writeSint16LE(supportData().id()); } @@ -4294,8 +4322,7 @@ CurrentActionEntry *CurrentActionEntry::loadFromStream(ReadStream *stream) { } else { // Handle support data for the entry bool dynamicData = stream->readByte() != 0; - if (dynamicData) - { + if (dynamicData) { // Load action entry that has dynamic data result = new CurrentActionEntry( (CurrentAction) actionNum, roomNumber); @@ -4308,9 +4335,7 @@ CurrentActionEntry *CurrentActionEntry::loadFromStream(ReadStream *stream) { result->_supportData->setDetails2(action, numParams, paramList); delete paramList; - } - else - { + } else { // Load action entry with an NPC schedule entry uint16 entryId = stream->readUint16LE(); CharacterScheduleEntry *entry = res.charSchedules().getEntry(entryId); @@ -4394,8 +4419,7 @@ void CurrentActionStack::saveToStream(WriteStream *stream) { list(buffer); debugC(ERROR_DETAILED, kLureDebugAnimations, "%s", buffer); - for (i = _actions.begin(); i != _actions.end(); ++i) - { + for (i = _actions.begin(); i != _actions.end(); ++i) { CurrentActionEntry *rec = *i; rec->saveToStream(stream); } @@ -4553,8 +4577,7 @@ bool Support::isCharacterInList(uint16 *lst, int numEntries, uint16 charId) { void HotspotList::saveToStream(WriteStream *stream) { HotspotList::iterator i; - for (i = begin(); i != end(); ++i) - { + for (i = begin(); i != end(); ++i) { Hotspot *hotspot = *i; debugC(ERROR_INTERMEDIATE, kLureDebugAnimations, "Saving hotspot %xh", hotspot->hotspotId()); bool dynamicObject = hotspot->hotspotId() != hotspot->originalId(); @@ -4574,8 +4597,7 @@ void HotspotList::loadFromStream(ReadStream *stream) { clear(); uint16 hotspotId = stream->readUint16LE(); - while (hotspotId != 0) - { + while (hotspotId != 0) { debugC(ERROR_INTERMEDIATE, kLureDebugAnimations, "Loading hotspot %xh", hotspotId); bool dynamicObject = stream->readByte() != 0; uint16 destHotspotId = stream->readUint16LE(); @@ -4585,9 +4607,7 @@ void HotspotList::loadFromStream(ReadStream *stream) { Hotspot *destHotspot = res.getActiveHotspot(destHotspotId); assert(destHotspot); hotspot = new Hotspot(destHotspot, hotspotId); - } - else - { + } else { HotspotData *hotspotData = res.getHotspot(hotspotId); assert(hotspotData); hotspot = new Hotspot(hotspotData); diff --git a/engines/lure/hotspots.h b/engines/lure/hotspots.h index fb3bb1478b..c30faa58c5 100644 --- a/engines/lure/hotspots.h +++ b/engines/lure/hotspots.h @@ -342,9 +342,13 @@ private: void npcPause(HotspotData *hotspot); void npcStartTalking(HotspotData *hotspot); void npcJumpAddress(HotspotData *hotspot); + + // Auxillaries + void doLookAction(HotspotData *hotspot, Action action); public: Hotspot(HotspotData *res); Hotspot(Hotspot *character, uint16 objType); + Hotspot(); ~Hotspot(); void setAnimation(uint16 newAnimId); diff --git a/engines/lure/intro.cpp b/engines/lure/intro.cpp index 3f939c6389..ae4199051e 100644 --- a/engines/lure/intro.cpp +++ b/engines/lure/intro.cpp @@ -26,20 +26,26 @@ #include "lure/intro.h" #include "lure/animseq.h" #include "lure/events.h" +#include "lure/sound.h" namespace Lure { struct AnimRecord { uint16 resourceId; uint8 paletteIndex; - bool initialPause; - bool endingPause; + uint16 initialPause; + uint16 endingPause; + uint8 soundNumber; }; static const uint16 start_screens[] = {0x18, 0x1A, 0x1E, 0x1C, 0}; -static const AnimRecord anim_screens[] = {{0x40, 0, true, true}, {0x42, 1, false, true}, - {0x44, 2, false, false}, {0x24, 3, false, true}, {0x46, 3, false, false}, - {0, 0, false, false}}; +static const AnimRecord anim_screens[] = { + {0x40, 0, 0x35A, 0xC8, 0}, // The kingdom was at peace + {0x42, 1, 0, 0x5FA, 1}, // Cliff overhang + {0x44, 2, 0, 0, 2}, // Siluette in moonlight + {0x24, 3, 0, 0x328 + 0x24, 0xff}, // Exposition of reaching town + {0x46, 3, 0, 0, 3}, // Skorl approaches + {0, 0, 0, 0, 0xff}}; // showScreen // Shows a screen by loading it from the given resource, and then fading it in @@ -73,26 +79,38 @@ bool Introduction::show() { if (showScreen(start_screens[ctr], start_screens[ctr] + 1, 5000)) return true; - AnimationSequence *anim; - bool result; - // Animated screens + AnimationSequence *anim; + bool result; + uint8 currentSound = 0xff; PaletteCollection coll(0x32); const AnimRecord *curr_anim = anim_screens; - for (; curr_anim->resourceId; ++curr_anim) - { + for (; curr_anim->resourceId; ++curr_anim) { + // Handle sound selection + if (curr_anim->soundNumber != 0xff) { + if (currentSound != 0xff) + // Fade out the previous sound + Sound.fadeOut(); + + currentSound = curr_anim->soundNumber; + Sound.musicInterface_Play(currentSound, 0); + // DEBUG TEST +// g_system->delayMillis(1000); +// Sound.musicInterface_Play(1, 1); + } + bool fadeIn = curr_anim == anim_screens; anim = new AnimationSequence(_screen, _system, curr_anim->resourceId, coll.getPalette(curr_anim->paletteIndex), fadeIn); - if (curr_anim->initialPause) - if (events.interruptableDelay(12000)) return true; + if (curr_anim->initialPause != 0) + if (events.interruptableDelay(curr_anim->initialPause * 1000 / 50)) return true; result = false; switch (anim->show()) { case ABORT_NONE: - if (curr_anim->endingPause) { - result = events.interruptableDelay(12000); + if (curr_anim->endingPause != 0) { + result = events.interruptableDelay(curr_anim->endingPause * 1000 / 50); } break; @@ -105,7 +123,10 @@ bool Introduction::show() { } delete anim; - if (result) return true; + if (result) { + Sound.musicInterface_KillAll(); + return true; + } } // Show battle pictures one frame at a time @@ -119,12 +140,12 @@ bool Introduction::show() { if (result) break; } while (anim->step()); delete anim; - if (result) return true; - - // Show final introduction screen - - showScreen(0x22, 0x21, 10000); + + if (!result) + // Show final introduction screen + showScreen(0x22, 0x21, 10000); + Sound.musicInterface_KillAll(); return false; } diff --git a/engines/lure/lure.cpp b/engines/lure/lure.cpp index f7c4272f0e..ada8f5081b 100644 --- a/engines/lure/lure.cpp +++ b/engines/lure/lure.cpp @@ -34,6 +34,7 @@ #include "lure/lure.h" #include "lure/intro.h" #include "lure/game.h" +#include "lure/sound.h" namespace Lure { @@ -45,17 +46,16 @@ LureEngine::LureEngine(OSystem *system): Engine(system) { Common::addSpecialDebugLevel(kLureDebugAnimations, "animations", "Animations debugging"); Common::addSpecialDebugLevel(kLureDebugHotspots, "hotspots", "Hotspots debugging"); Common::addSpecialDebugLevel(kLureDebugFights, "fights", "Fights debugging"); + Common::addSpecialDebugLevel(kLureDebugSounds, "sounds", "Sounds debugging"); // Setup mixer -/* + if (!_mixer->isReady()) { warning("Sound initialization failed."); } _mixer->setVolumeForSoundType(Audio::Mixer::kSFXSoundType, ConfMan.getInt("sfx_volume")); _mixer->setVolumeForSoundType(Audio::Mixer::kMusicSoundType, ConfMan.getInt("music_volume")); - _mixer->setVolumeForSoundType(Audio::Mixer::kSpeechSoundType, ConfMan.getInt("speech_volume")); -*/ _features = 0; _game = 0; @@ -106,7 +106,9 @@ LureEngine &LureEngine::getReference() { int LureEngine::go() { if (ConfMan.getInt("boot_param") == 0) { // Show the introduction + Sound.loadSection(INTRO_SOUND_RESOURCE_ID); Introduction *intro = new Introduction(*_screen, *_system); + intro->show(); delete intro; } @@ -114,6 +116,7 @@ int LureEngine::go() { // Play the game if (!_events->quitFlag) { // Play the game + Sound.loadSection(MAIN_SOUND_RESOURCE_ID); Game *gameInstance = new Game(); gameInstance->execute(); delete gameInstance; @@ -169,8 +172,7 @@ bool LureEngine::loadGame(uint8 slotNumber) { // Check for header char buffer[5]; f->read(buffer, 5); - if (memcmp(buffer, "lure", 5) != 0) - { + if (memcmp(buffer, "lure", 5) != 0) { warning(FAILED_MSG, slotNumber); delete f; return false; @@ -179,8 +181,7 @@ bool LureEngine::loadGame(uint8 slotNumber) { // Check language version uint8 language = f->readByte(); uint8 version = f->readByte(); - if ((language != _language) || (version != LURE_DAT_MINOR)) - { + if ((language != _language) || (version != LURE_DAT_MINOR)) { warning("loadGame: Failed to load slot %d - incorrect version", slotNumber); delete f; return false; diff --git a/engines/lure/lure.h b/engines/lure/lure.h index aa7f0ae93a..7ac0977900 100644 --- a/engines/lure/lure.h +++ b/engines/lure/lure.h @@ -71,6 +71,7 @@ public: uint32 features() { return _features; } uint8 game() { return _game; } Disk &disk() { return *_disk; } + Common::Language getLanguage() { return _language; } bool loadGame(uint8 slotNumber); bool saveGame(uint8 slotNumber, Common::String &caption); diff --git a/engines/lure/luredefs.h b/engines/lure/luredefs.h index d5991a5807..ef48f6f452 100644 --- a/engines/lure/luredefs.h +++ b/engines/lure/luredefs.h @@ -34,7 +34,7 @@ namespace Lure { #define SUPPORT_FILENAME "lure.dat" #define LURE_DAT_MAJOR 1 -#define LURE_DAT_MINOR 20 +#define LURE_DAT_MINOR 21 #define LURE_DEBUG 1 @@ -45,7 +45,8 @@ enum { kLureDebugScripts = 1 << 0, kLureDebugAnimations = 1 << 1, kLureDebugHotspots = 1 << 2, - kLureDebugFights = 1 << 3 + kLureDebugFights = 1 << 3, + kLureDebugSounds = 1 << 4 }; #define ERROR_BASIC 1 @@ -222,13 +223,15 @@ enum CursorType {CURSOR_ARROW = 0, CURSOR_DISK = 1, CURSOR_TIME_START = 2, #define EXIT_HOTSPOT_ID_LIST 0x3f15 #define FIGHT_DATA_RESOURCE_ID 0x3f16 #define STRING_LIST_RESOURCE_ID 0x3f17 +#define SOUND_DESC_RESOURCE_ID 0x3f18 // Script constants #define STARTUP_SCRIPT 0x23FC // Miscellaneous resources -#define CREDITS_RESOURCE_ID 0x7800 #define NAMES_RESOURCE_ID 9 +#define MAIN_SOUND_RESOURCE_ID 0xC +#define INTRO_SOUND_RESOURCE_ID 0x31 #define NOONE_ID 0x3E7 #define PLAYER_ID 0x3E8 #define RATPOUCH_ID 0x3E9 @@ -249,12 +252,16 @@ enum CursorType {CURSOR_ARROW = 0, CURSOR_DISK = 1, CURSOR_TIME_START = 2, #define SKORL_FIGHTER_ID 0x444 #define START_EXIT_ID 0x2710 #define BOTTLE_HOTSPOT_ID 0x2710 +#define CELL_DOOR_HOTSPOT_ID 0x2712 #define BRICKS_ID 0x2714 #define BOOK_ID 0x2723 #define START_NONVISUAL_HOTSPOT_ID 0x7530 +#define CREDITS_RESOURCE_ID 0x7800 +#define RESTART_RESOURCE_ID 0x7900 // Milliseconds delay between game frames #define GAME_FRAME_DELAY 80 +#define GAME_TICK_DELAY 20 // Tick proc constants #define STANDARD_CHARACTER_TICK_PROC 0x4f82 @@ -287,12 +294,14 @@ enum CursorType {CURSOR_ARROW = 0, CURSOR_DISK = 1, CURSOR_TIME_START = 2, #define EWAN_ALT_ANIM_ID 0x59ED #define PLAYER_ANIM_ID 0x5C80 #define SELENA_ANIM_ID 0x5CAA +#define DEFAULT_VOLUME 192 #define CONVERSE_COUNTDOWN_SIZE 40 #define IDLE_COUNTDOWN_SIZE 15 #define MAX_TELL_COMMANDS 8 #define MAX_SAVEGAME_SLOTS 10 +#define ROOMNUM_VILLAGE_SHOP 35 #define ROOMNUM_CAVE 38 #define ROOMNUM_CELLAR 42 #define ROOMNUM_DINING_HALL 45 diff --git a/engines/lure/menu.cpp b/engines/lure/menu.cpp index 3bb6769ff7..7dfb6e2a57 100644 --- a/engines/lure/menu.cpp +++ b/engines/lure/menu.cpp @@ -106,8 +106,7 @@ uint8 Menu::execute() { while (events.pollEvent()) { if (events.quitFlag) return MENUITEM_NONE; - if (mouse.y() < MENUBAR_Y_SIZE) - { + if (mouse.y() < MENUBAR_Y_SIZE) { MenuRecord *p = getMenuAt(mouse.x()); if (_selectedMenu != p) { diff --git a/engines/lure/res.cpp b/engines/lure/res.cpp index 4da38eddc7..b0e99b5be5 100644 --- a/engines/lure/res.cpp +++ b/engines/lure/res.cpp @@ -42,11 +42,19 @@ Resources &Resources::getReference() { Resources::Resources() { int_resources = this; reloadData(); + + // Load the string list + MemoryBlock *mb = Disk::getReference().getEntry(STRING_LIST_RESOURCE_ID); + _stringList.load(mb); + delete mb; } Resources::~Resources() { // Free up any loaded data freeData(); + + // Free up constant data + _stringList.clear(); } void Resources::freeData() { @@ -61,12 +69,16 @@ void Resources::freeData() { _randomActions.clear(); _indexedRoomExitHospots.clear(); _pausedList.clear(); - _stringList.clear(); + _actionsList.clear(); + _coordinateList.clear(); + _talkHeaders.clear(); + _talkData.clear(); + free(_hotspotScriptData); delete _paletteSubset; delete _scriptData; delete _script2Data; - free(_hotspotScriptData); + delete _talkDialogData; delete _messagesData; delete _cursors; delete [] _charOffsets; @@ -77,6 +89,13 @@ struct AnimRecordTemp { MovementDataList *list; }; +void Resources::reset() { + freeData(); + + _fieldList.reset(); + reloadData(); +} + void Resources::reloadData() { Disk &d = Disk::getReference(); MemoryBlock *mb, *paths; @@ -312,11 +331,6 @@ void Resources::reloadData() { indexedRec++; } - // Load the string list - mb = d.getEntry(STRING_LIST_RESOURCE_ID); - _stringList.load(mb); - delete mb; - // Initialise delay list _delayList.clear(true); @@ -341,7 +355,7 @@ RoomExitJoinData *Resources::getExitJoin(uint16 hotspotId) { for (i = _exitJoins.begin(); i != _exitJoins.end(); ++i) { RoomExitJoinData *rec = *i; - if ((rec->hotspot1Id == hotspotId) || (rec->hotspot2Id == hotspotId)) + if ((rec->hotspots[0].hotspotId == hotspotId) || (rec->hotspots[1].hotspotId == hotspotId)) return rec; } @@ -645,8 +659,7 @@ void Resources::setTalkData(uint16 offset) { error("Unknown talk entry offset %d requested", offset); } -void Resources::saveToStream(Common::WriteStream *stream) -{ +void Resources::saveToStream(Common::WriteStream *stream) { _hotspotData.saveToStream(stream); _activeHotspots.saveToStream(stream); _fieldList.saveToStream(stream); diff --git a/engines/lure/res.h b/engines/lure/res.h index 7c9970f27f..86d5ad5d95 100644 --- a/engines/lure/res.h +++ b/engines/lure/res.h @@ -88,12 +88,13 @@ private: int _talkStartEntry; uint16 _talkingCharacter; + void reloadData(); void freeData(); public: Resources(); ~Resources(); static Resources &getReference(); - void reloadData(); + void reset(); byte *getResource(uint16 resId); RoomDataList &roomData() { return _roomData; } diff --git a/engines/lure/res_struct.cpp b/engines/lure/res_struct.cpp index 12cf61a58a..f4506406ef 100644 --- a/engines/lure/res_struct.cpp +++ b/engines/lure/res_struct.cpp @@ -30,47 +30,47 @@ namespace Lure { -const Action sortedActions[] = {ASK, BRIBE, BUY, CLOSE, DRINK, EXAMINE, GET, GIVE, +extern const Action sortedActions[] = {ASK, BRIBE, BUY, CLOSE, DRINK, EXAMINE, GET, GIVE, GO_TO, LOCK, LOOK, LOOK_AT, LOOK_THROUGH, OPEN, OPERATE, PULL, PUSH, RETURN, STATUS, TALK_TO, TELL, UNLOCK, USE, NONE}; -int actionNumParams[NPC_JUMP_ADDRESS+1] = {0, +extern const int actionNumParams[NPC_JUMP_ADDRESS+1] = {0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 2, 0, 1, 0, 1, 1, 1, 1, 0, 0, 2, 1, 1, 0, 0, 1, 1, 2, 2, 5, 2, 2, 1}; // Barman related frame lists -uint16 basicPolish[] = {8+13,8+14,8+15,8+16,8+17,8+18,8+17,8+16,8+15,8+14, +static const uint16 basicPolish[] = {8+13,8+14,8+15,8+16,8+17,8+18,8+17,8+16,8+15,8+14, 8+15,8+16,8+17,8+18,8+17,8+16,8+15,8+14,8+13,0}; -uint16 sidsFetch[] = {12+1,12+2,12+3,12+4,12+5,12+6,12+5,12+6,12+5,12+4,12+3,12+7,12+8,0}; +static const uint16 sidsFetch[] = {12+1,12+2,12+3,12+4,12+5,12+6,12+5,12+6,12+5,12+4,12+3,12+7,12+8,0}; -uint16 nelliesScratch[] = {11+1,11+2,11+3,11+4,11+5,11+4,11+5,11+4,11+5,11+4,11+3,11+2,11+1,0}; +static const uint16 nelliesScratch[] = {11+1,11+2,11+3,11+4,11+5,11+4,11+5,11+4,11+5,11+4,11+3,11+2,11+1,0}; -uint16 nelliesFetch[] = {1,2,3,4,5,4,5,4,3,2,6,7,0}; +static const uint16 nelliesFetch[] = {1,2,3,4,5,4,5,4,3,2,6,7,0}; -uint16 ewansFetch[] = {13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,0}; +static const uint16 ewansFetch[] = {13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,0}; -uint16 ewanExtraGraphic1[]= { +static const uint16 ewanExtraGraphic1[]= { 28,29,30,31,32,33,34,35,36,37, 38,39,40,41,42,43,44,45,46,47, 48, 40,39,38,37,36,35,34,33,32,31,30,29,28, 0}; -uint16 ewanExtraGraphic2[] = { +static const uint16 ewanExtraGraphic2[] = { 1,2,3,4,5,6,7,8,9, 10,11,12,13,14,15,16,17,18,19, 20,21,22,23,24,0}; -BarEntry barList[3] = { +static const BarEntry default_barList[3] = { {29, SID_ID, {{0, 0}, {0, 0}, {0, 0}, {0, 0}}, {&basicPolish[0], &sidsFetch[0], NULL, NULL}, 13, NULL}, {32, NELLIE_ID, {{0, 0}, {0, 0}, {0, 0}, {0, 0}}, {&nelliesScratch[0], &nelliesFetch[0], NULL, NULL}, 14, NULL}, {35, EWAN_ID, {{0, 0}, {0, 0}, {0, 0}, {0, 0}}, {&ewansFetch[0], &ewansFetch[0], &ewanExtraGraphic1[0], &ewanExtraGraphic2[0]}, 16, NULL} }; -RoomTranslationRecord roomTranslations[] = { +extern const RoomTranslationRecord roomTranslations[] = { {0x1E, 0x13}, {0x07, 0x08}, {0x1C, 0x12}, {0x26, 0x0F}, {0x27, 0x0F}, {0x28, 0x0F}, {0x29, 0x0F}, {0x22, 0x0A}, {0x23, 0x13}, {0x24, 0x14}, {0x31, 0x2C}, {0x2F, 0x2C}, @@ -308,28 +308,29 @@ void RoomDataList::loadFromStream(ReadStream *stream) { // Room exit joins class RoomExitJoinData::RoomExitJoinData(RoomExitJoinResource *rec) { - hotspot1Id = FROM_LE_16(rec->hotspot1Id); - h1CurrentFrame = rec->h1CurrentFrame; - h1DestFrame = rec->h1DestFrame; - h1OpenSound = rec->h1OpenSound; - h1CloseSound = rec->h1CloseSound; - hotspot2Id = FROM_LE_16(rec->hotspot2Id); - h2CurrentFrame = rec->h2CurrentFrame; - h2DestFrame = rec->h2DestFrame; - h2OpenSound = rec->h2OpenSound; - h2CloseSound = rec->h2CloseSound; + hotspots[0].hotspotId = FROM_LE_16(rec->hotspot1Id); + hotspots[0].currentFrame = rec->h1CurrentFrame; + hotspots[0].destFrame = rec->h1DestFrame; + hotspots[0].openSound = rec->h1OpenSound; + hotspots[0].closeSound = rec->h1CloseSound; + hotspots[1].hotspotId = FROM_LE_16(rec->hotspot2Id); + hotspots[1].currentFrame = rec->h2CurrentFrame; + hotspots[1].destFrame = rec->h2DestFrame; + hotspots[1].openSound = rec->h2OpenSound; + hotspots[1].closeSound = rec->h2CloseSound; blocked = rec->blocked; } void RoomExitJoinList::saveToStream(WriteStream *stream) { for (RoomExitJoinList::iterator i = begin(); i != end(); ++i) { RoomExitJoinData *rec = *i; - stream->writeUint16LE(rec->hotspot1Id); - stream->writeUint16LE(rec->hotspot2Id); - stream->writeByte(rec->h1CurrentFrame); - stream->writeByte(rec->h1DestFrame); - stream->writeByte(rec->h2CurrentFrame); - stream->writeByte(rec->h2DestFrame); + + stream->writeUint16LE(rec->hotspots[0].hotspotId); + stream->writeUint16LE(rec->hotspots[1].hotspotId); + stream->writeByte(rec->hotspots[0].currentFrame); + stream->writeByte(rec->hotspots[0].destFrame); + stream->writeByte(rec->hotspots[1].currentFrame); + stream->writeByte(rec->hotspots[1].destFrame); stream->writeByte(rec->blocked); } @@ -345,13 +346,14 @@ void RoomExitJoinList::loadFromStream(ReadStream *stream) { if (hotspot1Id == 0xffff) error("Invalid room exit join list"); uint16 hotspot2Id = stream->readUint16LE(); - if ((rec->hotspot1Id != hotspot1Id) || (rec->hotspot2Id != hotspot2Id)) + if ((rec->hotspots[0].hotspotId != hotspot1Id) || + (rec->hotspots[1].hotspotId != hotspot2Id)) break; - rec->h1CurrentFrame = stream->readByte(); - rec->h1DestFrame = stream->readByte(); - rec->h2CurrentFrame = stream->readByte(); - rec->h2DestFrame = stream->readByte(); + rec->hotspots[0].currentFrame = stream->readByte(); + rec->hotspots[0].destFrame = stream->readByte(); + rec->hotspots[1].currentFrame = stream->readByte(); + rec->hotspots[1].destFrame = stream->readByte(); rec->blocked = stream->readByte(); } @@ -429,6 +431,8 @@ HotspotData::HotspotData(HotspotResource *rec) { pauseCtr = 0; actionHotspotId = 0; talkOverride = 0; + talkGate = 0; + scriptHotspotId = 0; } void HotspotData::saveToStream(WriteStream *stream) { @@ -517,8 +521,7 @@ void HotspotData::loadFromStream(ReadStream *stream) { void HotspotDataList::saveToStream(WriteStream *stream) { iterator i; - for (i = begin(); i != end(); ++i) - { + for (i = begin(); i != end(); ++i) { HotspotData *hotspot = *i; stream->writeUint16LE(hotspot->hotspotId); hotspot->saveToStream(stream); @@ -530,8 +533,7 @@ void HotspotDataList::loadFromStream(ReadStream *stream) { Resources &res = Resources::getReference(); iterator i; uint16 hotspotId = stream->readUint16LE(); - while (hotspotId != 0) - { + while (hotspotId != 0) { HotspotData *hotspot = res.getHotspot(hotspotId); assert(hotspot); hotspot->loadFromStream(stream); @@ -963,8 +965,7 @@ RandomActionSet::~RandomActionSet() { RandomActionSet *RandomActionList::getRoom(uint16 roomNumber) { iterator i; - for (i = begin(); i != end(); ++i) - { + for (i = begin(); i != end(); ++i) { RandomActionSet *v = *i; if (v->roomNumber() == roomNumber) return v; @@ -1104,8 +1105,7 @@ int PausedCharacterList::check(uint16 charId, int numImpinging, uint16 *impingin // There was, so move to next impinging character entry continue; - if ((hotspot->hotspotId() == PLAYER_ID) && !hotspot->coveredFlag()) - { + if ((hotspot->hotspotId() == PLAYER_ID) && !hotspot->coveredFlag()) { hotspot->updateMovement(); return 1; } @@ -1137,39 +1137,37 @@ int PausedCharacterList::check(uint16 charId, int numImpinging, uint16 *impingin // Wrapper class for the barman lists -BarEntry &BarmanLists::getDetails(uint16 roomNumber) -{ +BarmanLists::BarmanLists() { + for (int index = 0; index < 3; ++index) + _barList[index] = default_barList[index]; +} + +BarEntry &BarmanLists::getDetails(uint16 roomNumber) { for (int index = 0; index < 3; ++index) - if (barList[index].roomNumber == roomNumber) - return barList[index]; + if (_barList[index].roomNumber == roomNumber) + return _barList[index]; error("Invalid room %d specified for barman details retrieval", roomNumber); } -void BarmanLists::saveToStream(Common::WriteStream *stream) -{ - for (int index = 0; index < 2; ++index) - { - uint16 value = (barList[index].currentCustomer - &barList[index].customers[0]) / sizeof(BarEntry); +void BarmanLists::saveToStream(Common::WriteStream *stream) { + for (int index = 0; index < 2; ++index) { + uint16 value = (_barList[index].currentCustomer - &_barList[index].customers[0]) / sizeof(BarEntry); stream->writeUint16LE(value); - for (int ctr = 0; ctr < NUM_SERVE_CUSTOMERS; ++ctr) - { - stream->writeUint16LE(barList[index].customers[ctr].hotspotId); - stream->writeByte(barList[index].customers[ctr].serveFlags); + for (int ctr = 0; ctr < NUM_SERVE_CUSTOMERS; ++ctr) { + stream->writeUint16LE(_barList[index].customers[ctr].hotspotId); + stream->writeByte(_barList[index].customers[ctr].serveFlags); } } } -void BarmanLists::loadFromStream(Common::ReadStream *stream) -{ - for (int index = 0; index < 2; ++index) - { +void BarmanLists::loadFromStream(Common::ReadStream *stream) { + for (int index = 0; index < 2; ++index) { int16 value = stream->readUint16LE(); - barList[index].currentCustomer = (value == 0) ? NULL : &barList[index].customers[value]; + _barList[index].currentCustomer = (value == 0) ? NULL : &_barList[index].customers[value]; - for (int ctr = 0; ctr < NUM_SERVE_CUSTOMERS; ++ctr) - { - barList[index].customers[ctr].hotspotId = stream->readUint16LE(); - barList[index].customers[ctr].serveFlags = stream->readByte(); + for (int ctr = 0; ctr < NUM_SERVE_CUSTOMERS; ++ctr) { + _barList[index].customers[ctr].hotspotId = stream->readUint16LE(); + _barList[index].customers[ctr].serveFlags = stream->readByte(); } } } @@ -1202,12 +1200,16 @@ void StringList::clear() { // Field list and miscellaneous variables ValueTableData::ValueTableData() { + reset(); +} + +void ValueTableData::reset() { _numGroats = 0; _playerNewPos.roomNumber = 0; _playerNewPos.position.x = 0; _playerNewPos.position.y = 0; _flags = GAMEFLAG_4 | GAMEFLAG_1; - _hdrFlagMask = 1; + _hdrFlagMask = 1; for (uint16 index = 0; index < NUM_VALUE_FIELDS; ++index) _fieldList[index] = 0; @@ -1242,8 +1244,7 @@ void ValueTableData::setField(FieldName fieldName, uint16 value) { setField((uint16) fieldName, value); } -void ValueTableData::saveToStream(Common::WriteStream *stream) -{ +void ValueTableData::saveToStream(Common::WriteStream *stream) { // Write out the special fields stream->writeUint16LE(_numGroats); stream->writeSint16LE(_playerNewPos.position.x); @@ -1257,8 +1258,7 @@ void ValueTableData::saveToStream(Common::WriteStream *stream) stream->writeUint16LE(_fieldList[index]); } -void ValueTableData::loadFromStream(Common::ReadStream *stream) -{ +void ValueTableData::loadFromStream(Common::ReadStream *stream) { // Load special fields _numGroats = stream->readUint16LE(); _playerNewPos.position.x = stream->readSint16LE(); diff --git a/engines/lure/res_struct.h b/engines/lure/res_struct.h index 4d2c55e6b1..81ecd87563 100644 --- a/engines/lure/res_struct.h +++ b/engines/lure/res_struct.h @@ -225,6 +225,18 @@ struct RoomExitIndexedHotspotResource { uint16 hotspotId; } PACKED_STRUCT; +enum SoundDescFlags {SF_IN_USE = 1, SF_RESTORE = 2}; + +// In desc entry, numChannels: bits 0-1 # roland, bits 2-3 #adlib, bits 4-5 #internal + +struct SoundDescResource { + uint8 soundNumber; + uint8 channel; + uint8 numChannels; + uint8 flags; + uint8 volume; +} PACKED_STRUCT; + #include "common/pack-end.h" // END STRUCT PACKING /** @@ -242,23 +254,28 @@ public: } void clear() { - typename Common::List<T>::iterator i; - for (i = Common_List::begin(); i != Common_List::end(); ++i) - delete *i; - Common_List::clear(); + typename Common_List::iterator i = Common_List::begin(); + while (i != Common_List::end()) { + T v = *i; + i = Common_List::erase(i); + delete v; + } } - typename Common::List<T>::iterator erase(typename Common::List<T>::iterator pos) { - delete *pos; - return Common_List::erase(pos); + typename Common_List::iterator erase(typename Common_List::iterator pos) { + T obj = *pos; + typename Common_List::iterator result = Common_List::erase(pos); + delete obj; + return result; } - typename Common::List<T>::iterator erase(typename Common::List<T>::iterator first, - typename Common::List<T>::iterator last) { - typename Common::List<T>::iterator i; - for (i = first; i != last; ++i) - delete *i; - return Common_List::erase(first, last); + typename Common_List::iterator erase(typename Common_List::iterator first, + typename Common_List::iterator last) { + + while (first != last) + erase(first++); + + return last; } }; @@ -353,22 +370,21 @@ public: void loadFromStream(ReadStream *stream); }; +struct RoomExitJoinStruct { + uint16 hotspotId; + byte currentFrame; + byte destFrame; + uint8 openSound; + uint8 closeSound; +}; + class RoomExitJoinData { public: RoomExitJoinData(RoomExitJoinResource *rec); - uint16 hotspot1Id; - byte h1CurrentFrame; - byte h1DestFrame; - uint8 h1OpenSound; - uint8 h1CloseSound; - uint16 hotspot2Id; - byte h2CurrentFrame; - byte h2DestFrame; - uint8 h2OpenSound; - uint8 h2CloseSound; + RoomExitJoinStruct hotspots[2]; + byte blocked; - uint32 unknown; }; class RoomExitJoinList: public ManagedList<RoomExitJoinData *> { @@ -618,7 +634,7 @@ public: // The following classes holds the data for NPC schedules -extern int actionNumParams[NPC_JUMP_ADDRESS+1]; +extern const int actionNumParams[NPC_JUMP_ADDRESS+1]; class CharacterScheduleSet; @@ -730,13 +746,16 @@ struct BarEntry { uint16 roomNumber; uint16 barmanId; ServeEntry customers[NUM_SERVE_CUSTOMERS]; - uint16 *graphics[4]; + const uint16 *graphics[4]; uint16 gridLine; ServeEntry *currentCustomer; }; class BarmanLists { + BarEntry _barList[3]; public: + BarmanLists(); + BarEntry &getDetails(uint16 roomNumber); void saveToStream(Common::WriteStream *stream); void loadFromStream(Common::ReadStream *stream); @@ -749,7 +768,7 @@ struct RoomTranslationRecord { uint8 destRoom; }; -extern RoomTranslationRecord roomTranslations[]; +extern const RoomTranslationRecord roomTranslations[]; enum StringEnum {S_CREDITS = 25, S_RESTART_GAME = 26, S_SAVE_GAME = 27, S_RESTORE_GAME = 28, S_QUIT = 29, S_FAST_TEXT = 30, S_SLOW_TEXT = 31, S_SOUND_ON = 32, S_SOUND_OFF = 33, @@ -797,7 +816,8 @@ enum FieldName { BOTTLE_FILLED = 18, TALK_INDEX = 19, SACK_CUT = 20, - ROOM_EXIT_ANIMATION = 76 + ROOM_EXIT_ANIMATION = 76, + AREA_FLAG = 82 }; enum GameFlags { @@ -827,6 +847,7 @@ private: bool isKnownField(uint16 fieldIndex); public: ValueTableData(); + void reset(); uint16 getField(uint16 fieldIndex); uint16 getField(FieldName fieldName); diff --git a/engines/lure/room.cpp b/engines/lure/room.cpp index b48b50197b..acab44deea 100644 --- a/engines/lure/room.cpp +++ b/engines/lure/room.cpp @@ -492,13 +492,13 @@ void Room::update() { } void Room::setRoomNumber(uint16 newRoomNumber, bool showOverlay) { - Resources &r = Resources::getReference(); + Resources &res = Resources::getReference(); Game &game = Game::getReference(); Mouse &mouse = Mouse::getReference(); mouse.pushCursorNum(CURSOR_DISK); - _roomData = r.getRoom(newRoomNumber); + _roomData = res.getRoom(newRoomNumber); if (!_roomData) error("Tried to change to non-existant room: %d", newRoomNumber); bool leaveFlag = (_layers[0] && (newRoomNumber != _roomNumber) && (_roomNumber != 0)); @@ -512,6 +512,7 @@ void Room::setRoomNumber(uint16 newRoomNumber, bool showOverlay) { } _screen.empty(); + _screen.setPaletteEmpty(GAME_COLOURS); _numLayers = _roomData->numLayers; if (showOverlay) ++_numLayers; @@ -521,36 +522,38 @@ void Room::setRoomNumber(uint16 newRoomNumber, bool showOverlay) { _layers[layerNum] = new RoomLayer(_roomData->layers[layerNum], layerNum == 0); - // Load in the game palette and set the non-room specific colours at the top end of the palette + // Load in the game palette, which contains at it's top end general GUI element colours Palette mainPalette(GAME_PALETTE_RESOURCE_ID); - _screen.setPalette(&mainPalette, MAIN_PALETTE_SIZE, GAME_COLOURS - MAIN_PALETTE_SIZE); + _screen.setPalette(&mainPalette, 0, GAME_COLOURS); + + // Generate the palette for the room that will be faded in + Palette p(MAIN_PALETTE_SIZE, NULL, RGB64); + Palette tempPalette(paletteId); + p.copyFrom(&tempPalette); + res.insertPaletteSubset(p); // Set the new room number - r.fieldList().setField(ROOM_NUMBER, newRoomNumber); + res.fieldList().setField(ROOM_NUMBER, newRoomNumber); if (_roomData->sequenceOffset != 0xffff) Script::execute(_roomData->sequenceOffset); loadRoomHotspots(); - if (_roomData->exitTime != 0xffff) - { + if ((_roomData->exitTime != 0xffff) && (_roomData->exitTime != 0)) { // If time has passed, animation ticks needed before room is displayed int numSeconds = (g_system->getMillis() - _roomData->exitTime) / 1000; if (numSeconds > 300) numSeconds = 300; + game.preloadFlag() = true; while (numSeconds-- > 0) - game.tick(true); + game.tick(); + game.preloadFlag() = false; } + game.tick(); update(); _screen.update(); - - // Generate the palette for the room and fade it in - Palette p(MAIN_PALETTE_SIZE, NULL, RGB64); - Palette tempPalette(paletteId); - p.copyFrom(&tempPalette); - r.insertPaletteSubset(p); _screen.paletteFadeIn(&p); mouse.popCursor(); diff --git a/engines/lure/screen.cpp b/engines/lure/screen.cpp index 0cd2dd9357..552e609b84 100644 --- a/engines/lure/screen.cpp +++ b/engines/lure/screen.cpp @@ -55,11 +55,11 @@ Screen::~Screen() { // setPaletteEmpty // Defaults the palette to an empty set -void Screen::setPaletteEmpty() { +void Screen::setPaletteEmpty(int numEntries) { delete _palette; _palette = new Palette(); - _system.setPalette(_palette->data(), 0, GAME_COLOURS); + _system.setPalette(_palette->data(), 0, numEntries); _system.updateScreen(); } @@ -76,9 +76,8 @@ void Screen::setPalette(Palette *p) { // Variation that allows the specification of a subset of a palette passed in to be copied void Screen::setPalette(Palette *p, uint16 start, uint16 num) { - _palette->palette()->copyFrom(p->palette(), start * PALETTE_FADE_INC_SIZE, - start * PALETTE_FADE_INC_SIZE, num * PALETTE_FADE_INC_SIZE); - _system.setPalette(_palette->data(), 0, GAME_COLOURS); + _palette->palette()->copyFrom(p->palette(), start * 4, start * 4, num * 4); + _system.setPalette(_palette->data(), start, num); _system.updateScreen(); } @@ -96,8 +95,7 @@ void Screen::paletteFadeIn(Palette *p) { byte *pFinal = p->data(); byte *pCurrent = _palette->data(); - for (int palCtr = 0; palCtr < p->numEntries() * PALETTE_FADE_INC_SIZE; ++palCtr, ++pCurrent, ++pFinal) - { + for (int palCtr = 0; palCtr < p->numEntries() * PALETTE_FADE_INC_SIZE; ++palCtr, ++pCurrent, ++pFinal) { if (palCtr % PALETTE_FADE_INC_SIZE == (PALETTE_FADE_INC_SIZE - 1)) continue; bool isDifferent = *pCurrent < *pFinal; @@ -111,7 +109,7 @@ void Screen::paletteFadeIn(Palette *p) { } if (changed) { - _system.setPalette(_palette->data(), 0, GAME_COLOURS); + _system.setPalette(_palette->data(), 0, p->numEntries()); _system.updateScreen(); _system.delayMillis(20); events.pollEvent(); @@ -143,7 +141,7 @@ void Screen::paletteFadeOut(int numEntries) { } if (changed) { - _system.setPalette(_palette->data(), 0, GAME_COLOURS); + _system.setPalette(_palette->data(), 0, numEntries); _system.updateScreen(); _system.delayMillis(20); events.pollEvent(); diff --git a/engines/lure/screen.h b/engines/lure/screen.h index 7182c4236b..90db7ee314 100644 --- a/engines/lure/screen.h +++ b/engines/lure/screen.h @@ -47,12 +47,12 @@ public: ~Screen(); static Screen &getReference(); - void setPaletteEmpty(); + void setPaletteEmpty(int numEntries = RES_PALETTE_ENTRIES); void setPalette(Palette *p); void setPalette(Palette *p, uint16 start, uint16 num); Palette &getPalette() { return *_palette; } void paletteFadeIn(Palette *p); - void paletteFadeOut(int numEntries = MAIN_PALETTE_SIZE); + void paletteFadeOut(int numEntries = RES_PALETTE_ENTRIES); void resetPalette(); void empty(); void update(); diff --git a/engines/lure/scripts.cpp b/engines/lure/scripts.cpp index 3ce1b916b3..bba364bcf2 100644 --- a/engines/lure/scripts.cpp +++ b/engines/lure/scripts.cpp @@ -38,12 +38,12 @@ namespace Lure { // This list of hotspot Ids are used by sequence method #5 to deallocate a set // of hotspot Ids at once -uint16 dealloc_list_1[] = {0x13F2, 0x418, 0x2711, 0x2712, 0x40D, 0x3EA, 0x411, 0}; -uint16 dealloc_list_2[] = {0x2729, 0x272A, 0x272B, 0x272C, 0x272E, 0x272E, 0x272F, 0}; -uint16 dealloc_list_3[] = {0x3EF, 0x3E9, 0x3EB, 0x3EC, 0x3ED, 0x3EE, 0x3F0, 0x3F1, +static const uint16 dealloc_list_1[] = {0x13F2, 0x418, 0x2711, 0x2712, 0x40D, 0x3EA, 0x411, 0}; +static const uint16 dealloc_list_2[] = {0x2729, 0x272A, 0x272B, 0x272C, 0x272E, 0x272E, 0x272F, 0}; +static const uint16 dealloc_list_3[] = {0x3EF, 0x3E9, 0x3EB, 0x3EC, 0x3ED, 0x3EE, 0x3F0, 0x3F1, 0x420, 0x429, 0x436, 0x2715, 0x2716, 0x2717, 0x2718, 0x2719, 0x271A, 0x271E, 0x271F, 0x2720, 0x2721, 0x2722, 0x2725, 0x2726, 0}; -uint16 *hotspot_dealloc_set[4] = {&dealloc_list_1[0], &dealloc_list_2[0], +static const uint16 *hotspot_dealloc_set[4] = {&dealloc_list_1[0], &dealloc_list_2[0], &dealloc_list_3[1], &dealloc_list_3[0]}; /*------------------------------------------------------------------------*/ @@ -75,8 +75,8 @@ void Script::setHotspotScript(uint16 hotspotId, uint16 scriptIndex, uint16 v3) { } } -void Script::addSound2(uint16 soundId, uint16 v2, uint16 v3) { - // TODO: Not yet implemented +void Script::addSound2(uint16 soundIndex, uint16 v2, uint16 v3) { + Sound.addSound2(soundIndex); } // Sets the bitmask indicating what group of rooms/hotspots to display when the @@ -99,7 +99,7 @@ void Script::deactivateHotspotSet(uint16 listIndex, uint16 v2, uint16 v3) { if (listIndex > 3) error("Script::deactiveHotspotSet - Invalid list index"); Resources &res = Resources::getReference(); - uint16 *hotspotId = hotspot_dealloc_set[listIndex]; + const uint16 *hotspotId = hotspot_dealloc_set[listIndex]; while (*hotspotId != 0) { res.deactivateHotspot(*hotspotId); @@ -132,8 +132,7 @@ void Script::deactivateHotspot(uint16 hotspotId, uint16 v2, uint16 v3) { hs->layer = 0xff; } -// Sets the offset for the table of action sequence offsets for the given -// hotspot +// Sets the offset for the table of action sequence offsets for the given hotspot void Script::setDesc(uint16 hotspotId, uint16 descId, uint16 v3) { Resources &res = Resources::getReference(); @@ -151,8 +150,8 @@ void Script::addDelayedSequence(uint16 seqOffset, uint16 delay, uint16 canClear) // Stops the specified sound -void Script::killSound(uint16 soundId, uint16 v2, uint16 v3) { - // TODO +void Script::killSound(uint16 soundNumber, uint16 v2, uint16 v3) { + Sound.musicInterface_Stop(soundNumber); } // Checks whether the given character is in the specified room, and stores @@ -179,8 +178,8 @@ void Script::setHotspotName(uint16 hotspotId, uint16 nameId, uint16 v3) { // Unsure about this method, but at the moment I think it plays a sound -void Script::addSound(uint16 v1, uint16 v2, uint16 v3) { - // TODO: No implementation currently +void Script::addSound(uint16 soundIndex, uint16 v2, uint16 v3) { + Sound.addSound(soundIndex); } void Script::endgameSequence(uint16 v1, uint16 v2, uint16 v3) { @@ -251,10 +250,10 @@ void Script::startSpeakingToNoone(uint16 characterId, uint16 stringId, uint16 v3 charHotspot->converse(NOONE_ID, stringId, false); } +// Stops playing the specified sound index -void Script::playMusic(uint16 musicNum, uint16 v2, uint16 v3) { - // TODO: Play a given music - warning("TODO: Play music #%d", musicNum); +void Script::stopSound(uint16 soundIndex, uint16 v2, uint16 v3) { + Sound.stopSound(soundIndex); } // Gets the current blocked state for the given door and stores it in the @@ -277,8 +276,7 @@ void Script::isSkorlInCell(uint16 v1, uint16 v2, uint16 v3) { // Called by the script when Ratpouch is pushing the bricks in the Outer Cell -void Script::ratpouchPushBricks(uint16 v1, uint16 v2, uint16 v3) -{ +void Script::ratpouchPushBricks(uint16 v1, uint16 v2, uint16 v3) { Resources &res = Resources::getReference(); // Mark the bricks exit as now open @@ -309,8 +307,7 @@ void Script::characterChangeRoom(uint16 y, uint16 x, uint16 roomNumber) { // Pauses Ratpouch for a long period (as good as idefinite) -void Script::pauseRatpouch(uint16 v1, uint16 v2, uint16 v3) -{ +void Script::pauseRatpouch(uint16 v1, uint16 v2, uint16 v3) { Resources &res = Resources::getReference(); Hotspot *ratpouch = res.getActiveHotspot(RATPOUCH_ID); assert(ratpouch); @@ -599,7 +596,7 @@ void Script::moveCharacterToPlayer(uint16 characterId, uint16 v2, uint16 v3) { return; uint16 destRoom = playerHotspot->roomNumber(); - RoomTranslationRecord *rec; + const RoomTranslationRecord *rec; for (rec = &roomTranslations[0]; rec->srcRoom != 0; ++rec) { if (rec->srcRoom == destRoom) { destRoom = rec->destRoom; @@ -714,17 +711,20 @@ void Script::randomToGeneral(uint16 maxVal, uint16 minVal, uint16 v3) { // Checks the status of the cell door, and starts music depending on it's state void Script::checkCellDoor(uint16 v1, uint16 v2, uint16 v3) { - // In the original game, this method checks to see if the cell door - // is currently open, if it is, starts a music sequence. - // TODO: Implement starting music if cell door is open + Resources &res = Resources::getReference(); + RoomExitJoinData *joinRec = res.getExitJoin(CELL_DOOR_HOTSPOT_ID); + + if ((joinRec->blocked == 0) && (res.fieldList().getField(TORCH_HIDE) != 0)) + Sound.addSound(0x15); } // Checks if a sound is running -void Script::checkSound(uint16 hotspotId, uint16 actions, uint16 v3) { - // For now, simply set the general value field so that the Skorl schedule - // will work properly - Resources::getReference().fieldList().setField(GENERAL, 0); +void Script::checkSound(uint16 soundNumber, uint16 v2, uint16 v3) { + Sound.tidySounds(); + + SoundDescResource *rec = Sound.findSound(soundNumber); + Resources::getReference().fieldList().setField(GENERAL, (rec != NULL) ? 1 : 0); } typedef void(*SequenceMethodPtr)(uint16, uint16, uint16); @@ -734,7 +734,7 @@ struct SequenceMethodRecord { SequenceMethodPtr proc; }; -SequenceMethodRecord scriptMethods[] = { +static const SequenceMethodRecord scriptMethods[] = { {0, Script::activateHotspot}, {1, Script::setHotspotScript}, {2, Script::addSound2}, @@ -756,7 +756,7 @@ SequenceMethodRecord scriptMethods[] = { {18, Script::remoteRoomViewSetup}, {19, Script::startSpeakingToNoone}, {20, Script::checkCellDoor}, - {21, Script::playMusic}, + {21, Script::stopSound}, {22, Script::getDoorBlocked}, {23, Script::isSkorlInCell}, {24, Script::ratpouchPushBricks}, @@ -804,14 +804,14 @@ SequenceMethodRecord scriptMethods[] = { {66, Script::checkSound}, {0xff, NULL}}; -const char *scriptOpcodes[] = { +static const char *scriptOpcodes[] = { "ABORT", "ADD", "SUBTRACT", "MULTIPLY", "DIVIDE", "EQUALS", "NOT_EQUALS", "LT", "GT", "LTE", "GTE", "AND", "OR", "LOGICAL_AND", "LOGICAL_OR", "GET_FIELD", "SET_FIELD", "PUSH", "SUBROUTINE", "EXEC", "END", "COND_JUMP", "JUMP", "ABORT2", "ABORT3", "RANDOM" }; -const char *scriptMethodNames[67] = { +static const char *scriptMethodNames[67] = { "ACTIVATE HOTSPOT", "SET HOTSPOT SCRIPT", "ADD SOUND 2", "SET HOTSPOT FLAG MASK", "CLEAR SEQUENCE DELAY LIST", "DEACTIVATE HOTSPOT SET", "DEACTIVATE HOTSPOT", "RESET PATHFINDER", "ADD DELAYED SCRIPT", "KILL SOUND", @@ -860,7 +860,7 @@ uint16 Script::execute(uint16 startOffset) { uint16 fieldNum; uint32 tempVal; SequenceMethodPtr ptr; - SequenceMethodRecord *rec; + const SequenceMethodRecord *rec; char debugInfo[MAX_DESC_SIZE]; uint16 offset = startOffset; @@ -1152,9 +1152,9 @@ int16 HotspotScript::nextVal(MemoryBlock *data, uint16 &offset) { return value; } -bool HotspotScript::execute(Hotspot *h) -{ +bool HotspotScript::execute(Hotspot *h) { Resources &r = Resources::getReference(); + Room &room = Room::getReference(); MemoryBlock *scriptData = r.hotspotScriptData(); uint16 offset = h->hotspotScript(); int16 opcode = 0; @@ -1225,14 +1225,17 @@ bool HotspotScript::execute(Hotspot *h) case S2_OPCODE_PLAY_SOUND: param1 = nextVal(scriptData, offset); param2 = nextVal(scriptData, offset); - debugC(ERROR_DETAILED, kLureDebugScripts, "PLAY_SOUND(%d,%d)", param1, param2); -// warning("UNKNOWN_247 stub called"); + + if ((param2 == 0) || (room.roomNumber() == param2)) { + debugC(ERROR_DETAILED, kLureDebugScripts, "PLAY_SOUND(%d,%d)", param2, param1); + Sound.addSound2((uint8)param1); + } break; case S2_OPCODE_STOP_SOUND: param1 = nextVal(scriptData, offset); debugC(ERROR_DETAILED, kLureDebugScripts, "STOP_SOUND()"); -// warning("UNKNOWN_258 stub called"); + Sound.stopSound((uint8)param1); break; case S2_OPCODE_ACTIONS: diff --git a/engines/lure/scripts.h b/engines/lure/scripts.h index 1191017d11..4ad5226e70 100644 --- a/engines/lure/scripts.h +++ b/engines/lure/scripts.h @@ -79,25 +79,25 @@ public: static void activateHotspot(uint16 hotspotId, uint16 v2, uint16 v3); static void setHotspotScript(uint16 hotspotId, uint16 scriptIndex, uint16 v3); - static void addSound2(uint16 v1, uint16 v2, uint16 v3); + static void addSound2(uint16 soundIndex, uint16 v2, uint16 v3); static void setHotspotFlagMask(uint16 maskVal, uint16 v2, uint16 v3); static void clearSequenceDelayList(uint16 v1, uint16 scriptIndex, uint16 v3); static void deactivateHotspotSet(uint16 listIndex, uint16 v2, uint16 v3); static void deactivateHotspot(uint16 hotspotId, uint16 v2, uint16 v3); static void resetPathfinder(uint16 v1, uint16 v2, uint16 v3); static void addDelayedSequence(uint16 seqOffset, uint16 delay, uint16 canClear); - static void killSound(uint16 soundId, uint16 v2, uint16 v3); + static void killSound(uint16 soundNumber, uint16 v2, uint16 v3); static void characterInRoom(uint16 characterId, uint16 roomNumber, uint16 v3); static void setDesc(uint16 hotspotId, uint16 descId, uint16 v3); static void setHotspotName(uint16 hotspotId, uint16 nameId, uint16 v3); - static void addSound(uint16 soundId, uint16 v2, uint16 v3); + static void addSound(uint16 soundIndex, uint16 v2, uint16 v3); static void endgameSequence(uint16 v1, uint16 v2, uint16 v3); static void setupPigFight(uint16 v1, uint16 v2, uint16 v3); static void displayDialog(uint16 stringId, uint16 v2, uint16 v3); static void setupSkorlFight(uint16 v1, uint16 v2, uint16 v3); static void remoteRoomViewSetup(uint16 v1, uint16 v2, uint16 v3); static void startSpeakingToNoone(uint16 characterId, uint16 stringId, uint16 v3); - static void playMusic(uint16 musicNum, uint16 v2, uint16 v3); + static void stopSound(uint16 soundIndex, uint16 v2, uint16 v3); static void getDoorBlocked(uint16 hotspotId, uint16 v2, uint16 v3); static void isSkorlInCell(uint16 v1, uint16 v2, uint16 v3); static void ratpouchPushBricks(uint16 v1, uint16 v2, uint16 v3); @@ -142,7 +142,7 @@ public: static void addActions(uint16 hotspotId, uint16 actions, uint16 v3); static void randomToGeneral(uint16 maxVal, uint16 minVal, uint16 v3); static void checkCellDoor(uint16 v1, uint16 v2, uint16 v3); - static void checkSound(uint16 v1, uint16 v2, uint16 v3); + static void checkSound(uint16 soundNumber, uint16 v2, uint16 v3); }; class HotspotScript { diff --git a/engines/lure/sound.cpp b/engines/lure/sound.cpp index 6961e4c7cc..bf9a2032ab 100644 --- a/engines/lure/sound.cpp +++ b/engines/lure/sound.cpp @@ -21,17 +21,607 @@ */ #include "lure/sound.h" +#include "lure/game.h" +#include "lure/memory.h" +#include "lure/res.h" +#include "lure/room.h" + +#include "common/config-manager.h" +#include "common/endian.h" +#include "sound/midiparser.h" DECLARE_SINGLETON(Lure::SoundManager); namespace Lure { +SoundManager::SoundManager() { + _descs = Disk::getReference().getEntry(SOUND_DESC_RESOURCE_ID); + _numDescs = _descs->size() / sizeof(SoundDescResource); + _soundData = NULL; + + int midiDriver = MidiDriver::detectMusicDriver(MDT_MIDI | MDT_ADLIB | MDT_PREFER_MIDI); + _nativeMT32 = ((midiDriver == MD_MT32) || ConfMan.getBool("native_mt32")); + + memset(_channelsInUse, false, NUM_CHANNELS_OUTER); + + _driver = MidiDriver::createMidi(midiDriver); + int statusCode = _driver->open(); + if (statusCode) { + warning("Sound driver returned error code %d", statusCode); + _driver = NULL; + + } else { + if (_nativeMT32) + _driver->property(MidiDriver::PROP_CHANNEL_MASK, 0x03FE); + + for (int index = 0; index < NUM_CHANNELS_INNER; ++index) { + _channelsInner[index].midiChannel = _driver->allocateChannel(); + _channelsInner[index].volume = DEFAULT_VOLUME; + } + } +} + +SoundManager::~SoundManager() { + if (_driver) + _driver->setTimerCallback(this, NULL); + + removeSounds(); + _activeSounds.clear(); + _playingSounds.clear(); + + + delete _descs; + if (_soundData) + delete _soundData; + + if (_driver) + _driver->close(); + _driver = NULL; +} + +void SoundManager::loadSection(uint16 sectionId) { + debugC(ERROR_BASIC, kLureDebugSounds, "SoundManager::loadSection = %xh", sectionId); + killSounds(); + + if (_soundData) { + delete _soundData; + _driver->setTimerCallback(this, NULL); + } + + _soundData = Disk::getReference().getEntry(sectionId); + _soundsTotal = *_soundData->data(); + + _driver->setTimerCallback(this, &onTimer); +} + +void SoundManager::bellsBodge() { + debugC(ERROR_BASIC, kLureDebugSounds, "SoundManager::bellsBodge"); + Resources &res = Resources::getReference(); + Room &room = Room::getReference(); + + RoomData *roomData = res.getRoom(room.roomNumber()); + if (roomData->areaFlag != res.fieldList().getField(AREA_FLAG)) { + res.fieldList().setField(AREA_FLAG, roomData->areaFlag); + + switch (roomData->areaFlag) { + case 0: + killSound(1); + break; + case 1: + addSound(2); + killSound(33); + break; + case 2: + setVolume(0, 15); + // Deliberate fall through + default: + killSound(1); + break; + } + } +} + void SoundManager::killSounds() { + debugC(ERROR_BASIC, kLureDebugSounds, "SoundManager::killSounds"); + + // Stop the player playing all sounds + musicInterface_KillAll(); + + // Clear the active sounds + _activeSounds.clear(); + for (int channelNum = 0; channelNum < NUM_CHANNELS_INNER; ++channelNum) + _channelsInUse[channelNum] = false; +} + +void SoundManager::addSound(uint8 soundIndex, bool tidyFlag) { + debugC(ERROR_BASIC, kLureDebugSounds, "SoundManager::addSound index=%d", soundIndex); + Game &game = Game::getReference(); + + if (tidyFlag) + tidySounds(); + + if (game.preloadFlag()) + // Don't add a sound if in room preloading + return; + + SoundDescResource &rec = soundDescs()[soundIndex]; + int numChannels = (rec.numChannels >> 2) & 3; + + int channelCtr = 0; + while (channelCtr <= (NUM_CHANNELS_OUTER - numChannels)) { + if (!_channelsInUse[channelCtr]) { + bool foundSpace = true; + + int channelCtr2 = 1; + while (channelCtr2 < numChannels) { + foundSpace = !_channelsInUse[channelCtr + channelCtr2]; + if (!foundSpace) break; + ++channelCtr2; + } + + if (foundSpace) + break; + } + + ++channelCtr; + } + + if (channelCtr > NUM_CHANNELS_OUTER - numChannels) { + // No channels free + debugC(ERROR_BASIC, kLureDebugSounds, "SoundManager::addSound - no channels free"); + return; + } + + // Mark the found channels as in use + for (int channelCtr2 = 0; channelCtr2 < numChannels; ++channelCtr2) + _channelsInUse[channelCtr + channelCtr2] = true; + + SoundDescResource *newEntry = new SoundDescResource(); + newEntry->soundNumber = rec.soundNumber; + newEntry->channel = channelCtr; + newEntry->numChannels = numChannels; + newEntry->flags = rec.flags; + newEntry->volume = rec.volume; + _activeSounds.push_back(newEntry); + + // TODO: Figure a better way of sharing channels between multiple parsers - currently + // each parser seems to use 8 channels of a maximum 16 available, but here I'm + // overlapping channels 4 - 7 (3rd & 4th parser) across the other two + byte innerChannel = (channelCtr < 4) ? ((channelCtr / 2) * 8) : + (4 + (channelCtr / 2) * 8); + + musicInterface_Play(rec.soundNumber, innerChannel); + setVolume(rec.soundNumber, rec.volume); +} + +void SoundManager::addSound2(uint8 soundIndex) { + debugC(ERROR_BASIC, kLureDebugSounds, "SoundManager::addSound2 index=%d", soundIndex); + tidySounds(); + + if (soundIndex == 6) + // Chinese torture + addSound(6); + else { + SoundDescResource &descEntry = soundDescs()[soundIndex]; + SoundDescResource *rec = findSound(descEntry.soundNumber); + if (rec == NULL) + // Sound isn't active, so go and add it + addSound(soundIndex, false); + } +} + + +void SoundManager::stopSound(uint8 soundIndex) { + debugC(ERROR_BASIC, kLureDebugSounds, "SoundManager::stopSound index=%d", soundIndex); + SoundDescResource &rec = soundDescs()[soundIndex]; + musicInterface_Stop(rec.soundNumber & 0x7f); +} + +void SoundManager::killSound(uint8 soundNumber) { + debugC(ERROR_BASIC, kLureDebugSounds, "SoundManager::stopSound soundNumber=%d", soundNumber); + musicInterface_Stop(soundNumber & 0x7f); +} + +void SoundManager::setVolume(uint8 soundNumber, uint8 volume) { + debugC(ERROR_BASIC, kLureDebugSounds, "SoundManager::setVolume soundNumber=%d, volume=%d", + soundNumber, volume); + musicInterface_TidySounds(); + + SoundDescResource *entry = findSound(soundNumber); + if (entry) + musicInterface_SetVolume(entry->channel, volume); +} + +void SoundManager::setVolume(uint8 volume) { + debugC(ERROR_BASIC, kLureDebugSounds, "SoundManager::setVolume volume=%d", volume); + + for (int index = 0; index < NUM_CHANNELS_INNER; ++index) { + _channelsInner[index].midiChannel->volume(volume); + _channelsInner[index].volume = volume; + } +} + +SoundDescResource *SoundManager::findSound(uint8 soundNumber) { + debugC(ERROR_BASIC, kLureDebugSounds, "SoundManager::findSound soundNumber=%d", soundNumber); + ManagedList<SoundDescResource *>::iterator i; + + for (i = _activeSounds.begin(); i != _activeSounds.end(); ++i) { + SoundDescResource *rec = *i; + + if (rec->soundNumber == soundNumber) { + debugC(ERROR_INTERMEDIATE, kLureDebugSounds, "SoundManager::findSound - sound found"); + return rec; + } + } + + // Signal that sound wasn't found + debugC(ERROR_INTERMEDIATE, kLureDebugSounds, "SoundManager::findSound - sound not found"); + return NULL; +} + +void SoundManager::tidySounds() { + debugC(ERROR_INTERMEDIATE, kLureDebugSounds, "SoundManager::tidySounds"); + ManagedList<SoundDescResource *>::iterator i = _activeSounds.begin(); + + while (i != _activeSounds.end()) { + SoundDescResource *rec = *i; + + if (musicInterface_CheckPlaying(rec->soundNumber & 0x7f)) + // Still playing, so move to next entry + ++i; + else { + // Mark the channels that it used as now being free + for (int channelCtr = 0; channelCtr < rec->numChannels; ++channelCtr) + _channelsInUse[rec->channel + channelCtr] = false; + + i = _activeSounds.erase(i); + } + } +} + +void SoundManager::removeSounds() { + debugC(ERROR_BASIC, kLureDebugSounds, "SoundManager::removeSounds"); + bellsBodge(); + + ManagedList<SoundDescResource *>::iterator i = _activeSounds.begin(); + + while (i != _activeSounds.end()) { + SoundDescResource *rec = *i; + + if ((rec->flags & SF_IN_USE) != 0) + musicInterface_Stop(rec->soundNumber); + + ++i; + } +} + +void SoundManager::restoreSounds() { + debugC(ERROR_BASIC, kLureDebugSounds, "SoundManager::restoreSounds"); + ManagedList<SoundDescResource *>::iterator i = _activeSounds.begin(); + + while (i != _activeSounds.end()) { + SoundDescResource *rec = *i; + + if ((rec->numChannels != 0) && ((rec->flags & SF_RESTORE) != 0)) { + for (int channelCtr = 0; channelCtr < rec->numChannels; ++channelCtr) + _channelsInUse[rec->channel + channelCtr] = true; + + musicInterface_Play(rec->soundNumber, rec->channel); + musicInterface_SetVolume(rec->soundNumber, rec->volume); + } + + ++i; + } +} + +void SoundManager::fadeOut() { + debugC(ERROR_BASIC, kLureDebugSounds, "SoundManager::fadeOut"); + + // Fade out all the active sounds + musicInterface_TidySounds(); + + bool inProgress = true; + while (inProgress) + { + inProgress = false; + + ManagedList<MidiMusic *>::iterator i; + for (i = _playingSounds.begin(); i != _playingSounds.end(); ++i) { + MidiMusic *music = *i; + if (music->getVolume() > 0) { + inProgress = true; + music->setVolume(music->getVolume() > 4 ? (music->getVolume() - 10) : 0); + } + } + + g_system->delayMillis(10); + } + + // Kill all the sounds + musicInterface_KillAll(); +} + +/*------------------------------------------------------------------------*/ + +// musicInterface_Play +// Play the specified sound + +void SoundManager::musicInterface_Play(uint8 soundNumber, uint8 channelNumber) { + debugC(ERROR_INTERMEDIATE, kLureDebugSounds, "musicInterface_Play soundNumber=%d, channel=%d", + soundNumber, channelNumber); + + if (!_soundData) + error("Sound section has not been specified"); + + uint8 soundNum = soundNumber & 0x7f; + if (soundNum > _soundsTotal) + error("Invalid sound index %d requested", soundNum); + + if (_driver == NULL) + // Only play sounds if a sound driver is active + return; + + uint32 dataOfs = READ_LE_UINT32(_soundData->data() + soundNum * 4 + 2); + uint8 *soundStart = _soundData->data() + dataOfs; + uint32 dataSize; + + if (soundNumber == _soundsTotal - 1) + dataSize = _soundData->size() - dataOfs; + else { + uint32 nextDataOfs = READ_LE_UINT32(_soundData->data() + (soundNum + 1) * 4 + 2); + dataSize = nextDataOfs - dataOfs; + } + + MidiMusic *sound = new MidiMusic(_driver, _channelsInner, channelNumber, soundNumber, + soundStart, dataSize); + _playingSounds.push_back(sound); +} + +// musicInterface_Stop +// Stops the specified sound from playing + +void SoundManager::musicInterface_Stop(uint8 soundNumber) { + debugC(ERROR_INTERMEDIATE, kLureDebugSounds, "musicInterface_Stop soundNumber=%d", soundNumber); + musicInterface_TidySounds(); + uint8 soundNum = soundNumber & 0x7f; + + ManagedList<MidiMusic *>::iterator i; + for (i = _playingSounds.begin(); i != _playingSounds.end(); ++i) { + MidiMusic *music = *i; + if (music->soundNumber() == soundNum) { + _playingSounds.erase(i); + return; + } + } +} + +// musicInterface_CheckPlaying +// Returns true if a sound is still playing + +bool SoundManager::musicInterface_CheckPlaying(uint8 soundNumber) { + debugC(ERROR_DETAILED, kLureDebugSounds, "musicInterface_CheckPlaying soundNumber=%d", soundNumber); + musicInterface_TidySounds(); + uint8 soundNum = soundNumber & 0x7f; + + ManagedList<MidiMusic *>::iterator i; + for (i = _playingSounds.begin(); i != _playingSounds.end(); ++i) { + MidiMusic *music = *i; + if (music->soundNumber() == soundNum) + return true; + } + + return false; +} + +// musicInterface_SetVolume +// Sets the volume of the specified channel + +void SoundManager::musicInterface_SetVolume(uint8 channelNum, uint8 volume) { + debugC(ERROR_INTERMEDIATE, kLureDebugSounds, "musicInterface_SetVolume channel=%d, volume=%d", + channelNum, volume); + musicInterface_TidySounds(); + + ManagedList<MidiMusic *>::iterator i; + for (i = _playingSounds.begin(); i != _playingSounds.end(); ++i) { + MidiMusic *music = *i; + if (music->channelNumber() == channelNum) + music->setVolume(volume); + } +} + +// musicInterface_KillAll +// Stops all currently active sounds playing + +void SoundManager::musicInterface_KillAll() { + debugC(ERROR_INTERMEDIATE, kLureDebugSounds, "musicInterface_KillAll"); + musicInterface_TidySounds(); + + ManagedList<MidiMusic *>::iterator i; + for (i = _playingSounds.begin(); i != _playingSounds.end(); ++i) { + MidiMusic *music = *i; + music->stopMusic(); + } + + _playingSounds.clear(); + _activeSounds.clear(); +} + +// musicInterface_ContinuePlaying +// The original player used this method for any sound managers needing continual calls + +void SoundManager::musicInterface_ContinuePlaying() { + // No implementation needed +} + +// musicInterface_TrashReverb +// Trashes reverb on actively playing sounds + +void SoundManager::musicInterface_TrashReverb() { + // TODO: Handle support for trashing reverb + debugC(ERROR_INTERMEDIATE, kLureDebugSounds, "musicInterface_TrashReverb"); +} + +// musicInterface_KillAll +// Scans all the active sounds and deallocates any objects that have finished playing + +void SoundManager::musicInterface_TidySounds() { + debugC(ERROR_DETAILED, kLureDebugSounds, "musicInterface_TidySounds"); + ManagedList<MidiMusic *>::iterator i = _playingSounds.begin(); + while (i != _playingSounds.end()) { + MidiMusic *music = *i; + if (!music->isPlaying()) + i = _playingSounds.erase(i); + else + ++i; + } +} + +void SoundManager::onTimer(void *data) { + SoundManager *snd = (SoundManager *) data; + + ManagedList<MidiMusic *>::iterator i; + for (i = snd->_playingSounds.begin(); i != snd->_playingSounds.end(); ++i) { + MidiMusic *music = *i; + if (music->isPlaying()) + music->onTimer(); + } +} + +/*------------------------------------------------------------------------*/ + +MidiMusic::MidiMusic(MidiDriver *driver, ChannelEntry channels[NUM_CHANNELS_INNER], + uint8 channelNum, uint8 soundNum, void *soundData, uint32 size) { + + _driver = driver; + _channels = channels; + _soundNumber = soundNum; + _channelNumber = channelNum; + _numChannels = 8; + _volume = _channels[channelNum].volume; + + _passThrough = false; + + _parser = MidiParser::createParser_SMF(); + _parser->setMidiDriver(this); + _parser->setTimerRate(_driver->getBaseTempo()); + + this->open(); + + _soundData = (uint8 *) soundData; + _soundSize = size; + + // Check whether the music data is compressed - if so, decompress it for the duration + // of playing the sound + _decompressedSound = NULL; + if ((*_soundData == 'C') || (*_soundData == 'c')) { + uint32 packedSize = size - 0x201; + _decompressedSound = Memory::allocate(packedSize * 2); + + uint16 *data = (uint16 *)(_soundData + 1); + uint16 *dataDest = (uint16 *) _decompressedSound->data(); + byte *idx = ((byte *)data) + 0x200; + + for (uint i = 0; i < packedSize; i++) +#if defined(SCUMM_NEED_ALIGNMENT) + memcpy(dataDest++, (byte*)((byte*)data + *(idx + i) * sizeof(uint16)), sizeof(uint16)); +#else + *dataDest++ = data[*(idx + i)]; +#endif + + _soundData = _decompressedSound->data() + ((*_soundData == 'c') ? 1 : 0); + _soundSize = _decompressedSound->size(); + } + + playMusic(); +} + +MidiMusic::~MidiMusic() { + _parser->unloadMusic(); + delete _parser; + this->close(); + if (_decompressedSound != NULL) + delete _decompressedSound; } -void SoundManager::playSound(uint16 soundId) { +void MidiMusic::setVolume(int volume) { + if (volume < 0) + volume = 0; + else if (volume > 255) + volume = 255; + + if (_volume == volume) + return; + + _volume = volume; + + for (int i = 0; i < _numChannels; ++i) + _channels[_channelNumber + i].midiChannel->volume( + _channels[_channelNumber + i].volume * _volume / 255); +} + +void MidiMusic::playMusic() { + debugC(ERROR_DETAILED, kLureDebugSounds, "MidiMusic::PlayMusic playing sound %d", _soundNumber); + _parser->loadMusic(_soundData, _soundSize); + _parser->setTrack(0); + _isPlaying = true; +} + +int MidiMusic::open() { + // Don't ever call open without first setting the output driver! + if (!_driver) + return 255; + + return 0; +} + +void MidiMusic::close() { +} + +void MidiMusic::send(uint32 b) { + if (_passThrough) { + _driver->send(b); + return; + } + + byte channel = _channelNumber + (byte)(b & 0x0F); + if ((channel >= NUM_CHANNELS_INNER) || (_channels[channel].midiChannel == NULL)) + return; + + if ((b & 0xFFF0) == 0x07B0) { + // Adjust volume changes by master volume + byte volume = (byte)((b >> 16) & 0x7F); + _channels[channel].volume = volume; + volume = volume * _volume / 255; + b = (b & 0xFF00FFFF) | (volume << 16); + } else if ((b & 0xF0) == 0xC0 && !_nativeMT32) { + b = (b & 0xFFFF00FF) | MidiDriver::_mt32ToGm[(b >> 8) & 0xFF] << 8; + } + else if ((b & 0xFFF0) == 0x007BB0) { + // No implementation + } + + _channels[channel].midiChannel->send(b); +} + +void MidiMusic::metaEvent(byte type, byte *data, uint16 length) { + //Only thing we care about is End of Track. + if (type != 0x2F) + return; + + stopMusic(); +} + +void MidiMusic::onTimer() { + if (_isPlaying) + _parser->onTimer(); +} +void MidiMusic::stopMusic() { + debugC(ERROR_DETAILED, kLureDebugSounds, "MidiMusic::stopMusic sound %d", _soundNumber); + _isPlaying = false; + _parser->unloadMusic(); + close(); } } // end of namespace Lure diff --git a/engines/lure/sound.h b/engines/lure/sound.h index 4a7422d77f..cfe0739298 100644 --- a/engines/lure/sound.h +++ b/engines/lure/sound.h @@ -24,14 +24,131 @@ #define LURE_SOUND_H #include "lure/luredefs.h" +#include "lure/disk.h" +#include "lure/memory.h" + #include "common/singleton.h" +#include "sound/mididrv.h" +#include "sound/mixer.h" + +class MidiParser; namespace Lure { +#define NUM_CHANNELS_OUTER 8 +#define NUM_CHANNELS_INNER 16 + +struct ChannelEntry { + MidiChannel *midiChannel; + byte volume; +}; + +class MidiMusic: public MidiDriver { +private: + uint8 _soundNumber; + uint8 _channelNumber; + uint8 _numChannels; + byte _volume; + MemoryBlock *_decompressedSound; + uint8 *_soundData; + uint8 _soundSize; + MidiDriver *_driver; + MidiParser *_parser; + ChannelEntry *_channels; + bool _isPlaying; + bool _nativeMT32; + + void queueUpdatePos(); + uint8 randomQueuePos(); + uint32 songOffset(uint16 songNum) const; + uint32 songLength(uint16 songNum) const; + + bool _passThrough; + +public: + MidiMusic(MidiDriver *driver, ChannelEntry channels[NUM_CHANNELS_INNER], + uint8 channelNum, uint8 soundNum, void *soundData, uint32 size); + ~MidiMusic(); + void setVolume(int volume); + int getVolume() { return _volume; } + + void hasNativeMT32(bool b) { _nativeMT32 = b; } + void playSong(uint16 songNum); + void stopSong() { stopMusic(); } + void playMusic(); + void stopMusic(); + void queueTuneList(int16 tuneList); + bool queueSong(uint16 songNum); + void setPassThrough(bool b) { _passThrough = b; } + void toggleVChange(); + + //MidiDriver interface implementation + int open(); + void close(); + void send(uint32 b); + void onTimer(); + + void metaEvent(byte type, byte *data, uint16 length); + + void setTimerCallback(void *timerParam, void (*timerProc)(void *)) { } + uint32 getBaseTempo(void) { return _driver ? _driver->getBaseTempo() : 0; } + + //Channel allocation functions + MidiChannel *allocateChannel() { return 0; } + MidiChannel *getPercussionChannel() { return 0; } + + uint8 channelNumber() { return _channelNumber; } + uint8 soundNumber() { return _soundNumber; } + bool isPlaying() { return _isPlaying; } +}; + class SoundManager: public Common::Singleton<SoundManager> { +private: + // Outer sound interface properties + MemoryBlock *_descs; + MemoryBlock *_soundData; + uint8 _soundsTotal; + int _numDescs; + SoundDescResource *soundDescs() { return (SoundDescResource *) _descs->data(); } + MidiDriver *_driver; + ManagedList<SoundDescResource *> _activeSounds; + ManagedList<MidiMusic *> _playingSounds; + ChannelEntry _channelsInner[NUM_CHANNELS_INNER]; + bool _channelsInUse[NUM_CHANNELS_OUTER]; + bool _isPlaying; + bool _nativeMT32; + + // Internal support methods + void bellsBodge(); + void musicInterface_TidySounds(); + static void onTimer(void *data); public: - static void killSounds(); - static void playSound(uint16 soundId); + SoundManager(); + ~SoundManager(); + + void loadSection(uint16 sectionId); + void killSounds(); + void addSound(uint8 soundIndex, bool tidyFlag = true); + void addSound2(uint8 soundIndex); + void stopSound(uint8 soundIndex); + void killSound(uint8 soundNumber); + void setVolume(uint8 soundNumber, uint8 volume); + void setVolume(uint8 volume); + void tidySounds(); + SoundDescResource *findSound(uint8 soundNumber); + void removeSounds(); + void restoreSounds(); + void fadeOut(); + + // The following methods implement the external sound player module + void musicInterface_Initialise(); + void musicInterface_Play(uint8 soundNumber, uint8 channelNumber); + void musicInterface_Stop(uint8 soundNumber); + bool musicInterface_CheckPlaying(uint8 soundNumber); + void musicInterface_SetVolume(uint8 channelNum, uint8 volume); + void musicInterface_KillAll(); + void musicInterface_ContinuePlaying(); + void musicInterface_TrashReverb(); }; } // End of namespace Lure diff --git a/engines/lure/surface.cpp b/engines/lure/surface.cpp index 3486a5abb9..d5b9db4955 100644 --- a/engines/lure/surface.cpp +++ b/engines/lure/surface.cpp @@ -29,6 +29,7 @@ #include "lure/screen.h" #include "lure/lure.h" #include "lure/room.h" +#include "lure/sound.h" #include "lure/strings.h" #include "common/endian.h" @@ -50,8 +51,7 @@ void Surface::initialise() { byte *pChar = int_font->data() + (ctr * 8); fontSize[ctr] = 0; - for (int yp = 0; yp < FONT_HEIGHT; ++yp) - { + for (int yp = 0; yp < FONT_HEIGHT; ++yp) { byte v = *pChar++; for (int xp = 0; xp < FONT_WIDTH; ++xp) { @@ -155,13 +155,11 @@ void Surface::transparentCopyTo(Surface *dest) { } } -void Surface::copyTo(Surface *dest) -{ +void Surface::copyTo(Surface *dest) { copyTo(dest, 0, 0); } -void Surface::copyTo(Surface *dest, uint16 x, uint16 y) -{ +void Surface::copyTo(Surface *dest, uint16 x, uint16 y) { if ((x == 0) && (dest->width() == _width)) { // Use fast data transfer uint32 dataSize = dest->data().size() - (y * _width); @@ -631,7 +629,6 @@ bool SaveRestoreDialog::show(bool saveDialog) { Screen &screen = Screen::getReference(); Mouse &mouse = Mouse::getReference(); Events &events = Events::getReference(); - Room &room = Room::getReference(); Resources &res = Resources::getReference(); LureEngine &engine = LureEngine::getReference(); int selectedLine = -1; @@ -655,7 +652,6 @@ bool SaveRestoreDialog::show(bool saveDialog) { return false; } - room.update(); Surface *s = new Surface(INFO_DIALOG_WIDTH, SR_SAVEGAME_NAMES_Y + numSaves * FONT_HEIGHT + FONT_HEIGHT + 2); @@ -778,4 +774,139 @@ bool SaveRestoreDialog::show(bool saveDialog) { return doneFlag; } +/*--------------------------------------------------------------------------*/ + +struct RestartRecordPos { + int16 x, y; +}; + +struct RestartRecord { + Common::Language Language; + int16 width, height; + RestartRecordPos BtnRestart; + RestartRecordPos BtnRestore; +}; + +static const RestartRecord buttonBounds[] = { + { EN_ANY, 48, 14, { 118, 152 }, { 168, 152 } }, + { DE_DEU, 48, 14, { 106, 152 }, { 168, 152 } }, + { UNK_LANG, 48, 14, { 112, 152 }, { 168, 152 } } +}; + + +bool RestartRestoreDialog::show() { + Resources &res = Resources::getReference(); + Events &events = Events::getReference(); + Mouse &mouse = Mouse::getReference(); + Screen &screen = Screen::getReference(); + LureEngine &engine = LureEngine::getReference(); + + Sound.killSounds(); + Sound.musicInterface_Play(60, 0); + mouse.setCursorNum(CURSOR_ARROW); + + // See if there are any savegames that can be restored + String *firstSave = engine.detectSave(1); + bool restartFlag = (firstSave == NULL); + int highlightedButton = -1; + + if (!restartFlag) { + Memory::dealloc(firstSave); + + // Get the correct button bounds record to use + const RestartRecord *btnRecord = &buttonBounds[0]; + while ((btnRecord->Language != engine.getLanguage()) && + (btnRecord->Language != UNK_LANG)) + ++btnRecord; + + // Fade out the screen + screen.paletteFadeOut(RES_PALETTE_ENTRIES); + + // Get the palette that will be used, and first fade out the prior screen + Palette p(RESTART_RESOURCE_ID - 1); + + // Turn on the mouse + mouse.cursorOn(); + + // Load the restore/restart screen image + Surface *s = Surface::getScreen(RESTART_RESOURCE_ID); + s->copyTo(&screen.screen(), 0, MENUBAR_Y_SIZE); + delete s; + + res.activeHotspots().clear(); + Hotspot *btnHotspot = new Hotspot(); + + // Restart button + btnHotspot->setSize(btnRecord->width, btnRecord->height); + btnHotspot->setPosition(btnRecord->BtnRestart.x, btnRecord->BtnRestart.y); + btnHotspot->setAnimation(0x184B); + btnHotspot->copyTo(&screen.screen()); + + // Restore button + btnHotspot->setFrameNumber(1); + btnHotspot->setPosition(btnRecord->BtnRestore.x, btnRecord->BtnRestore.y); + btnHotspot->copyTo(&screen.screen()); + + screen.update(); + screen.paletteFadeIn(&p); + + // Event loop for making selection + while (!events.quitFlag) { + // Handle events + if (events.pollEvent()) { + if ((events.type() == Common::EVENT_LBUTTONDOWN) && (highlightedButton != -1)) { + mouse.waitForRelease(); + break; + } + } + + // Check if the pointer is over either button + int currentButton = -1; + if ((mouse.y() >= btnRecord->BtnRestart.y) && + (mouse.y() < btnRecord->BtnRestart.y + btnRecord->height)) { + // Check whether the Restart or Restore button is highlighted + if ((mouse.x() >= btnRecord->BtnRestart.x) && + (mouse.x() < btnRecord->BtnRestart.x + btnRecord->width)) + currentButton = 0; + else if ((mouse.x() >= btnRecord->BtnRestore.x) && + (mouse.x() < btnRecord->BtnRestore.x + btnRecord->width)) + currentButton = 1; + } + + // Take care of highlighting as the selected button changes + if (currentButton != highlightedButton) { + highlightedButton = currentButton; + + // Restart button + btnHotspot->setFrameNumber((highlightedButton == 0) ? 2 : 0); + btnHotspot->setPosition(btnRecord->BtnRestart.x, btnRecord->BtnRestart.y); + btnHotspot->copyTo(&screen.screen()); + + // Restore button + btnHotspot->setFrameNumber((highlightedButton == 1) ? 3 : 1); + btnHotspot->setPosition(btnRecord->BtnRestore.x, btnRecord->BtnRestore.y); + btnHotspot->copyTo(&screen.screen()); + } + + + screen.update(); + g_system->delayMillis(10); + } + + restartFlag = highlightedButton == 0; + delete btnHotspot; + } + + Sound.killSounds(); + + if (!restartFlag && !events.quitFlag) { + // Need to show Restore game dialog + if (!SaveRestoreDialog::show(false)) + // User cancelled, so fall back on Restart + restartFlag = true; + } + + return restartFlag; +} + } // end of namespace Lure diff --git a/engines/lure/surface.h b/engines/lure/surface.h index f97666d1e7..564f65dd99 100644 --- a/engines/lure/surface.h +++ b/engines/lure/surface.h @@ -104,6 +104,11 @@ public: static bool show(bool saveDialog); }; +class RestartRestoreDialog { +public: + static bool show(); +}; + } // End of namespace Lure #endif diff --git a/engines/parallaction/animation.cpp b/engines/parallaction/animation.cpp deleted file mode 100644 index 118f35e705..0000000000 --- a/engines/parallaction/animation.cpp +++ /dev/null @@ -1,683 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ - * - */ - -#include "common/stdafx.h" - -#include "parallaction/parallaction.h" - - -namespace Parallaction { - - -#define INST_ON 1 -#define INST_OFF 2 -#define INST_X 3 -#define INST_Y 4 -#define INST_Z 5 -#define INST_F 6 -#define INST_LOOP 7 -#define INST_ENDLOOP 8 -#define INST_SHOW 9 -#define INST_INC 10 -#define INST_DEC 11 -#define INST_SET 12 -#define INST_PUT 13 -#define INST_CALL 14 -#define INST_WAIT 15 -#define INST_START 16 -#define INST_SOUND 17 -#define INST_MOVE 18 -#define INST_END 1000 - - -void wrapLocalVar(LocalVariable *local); - - - - -uint16 _numLocals = 0; -char _localNames[10][10]; - -Animation *Parallaction::findAnimation(const char *name) { - - for (AnimationList::iterator it = _animations.begin(); it != _animations.end(); it++) - if (!scumm_stricmp((*it)->_label._text, name)) return *it; - - return NULL; -} - - -Animation *Parallaction::parseAnimation(Script& script, AnimationList &list, char *name) { -// printf("parseAnimation(%s)\n", name); - - Animation *vD0 = new Animation; - - vD0->_label._text = (char*)malloc(strlen(name)+1); - strcpy(vD0->_label._text, name); - - list.push_front(vD0); - - fillBuffers(script, true); - while (scumm_stricmp(_tokens[0], "endanimation")) { -// printf("token[0] = %s\n", _tokens[0]); - - if (!scumm_stricmp(_tokens[0], "script")) { - loadProgram(vD0, _tokens[1]); - } - if (!scumm_stricmp(_tokens[0], "commands")) { - parseCommands(script, vD0->_commands); - } - if (!scumm_stricmp(_tokens[0], "type")) { - if (_tokens[2][0] != '\0') { - vD0->_type = ((4 + _objectsNames->lookup(_tokens[2])) << 16) & 0xFFFF0000; - } - int16 _si = _zoneTypeNames->lookup(_tokens[1]); - if (_si != -1) { - vD0->_type |= 1 << (_si-1); - if (((vD0->_type & 0xFFFF) != kZoneNone) && ((vD0->_type & 0xFFFF) != kZoneCommand)) { - parseZoneTypeBlock(script, vD0); - } - } - } - if (!scumm_stricmp(_tokens[0], "label")) { - _gfx->makeCnvFromString(&vD0->_label._cnv, _tokens[1]); - } - if (!scumm_stricmp(_tokens[0], "flags")) { - uint16 _si = 1; - - do { - byte _al = _zoneFlagNames->lookup(_tokens[_si]); - _si++; - vD0->_flags |= 1 << (_al - 1); - } while (!scumm_stricmp(_tokens[_si++], "|")); - } - if (!scumm_stricmp(_tokens[0], "file")) { - char vC8[200]; - strcpy(vC8, _tokens[1]); - if (_engineFlags & kEngineTransformedDonna) { - if (!scumm_stricmp(_tokens[1], "donnap") || !scumm_stricmp(_tokens[1], "donnapa")) { - strcat(vC8, "tras"); - } - } - vD0->_cnv = _disk->loadFrames(vC8); - } - if (!scumm_stricmp(_tokens[0], "position")) { - vD0->_left = atoi(_tokens[1]); - vD0->_top = atoi(_tokens[2]); - vD0->_z = atoi(_tokens[3]); - } - if (!scumm_stricmp(_tokens[0], "moveto")) { - vD0->_moveTo.x = atoi(_tokens[1]); - vD0->_moveTo.y = atoi(_tokens[2]); - } - - fillBuffers(script, true); - } - - vD0->_oldPos.x = -1000; - vD0->_oldPos.y = -1000; - - vD0->_flags |= 0x1000000; - - return vD0; -} - - -void Parallaction::freeAnimations() { - _animations.clear(); - return; -} - - - -void jobDisplayAnimations(void *parm, Job *j) { -// printf("jobDisplayAnimations()...\n"); - - StaticCnv v14; - - uint16 _si = 0; - - for (AnimationList::iterator it = _vm->_animations.begin(); it != _vm->_animations.end(); it++) { - - Animation *v18 = *it; - - if ((v18->_flags & kFlagsActive) && ((v18->_flags & kFlagsRemove) == 0)) { - v14._width = v18->width(); - v14._height = v18->height(); - - int16 frame = CLIP((int)v18->_frame, 0, v18->getFrameNum()-1); - - v14._data0 = v18->getFrameData(frame); -// v14._data1 = v18->_cnv->field_8[frame]; - - if (v18->_flags & kFlagsNoMasked) - _si = 3; - else - _si = _vm->_gfx->queryMask(v18->_top + v18->height()); - - debugC(9, kDebugLocation, "jobDisplayAnimations(%s, x:%i, y:%i, z:%i, w:%i, h:%i, f:%i/%i, %p)", v18->_label._text, v18->_left, v18->_top, _si, v14._width, v14._height, - frame, v18->getFrameNum(), v14._data0); - _vm->_gfx->blitCnv(&v14, v18->_left, v18->_top, _si, Gfx::kBitBack); - - } - - if (((v18->_flags & kFlagsActive) == 0) && (v18->_flags & kFlagsRemove)) { - v18->_flags &= ~kFlagsRemove; - v18->_oldPos.x = -1000; - } - - if ((v18->_flags & kFlagsActive) && (v18->_flags & kFlagsRemove)) { - v18->_flags &= ~kFlagsActive; - v18->_flags |= kFlagsRemove; - } - - } - -// printf("done\n"); - - return; -} - - -void jobEraseAnimations(void *arg_0, Job *j) { - debugC(3, kDebugJobs, "jobEraseAnimations"); - - for (AnimationList::iterator it = _vm->_animations.begin(); it != _vm->_animations.end(); it++) { - - Animation *a = *it; - - if (((a->_flags & kFlagsActive) == 0) && ((a->_flags & kFlagsRemove) == 0)) continue; - - Common::Rect r(a->width(), a->height()); - r.moveTo(a->_oldPos); - _vm->_gfx->restoreBackground(r); - - if (arg_0) { - a->_oldPos.x = a->_left; - a->_oldPos.y = a->_top; - } - - } - -// printf("done\n"); - - return; -} - - -void Parallaction::loadProgram(Animation *a, char *filename) { -// printf("loadProgram(%s)\n", filename); - - Script *script = _disk->loadScript(filename); - - _numLocals = 0; - - fillBuffers(*script); - - a->_program = new Program; - - Instruction *vCC = new Instruction; - - while (scumm_stricmp(_tokens[0], "endscript")) { - parseScriptLine(vCC, a, a->_program->_locals); - a->_program->_instructions.push_back(vCC); - vCC = new Instruction; - fillBuffers(*script); - } - - // TODO: use List<>::end() to detect the end of the program - vCC->_index = INST_END; - a->_program->_instructions.push_back(vCC); - a->_program->_ip = a->_program->_instructions.begin(); - - delete script; - - return; -} - - - - - - -void Parallaction::parseScriptLine(Instruction *inst, Animation *a, LocalVariable *locals) { -// printf("parseScriptLine()\n"); - - if (_tokens[0][1] == '.') { - _tokens[0][1] = '\0'; - a = findAnimation(&_tokens[0][2]); - } - - if (_tokens[1][1] == '.') { - _tokens[1][1] = '\0'; - a = findAnimation(&_tokens[1][2]); - } - - int16 _si = _instructionNames->lookup(_tokens[0]); - inst->_index = _si; - -// printf("token[0] = %s (%i)\n", _tokens[0], inst->_index); - - switch (inst->_index) { - case INST_ON: // on - case INST_OFF: // off - case INST_START: // start - if (!scumm_stricmp(_tokens[1], a->_label._text)) { - inst->_opBase._a = a; - } else { - inst->_opBase._a = findAnimation(_tokens[1]); - } - break; - - case INST_LOOP: // loop - inst->_opBase._loopCounter = getLValue(inst, _tokens[1], locals, a); - break; - - case INST_X: // x - inst->_opA._pvalue = &a->_left; - inst->_opB = getLValue(inst, _tokens[1], locals, a); - break; - - case INST_Y: // y - inst->_opA._pvalue = &a->_top; - inst->_opB = getLValue(inst, _tokens[1], locals, a); - break; - - case INST_Z: // z - inst->_opA._pvalue = &a->_z; - inst->_opB = getLValue(inst, _tokens[1], locals, a); - break; - - case INST_F: // f - inst->_opA._pvalue = &a->_frame; - inst->_opB = getLValue(inst, _tokens[1], locals, a); - break; - - case INST_INC: // inc - case INST_DEC: // dec - if (!scumm_stricmp(_tokens[1], "X")) { - inst->_opA._pvalue = &a->_left; - } else - if (!scumm_stricmp(_tokens[1], "Y")) { - inst->_opA._pvalue = &a->_top; - } else - if (!scumm_stricmp(_tokens[1], "Z")) { - inst->_opA._pvalue = &a->_z; - } else - if (!scumm_stricmp(_tokens[1], "F")) { - inst->_opA._pvalue = &a->_frame; - } else { - inst->_flags |= kInstUsesLocal; - inst->_opA = getLValue(inst, _tokens[1], locals, a); - } - - inst->_opB = getLValue(inst, _tokens[2], locals, a); - - if (!scumm_stricmp(_tokens[3], "mod")) { - inst->_flags |= kInstMod; - } - break; - - case INST_SET: // set - inst->_opA = getLValue(inst, _tokens[1], locals, a); - inst->_flags |= kInstUsesLocal; - inst->_opB = getLValue(inst, _tokens[2], locals, a); - break; - - case INST_MOVE: // move - inst->_opA = getLValue(inst, _tokens[1], locals, a); - inst->_opB = getLValue(inst, _tokens[2], locals, a); - break; - - case INST_PUT: // put - if (!scumm_stricmp(_tokens[1], a->_label._text)) { - inst->_opBase._a = a; - } else { - inst->_opBase._a = findAnimation(_tokens[1]); - } - - inst->_opA = getLValue(inst, _tokens[2], locals, a); - inst->_opB = getLValue(inst, _tokens[3], locals, a); - if (!scumm_stricmp(_tokens[4], "masked")) { - inst->_flags |= kInstMaskedPut; - } - break; - - case INST_CALL: { // call - int16 _ax = _callableNames->lookup(_tokens[1]); - inst->_opBase._index = _ax - 1; - if (_ax - 1 < 0) exit(0); - } - break; - - case INST_SOUND: // sound - inst->_opBase._z = findZone(_tokens[1]); - break; - - case INST_ENDLOOP: // endloop - case INST_SHOW: // show - case INST_WAIT: // wait - break; - - default: // local definition - strcpy(_localNames[_numLocals], _tokens[0]); - locals[_numLocals]._value = atoi(_tokens[2]); - - if (_tokens[3][0] != '\0') { - locals[_numLocals]._min = atoi(_tokens[3]); - locals[_numLocals]._max = atoi(_tokens[4]); - } else { - locals[_numLocals]._min = -10000; - locals[_numLocals]._max = 10000; - } - - inst->_opA._local = &locals[_numLocals]; - inst->_opB._value = locals[_numLocals]._value; - - inst->_flags = kInstUsesLiteral | kInstUsesLocal; - inst->_index = INST_SET; - _numLocals++; - break; - - } - - - return; -} - -LValue Parallaction::getLValue(Instruction *inst, char *str, LocalVariable *locals, Animation *a) { - - LValue v; - - v._pvalue = 0; // should stop compiler from complaining - - if (isdigit(str[0]) || str[0] == '-') { - inst->_flags |= kInstUsesLiteral; - v._value = atoi(str); - return v; - } - - for (uint16 _si = 0; _si < 10; _si++) { - if (!scumm_stricmp(str, _localNames[_si])) { - v._local = &locals[_si]; - return v; - } - } - - if (str[1] == '.') { - a = findAnimation(&str[2]); - } - - if (str[0] == 'X') { - v._pvalue = &a->_left; - } else - if (str[0] == 'Y') { - v._pvalue = &a->_top; - } else - if (str[0] == 'Z') { - v._pvalue = &a->_z; - } else - if (str[0] == 'F') { - v._pvalue = &a->_frame; - } - - return v; -} - - - -void jobRunScripts(void *parm, Job *j) { - debugC(3, kDebugJobs, "jobRunScripts"); - - static uint16 modCounter = 0; - - StaticCnv v18; - - for (AnimationList::iterator it = _vm->_animations.begin(); it != _vm->_animations.end(); it++) { - - Animation *a = *it; - - if (a->_flags & kFlagsCharacter) a->_z = a->_top + a->height(); - - if ((a->_flags & kFlagsActing) == 0) continue; - InstructionList::iterator inst = a->_program->_ip; - -// printf("Animation: %s, flags: %x\n", a->_name, a->_flags); - - while (((*inst)->_index != INST_SHOW) && (a->_flags & kFlagsActing)) { - - debugC(9, kDebugJobs, "Animation: %s, instruction: %s", a->_label._text, (*inst)->_index == INST_END ? "end" : _vm->_instructionNamesRes[(*inst)->_index - 1]); - - switch ((*inst)->_index) { - case INST_ENDLOOP: // endloop - if (--a->_program->_loopCounter > 0) { - inst = a->_program->_loopStart; - } - break; - - case INST_OFF: {// off - (*inst)->_opBase._a->_flags |= kFlagsRemove; -// v1C = (*inst)->_opBase; - } - break; - - case INST_ON: // on - (*inst)->_opBase._a->_flags |= kFlagsActive; - (*inst)->_opBase._a->_flags &= ~kFlagsRemove; - break; - - case INST_START: // start -// v1C = (*inst)->_opBase; - (*inst)->_opBase._a->_flags |= (kFlagsActing | kFlagsActive); - break; - - case INST_LOOP: // loop - if ((*inst)->_flags & kInstUsesLiteral) { - a->_program->_loopCounter = (*inst)->_opBase._loopCounter._value; - } else { - a->_program->_loopCounter = *(*inst)->_opBase._loopCounter._pvalue; - } - a->_program->_loopStart = inst; - break; - - case INST_INC: // inc - case INST_DEC: { // dec - int16 _si = 0; - int16 _ax = 0, _bx = 0; - if ((*inst)->_flags & kInstUsesLiteral) { - _si = (*inst)->_opB._value; - } else { - _si = *(*inst)->_opB._pvalue; - } - if ((*inst)->_flags & kInstMod) { // mod - _bx = (_si > 0 ? _si : -_si); - if (modCounter % _bx != 0) break; - - _si = (_si > 0 ? 1 : -1); - } - if ((*inst)->_flags & kInstUsesLocal) { // local - if ((*inst)->_index == INST_INC) _ax = _si; - else _ax = -_si; - - (*inst)->_opA._local->_value += _ax; - wrapLocalVar((*inst)->_opA._local); - break; - } - - // built-in variable (x, y, z, f) - if ((*inst)->_index == INST_INC) _ax = _si; - else _ax = -_si; - *(*inst)->_opA._pvalue += _ax; - } - break; - - case INST_MOVE: { // move - WalkNodeList *v4 = _vm->_char._builder.buildPath(*(*inst)->_opA._pvalue, *(*inst)->_opB._pvalue); - _vm->addJob(&jobWalk, v4, kPriority19 ); - _engineFlags |= kEngineWalking; - } - break; - - case INST_PUT: // put - v18._width = (*inst)->_opBase._a->width(); - v18._height = (*inst)->_opBase._a->height(); - v18._data0 = (*inst)->_opBase._a->getFrameData((*inst)->_opBase._a->_frame); - v18._data1 = NULL; // (*inst)->_opBase._a->_cnv.field_8[(*inst)->_opBase._a->_frame]; - - if ((*inst)->_flags & kInstMaskedPut) { - uint16 _si = _vm->_gfx->queryMask((*inst)->_opB._value); - _vm->_gfx->blitCnv(&v18, (*inst)->_opA._value, (*inst)->_opB._value, _si, Gfx::kBitBack); - _vm->_gfx->blitCnv(&v18, (*inst)->_opA._value, (*inst)->_opB._value, _si, Gfx::kBit2); - } else { - _vm->_gfx->flatBlitCnv(&v18, (*inst)->_opA._value, (*inst)->_opB._value, Gfx::kBitBack); - _vm->_gfx->flatBlitCnv(&v18, (*inst)->_opA._value, (*inst)->_opB._value, Gfx::kBit2); - } - break; - - case INST_END: // exit - if ((a->_flags & kFlagsLooping) == 0) { - a->_flags &= ~kFlagsActing; - _vm->runCommands(a->_commands, a); - } - a->_program->_ip = a->_program->_instructions.begin(); - goto label1; - - - case INST_CALL: // call - _vm->callFunction((*inst)->_opBase._index, 0); - break; - - case INST_WAIT: // wait - if (_engineFlags & kEngineWalking) goto label1; - break; - - case INST_SOUND: // sound - _activeZone = (*inst)->_opBase._z; - break; - - default: { // INST_SET, INST_X, INST_Y, INST_Z, INST_F - int16 _si; - if ((*inst)->_flags & kInstUsesLiteral) { - _si = (*inst)->_opB._value; - } else { - _si = *(*inst)->_opB._pvalue; - } - - if ((*inst)->_flags & kInstUsesLocal) { - (*inst)->_opA._local->_value = _si; - } else { - *(*inst)->_opA._pvalue = _si; - } - } - break; - - } - - inst++; - } - - a->_program->_ip = ++inst; - -label1: - if (a->_flags & kFlagsCharacter) - a->_z = a->_top + a->height(); - } - - _vm->sortAnimations(); - modCounter++; - - return; -} - -void wrapLocalVar(LocalVariable *local) { -// printf("wrapLocalVar(v: %i, min: %i, max: %i)\n", local->_value, local->_min, local->_max); - - if (local->_value >= local->_max) - local->_value = local->_min; - if (local->_value < local->_min) - local->_value = local->_max - 1; - - return; -} - -int compareAnimationZ(const AnimationPointer &a1, const AnimationPointer &a2) { - if (a1->_z == a2->_z) return 0; - return (a1->_z < a2->_z ? -1 : 1); -} - - -void Parallaction::sortAnimations() { - _char._ani._z = _char._ani.height() + _char._ani._top; - _animations.sort(compareAnimationZ); - return; -} - -Animation::Animation() { - _cnv = NULL; - _program = NULL; - _frame = 0; - _z = 0; -} - -Animation::~Animation() { - if (_program) - delete _program; - - if (_cnv) - delete _cnv; -} - -uint16 Animation::width() const { - if (!_cnv) return 0; - return _cnv->_width; -} - -uint16 Animation::height() const { - if (!_cnv) return 0; - return _cnv->_height; -} - -uint16 Animation::getFrameNum() const { - if (!_cnv) return 0; - return _cnv->_count; -} - -byte* Animation::getFrameData(uint32 index) const { - if (!_cnv) return NULL; - return _cnv->getFramePtr(index); -} - - -Program::Program() { - _loopCounter = 0; - _locals = new LocalVariable[10]; -} - -Program::~Program() { - delete[] _locals; -} - - -} // namespace Parallaction diff --git a/engines/parallaction/callables_ns.cpp b/engines/parallaction/callables_ns.cpp index 94a0747ab1..8f5c80fc0c 100644 --- a/engines/parallaction/callables_ns.cpp +++ b/engines/parallaction/callables_ns.cpp @@ -199,13 +199,11 @@ void Parallaction_ns::_c_score(void *parm) { void Parallaction_ns::_c_fade(void *parm) { - _gfx->setBlackPalette(); - - Gfx::Palette pal; - memset(pal, 0, sizeof(Gfx::Palette)); + Palette pal; + _gfx->setPalette(pal); for (uint16 _di = 0; _di < 64; _di++) { - _gfx->fadePalette(pal, _gfx->_palette, 1); + pal.fadeTo(_gfx->_palette, 1); _gfx->setPalette(pal); _gfx->updateScreen(); @@ -331,35 +329,21 @@ void Parallaction_ns::_c_onMouse(void *parm) { void Parallaction_ns::_c_setMask(void *parm) { - _gfx->intGrottaHackMask(); + memset(_backgroundInfo->mask.data + 3600, 0, 3600); + _gfx->_bgLayers[1] = 500; return; } void Parallaction_ns::_c_endComment(void *param) { - int16 w = 0, h = 0; - _gfx->getStringExtent(_location._endComment, 130, &w, &h); - - Common::Rect r(w+5, h+5); - r.moveTo(5, 5); - _gfx->floodFill(Gfx::kBitFront, r, 0); - - r.setWidth(w+3); - r.setHeight(h+3); - r.moveTo(7, 7); - _gfx->floodFill(Gfx::kBitFront, r, 1); - - _gfx->setFont(kFontDialogue); - _gfx->displayWrappedString(_location._endComment, 3, 5, 0, 130); - _gfx->updateScreen(); - + showLocationComment(_location._endComment, true); - Gfx::Palette pal; - _gfx->makeGrayscalePalette(pal); + Palette pal(_gfx->_palette); + pal.makeGrayscale(); for (uint di = 0; di < 64; di++) { - _gfx->fadePalette(_gfx->_palette, pal, 1); + _gfx->_palette.fadeTo(pal, 1); _gfx->setPalette(_gfx->_palette); _gfx->updateScreen(); @@ -373,24 +357,19 @@ void Parallaction_ns::_c_endComment(void *param) { void Parallaction_ns::_c_frankenstein(void *parm) { - Gfx::Palette pal0; - Gfx::Palette pal1; + Palette pal0(_gfx->_palette); + Palette pal1; - for (uint16 i = 0; i <= BASE_PALETTE_COLORS; i++) { - pal0[(i+FIRST_BASE_COLOR)] = _gfx->_palette[i]; - pal0[(i+FIRST_BASE_COLOR)*3+1] = 0; - pal0[(i+FIRST_BASE_COLOR)*3+2] = 0; - - pal1[(i+FIRST_BASE_COLOR)*3+1] = 0; - pal1[(i+FIRST_BASE_COLOR)*3+2] = 0; + for (uint16 i = 0; i <= 32; i++) { + pal0.setEntry(i, -1, 0, 0); // leaves reds unchanged while zeroing other components } for (uint16 _di = 0; _di < 30; _di++) { g_system->delayMillis(20); - _gfx->setPalette(pal0, FIRST_BASE_COLOR, BASE_PALETTE_COLORS); + _gfx->setPalette(pal0); _gfx->updateScreen(); g_system->delayMillis(20); - _gfx->setPalette(pal1, FIRST_BASE_COLOR, BASE_PALETTE_COLORS); + _gfx->setPalette(pal1); _gfx->updateScreen(); } @@ -435,7 +414,7 @@ void Parallaction_ns::_c_finito(void *parm) { _gfx->setPalette(_gfx->_palette); if (gameCompleted) { - _gfx->setFont(kFontMenu); + _gfx->setFont(_menuFont); _gfx->displayCenteredString(70, v4C[_language]); _gfx->displayCenteredString(100, v3C[_language]); _gfx->displayCenteredString(130, v2C[_language]); @@ -448,7 +427,7 @@ void Parallaction_ns::_c_finito(void *parm) { _engineFlags |= kEngineChangeLocation; } else { - _gfx->setFont(kFontMenu); + _gfx->setFont(_menuFont); _gfx->displayCenteredString(70, v8C[_language]); _gfx->displayCenteredString(100, v7C[_language]); _gfx->displayCenteredString(130, v6C[_language]); @@ -493,7 +472,7 @@ void Parallaction_ns::_c_testResult(void *parm) { _disk->selectArchive("disk1"); parseLocation("common"); - _gfx->setFont(kFontMenu); + _gfx->setFont(_menuFont); _gfx->displayCenteredString(38, _slideText[0]); _gfx->displayCenteredString(58, _slideText[1]); @@ -538,9 +517,9 @@ void Parallaction_ns::_c_startIntro(void *parm) { void Parallaction_ns::_c_endIntro(void *parm) { - _gfx->setFont(kFontMenu); + _gfx->setFont(_menuFont); - debugC(1, kDebugLocation, "endIntro()"); + debugC(1, kDebugExec, "endIntro()"); for (uint16 _si = 0; _si < 6; _si++) { _gfx->displayCenteredString(80, _credits[_si]._role); @@ -559,7 +538,7 @@ void Parallaction_ns::_c_endIntro(void *parm) { _gfx->copyScreen(Gfx::kBitBack, Gfx::kBitFront); } - debugC(1, kDebugLocation, "endIntro(): done showing credits"); + debugC(1, kDebugExec, "endIntro(): done showing credits"); if ((getFeatures() & GF_DEMO) == 0) { _gfx->displayCenteredString(80, "CLICK MOUSE BUTTON TO START"); @@ -604,21 +583,40 @@ void Parallaction_ns::_c_moveSheet(void *parm) { return; } -void plotPixel(int x, int y, int color, void *data) { - _vm->_gfx->plotMaskPixel(x, y, color); +void zeroMask(int x, int y, int color, void *data) { + //_vm->_gfx->zeroMaskValue(x, y, color); + + BackgroundInfo* info = (BackgroundInfo*)data; + + uint16 _ax = x + y * info->width; + info->mask.data[_ax >> 2] &= ~(3 << ((_ax & 3) << 1)); + } void Parallaction_ns::_c_sketch(void *parm) { static uint16 index = 1; - uint16 newy = _rightHandPositions[2*index+1]; - uint16 newx = _rightHandPositions[2*index]; + uint16 newx; + uint16 newy; uint16 oldy = _rightHandPositions[2*(index-1)+1]; uint16 oldx = _rightHandPositions[2*(index-1)]; - Graphics::drawLine(oldx, oldy, newx, newy, 0, plotPixel, NULL); + // WORKAROUND: original code overflowed _rightHandPositions by trying + // to access elements at positions 684 and 685. That used to happen + // when index == 342. Code now checks for this possibility and assigns + // the last valid value to the new coordinates for drawing without + // accessing the array. + if (index == 342) { + newy = oldy; + newx = oldx; + } else { + newy = _rightHandPositions[2*index+1]; + newx = _rightHandPositions[2*index]; + } + + Graphics::drawLine(oldx, oldy, newx, newy, 0, zeroMask, _backgroundInfo); _rightHandAnim->_left = newx; _rightHandAnim->_top = newy - 20; @@ -640,7 +638,12 @@ void Parallaction_ns::_c_shade(void *parm) { _rightHandAnim->_top ); - _gfx->fillMaskRect(r, 0); + uint16 _di = r.left/4 + r.top * _backgroundInfo->mask.internalWidth; + + for (uint16 _si = r.top; _si < r.bottom; _si++) { + memset(_backgroundInfo->mask.data + _di, 0, r.width()/4+1); + _di += _backgroundInfo->mask.internalWidth; + } return; diff --git a/engines/parallaction/commands.cpp b/engines/parallaction/commands.cpp deleted file mode 100644 index dc392fde2c..0000000000 --- a/engines/parallaction/commands.cpp +++ /dev/null @@ -1,351 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ - * - */ - -#include "common/stdafx.h" - -#include "parallaction/parallaction.h" - - -namespace Parallaction { - -#define CMD_SET 1 -#define CMD_CLEAR 2 -#define CMD_START 3 -#define CMD_SPEAK 4 -#define CMD_GET 5 -#define CMD_LOCATION 6 -#define CMD_OPEN 7 -#define CMD_CLOSE 8 -#define CMD_ON 9 -#define CMD_OFF 10 -#define CMD_CALL 11 -#define CMD_TOGGLE 12 -#define CMD_DROP 13 -#define CMD_QUIT 14 -#define CMD_MOVE 15 -#define CMD_STOP 16 - - -void Parallaction::parseCommands(Script &script, CommandList& list) { -// printf("parseCommands()"); - - fillBuffers(script, true); - - while (scumm_stricmp(_tokens[0], "ENDCOMMANDS") && scumm_stricmp(_tokens[0], "ENDZONE")) { -// printf("token[0] = %s", _tokens[0]); - - Command *cmd = new Command; - - cmd->_id = _commandsNames->lookup(_tokens[0]); - uint16 _si = 1; - -// printf("cmd id = %i", cmd->_id); - - switch (cmd->_id) { - case CMD_SET: // set - case CMD_CLEAR: // clear - case CMD_TOGGLE: // toggle - if (_globalTable->lookup(_tokens[1]) == -1) { - do { - char _al = _localFlagNames->lookup(_tokens[_si]); - _si++; - cmd->u._flags |= 1 << (_al - 1); - } while (!scumm_stricmp(_tokens[_si++], "|")); - _si--; - } else { - cmd->u._flags |= kFlagsGlobal; - do { - char _al = _globalTable->lookup(_tokens[1]); - _si++; - cmd->u._flags |= 1 << (_al - 1); - } while (!scumm_stricmp(_tokens[_si++], "|")); - _si--; - } - break; - - case CMD_START: // start - case CMD_STOP: // stop - cmd->u._animation = findAnimation(_tokens[_si]); - _si++; - if (cmd->u._animation == NULL) { - strcpy(_forwardedAnimationNames[_numForwards], _tokens[_si-1]); - _forwardedCommands[_numForwards] = cmd; - _numForwards++; - } - break; - - case CMD_SPEAK: // speak - case CMD_GET: // get - case CMD_OPEN: // open - case CMD_CLOSE: // close - case CMD_ON: // on - case CMD_OFF: // off - cmd->u._zone = findZone(_tokens[_si]); - _si++; - break; - - case CMD_LOCATION: // location - cmd->u._string = (char*)malloc(strlen(_tokens[_si])+1); - strcpy(cmd->u._string, _tokens[_si]); - _si++; - break; - - case CMD_CALL: // call - cmd->u._callable = _callableNames->lookup(_tokens[_si]) - 1; - _si++; - break; - - case CMD_DROP: // drop - cmd->u._object = _objectsNames->lookup(_tokens[_si]); - _si++; - break; - - case CMD_QUIT: // quit - break; - - case CMD_MOVE: // move - cmd->u._move._x = atoi(_tokens[_si]); - _si++; - cmd->u._move._y = atoi(_tokens[_si]); - _si++; - break; - - } - - if (!scumm_stricmp(_tokens[_si], "flags")) { - _si++; - - do { - if (!scumm_stricmp(_tokens[_si], "exit") || !scumm_stricmp(_tokens[_si], "exittrap")) { - cmd->_flagsOn |= kFlagsExit; - } else - if (!scumm_stricmp(_tokens[_si], "enter") || !scumm_stricmp(_tokens[_si], "entertrap")) { - cmd->_flagsOn |= kFlagsEnter; - } else - if (!scumm_strnicmp(_tokens[_si], "no", 2)) { - byte _al = _localFlagNames->lookup(&_tokens[_si][2]); - cmd->_flagsOff |= 1 << (_al - 1); - } else { - byte _al = _localFlagNames->lookup(_tokens[_si]); - cmd->_flagsOn |= 1 << (_al - 1); - } - - _si++; - - } while (!scumm_stricmp(_tokens[_si++], "|")); - - } - - if (!scumm_stricmp(_tokens[_si], "gflags")) { - _si++; - cmd->_flagsOn |= kFlagsGlobal; - - do { - if (!scumm_stricmp(_tokens[_si], "exit")) { - cmd->_flagsOn |= kFlagsExit; - } else - if (!scumm_stricmp(_tokens[_si], "enter")) { - cmd->_flagsOn |= kFlagsEnter; - } else - if (!scumm_strnicmp(_tokens[_si], "no", 2)) { - byte _al = _globalTable->lookup(&_tokens[_si][2]); - cmd->_flagsOff |= 1 << (_al - 1); - } else { - byte _al = _globalTable->lookup(_tokens[_si]); - cmd->_flagsOn |= 1 << (_al - 1); - } - - _si++; - - } while (!scumm_stricmp(_tokens[_si++], "|")); - - } - - list.push_front(cmd); // NOTE: command lists are written backwards in scripts - fillBuffers(script, true); - - } - -} - - -void Parallaction::runCommands(CommandList& list, Zone *z) { - debugC(1, kDebugLocation, "runCommands"); - - CommandList::iterator it = list.begin(); - for ( ; it != list.end(); it++) { - - Command *cmd = *it; - CommandData *u = &cmd->u; - uint32 v8 = _localFlags[_currentLocationIndex]; - - if (_engineFlags & kEngineQuit) - break; - - if (cmd->_flagsOn & kFlagsGlobal) { - v8 = _commandFlags | kFlagsGlobal; - } - - if ((cmd->_flagsOn & v8) != cmd->_flagsOn) continue; - if ((cmd->_flagsOff & ~v8) != cmd->_flagsOff) continue; - - debugC(1, kDebugLocation, "runCommands: %s (on: %x, off: %x)", _commandsNamesRes[cmd->_id-1], cmd->_flagsOn, cmd->_flagsOff); - - switch (cmd->_id) { - - case CMD_SET: // set - if (cmd->u._flags & kFlagsGlobal) { - cmd->u._flags &= ~kFlagsGlobal; - _commandFlags |= cmd->u._flags; - } else { - _localFlags[_currentLocationIndex] |= cmd->u._flags; - } - break; - - case CMD_CLEAR: // clear - if (cmd->u._flags & kFlagsGlobal) { - cmd->u._flags &= ~kFlagsGlobal; - _commandFlags &= ~cmd->u._flags; - } else { - _localFlags[_currentLocationIndex] &= ~cmd->u._flags; - } - break; - - case CMD_TOGGLE: // toggle - if (cmd->u._flags & kFlagsGlobal) { - cmd->u._flags &= ~kFlagsGlobal; - _commandFlags ^= cmd->u._flags; - } else { - _localFlags[_currentLocationIndex] ^= cmd->u._flags; - } - break; - - case CMD_START: // start - cmd->u._zone->_flags |= kFlagsActing; - break; - - case CMD_STOP: // stop - cmd->u._zone->_flags &= ~kFlagsActing; - break; - - case CMD_SPEAK: // speak - _activeZone = u->_zone; - break; - - case CMD_GET: // get - u->_zone->_flags &= ~kFlagsFixed; - if (!runZone(u->_zone)) { - runCommands(u->_zone->_commands); - } - break; - - case CMD_DROP: // drop - dropItem( u->_object ); - break; - - case CMD_OPEN: // open - u->_zone->_flags &= ~kFlagsClosed; - if (u->_zone->u.door->_cnv) { - addJob(&jobToggleDoor, (void*)u->_zone, kPriority18 ); - } - break; - - case CMD_CLOSE: // close - u->_zone->_flags |= kFlagsClosed; - if (u->_zone->u.door->_cnv) { - addJob(&jobToggleDoor, (void*)u->_zone, kPriority18 ); - } - break; - - case CMD_ON: // on - // WORKAROUND: the original DOS-based engine didn't check u->_zone before dereferencing - // the pointer to get structure members, thus leading to crashes in systems with memory - // protection. - // As a side note, the overwritten address is the 5th entry in the DOS interrupt table - // (print screen handler): this suggests that a system would hang when the print screen - // key is pressed after playing Nippon Safes, provided that this code path is taken. - if (u->_zone != NULL) { - u->_zone->_flags &= ~kFlagsRemove; - u->_zone->_flags |= kFlagsActive; - if ((u->_zone->_type & 0xFFFF) == kZoneGet) { - addJob(&jobDisplayDroppedItem, u->_zone, kPriority17 ); - } - } - break; - - case CMD_OFF: // off - u->_zone->_flags |= kFlagsRemove; - break; - - case CMD_LOCATION: // location - strcpy(_location._name, u->_string); - _engineFlags |= kEngineChangeLocation; - break; - - case CMD_CALL: // call - callFunction(u->_callable, z); - break; - - case CMD_QUIT: // quit - _engineFlags |= kEngineQuit; - break; - - case CMD_MOVE: { // move - if ((_char._ani._flags & kFlagsRemove) || (_char._ani._flags & kFlagsActive) == 0) { - continue; - } - - WalkNodeList *vC = _char._builder.buildPath(u->_move._x, u->_move._y); - - addJob(&jobWalk, vC, kPriority19 ); - _engineFlags |= kEngineWalking; - } - break; - - } - } - - debugC(1, kDebugLocation, "runCommands completed"); - - return; - -} - -Command::Command() { - _id = 0; - _flagsOn = 0; - _flagsOff = 0; -} - -Command::~Command() { - - if (_id == CMD_LOCATION) free(u._string); - -} - -} // namespace Parallaction - - - diff --git a/engines/parallaction/debug.cpp b/engines/parallaction/debug.cpp index 95091789a9..5e419def52 100644 --- a/engines/parallaction/debug.cpp +++ b/engines/parallaction/debug.cpp @@ -116,7 +116,7 @@ bool Debugger::Cmd_Give(int argc, const char **argv) { DebugPrintf("give <item name>\n"); } else { int index = _vm->_objectsNames->lookup(argv[1]); - if (index != -1) + if (index != Table::notFound) _vm->addInventoryItem(index + 4); else DebugPrintf("invalid item name '%s'\n", argv[1]); @@ -135,7 +135,7 @@ bool Debugger::Cmd_Jobs(int argc, const char **argv) { "|tag| description |\n" "+---+-------------------------------------------------------------+\n"); for ( ; b != e; b++) { - DebugPrintf("|%3i| %-60s|\n", (*b)->_tag, _jobDescriptions[(*b)->_tag] ); + DebugPrintf("|%3i| %-60s|\n", (*b)->_job->_tag, _jobDescriptions[(*b)->_job->_tag] ); } DebugPrintf("+---+-------------------------------------------------------------+\n"); diff --git a/engines/parallaction/detection.cpp b/engines/parallaction/detection.cpp index 84c45584a4..8ad79f34eb 100644 --- a/engines/parallaction/detection.cpp +++ b/engines/parallaction/detection.cpp @@ -48,6 +48,7 @@ Common::Platform Parallaction::getPlatform() const { return _gameDescription->de } static const PlainGameDescriptor parallactionGames[] = { + {"parallaction", "Parallaction engine game"}, {"nippon", "Nippon Safes Inc."}, {"bra", "The Big Red Adventure"}, {0, 0} @@ -176,7 +177,7 @@ static const Common::ADParams detectionParams = { // Structure for autoupgrading obsolete targets 0, // Name of single gameid (optional) - 0, + "parallaction", // List of files for file-based fallback detection (optional) 0, // Fallback callback @@ -185,33 +186,27 @@ static const Common::ADParams detectionParams = { Common::kADFlagAugmentPreferredTarget }; -GameList Engine_PARALLACTION_gameIDList() { - return GameList(parallactionGames); -} - -GameDescriptor Engine_PARALLACTION_findGameID(const char *gameid) { - return Common::AdvancedDetector::findGameID(gameid, parallactionGames); -} - -GameList Engine_PARALLACTION_detectGames(const FSList &fslist) { - return Common::AdvancedDetector::detectAllGames(fslist, detectionParams); -} - -PluginError Engine_PARALLACTION_create(OSystem *syst, Engine **engine) { - assert(engine); - const char *gameid = ConfMan.get("gameid").c_str(); +bool engineCreateParallaction(OSystem *syst, Engine **engine, Common::EncapsulatedADGameDesc encapsulatedDesc) { + const Parallaction::PARALLACTIONGameDescription *gd = (const Parallaction::PARALLACTIONGameDescription *)(encapsulatedDesc.realDesc); + bool res = true; - if (!scumm_stricmp("nippon", gameid)) { + switch (gd->gameType) { + case Parallaction::GType_Nippon: *engine = new Parallaction::Parallaction_ns(syst); - } else - if (!scumm_stricmp("bra", gameid)) { + break; + case Parallaction::GType_BRA: *engine = new Parallaction::Parallaction_br(syst); - } else - error("Parallaction engine created with invalid gameid ('%s')", gameid); + break; + default: + res = false; + error("Parallaction engine: unknown gameType"); + } - return kNoError; + return res; } +ADVANCED_DETECTOR_DEFINE_PLUGIN_WITH_COMPLEX_CREATION(PARALLACTION, engineCreateParallaction, detectionParams); + REGISTER_PLUGIN(PARALLACTION, "Parallaction engine", "Nippon Safes Inc. (C) Dynabyte"); diff --git a/engines/parallaction/dialogue.cpp b/engines/parallaction/dialogue.cpp index 84ecde6e64..15a280d3be 100644 --- a/engines/parallaction/dialogue.cpp +++ b/engines/parallaction/dialogue.cpp @@ -46,7 +46,7 @@ namespace Parallaction { #define ANSWER_CHARACTER_X 10 #define ANSWER_CHARACTER_Y 80 -int16 selectAnswer(Question *q, StaticCnv*); +int16 selectAnswer(Question *q, Graphics::Surface*); int16 getHoverAnswer(int16 x, int16 y, Question *q); int16 _answerBalloonX[10] = { 80, 120, 150, 150, 150, 0, 0, 0, 0, 0 }; @@ -56,136 +56,6 @@ int16 _answerBalloonH[10] = { 0 }; -Dialogue *Parallaction::parseDialogue(Script &script) { -// printf("parseDialogue()\n"); - uint16 numQuestions = 0; - - Dialogue *dialogue = new Dialogue; - - Table forwards(20); - - fillBuffers(script, true); - - while (scumm_stricmp(_tokens[0], "enddialogue")) { - if (scumm_stricmp(_tokens[0], "Question")) continue; - - Question *question = new Question; - dialogue->_questions[numQuestions] = question; - - forwards.addData(_tokens[1]); - - question->_text = parseDialogueString(script); - - fillBuffers(script, true); - question->_mood = atoi(_tokens[0]); - - uint16 numAnswers = 0; - - fillBuffers(script, true); - while (scumm_stricmp(_tokens[0], "endquestion")) { // parse answers - - Answer *answer = new Answer; - question->_answers[numAnswers] = answer; - - if (_tokens[1][0]) { - - Table* flagNames; - uint16 token; - - if (!scumm_stricmp(_tokens[1], "global")) { - token = 2; - flagNames = _globalTable; - answer->_yesFlags |= kFlagsGlobal; - } else { - token = 1; - flagNames = _localFlagNames; - } - - do { - - if (!scumm_strnicmp(_tokens[token], "no", 2)) { - byte _al = flagNames->lookup(_tokens[token]+2); - answer->_noFlags |= 1 << (_al - 1); - } else { - byte _al = flagNames->lookup(_tokens[token]); - answer->_yesFlags |= 1 << (_al - 1); - } - - token++; - - } while (!scumm_stricmp(_tokens[token++], "|")); - - } - - answer->_text = parseDialogueString(script); - - fillBuffers(script, true); - answer->_mood = atoi(_tokens[0]); - answer->_following._name = parseDialogueString(script); - - fillBuffers(script, true); - if (!scumm_stricmp(_tokens[0], "commands")) { - parseCommands(script, answer->_commands); - fillBuffers(script, true); - } - - numAnswers++; - } - - fillBuffers(script, true); - numQuestions++; - - } - - // link questions - byte v50[20]; - memset(v50, 0, 20); - - for (uint16 i = 0; i < numQuestions; i++) { - Question *question = dialogue->_questions[i]; - - for (uint16 j = 0; j < NUM_ANSWERS; j++) { - Answer *answer = question->_answers[j]; - if (answer == 0) continue; - - int16 index = forwards.lookup(answer->_following._name); - free(answer->_following._name); - - if (index == -1) - answer->_following._question = 0; - else - answer->_following._question = dialogue->_questions[index - 1]; - - - } - } - - return dialogue; -} - - -char *Parallaction::parseDialogueString(Script &script) { - - char vC8[200]; - char *vD0 = NULL; - do { - - vD0 = script.readLine(vC8, 200); - if (vD0 == 0) return NULL; - - vD0 = Common::ltrim(vD0); - - } while (strlen(vD0) == 0); - - vD0[strlen(vD0)-1] = '\0'; // deletes the trailing '0xA' - // this is critical for Gfx::displayWrappedString to work properly - - char *vCC = (char*)malloc(strlen(vD0)+1); - strcpy(vCC, vD0); - - return vCC; -} - class DialogueManager { Parallaction *_vm; @@ -195,8 +65,8 @@ class DialogueManager { bool _askPassword; bool isNpc; - Cnv *_questioner; - Cnv *_answerer; + Frames *_questioner; + Frames *_answerer; Question *_q; @@ -233,7 +103,7 @@ protected: }; uint16 DialogueManager::askPassword() { - debugC(1, kDebugDialogue, "checkDialoguePassword()"); + debugC(3, kDebugExec, "checkDialoguePassword()"); char password[100]; uint16 passwordLen; @@ -258,9 +128,10 @@ uint16 DialogueManager::askPassword() { // FIXME: see comment for updateInput() if (!g_system->getEventManager()->pollEvent(e)) continue; - if (e.type != Common::EVENT_KEYDOWN) continue; if (e.type == Common::EVENT_QUIT) g_system->quit(); + + if (e.type != Common::EVENT_KEYDOWN) continue; if (!isdigit(e.kbd.ascii)) continue; password[passwordLen] = e.kbd.ascii; @@ -291,7 +162,7 @@ uint16 DialogueManager::askPassword() { bool DialogueManager::displayAnswer(uint16 i) { - uint32 v28 = _localFlags[_vm->_currentLocationIndex]; + uint32 v28 = _vm->_localFlags[_vm->_currentLocationIndex]; if (_q->_answers[i]->_yesFlags & kFlagsGlobal) v28 = _commandFlags | kFlagsGlobal; @@ -370,7 +241,7 @@ uint16 DialogueManager::getAnswer() { clear(); - debugC(1, kDebugDialogue, "runDialogue: user selected answer #%i", answer); + debugC(3, kDebugExec, "runDialogue: user selected answer #%i", answer); return answer; } @@ -383,6 +254,8 @@ void DialogueManager::run() { _q = _dialogue->_questions[0]; int16 answer; + _vm->_gfx->copyScreen(Gfx::kBitFront, Gfx::kBitBack); + while (_q) { answer = 0; @@ -488,9 +361,9 @@ int16 DialogueManager::getHoverAnswer(int16 x, int16 y) { void Parallaction::runDialogue(SpeakData *data) { - debugC(1, kDebugDialogue, "runDialogue: starting dialogue '%s'", data->_name); + debugC(1, kDebugExec, "runDialogue: starting dialogue '%s'", data->_name); - _gfx->setFont(kFontDialogue); + _gfx->setFont(_dialogueFont); if (getPlatform() == Common::kPlatformPC) showCursor(false); @@ -503,34 +376,5 @@ void Parallaction::runDialogue(SpeakData *data) { return; } -Answer::Answer() { - _text = NULL; - _mood = 0; - _following._question = NULL; - _noFlags = 0; - _yesFlags = 0; -} - -Answer::~Answer() { - if (_text) - free(_text); -} - -Question::Question() { - _text = NULL; - _mood = 0; - - for (uint32 i = 0; i < NUM_ANSWERS; i++) - _answers[i] = NULL; - -} - -Question::~Question() { - - for (uint32 i = 0; i < NUM_ANSWERS; i++) - if (_answers[i]) delete _answers[i]; - - free(_text); -} } // namespace Parallaction diff --git a/engines/parallaction/disk.h b/engines/parallaction/disk.h index ae572b1122..6adab69f51 100644 --- a/engines/parallaction/disk.h +++ b/engines/parallaction/disk.h @@ -28,6 +28,7 @@ #include "parallaction/defs.h" #include "common/file.h" +#include "graphics/surface.h" namespace Parallaction { @@ -37,9 +38,10 @@ class Gfx; class Script; class Font; +struct Frames; struct Cnv; -struct StaticCnv; - +struct Sprites; +struct BackgroundInfo; class Disk { @@ -52,15 +54,15 @@ public: virtual Script* loadLocation(const char *name) = 0; virtual Script* loadScript(const char* name) = 0; - virtual Cnv* loadTalk(const char *name) = 0; - virtual Cnv* loadObjects(const char *name) = 0; - virtual StaticCnv* loadPointer() = 0; - virtual StaticCnv* loadHead(const char* name) = 0; + virtual Frames* loadTalk(const char *name) = 0; + virtual Frames* loadObjects(const char *name) = 0; + virtual Graphics::Surface* loadPointer(const char *name) = 0; + virtual Graphics::Surface* loadHead(const char* name) = 0; virtual Font* loadFont(const char* name) = 0; - virtual StaticCnv* loadStatic(const char* name) = 0; - virtual Cnv* loadFrames(const char* name) = 0; - virtual void loadSlide(const char *filename) = 0; - virtual void loadScenery(const char* background, const char* mask) = 0; + virtual Graphics::Surface* loadStatic(const char* name) = 0; + virtual Frames* loadFrames(const char* name) = 0; + virtual void loadSlide(BackgroundInfo& info, const char *filename) = 0; + virtual void loadScenery(BackgroundInfo& info, const char* background, const char* mask, const char* path) = 0; virtual Table* loadTable(const char* name) = 0; virtual Common::SeekableReadStream* loadMusic(const char* name) = 0; virtual Common::ReadStream* loadSound(const char* name) = 0; @@ -128,11 +130,11 @@ private: void unpackBackground(Common::ReadStream *stream, byte *screen, byte *mask, byte *path); Cnv* loadExternalCnv(const char *filename); Cnv* loadCnv(const char *filename); - StaticCnv *loadExternalStaticCnv(const char *filename); - void loadBackground(const char *filename); - void loadMaskAndPath(const char *name); + Graphics::Surface *loadExternalStaticCnv(const char *filename); + void loadBackground(BackgroundInfo& info, const char *filename); + void loadMaskAndPath(BackgroundInfo& info, const char *name); void parseDepths(Common::SeekableReadStream &stream); - void parseBackground(Common::SeekableReadStream &stream); + void parseBackground(BackgroundInfo& info, Common::SeekableReadStream &stream); Font *createFont(const char *name, Cnv* cnv); protected: @@ -144,15 +146,15 @@ public: Script* loadLocation(const char *name); Script* loadScript(const char* name); - Cnv* loadTalk(const char *name); - Cnv* loadObjects(const char *name); - StaticCnv* loadPointer(); - StaticCnv* loadHead(const char* name); + Frames* loadTalk(const char *name); + Frames* loadObjects(const char *name); + Graphics::Surface* loadPointer(const char *name); + Graphics::Surface* loadHead(const char* name); Font* loadFont(const char* name); - StaticCnv* loadStatic(const char* name); - Cnv* loadFrames(const char* name); - void loadSlide(const char *filename); - void loadScenery(const char* background, const char* mask); + Graphics::Surface* loadStatic(const char* name); + Frames* loadFrames(const char* name); + void loadSlide(BackgroundInfo& info, const char *filename); + void loadScenery(BackgroundInfo& info, const char* background, const char* mask, const char* path); Table* loadTable(const char* name); Common::SeekableReadStream* loadMusic(const char* name); Common::ReadStream* loadSound(const char* name); @@ -162,15 +164,15 @@ class AmigaDisk_ns : public Disk_ns { protected: Cnv* makeCnv(Common::SeekableReadStream &stream); - StaticCnv* makeStaticCnv(Common::SeekableReadStream &stream); + Graphics::Surface* makeStaticCnv(Common::SeekableReadStream &stream); void patchFrame(byte *dst, byte *dlta, uint16 bytesPerPlane, uint16 height); void unpackFrame(byte *dst, byte *src, uint16 planeSize); void unpackBitmap(byte *dst, byte *src, uint16 numFrames, uint16 bytesPerPlane, uint16 height); Common::SeekableReadStream *openArchivedFile(const char* name, bool errorOnFileNotFound = false); Font *createFont(const char *name, Common::SeekableReadStream &stream); - void loadMask(const char *name); - void loadPath(const char *name); - void loadBackground(const char *name); + void loadMask(BackgroundInfo& info, const char *name); + void loadPath(BackgroundInfo& info, const char *name); + void loadBackground(BackgroundInfo& info, const char *name); public: AmigaDisk_ns(Parallaction *vm); @@ -178,15 +180,15 @@ public: Script* loadLocation(const char *name); Script* loadScript(const char* name); - Cnv* loadTalk(const char *name); - Cnv* loadObjects(const char *name); - StaticCnv* loadPointer(); - StaticCnv* loadHead(const char* name); + Frames* loadTalk(const char *name); + Frames* loadObjects(const char *name); + Graphics::Surface* loadPointer(const char *name); + Graphics::Surface* loadHead(const char* name); Font* loadFont(const char* name); - StaticCnv* loadStatic(const char* name); - Cnv* loadFrames(const char* name); - void loadSlide(const char *filename); - void loadScenery(const char* background, const char* mask); + Graphics::Surface* loadStatic(const char* name); + Frames* loadFrames(const char* name); + void loadSlide(BackgroundInfo& info, const char *filename); + void loadScenery(BackgroundInfo& info, const char* background, const char* mask, const char* path); Table* loadTable(const char* name); Common::SeekableReadStream* loadMusic(const char* name); Common::ReadStream* loadSound(const char* name); @@ -200,9 +202,13 @@ class DosDisk_br : public Disk { protected: Parallaction *_vm; + char _partPath[PATH_LEN]; + char _languageDir[2]; protected: void errorFileNotFound(const char *s); + Font *createFont(const char *name, Common::ReadStream &stream); + Sprites* createSprites(const char *name); public: DosDisk_br(Parallaction *vm); @@ -212,15 +218,15 @@ public: void setLanguage(uint16 language); Script* loadLocation(const char *name); Script* loadScript(const char* name); - Cnv* loadTalk(const char *name); - Cnv* loadObjects(const char *name); - StaticCnv* loadPointer(); - StaticCnv* loadHead(const char* name); + Frames* loadTalk(const char *name); + Frames* loadObjects(const char *name); + Graphics::Surface* loadPointer(const char *name); + Graphics::Surface* loadHead(const char* name); Font* loadFont(const char* name); - StaticCnv* loadStatic(const char* name); - Cnv* loadFrames(const char* name); - void loadSlide(const char *filename); - void loadScenery(const char* background, const char* mask); + Graphics::Surface* loadStatic(const char* name); + Frames* loadFrames(const char* name); + void loadSlide(BackgroundInfo& info, const char *filename); + void loadScenery(BackgroundInfo& info, const char* background, const char* mask, const char* path); Table* loadTable(const char* name); Common::SeekableReadStream* loadMusic(const char* name); Common::ReadStream* loadSound(const char* name); diff --git a/engines/parallaction/disk_br.cpp b/engines/parallaction/disk_br.cpp index 452b74be51..5b79ad7df6 100644 --- a/engines/parallaction/disk_br.cpp +++ b/engines/parallaction/disk_br.cpp @@ -30,18 +30,95 @@ namespace Parallaction { +struct Sprite { + uint16 size; + uint16 x; + uint16 y; + uint16 w; + uint16 h; + + byte *packedData; + + Sprite() : size(0), x(0), y(0), w(0), h(0), packedData(0) { + } + + ~Sprite() { + if (packedData) + free(packedData); + } +}; + +struct Sprites : public Frames { + uint16 _num; + Sprite* _sprites; + + Sprites(uint num) { + _num = num; + _sprites = new Sprite[_num]; + } + + ~Sprites() { + delete _sprites; + } + + uint16 getNum() { + return _num; + } + + byte* getData(uint16 index) { + assert(index < _num); + return _sprites[index].packedData; + } + + void getRect(uint16 index, Common::Rect &r) { + assert(index < _num); + r.setWidth(_sprites[index].w); + r.setHeight(_sprites[index].h); + r.moveTo(_sprites[index].x, _sprites[index].y); +} + +}; + + + void DosDisk_br::errorFileNotFound(const char *s) { error("File '%s' not found", s); } Common::String DosDisk_br::selectArchive(const Common::String& name) { debugC(5, kDebugDisk, "DosDisk_br::selectArchive"); - return ""; + + Common::String oldPath(_partPath); + strcpy(_partPath, name.c_str()); + + return oldPath; } void DosDisk_br::setLanguage(uint16 language) { debugC(5, kDebugDisk, "DosDisk_br::setLanguage"); + switch (language) { + case 0: + strcpy(_languageDir, "it"); + break; + + case 1: + strcpy(_languageDir, "fr"); + break; + + case 2: + strcpy(_languageDir, "en"); + break; + + case 3: + strcpy(_languageDir, "ge"); + break; + + default: + error("unknown language"); + + } + return; } @@ -52,71 +129,239 @@ DosDisk_br::DosDisk_br(Parallaction* vm) : _vm(vm) { DosDisk_br::~DosDisk_br() { } -Cnv* DosDisk_br::loadTalk(const char *name) { +Frames* DosDisk_br::loadTalk(const char *name) { debugC(5, kDebugDisk, "DosDisk_br::loadTalk"); - return 0; + char path[PATH_LEN]; + sprintf(path, "%s/tal/%s.tal", _partPath, name); + + return createSprites(path); } Script* DosDisk_br::loadLocation(const char *name) { debugC(5, kDebugDisk, "DosDisk_br::loadLocation"); - return 0; + + Common::File *stream = new Common::File; + + char path[PATH_LEN]; + sprintf(path, "%s/%s/%s.slf", _partPath, _languageDir, name); + if (!stream->open(path)) { + sprintf(path, "%s/%s/%s.loc", _partPath, _languageDir, name); + if (!stream->open(path)) + errorFileNotFound(path); + } + + return new Script(stream, true); } Script* DosDisk_br::loadScript(const char* name) { debugC(5, kDebugDisk, "DosDisk_br::loadScript"); - return 0; + + Common::File *stream = new Common::File; + + char path[PATH_LEN]; + sprintf(path, "%s/scripts/%s.scr", _partPath, name); + if (!stream->open(path)) + errorFileNotFound(path); + + return new Script(stream, true); } // there are no Head resources in Big Red Adventure -StaticCnv* DosDisk_br::loadHead(const char* name) { +Graphics::Surface* DosDisk_br::loadHead(const char* name) { debugC(5, kDebugDisk, "DosDisk_br::loadHead"); return 0; } -StaticCnv* DosDisk_br::loadPointer() { +Graphics::Surface* DosDisk_br::loadPointer(const char *name) { debugC(5, kDebugDisk, "DosDisk_br::loadPointer"); - return 0; + + char path[PATH_LEN]; + sprintf(path, "%s.ras", name); + + Common::File stream; + if (!stream.open(path)) + errorFileNotFound(path); + + stream.skip(4); + uint width = stream.readUint32BE(); + uint height = stream.readUint32BE(); + stream.skip(20); + stream.skip(768); + + Graphics::Surface *surf = new Graphics::Surface; + + surf->create(width, height, 1); + stream.read(surf->pixels, width * height); + + return surf; } Font* DosDisk_br::loadFont(const char* name) { debugC(5, kDebugDisk, "DosDisk_br::loadFont"); - return 0; + + char path[PATH_LEN]; + sprintf(path, "%s.fnt", name); + + Common::File stream; + if (!stream.open(path)) + errorFileNotFound(path); + + return createFont(name, stream); } -Cnv* DosDisk_br::loadObjects(const char *name) { +Frames* DosDisk_br::loadObjects(const char *name) { debugC(5, kDebugDisk, "DosDisk_br::loadObjects"); return 0; } +void genSlidePath(char *path, const char* name) { + sprintf(path, "%s.bmp", name); +} -StaticCnv* DosDisk_br::loadStatic(const char* name) { +Graphics::Surface* DosDisk_br::loadStatic(const char* name) { debugC(5, kDebugDisk, "DosDisk_br::loadStatic"); return 0; } -Cnv* DosDisk_br::loadFrames(const char* name) { +Sprites* DosDisk_br::createSprites(const char *path) { + + Common::File stream; + if (!stream.open(path)) { + errorFileNotFound(path); + } + + uint16 num = stream.readUint16LE(); + + Sprites *sprites = new Sprites(num); + + for (uint i = 0; i < num; i++) { + Sprite *spr = &sprites->_sprites[i]; + spr->size = stream.readUint16LE(); + spr->x = stream.readUint16LE(); + spr->y = stream.readUint16LE(); + spr->w = stream.readUint16LE(); + spr->h = stream.readUint16LE(); + + spr->packedData = (byte*)malloc(spr->size); + stream.read(spr->packedData, spr->size); + } + + return sprites; +} + +Frames* DosDisk_br::loadFrames(const char* name) { debugC(5, kDebugDisk, "DosDisk_br::loadFrames"); - return 0; + + char path[PATH_LEN]; + sprintf(path, "%s/ani/%s.ani", _partPath, name); + + return createSprites(path); } -// there are no Slide resources in Big Red Adventure -void DosDisk_br::loadSlide(const char *filename) { +// Slides in Nippon Safes are basically screen-sized pictures with valid +// palette data used for menu and for location switches. Big Red Adventure +// doesn't need slides in that sense, but it still has some special +// graphics resources with palette data, so those will be named slides. +// +void DosDisk_br::loadSlide(BackgroundInfo& info, const char *name) { debugC(5, kDebugDisk, "DosDisk_br::loadSlide"); + + char path[PATH_LEN]; + genSlidePath(path, name); + + Common::File stream; + if (!stream.open(path)) + errorFileNotFound(path); + + stream.skip(4); + info.width = stream.readUint32BE(); + info.height = stream.readUint32BE(); + stream.skip(20); + + byte rgb[768]; + stream.read(rgb, 768); + + for (uint i = 0; i < 256; i++) { + info.palette.setEntry(i, rgb[i] >> 2, rgb[i+256] >> 2, rgb[i+512] >> 2); + } + + info.bg.create(info.width, info.height, 1); + stream.read(info.bg.pixels, info.width * info.height); + return; } -void DosDisk_br::loadScenery(const char *name, const char *mask) { +void DosDisk_br::loadScenery(BackgroundInfo& info, const char *name, const char *mask, const char* path) { debugC(5, kDebugDisk, "DosDisk_br::loadScenery"); + + char filename[PATH_LEN]; + Common::File stream; + + if (name) { + sprintf(filename, "%s/bkg/%s.bkg", _partPath, name); + if (!stream.open(filename)) + errorFileNotFound(filename); + + stream.skip(4); + info.width = stream.readUint32BE(); + info.height = stream.readUint32BE(); + stream.skip(20); + + byte rgb[768]; + stream.read(rgb, 768); + + for (uint i = 0; i < 256; i++) { + info.palette.setEntry(i, rgb[i] >> 2, rgb[i+256] >> 2, rgb[i+512] >> 2); + } + + info.bg.create(info.width, info.height, 1); + stream.read(info.bg.pixels, info.width * info.height); + } + + if (mask) { + sprintf(filename, "%s/msk/%s.msk", _partPath, mask); + if (!stream.open(filename)) + errorFileNotFound(filename); + + // NOTE: info.width and info.height are only valid if the background graphics + // have already been loaded + info.mask.create(info.width, info.height); + stream.read(info.mask.data, info.width * info.height); + } + + if (path) { + sprintf(filename, "%s/pth/%s.pth", _partPath, path); + if (!stream.open(filename)) + errorFileNotFound(filename); + + // NOTE: info.width and info.height are only valid if the background graphics + // have already been loaded + info.path.create(info.width, info.height); + stream.read(info.path.data, info.width * info.height); + } + return; } Table* DosDisk_br::loadTable(const char* name) { debugC(5, kDebugDisk, "DosDisk_br::loadTable"); - return 0; + + char path[PATH_LEN]; + sprintf(path, "%s/%s.tab", _partPath, name); + + Common::File stream; + if (!stream.open(path)) + errorFileNotFound(path); + + Table *t = createTableFromStream(100, stream); + + stream.close(); + + return t; } Common::SeekableReadStream* DosDisk_br::loadMusic(const char* name) { diff --git a/engines/parallaction/disk_ns.cpp b/engines/parallaction/disk_ns.cpp index c0bb2691ef..8b5ce850ff 100644 --- a/engines/parallaction/disk_ns.cpp +++ b/engines/parallaction/disk_ns.cpp @@ -345,7 +345,7 @@ Cnv* DosDisk_ns::loadExternalCnv(const char *filename) { return new Cnv(numFrames, width, height, data); } -StaticCnv *DosDisk_ns::loadExternalStaticCnv(const char *filename) { +Graphics::Surface *DosDisk_ns::loadExternalStaticCnv(const char *filename) { char path[PATH_LEN]; @@ -356,16 +356,14 @@ StaticCnv *DosDisk_ns::loadExternalStaticCnv(const char *filename) { if (!stream.open(path)) errorFileNotFound(path); - StaticCnv *cnv = new StaticCnv; + Graphics::Surface *cnv = new Graphics::Surface; stream.skip(1); - cnv->_width = stream.readByte(); - cnv->_height = stream.readByte(); + byte w = stream.readByte(); + byte h = stream.readByte(); - uint16 size = cnv->_width*cnv->_height; - - cnv->_data0 = (byte*)malloc(size); - stream.read(cnv->_data0, size); + cnv->create(w, h, 1); + stream.read(cnv->pixels, w*h); return cnv; } @@ -395,7 +393,7 @@ Cnv* DosDisk_ns::loadCnv(const char *filename) { return new Cnv(numFrames, width, height, data); } -Cnv* DosDisk_ns::loadTalk(const char *name) { +Frames* DosDisk_ns::loadTalk(const char *name) { const char *ext = strstr(name, ".talk"); if (ext != NULL) { @@ -462,7 +460,7 @@ Script* DosDisk_ns::loadScript(const char* name) { return new Script(new DummyArchiveStream(_resArchive), true); } -StaticCnv* DosDisk_ns::loadHead(const char* name) { +Graphics::Surface* DosDisk_ns::loadHead(const char* name) { char path[PATH_LEN]; @@ -477,8 +475,8 @@ StaticCnv* DosDisk_ns::loadHead(const char* name) { } -StaticCnv* DosDisk_ns::loadPointer() { - return loadExternalStaticCnv("pointer"); +Graphics::Surface* DosDisk_ns::loadPointer(const char *name) { + return loadExternalStaticCnv(name); } @@ -489,7 +487,7 @@ Font* DosDisk_ns::loadFont(const char* name) { } -Cnv* DosDisk_ns::loadObjects(const char *name) { +Frames* DosDisk_ns::loadObjects(const char *name) { if (IS_MINI_CHARACTER(name)) { name += 4; @@ -501,7 +499,7 @@ Cnv* DosDisk_ns::loadObjects(const char *name) { } -StaticCnv* DosDisk_ns::loadStatic(const char* name) { +Graphics::Surface* DosDisk_ns::loadStatic(const char* name) { char path[PATH_LEN]; @@ -512,22 +510,21 @@ StaticCnv* DosDisk_ns::loadStatic(const char* name) { errorFileNotFound(path); } - StaticCnv* cnv = new StaticCnv; + Graphics::Surface* cnv = new Graphics::Surface; _resArchive.skip(1); - cnv->_width = _resArchive.readByte(); - cnv->_height = _resArchive.readByte(); + byte w = _resArchive.readByte(); + byte h = _resArchive.readByte(); - uint16 size = cnv->_width*cnv->_height; - cnv->_data0 = (byte*)malloc(size); + cnv->create(w, h, 1); Graphics::PackBitsReadStream decoder(_resArchive); - decoder.read(cnv->_data0, size); + decoder.read(cnv->pixels, w*h); return cnv; } -Cnv* DosDisk_ns::loadFrames(const char* name) { +Frames* DosDisk_ns::loadFrames(const char* name) { return loadCnv(name); } @@ -565,10 +562,16 @@ void DosDisk_ns::parseDepths(Common::SeekableReadStream &stream) { } -void DosDisk_ns::parseBackground(Common::SeekableReadStream &stream) { +void DosDisk_ns::parseBackground(BackgroundInfo& info, Common::SeekableReadStream &stream) { + + byte tmp[3]; - stream.read(_vm->_gfx->_palette, BASE_PALETTE_SIZE); - _vm->_gfx->setPalette(_vm->_gfx->_palette); + for (uint i = 0; i < 32; i++) { + tmp[0] = stream.readByte(); + tmp[1] = stream.readByte(); + tmp[2] = stream.readByte(); + info.palette.setEntry(i, tmp[0], tmp[1], tmp[2]); + } parseDepths(stream); @@ -582,28 +585,22 @@ void DosDisk_ns::parseBackground(Common::SeekableReadStream &stream) { } -void DosDisk_ns::loadBackground(const char *filename) { +void DosDisk_ns::loadBackground(BackgroundInfo& info, const char *filename) { if (!_resArchive.openArchivedFile(filename)) errorFileNotFound(filename); - parseBackground(_resArchive); + info.width = _vm->_screenWidth; // 320 + info.height = _vm->_screenHeight; // 200 - byte *bg = (byte*)calloc(1, _vm->_screenSize); - byte *mask = (byte*)calloc(1, _vm->_screenMaskSize); - byte *path = (byte*)calloc(1, _vm->_screenPathSize); + parseBackground(info, _resArchive); + info.bg.create(info.width, info.height, 1); + info.mask.create(info.width, info.height); + info.path.create(info.width, info.height); Graphics::PackBitsReadStream stream(_resArchive); - unpackBackground(&stream, bg, mask, path); - - _vm->_gfx->setBackground(bg); - _vm->_gfx->setMask(mask); - _vm->setPath(path); - - free(bg); - free(mask); - free(path); + unpackBackground(&stream, (byte*)info.bg.pixels, info.mask.data, info.path.data); return; } @@ -614,43 +611,44 @@ void DosDisk_ns::loadBackground(const char *filename) { // mask and path are normally combined (via OR) into the background picture itself // read the comment on the top of this file for more // -void DosDisk_ns::loadMaskAndPath(const char *name) { +void DosDisk_ns::loadMaskAndPath(BackgroundInfo& info, const char *name) { char path[PATH_LEN]; sprintf(path, "%s.msk", name); if (!_resArchive.openArchivedFile(path)) errorFileNotFound(name); - byte *maskBuf = (byte*)calloc(1, _vm->_screenMaskSize); - byte *pathBuf = (byte*)calloc(1, _vm->_screenPathSize); - parseDepths(_resArchive); - _resArchive.read(pathBuf, _vm->_screenPathSize); - _resArchive.read(maskBuf, _vm->_screenMaskSize); + info.path.create(info.width, info.height); + _resArchive.read(info.path.data, info.path.size); - _vm->_gfx->setMask(maskBuf); - _vm->setPath(pathBuf); + info.mask.create(info.width, info.height); + _resArchive.read(info.mask.data, info.mask.size); return; } -void DosDisk_ns::loadSlide(const char *filename) { +void DosDisk_ns::loadSlide(BackgroundInfo& info, const char *filename) { char path[PATH_LEN]; sprintf(path, "%s.slide", filename); - loadBackground(path); + loadBackground(info, path); + + return; } -void DosDisk_ns::loadScenery(const char *name, const char *mask) { - char path[PATH_LEN]; - sprintf(path, "%s.dyn", name); - loadBackground(path); +void DosDisk_ns::loadScenery(BackgroundInfo& info, const char *name, const char *mask, const char* path) { + char filename[PATH_LEN]; + sprintf(filename, "%s.dyn", name); + + loadBackground(info, filename); if (mask != NULL) { // load external masks and paths only for certain locations - loadMaskAndPath(mask); + loadMaskAndPath(info, mask); } + return; } Table* DosDisk_ns::loadTable(const char* name) { @@ -661,13 +659,7 @@ Table* DosDisk_ns::loadTable(const char* name) { if (!stream.open(path)) errorFileNotFound(path); - Table *t = new Table(100); - - fillBuffers(stream); - while (scumm_stricmp(_tokens[0], "ENDTABLE")) { - t->addData(_tokens[0]); - fillBuffers(stream); - } + Table *t = createTableFromStream(100, stream); stream.close(); @@ -974,7 +966,7 @@ void AmigaDisk_ns::unpackBitmap(byte *dst, byte *src, uint16 numFrames, uint16 b } -StaticCnv* AmigaDisk_ns::makeStaticCnv(Common::SeekableReadStream &stream) { +Graphics::Surface* AmigaDisk_ns::makeStaticCnv(Common::SeekableReadStream &stream) { stream.skip(1); uint16 width = stream.readByte(); @@ -988,19 +980,13 @@ StaticCnv* AmigaDisk_ns::makeStaticCnv(Common::SeekableReadStream &stream) { byte *buf = (byte*)malloc(rawsize); stream.read(buf, rawsize); - uint32 decsize = width * height; - byte *data = (byte*)calloc(decsize, 1); + Graphics::Surface *cnv = new Graphics::Surface; + cnv->create(width, height, 1); - unpackBitmap(data, buf, 1, bytesPerPlane, height); + unpackBitmap((byte*)cnv->pixels, buf, 1, bytesPerPlane, height); free(buf); - StaticCnv *cnv = new StaticCnv(); - cnv->_width = width; - cnv->_height = height; - cnv->_data0 = data; - cnv->_data1 = NULL; - return cnv; } @@ -1063,21 +1049,21 @@ Script* AmigaDisk_ns::loadScript(const char* name) { return new Script(new DummyArchiveStream(_resArchive), true); } -StaticCnv* AmigaDisk_ns::loadPointer() { +Graphics::Surface* AmigaDisk_ns::loadPointer(const char* name) { debugC(1, kDebugDisk, "AmigaDisk_ns::loadPointer"); Common::File stream; - if (!stream.open("pointer")) - errorFileNotFound("pointer"); + if (!stream.open(name)) + errorFileNotFound(name); return makeStaticCnv(stream); } -StaticCnv* AmigaDisk_ns::loadStatic(const char* name) { +Graphics::Surface* AmigaDisk_ns::loadStatic(const char* name) { debugC(1, kDebugDisk, "AmigaDisk_ns::loadStatic '%s'", name); Common::SeekableReadStream *s = openArchivedFile(name, true); - StaticCnv *cnv = makeStaticCnv(*s); + Graphics::Surface *cnv = makeStaticCnv(*s); delete s; @@ -1186,28 +1172,38 @@ public: }; -void AmigaDisk_ns::loadBackground(const char *name) { +void AmigaDisk_ns::loadBackground(BackgroundInfo& info, const char *name) { Common::SeekableReadStream *s = openArchivedFile(name, true); - Graphics::Surface surf; byte *pal; - BackgroundDecoder decoder(*s, surf, pal, _vm->_gfx->_palettefx); + + BackgroundDecoder decoder(*s, info.bg, pal, _vm->_gfx->_palettefx); decoder.decode(); - for (uint32 i = 0; i < BASE_PALETTE_COLORS * 3; i++) - _vm->_gfx->_palette[i] = pal[i] >> 2; + info.width = info.bg.w; + info.height = info.bg.h; + + byte *p = pal; + for (uint i = 0; i < 32; i++) { + byte r = *p >> 2; + p++; + byte g = *p >> 2; + p++; + byte b = *p >> 2; + p++; + info.palette.setEntry(i, r, g, b); + } + free(pal); - _vm->_gfx->setPalette(_vm->_gfx->_palette); - _vm->_gfx->setBackground(static_cast<byte*>(surf.pixels)); - surf.free(); + delete s; return; } -void AmigaDisk_ns::loadMask(const char *name) { +void AmigaDisk_ns::loadMask(BackgroundInfo& info, const char *name) { debugC(5, kDebugDisk, "AmigaDisk_ns::loadMask(%s)", name); char path[PATH_LEN]; @@ -1236,18 +1232,16 @@ void AmigaDisk_ns::loadMask(const char *name) { s->seek(0x126, SEEK_SET); // HACK: skipping IFF/ILBM header should be done by analysis, not magic Graphics::PackBitsReadStream stream(*s); - byte *buf = (byte*)malloc(_vm->_screenMaskSize); - stream.read(buf, _vm->_screenMaskSize); - buildMask(buf); + info.mask.create(info.width, info.height); + stream.read(info.mask.data, info.mask.size); + buildMask(info.mask.data); - _vm->_gfx->setMask(buf); - free(buf); delete s; return; } -void AmigaDisk_ns::loadPath(const char *name) { +void AmigaDisk_ns::loadPath(BackgroundInfo& info, const char *name) { char path[PATH_LEN]; sprintf(path, "%s.path", name); @@ -1260,49 +1254,52 @@ void AmigaDisk_ns::loadPath(const char *name) { s->seek(0x120, SEEK_SET); // HACK: skipping IFF/ILBM header should be done by analysis, not magic Graphics::PackBitsReadStream stream(*s); - byte *buf = (byte*)malloc(_vm->_screenPathSize); - stream.read(buf, _vm->_screenPathSize); - _vm->setPath(buf); - free(buf); + + info.path.create(info.width, info.height); + stream.read(info.path.data, info.path.size); + delete s; return; } -void AmigaDisk_ns::loadScenery(const char* background, const char* mask) { +void AmigaDisk_ns::loadScenery(BackgroundInfo& info, const char* background, const char* mask, const char* path) { debugC(1, kDebugDisk, "AmigaDisk_ns::loadScenery '%s', '%s'", background, mask); - char path[PATH_LEN]; - sprintf(path, "%s.bkgnd", background); + char filename[PATH_LEN]; + sprintf(filename, "%s.bkgnd", background); - loadBackground(path); + loadBackground(info, filename); if (mask == NULL) { - loadMask(background); - loadPath(background); + loadMask(info, background); + loadPath(info, background); } else { - loadMask(mask); - loadPath(mask); + loadMask(info, mask); + loadPath(info, mask); } return; } -void AmigaDisk_ns::loadSlide(const char *name) { +void AmigaDisk_ns::loadSlide(BackgroundInfo& info, const char *name) { debugC(1, kDebugDisk, "AmigaDisk_ns::loadSlide '%s'", name); char path[PATH_LEN]; sprintf(path, "slides/%s", name); Common::SeekableReadStream *s = openArchivedFile(path, false); + if (s) - loadBackground(path); + loadBackground(info, path); else - loadBackground(name); + loadBackground(info, name); + + delete s; return; } -Cnv* AmigaDisk_ns::loadFrames(const char* name) { +Frames* AmigaDisk_ns::loadFrames(const char* name) { debugC(1, kDebugDisk, "AmigaDisk_ns::loadFrames '%s'", name); Common::SeekableReadStream *s; @@ -1320,14 +1317,14 @@ Cnv* AmigaDisk_ns::loadFrames(const char* name) { return cnv; } -StaticCnv* AmigaDisk_ns::loadHead(const char* name) { +Graphics::Surface* AmigaDisk_ns::loadHead(const char* name) { debugC(1, kDebugDisk, "AmigaDisk_ns::loadHead '%s'", name); char path[PATH_LEN]; sprintf(path, "%s.head", name); Common::SeekableReadStream *s = openArchivedFile(path, true); - StaticCnv *cnv = makeStaticCnv(*s); + Graphics::Surface *cnv = makeStaticCnv(*s); delete s; @@ -1335,7 +1332,7 @@ StaticCnv* AmigaDisk_ns::loadHead(const char* name) { } -Cnv* AmigaDisk_ns::loadObjects(const char *name) { +Frames* AmigaDisk_ns::loadObjects(const char *name) { debugC(1, kDebugDisk, "AmigaDisk_ns::loadObjects"); char path[PATH_LEN]; @@ -1353,7 +1350,7 @@ Cnv* AmigaDisk_ns::loadObjects(const char *name) { } -Cnv* AmigaDisk_ns::loadTalk(const char *name) { +Frames* AmigaDisk_ns::loadTalk(const char *name) { debugC(1, kDebugDisk, "AmigaDisk_ns::loadTalk '%s'", name); Common::SeekableReadStream *s; @@ -1401,13 +1398,7 @@ Table* AmigaDisk_ns::loadTable(const char* name) { stream = &_resArchive; } - Table *t = new Table(100); - - fillBuffers(*stream); - while (scumm_stricmp(_tokens[0], "ENDTABLE")) { - t->addData(_tokens[0]); - fillBuffers(*stream); - } + Table *t = createTableFromStream(100, *stream); if (dispose) delete stream; diff --git a/engines/parallaction/exec_br.cpp b/engines/parallaction/exec_br.cpp new file mode 100644 index 0000000000..7862a4a0c6 --- /dev/null +++ b/engines/parallaction/exec_br.cpp @@ -0,0 +1,588 @@ + +#include "common/stdafx.h" +#include "parallaction/parallaction.h" + +namespace Parallaction { + +#define INST_ON 1 +#define INST_OFF 2 +#define INST_X 3 +#define INST_Y 4 +#define INST_Z 5 +#define INST_F 6 +#define INST_LOOP 7 +#define INST_ENDLOOP 8 +#define INST_SHOW 9 +#define INST_INC 10 +#define INST_DEC 11 +#define INST_SET 12 +#define INST_PUT 13 +#define INST_CALL 14 +#define INST_WAIT 15 +#define INST_START 16 +#define INST_PROCESS 17 +#define INST_MOVE 18 +#define INST_COLOR 19 +#define INST_SOUND 20 +#define INST_MASK 21 +#define INST_PRINT 22 +#define INST_TEXT 23 +#define INST_MUL 24 +#define INST_DIV 25 +#define INST_IFEQ 26 +#define INST_IFLT 27 +#define INST_IFGT 28 +#define INST_ENDIF 29 +#define INST_STOP 30 +#define INST_ENDSCRIPT 31 + + + +typedef OpcodeImpl<Parallaction_br> OpcodeV2; +#define COMMAND_OPCODE(op) OpcodeV2(this, &Parallaction_br::cmdOp_##op) +#define DECLARE_COMMAND_OPCODE(op) void Parallaction_br::cmdOp_##op() + +#define INSTRUCTION_OPCODE(op) OpcodeV2(this, &Parallaction_br::instOp_##op) +#define DECLARE_INSTRUCTION_OPCODE(op) void Parallaction_br::instOp_##op() + +void Parallaction_br::setupSubtitles(char *s, char *s2, int y) { + debugC(5, kDebugExec, "setupSubtitles(%s, %s, %i)", s, s2, y); + + if (!scumm_stricmp("clear", s)) { + + removeJob(_jDisplaySubtitle); + addJob(kJobWaitRemoveSubtitleJob, _jEraseSubtitle, 15); + _jDisplaySubtitle = 0; + + _subtitle0.free(); + _subtitle1.free(); + return; + } + + _subtitle0.free(); + _subtitle1.free(); + + renderLabel(&_subtitle0._cnv, s); + _subtitle0._text = strdup(s); + + if (s2) { + renderLabel(&_subtitle1._cnv, s2); + _subtitle1._text = strdup(s2); + } + + _subtitleLipSync = 0; + + if (y != -1) { + _subtitle0._pos.y = y; + _subtitle1._pos.y = y + 5 + _labelFont->height(); + } + + _subtitle0._pos.x = (_gfx->_screenX << 2) + ((640 - _subtitle0._cnv.w) >> 1); + if (_subtitle1._text) + _subtitle1._pos.x = (_gfx->_screenX << 2) + ((640 - _subtitle1._cnv.w) >> 1); + + if (_jDisplaySubtitle == 0) { + _subtitle0._old.x = -1000; + _subtitle0._old.y = -1000; + _jDisplaySubtitle = addJob(kJobDisplaySubtitle, 0, 1); + _jEraseSubtitle = addJob(kJobEraseSubtitle, 0, 20); + } +} + + + +DECLARE_COMMAND_OPCODE(location) { + warning("Parallaction_br::cmdOp_location command not yet implemented"); +} + + +DECLARE_COMMAND_OPCODE(open) { + warning("Parallaction_br::cmdOp_open command not yet implemented"); +} + + +DECLARE_COMMAND_OPCODE(close) { + warning("Parallaction_br::cmdOp_close not yet implemented"); +} + + +DECLARE_COMMAND_OPCODE(on) { + warning("Parallaction_br::cmdOp_on not yet implemented"); +} + + +DECLARE_COMMAND_OPCODE(off) { + warning("Parallaction_br::cmdOp_off not yet implemented"); +} + + +DECLARE_COMMAND_OPCODE(call) { + callFunction(_cmdRunCtxt.cmd->u._callable, _cmdRunCtxt.z); +} + + +DECLARE_COMMAND_OPCODE(drop) { + warning("Parallaction_br::cmdOp_drop not yet implemented"); +} + + +DECLARE_COMMAND_OPCODE(move) { + warning("Parallaction_br::cmdOp_move not yet implemented"); +} + +DECLARE_COMMAND_OPCODE(start) { + warning("Parallaction_br::cmdOp_start not yet implemented"); +} + +DECLARE_COMMAND_OPCODE(stop) { + warning("Parallaction_br::cmdOp_stop not yet implemented"); +} + + +DECLARE_COMMAND_OPCODE(character) { + warning("Parallaction_br::cmdOp_character not yet implemented"); +} + + +DECLARE_COMMAND_OPCODE(followme) { + warning("Parallaction_br::cmdOp_followme not yet implemented"); +} + + +DECLARE_COMMAND_OPCODE(onmouse) { + showCursor(true); +} + + +DECLARE_COMMAND_OPCODE(offmouse) { + showCursor(false); +} + + +DECLARE_COMMAND_OPCODE(add) { + warning("Parallaction_br::cmdOp_add not yet implemented"); +} + + +DECLARE_COMMAND_OPCODE(leave) { + warning("Parallaction_br::cmdOp_leave not yet implemented"); +} + + +DECLARE_COMMAND_OPCODE(inc) { + _counters[_cmdRunCtxt.cmd->u._lvalue] += _cmdRunCtxt.cmd->u._rvalue; +} + + +DECLARE_COMMAND_OPCODE(dec) { + _counters[_cmdRunCtxt.cmd->u._lvalue] -= _cmdRunCtxt.cmd->u._rvalue; +} + + +DECLARE_COMMAND_OPCODE(ifeq) { + if (_counters[_cmdRunCtxt.cmd->u._lvalue] == _cmdRunCtxt.cmd->u._rvalue) { + _localFlags[_currentLocationIndex] |= kFlagsTestTrue; + } else { + _localFlags[_currentLocationIndex] &= ~kFlagsTestTrue; + } +} + +DECLARE_COMMAND_OPCODE(iflt) { + if (_counters[_cmdRunCtxt.cmd->u._lvalue] < _cmdRunCtxt.cmd->u._rvalue) { + _localFlags[_currentLocationIndex] |= kFlagsTestTrue; + } else { + _localFlags[_currentLocationIndex] &= ~kFlagsTestTrue; + } +} + +DECLARE_COMMAND_OPCODE(ifgt) { + if (_counters[_cmdRunCtxt.cmd->u._lvalue] > _cmdRunCtxt.cmd->u._rvalue) { + _localFlags[_currentLocationIndex] |= kFlagsTestTrue; + } else { + _localFlags[_currentLocationIndex] &= ~kFlagsTestTrue; + } +} + + +DECLARE_COMMAND_OPCODE(let) { + _counters[_cmdRunCtxt.cmd->u._lvalue] = _cmdRunCtxt.cmd->u._rvalue; +} + + +DECLARE_COMMAND_OPCODE(music) { + warning("Parallaction_br::cmdOp_music not yet implemented"); +} + + +DECLARE_COMMAND_OPCODE(fix) { + _cmdRunCtxt.cmd->u._zone->_flags |= kFlagsFixed; +} + + +DECLARE_COMMAND_OPCODE(unfix) { + _cmdRunCtxt.cmd->u._zone->_flags &= ~kFlagsFixed; +} + + +DECLARE_COMMAND_OPCODE(zeta) { + _zeta0 = _cmdRunCtxt.cmd->u._zeta0; + _zeta1 = _cmdRunCtxt.cmd->u._zeta1; + _zeta2 = _cmdRunCtxt.cmd->u._zeta2; +} + + +DECLARE_COMMAND_OPCODE(scroll) { + warning("Parallaction_br::cmdOp_scroll not yet implemented"); +} + + +DECLARE_COMMAND_OPCODE(swap) { + warning("Parallaction_br::cmdOp_swap not yet implemented"); +} + + +DECLARE_COMMAND_OPCODE(give) { + warning("Parallaction_br::cmdOp_give not yet implemented"); +} + + +DECLARE_COMMAND_OPCODE(text) { + CommandData *data = &_cmdRunCtxt.cmd->u; + setupSubtitles(data->_string, data->_string2, data->_zeta0); +} + + +DECLARE_COMMAND_OPCODE(part) { + warning("Parallaction_br::cmdOp_part not yet implemented"); +} + + +DECLARE_COMMAND_OPCODE(testsfx) { + warning("Parallaction_br::cmdOp_testsfx not completely implemented"); + _localFlags[_currentLocationIndex] &= ~kFlagsTestTrue; // should test if sfx are enabled +} + + +DECLARE_COMMAND_OPCODE(ret) { + warning("Parallaction_br::cmdOp_ret not yet implemented"); +} + + +DECLARE_COMMAND_OPCODE(onsave) { + warning("Parallaction_br::cmdOp_onsave not yet implemented"); +} + + +DECLARE_COMMAND_OPCODE(offsave) { + warning("Parallaction_br::cmdOp_offsave not yet implemented"); +} + + + + +DECLARE_INSTRUCTION_OPCODE(on) { + warning("Parallaction_br::instOp_on not yet implemented"); +} + + +DECLARE_INSTRUCTION_OPCODE(off) { + warning("Parallaction_br::instOp_off not yet implemented"); +} + + +DECLARE_INSTRUCTION_OPCODE(set) { + Instruction *inst = *_instRunCtxt.inst; + + int16 rvalue = inst->_opB.getRValue(); + int16* lvalue = inst->_opA.getLValue(); + + *lvalue = rvalue; + +} + + +DECLARE_INSTRUCTION_OPCODE(loop) { + Instruction *inst = *_instRunCtxt.inst; + + _instRunCtxt.a->_program->_loopCounter = inst->_opB.getRValue(); + _instRunCtxt.a->_program->_loopStart = _instRunCtxt.inst; +} + + +DECLARE_INSTRUCTION_OPCODE(inc) { + Instruction *inst = *_instRunCtxt.inst; + + int16 rvalue = inst->_opB.getRValue(); + + if (inst->_flags & kInstMod) { // mod + int16 _bx = (rvalue > 0 ? rvalue : -rvalue); + if (_instRunCtxt.modCounter % _bx != 0) return; + + rvalue = (rvalue > 0 ? 1 : -1); + } + + int16 *lvalue = inst->_opA.getLValue(); + + switch (inst->_index) { + case INST_INC: + *lvalue += rvalue; + break; + + case INST_DEC: + *lvalue -= rvalue; + break; + + case INST_MUL: + *lvalue *= rvalue; + break; + + case INST_DIV: + *lvalue /= rvalue; + break; + + default: + error("This should never happen. Report immediately");; + } + + if (inst->_opA._flags & kParaLocal) { + wrapLocalVar(inst->_opA._local); + } + +} + + +DECLARE_INSTRUCTION_OPCODE(put) { + warning("Parallaction_br::instOp_put not yet implemented"); +} + + + +DECLARE_INSTRUCTION_OPCODE(wait) { + warning("Parallaction_br::instOp_wait not yet implemented"); +} + + +DECLARE_INSTRUCTION_OPCODE(start) { + (*_instRunCtxt.inst)->_z->_flags |= kFlagsActing; +} + + +DECLARE_INSTRUCTION_OPCODE(process) { + _activeZone2 = (*_instRunCtxt.inst)->_z; +} + + +DECLARE_INSTRUCTION_OPCODE(move) { + warning("Parallaction_br::instOp_move not yet implemented"); +} + + +DECLARE_INSTRUCTION_OPCODE(color) { + Instruction *inst = *_instRunCtxt.inst; + + int16 entry = inst->_opB.getRValue(); + + _gfx->_palette.setEntry(entry, inst->_colors[0], inst->_colors[1], inst->_colors[2]); + +} + + +DECLARE_INSTRUCTION_OPCODE(mask) { + Instruction *inst = *_instRunCtxt.inst; + + _gfx->_bgLayers[0] = inst->_opA.getRValue(); + _gfx->_bgLayers[1] = inst->_opB.getRValue(); + _gfx->_bgLayers[2] = inst->_opC.getRValue(); +} + + +DECLARE_INSTRUCTION_OPCODE(print) { + warning("Parallaction_br::instOp_print not yet implemented"); +} + + + +void Parallaction_br::jobDisplaySubtitle(void *parm, Job *job) { + _gfx->drawLabel(_subtitle0); + _gfx->drawLabel(_subtitle1); +} + +void Parallaction_br::jobEraseSubtitle(void *parm, Job *job) { + Common::Rect r; + + if (_subtitle0._old.x != -1000) { + _subtitle0.getRect(r); + +// printf("sub0: (%i, %i, %i, %i)\n", r.left, r.top, r.right, r.bottom); + + _gfx->restoreBackground(r); + } + _subtitle0._old = _subtitle0._pos; + + if (_subtitle1._old.x != -1000) { + _subtitle0.getRect(r); + +// printf("sub1: (%i, %i, %i, %i)\n", r.left, r.top, r.right, r.bottom); + + _gfx->restoreBackground(r); + } + _subtitle1._old = _subtitle1._pos; +} + +DECLARE_INSTRUCTION_OPCODE(text) { + Instruction *inst = (*_instRunCtxt.inst); + setupSubtitles(inst->_text, inst->_text2, inst->_y); +} + + +DECLARE_INSTRUCTION_OPCODE(ifeq) { + warning("Parallaction_br::instOp_ifeq not yet implemented"); +} + + +DECLARE_INSTRUCTION_OPCODE(iflt) { + warning("Parallaction_br::instOp_iflt not yet implemented"); +} + + +DECLARE_INSTRUCTION_OPCODE(ifgt) { + warning("Parallaction_br::instOp_ifgt not yet implemented"); +} + + +DECLARE_INSTRUCTION_OPCODE(endif) { + warning("Parallaction_br::instOp_endif not yet implemented"); +} + + +DECLARE_INSTRUCTION_OPCODE(stop) { + warning("Parallaction_br::instOp_stop not yet implemented"); +} + +DECLARE_INSTRUCTION_OPCODE(endscript) { + warning("Parallaction_br::instOp_endscript not yet implemented"); +} + +void Parallaction_br::initOpcodes() { + + static const OpcodeV2 op1[] = { + COMMAND_OPCODE(invalid), + COMMAND_OPCODE(set), + COMMAND_OPCODE(clear), + COMMAND_OPCODE(start), + COMMAND_OPCODE(speak), + COMMAND_OPCODE(get), + COMMAND_OPCODE(location), + COMMAND_OPCODE(open), + COMMAND_OPCODE(close), + COMMAND_OPCODE(on), + COMMAND_OPCODE(off), + COMMAND_OPCODE(call), + COMMAND_OPCODE(toggle), + COMMAND_OPCODE(drop), + COMMAND_OPCODE(quit), + COMMAND_OPCODE(move), + COMMAND_OPCODE(stop), + COMMAND_OPCODE(character), + COMMAND_OPCODE(followme), + COMMAND_OPCODE(onmouse), + COMMAND_OPCODE(offmouse), + COMMAND_OPCODE(add), + COMMAND_OPCODE(leave), + COMMAND_OPCODE(inc), + COMMAND_OPCODE(dec), + COMMAND_OPCODE(ifeq), + COMMAND_OPCODE(iflt), + COMMAND_OPCODE(ifgt), + COMMAND_OPCODE(let), + COMMAND_OPCODE(music), + COMMAND_OPCODE(fix), + COMMAND_OPCODE(unfix), + COMMAND_OPCODE(zeta), + COMMAND_OPCODE(scroll), + COMMAND_OPCODE(swap), + COMMAND_OPCODE(give), + COMMAND_OPCODE(text), + COMMAND_OPCODE(part), + COMMAND_OPCODE(testsfx), + COMMAND_OPCODE(ret), + COMMAND_OPCODE(onsave), + COMMAND_OPCODE(offsave) + }; + + uint i; + for (i = 0; i < ARRAYSIZE(op1); i++) + _commandOpcodes.push_back(&op1[i]); + + + static const OpcodeV2 op2[] = { + INSTRUCTION_OPCODE(invalid), + INSTRUCTION_OPCODE(on), + INSTRUCTION_OPCODE(off), + INSTRUCTION_OPCODE(set), // x + INSTRUCTION_OPCODE(set), // y + INSTRUCTION_OPCODE(set), // z + INSTRUCTION_OPCODE(set), // f + INSTRUCTION_OPCODE(loop), + INSTRUCTION_OPCODE(endloop), + INSTRUCTION_OPCODE(null), // show + INSTRUCTION_OPCODE(inc), + INSTRUCTION_OPCODE(inc), // dec + INSTRUCTION_OPCODE(set), + INSTRUCTION_OPCODE(put), + INSTRUCTION_OPCODE(call), + INSTRUCTION_OPCODE(wait), + INSTRUCTION_OPCODE(start), + INSTRUCTION_OPCODE(process), + INSTRUCTION_OPCODE(move), + INSTRUCTION_OPCODE(color), + INSTRUCTION_OPCODE(process), // sound + INSTRUCTION_OPCODE(mask), + INSTRUCTION_OPCODE(print), + INSTRUCTION_OPCODE(text), + INSTRUCTION_OPCODE(inc), // mul + INSTRUCTION_OPCODE(inc), // div + INSTRUCTION_OPCODE(ifeq), + INSTRUCTION_OPCODE(iflt), + INSTRUCTION_OPCODE(ifgt), + INSTRUCTION_OPCODE(endif), + INSTRUCTION_OPCODE(stop), + INSTRUCTION_OPCODE(endscript) + }; + + for (i = 0; i < ARRAYSIZE(op2); i++) + _instructionOpcodes.push_back(&op2[i]); + + +} + + +void Parallaction_br::jobWaitRemoveLabelJob(void *parm, Job *job) { + +} + + +void Parallaction_br::jobWaitRemoveSubtitleJob(void *parm, Job *job) { + +} + + +void Parallaction_br::jobPauseSfx(void *parm, Job *job) { + +} + + +void Parallaction_br::jobStopFollower(void *parm, Job *job) { + +} + + +void Parallaction_br::jobScroll(void *parm, Job *job) { + +} + + + + + +} // namespace Parallaction diff --git a/engines/parallaction/exec_ns.cpp b/engines/parallaction/exec_ns.cpp new file mode 100644 index 0000000000..2b88469702 --- /dev/null +++ b/engines/parallaction/exec_ns.cpp @@ -0,0 +1,925 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * $URL$ + * $Id$ + * + */ + +#include "common/stdafx.h" +#include "parallaction/parallaction.h" +#include "parallaction/sound.h" + + +namespace Parallaction { + +#define INST_ON 1 +#define INST_OFF 2 +#define INST_X 3 +#define INST_Y 4 +#define INST_Z 5 +#define INST_F 6 +#define INST_LOOP 7 +#define INST_ENDLOOP 8 +#define INST_SHOW 9 +#define INST_INC 10 +#define INST_DEC 11 +#define INST_SET 12 +#define INST_PUT 13 +#define INST_CALL 14 +#define INST_WAIT 15 +#define INST_START 16 +#define INST_SOUND 17 +#define INST_MOVE 18 +#define INST_ENDSCRIPT 19 + + +typedef OpcodeImpl<Parallaction_ns> OpcodeV1; +#define COMMAND_OPCODE(op) OpcodeV1(this, &Parallaction_ns::cmdOp_##op) +#define DECLARE_COMMAND_OPCODE(op) void Parallaction_ns::cmdOp_##op() + +#define INSTRUCTION_OPCODE(op) OpcodeV1(this, &Parallaction_ns::instOp_##op) +#define DECLARE_INSTRUCTION_OPCODE(op) void Parallaction_ns::instOp_##op() + + + + +DECLARE_INSTRUCTION_OPCODE(on) { + Instruction *inst = *_instRunCtxt.inst; + + inst->_a->_flags |= kFlagsActive; + inst->_a->_flags &= ~kFlagsRemove; +} + + +DECLARE_INSTRUCTION_OPCODE(off) { + (*_instRunCtxt.inst)->_a->_flags |= kFlagsRemove; +} + + +DECLARE_INSTRUCTION_OPCODE(loop) { + Instruction *inst = *_instRunCtxt.inst; + + _instRunCtxt.a->_program->_loopCounter = inst->_opB.getRValue(); + _instRunCtxt.a->_program->_loopStart = _instRunCtxt.inst; +} + + +DECLARE_INSTRUCTION_OPCODE(endloop) { + if (--_instRunCtxt.a->_program->_loopCounter > 0) { + _instRunCtxt.inst = _instRunCtxt.a->_program->_loopStart; + } +} + +DECLARE_INSTRUCTION_OPCODE(inc) { + Instruction *inst = *_instRunCtxt.inst; + int16 _si = inst->_opB.getRValue(); + + if (inst->_flags & kInstMod) { // mod + int16 _bx = (_si > 0 ? _si : -_si); + if (_instRunCtxt.modCounter % _bx != 0) return; + + _si = (_si > 0 ? 1 : -1); + } + + int16* lvalue = inst->_opA.getLValue(); + + if (inst->_index == INST_INC) { + *lvalue += _si; + } else { + *lvalue -= _si; + } + + if (inst->_opA._flags & kParaLocal) { + wrapLocalVar(inst->_opA._local); + } + +} + + +DECLARE_INSTRUCTION_OPCODE(set) { + Instruction *inst = *_instRunCtxt.inst; + + int16 _si = inst->_opB.getRValue(); + int16 *lvalue = inst->_opA.getLValue(); + + *lvalue = _si; + +} + + +DECLARE_INSTRUCTION_OPCODE(put) { + Instruction *inst = *_instRunCtxt.inst; + Graphics::Surface v18; + v18.w = inst->_a->width(); + v18.h = inst->_a->height(); + v18.pixels = inst->_a->getFrameData(inst->_a->_frame); + + int16 x = inst->_opA.getRValue(); + int16 y = inst->_opB.getRValue(); + + if (inst->_flags & kInstMaskedPut) { + uint16 z = _gfx->queryMask(y); + _gfx->blitCnv(&v18, x, y, z, Gfx::kBitBack); + _gfx->blitCnv(&v18, x, y, z, Gfx::kBit2); + } else { + _gfx->flatBlitCnv(&v18, x, y, Gfx::kBitBack); + _gfx->flatBlitCnv(&v18, x, y, Gfx::kBit2); + } +} + +DECLARE_INSTRUCTION_OPCODE(null) { + +} + +DECLARE_INSTRUCTION_OPCODE(invalid) { + error("Can't execute invalid opcode %i", (*_instRunCtxt.inst)->_index); +} + +DECLARE_INSTRUCTION_OPCODE(call) { + callFunction((*_instRunCtxt.inst)->_immediate, 0); +} + + +DECLARE_INSTRUCTION_OPCODE(wait) { + if (_engineFlags & kEngineWalking) + _instRunCtxt.suspend = true; +} + + +DECLARE_INSTRUCTION_OPCODE(start) { + (*_instRunCtxt.inst)->_a->_flags |= (kFlagsActing | kFlagsActive); +} + + +DECLARE_INSTRUCTION_OPCODE(sound) { + _activeZone = (*_instRunCtxt.inst)->_z; +} + + +DECLARE_INSTRUCTION_OPCODE(move) { + Instruction *inst = (*_instRunCtxt.inst); + + int16 x = inst->_opA.getRValue(); + int16 y = inst->_opB.getRValue(); + + WalkNodeList *v4 = _char._builder.buildPath(x, y); + addJob(kJobWalk, v4, kPriority19 ); + _engineFlags |= kEngineWalking; +} + +DECLARE_INSTRUCTION_OPCODE(endscript) { + if ((_instRunCtxt.a->_flags & kFlagsLooping) == 0) { + _instRunCtxt.a->_flags &= ~kFlagsActing; + runCommands(_instRunCtxt.a->_commands, _instRunCtxt.a); + } + _instRunCtxt.a->_program->_ip = _instRunCtxt.a->_program->_instructions.begin(); + + _instRunCtxt.suspend = true; +} + + + +void Parallaction_ns::wrapLocalVar(LocalVariable *local) { + + if (local->_value >= local->_max) + local->_value = local->_min; + if (local->_value < local->_min) + local->_value = local->_max - 1; + + return; +} + + +DECLARE_COMMAND_OPCODE(invalid) { + error("Can't execute invalid command '%i'", _cmdRunCtxt.cmd->_id); +} + +DECLARE_COMMAND_OPCODE(set) { + if (_cmdRunCtxt.cmd->u._flags & kFlagsGlobal) { + _cmdRunCtxt.cmd->u._flags &= ~kFlagsGlobal; + _commandFlags |= _cmdRunCtxt.cmd->u._flags; + } else { + _localFlags[_currentLocationIndex] |= _cmdRunCtxt.cmd->u._flags; + } +} + + +DECLARE_COMMAND_OPCODE(clear) { + if (_cmdRunCtxt.cmd->u._flags & kFlagsGlobal) { + _cmdRunCtxt.cmd->u._flags &= ~kFlagsGlobal; + _commandFlags &= ~_cmdRunCtxt.cmd->u._flags; + } else { + _localFlags[_currentLocationIndex] &= ~_cmdRunCtxt.cmd->u._flags; + } +} + + +DECLARE_COMMAND_OPCODE(start) { + _cmdRunCtxt.cmd->u._animation->_flags |= kFlagsActing; +} + + +DECLARE_COMMAND_OPCODE(speak) { + _activeZone = _cmdRunCtxt.cmd->u._zone; +} + + +DECLARE_COMMAND_OPCODE(get) { + _cmdRunCtxt.cmd->u._zone->_flags &= ~kFlagsFixed; + if (!runZone(_cmdRunCtxt.cmd->u._zone)) { + runCommands(_cmdRunCtxt.cmd->u._zone->_commands); + } +} + + +DECLARE_COMMAND_OPCODE(location) { + strcpy(_location._name, _cmdRunCtxt.cmd->u._string); + _engineFlags |= kEngineChangeLocation; +} + + +DECLARE_COMMAND_OPCODE(open) { + _cmdRunCtxt.cmd->u._zone->_flags &= ~kFlagsClosed; + if (_cmdRunCtxt.cmd->u._zone->u.door->_cnv) { + addJob(kJobToggleDoor, (void*)_cmdRunCtxt.cmd->u._zone, kPriority18 ); + } +} + + +DECLARE_COMMAND_OPCODE(close) { + _cmdRunCtxt.cmd->u._zone->_flags |= kFlagsClosed; + if (_cmdRunCtxt.cmd->u._zone->u.door->_cnv) { + addJob(kJobToggleDoor, (void*)_cmdRunCtxt.cmd->u._zone, kPriority18 ); + } +} + + +DECLARE_COMMAND_OPCODE(on) { + // WORKAROUND: the original DOS-based engine didn't check u->_zone before dereferencing + // the pointer to get structure members, thus leading to crashes in systems with memory + // protection. + // As a side note, the overwritten address is the 5th entry in the DOS interrupt table + // (print screen handler): this suggests that a system would hang when the print screen + // key is pressed after playing Nippon Safes, provided that this code path is taken. + if (_cmdRunCtxt.cmd->u._zone != NULL) { + _cmdRunCtxt.cmd->u._zone->_flags &= ~kFlagsRemove; + _cmdRunCtxt.cmd->u._zone->_flags |= kFlagsActive; + if ((_cmdRunCtxt.cmd->u._zone->_type & 0xFFFF) == kZoneGet) { + addJob(kJobDisplayDroppedItem, _cmdRunCtxt.cmd->u._zone, kPriority17 ); + } + } +} + + +DECLARE_COMMAND_OPCODE(off) { + _cmdRunCtxt.cmd->u._zone->_flags |= kFlagsRemove; +} + + +DECLARE_COMMAND_OPCODE(call) { + callFunction(_cmdRunCtxt.cmd->u._callable, _cmdRunCtxt.z); +} + + +DECLARE_COMMAND_OPCODE(toggle) { + if (_cmdRunCtxt.cmd->u._flags & kFlagsGlobal) { + _cmdRunCtxt.cmd->u._flags &= ~kFlagsGlobal; + _commandFlags ^= _cmdRunCtxt.cmd->u._flags; + } else { + _localFlags[_currentLocationIndex] ^= _cmdRunCtxt.cmd->u._flags; + } +} + + +DECLARE_COMMAND_OPCODE(drop){ + dropItem( _cmdRunCtxt.cmd->u._object ); +} + + +DECLARE_COMMAND_OPCODE(quit) { + _engineFlags |= kEngineQuit; +} + + +DECLARE_COMMAND_OPCODE(move) { + if ((_char._ani._flags & kFlagsRemove) || (_char._ani._flags & kFlagsActive) == 0) { + return; + } + + WalkNodeList *vC = _char._builder.buildPath(_cmdRunCtxt.cmd->u._move.x, _cmdRunCtxt.cmd->u._move.y); + + addJob(kJobWalk, vC, kPriority19 ); + _engineFlags |= kEngineWalking; +} + + +DECLARE_COMMAND_OPCODE(stop) { + _cmdRunCtxt.cmd->u._animation->_flags &= ~kFlagsActing; +} + + +void Parallaction_ns::jobDisplayAnimations(void *parm, Job *j) { + + Graphics::Surface v14; + + uint16 _si = 0; + + for (AnimationList::iterator it = _animations.begin(); it != _animations.end(); it++) { + + Animation *v18 = *it; + + if ((v18->_flags & kFlagsActive) && ((v18->_flags & kFlagsRemove) == 0)) { + v14.w = v18->width(); + v14.h = v18->height(); + + int16 frame = CLIP((int)v18->_frame, 0, v18->getFrameNum()-1); + + v14.pixels = v18->getFrameData(frame); + + if (v18->_flags & kFlagsNoMasked) + _si = 3; + else + _si = _gfx->queryMask(v18->_top + v18->height()); + + debugC(9, kDebugExec, "jobDisplayAnimations(%s, x:%i, y:%i, z:%i, w:%i, h:%i, f:%i/%i, %p)", v18->_label._text, v18->_left, v18->_top, _si, v14.w, v14.h, + frame, v18->getFrameNum(), v14.pixels); + _gfx->blitCnv(&v14, v18->_left, v18->_top, _si, Gfx::kBitBack); + + } + + if (((v18->_flags & kFlagsActive) == 0) && (v18->_flags & kFlagsRemove)) { + v18->_flags &= ~kFlagsRemove; + v18->_oldPos.x = -1000; + } + + if ((v18->_flags & kFlagsActive) && (v18->_flags & kFlagsRemove)) { + v18->_flags &= ~kFlagsActive; + v18->_flags |= kFlagsRemove; + } + } + + return; +} + + +void Parallaction_ns::jobEraseAnimations(void *arg_0, Job *j) { + debugC(9, kDebugExec, "jobEraseAnimations"); + + for (AnimationList::iterator it = _animations.begin(); it != _animations.end(); it++) { + + Animation *a = *it; + + if (((a->_flags & kFlagsActive) == 0) && ((a->_flags & kFlagsRemove) == 0)) continue; + + Common::Rect r(a->width(), a->height()); + r.moveTo(a->_oldPos); + _gfx->restoreBackground(r); + + if (arg_0) { + a->_oldPos.x = a->_left; + a->_oldPos.y = a->_top; + } + + } + + return; +} + + +void Parallaction_ns::jobRunScripts(void *parm, Job *j) { + debugC(9, kDebugExec, "jobRunScripts"); + + static uint16 modCounter = 0; + + for (AnimationList::iterator it = _animations.begin(); it != _animations.end(); it++) { + + Animation *a = *it; + + if (a->_flags & kFlagsCharacter) + a->_z = a->_top + a->height(); + + if ((a->_flags & kFlagsActing) == 0) + continue; + + InstructionList::iterator inst = a->_program->_ip; + while (((*inst)->_index != INST_SHOW) && (a->_flags & kFlagsActing)) { + + debugC(9, kDebugExec, "Animation: %s, instruction: %s", a->_label._text, _instructionNamesRes[(*inst)->_index - 1]); + + _instRunCtxt.inst = inst; + _instRunCtxt.a = a; + _instRunCtxt.modCounter = modCounter; + _instRunCtxt.suspend = false; + + (*_instructionOpcodes[(*inst)->_index])(); + + inst = _instRunCtxt.inst; // handles endloop correctly + + if (_instRunCtxt.suspend) + goto label1; + + inst++; + } + + a->_program->_ip = ++inst; + +label1: + if (a->_flags & kFlagsCharacter) + a->_z = a->_top + a->height(); + } + + sortAnimations(); + modCounter++; + + return; +} + + +void Parallaction::runCommands(CommandList& list, Zone *z) { + debugC(3, kDebugExec, "runCommands"); + + CommandList::iterator it = list.begin(); + for ( ; it != list.end(); it++) { + + Command *cmd = *it; + uint32 v8 = _localFlags[_currentLocationIndex]; + + if (_engineFlags & kEngineQuit) + break; + + if (cmd->_flagsOn & kFlagsGlobal) { + v8 = _commandFlags | kFlagsGlobal; + } + + if ((cmd->_flagsOn & v8) != cmd->_flagsOn) continue; + if ((cmd->_flagsOff & ~v8) != cmd->_flagsOff) continue; + + debugC(3, kDebugExec, "runCommands[%i]: %s (on: %x, off: %x)", cmd->_id, _commandsNamesRes[cmd->_id-1], cmd->_flagsOn, cmd->_flagsOff); + + _cmdRunCtxt.z = z; + _cmdRunCtxt.cmd = cmd; + + (*_commandOpcodes[cmd->_id])(); + } + + debugC(3, kDebugExec, "runCommands completed"); + + return; + +} + + + + +// displays character head commenting an examined object +// +// works on the frontbuffer +// +void Parallaction::displayCharacterComment(ExamineData *data) { + if (data->_description == NULL) return; + + // NOTE: saving visible screen before displaying comment allows + // to restore the exact situation after the comment is deleted. + // This means animations are restored in the exact position as + // they were, thus avoiding clipping effect as signalled in + // BUG item #1762614. + _gfx->copyScreen(Gfx::kBitFront, Gfx::kBitBack); + + _gfx->setFont(_dialogueFont); + _gfx->flatBlitCnv(_char._talk, 0, 190, 80, Gfx::kBitFront); + + int16 v26, v28; + _gfx->getStringExtent(data->_description, 130, &v28, &v26); + Common::Rect r(v28, v26); + r.moveTo(140, 10); + _gfx->drawBalloon(r, 0); + _gfx->displayWrappedString(data->_description, 140, 10, 0, 130); + + waitUntilLeftClick(); + + _gfx->copyScreen(Gfx::kBitBack, Gfx::kBitFront); + _gfx->updateScreen(); + + return; +} + +// +// ZONE TYPE: EXAMINE +// + +// display detail view of an item (and eventually comments) +// +// works on the frontbuffer +// + +void Parallaction::displayItemComment(ExamineData *data) { + + if (data->_description == NULL) return; + + _gfx->setHalfbriteMode(true); + + char v68[PATH_LEN]; + strcpy(v68, data->_filename); + data->_cnv = _disk->loadStatic(v68); + _gfx->flatBlitCnv(data->_cnv, 140, (_screenHeight - data->_cnv->h)/2, Gfx::kBitFront); + delete data->_cnv; + + int16 v6A = 0, v6C = 0; + + _gfx->setFont(_dialogueFont); + _gfx->getStringExtent(data->_description, 130, &v6C, &v6A); + Common::Rect r(v6C, v6A); + r.moveTo(0, 90); + _gfx->drawBalloon(r, 0); + _gfx->flatBlitCnv(_char._head, 100, 152, Gfx::kBitFront); + _gfx->displayWrappedString(data->_description, 0, 90, 0, 130); + + jobEraseAnimations((void*)1, NULL); + _gfx->updateScreen(); + + waitUntilLeftClick(); + + _gfx->setHalfbriteMode(false); + _gfx->copyScreen(Gfx::kBitBack, Gfx::kBitFront); + _gfx->updateScreen(); + + return; +} + + + +uint16 Parallaction::runZone(Zone *z) { + debugC(3, kDebugExec, "runZone (%s)", z->_label._text); + + uint16 subtype = z->_type & 0xFFFF; + + debugC(3, kDebugExec, "type = %x, object = %x", subtype, (z->_type & 0xFFFF0000) >> 16); + switch(subtype) { + + case kZoneExamine: + if (z->u.examine->_filename) { + displayItemComment(z->u.examine); + } else { + displayCharacterComment(z->u.examine); + } + break; + + case kZoneGet: + if (z->_flags & kFlagsFixed) break; + if (pickupItem(z) != 0) { + return 1; + } + z->_flags |= kFlagsRemove; + break; + + case kZoneDoor: + if (z->_flags & kFlagsLocked) break; + z->_flags ^= kFlagsClosed; + if (z->u.door->_cnv == NULL) break; + addJob(kJobToggleDoor, z, kPriority18 ); + break; + + case kZoneHear: + _soundMan->playSfx(z->u.hear->_name, z->u.hear->_channel, (z->_flags & kFlagsLooping) == kFlagsLooping, 60); + break; + + case kZoneSpeak: + runDialogue(z->u.speak); + break; + + } + + debugC(3, kDebugExec, "runZone completed"); + + return 0; +} + +// +// ZONE TYPE: DOOR +// +void Parallaction_ns::jobToggleDoor(void *parm, Job *j) { + + static byte count = 0; + + Zone *z = (Zone*)parm; + + if (z->u.door->_cnv) { + Common::Rect r; + z->u.door->_cnv->getRect(0, r); + r.moveTo(z->_left, z->_top); + + uint16 _ax = (z->_flags & kFlagsClosed ? 1 : 0); + _gfx->restoreDoorBackground(r, z->u.door->_cnv->getData(_ax), z->u.door->_background); + + _ax = (z->_flags & kFlagsClosed ? 0 : 1); + _gfx->flatBlitCnv(z->u.door->_cnv, _ax, z->_left, z->_top, Gfx::kBitBack); + _gfx->flatBlitCnv(z->u.door->_cnv, _ax, z->_left, z->_top, Gfx::kBit2); + } + + count++; + if (count == 2) { + j->_finished = 1; + count = 0; + } + + return; +} + + + +// +// ZONE TYPE: GET +// + +int16 Parallaction::pickupItem(Zone *z) { + int r = addInventoryItem(z->u.get->_icon); + if (r == 0) + addJob(kJobRemovePickedItem, z, kPriority17 ); + + return r; +} + +void Parallaction_ns::jobRemovePickedItem(void *parm, Job *j) { + + Zone *z = (Zone*)parm; + + static uint16 count = 0; + + if (z->u.get->_cnv) { + Common::Rect r(z->_left, z->_top, z->_left + z->u.get->_cnv->w, z->_top + z->u.get->_cnv->h); + + _gfx->restoreGetBackground(r, z->u.get->_backup); + } + + count++; + if (count == 2) { + count = 0; + j->_finished = 1; + } + + return; +} + +void Parallaction_ns::jobDisplayDroppedItem(void *parm, Job *j) { +// printf("jobDisplayDroppedItem..."); + + Zone *z = (Zone*)parm; + + if (z->u.get->_cnv) { + if (j->_count == 0) { + _gfx->backupGetBackground(z->u.get, z->_left, z->_top); + } + + _gfx->flatBlitCnv(z->u.get->_cnv, z->_left, z->_top, Gfx::kBitBack); + _gfx->flatBlitCnv(z->u.get->_cnv, z->_left, z->_top, Gfx::kBit2); + } + + j->_count++; + if (j->_count == 2) { + j->_count = 0; + j->_finished = 1; + } + +// printf("done"); + + return; +} + + + + +Zone *Parallaction::hitZone(uint32 type, uint16 x, uint16 y) { +// printf("hitZone(%i, %i, %i)", type, x, y); + + uint16 _di = y; + uint16 _si = x; + + for (ZoneList::iterator it = _zones.begin(); it != _zones.end(); it++) { +// printf("Zone name: %s", z->_name); + + Zone *z = *it; + + if (z->_flags & kFlagsRemove) continue; + + Common::Rect r; + z->getRect(r); + r.right++; // adjust border because Common::Rect doesn't include bottom-right edge + r.bottom++; + + r.grow(-1); // allows some tolerance for mouse click + + if (!r.contains(_si, _di)) { + + // out of Zone, so look for special values + if ((z->_left == -2) || (z->_left == -3)) { + + // WORKAROUND: this huge condition is needed because we made TypeData a collection of structs + // instead of an union. So, merge->_obj1 and get->_icon were just aliases in the original engine, + // but we need to check it separately here. The same workaround is applied in freeZones. + if ((((z->_type & 0xFFFF) == kZoneMerge) && (((_si == z->u.merge->_obj1) && (_di == z->u.merge->_obj2)) || ((_si == z->u.merge->_obj2) && (_di == z->u.merge->_obj1)))) || + (((z->_type & 0xFFFF) == kZoneGet) && ((_si == z->u.get->_icon) || (_di == z->u.get->_icon)))) { + + // special Zone + if ((type == 0) && ((z->_type & 0xFFFF0000) == 0)) + return z; + if (z->_type == type) + return z; + if ((z->_type & 0xFFFF0000) == type) + return z; + + } + } + + if (z->_left != -1) + continue; + if (_si < _char._ani._left) + continue; + if (_si > (_char._ani._left + _char._ani.width())) + continue; + if (_di < _char._ani._top) + continue; + if (_di > (_char._ani._top + _char._ani.height())) + continue; + + } + + // normal Zone + if ((type == 0) && ((z->_type & 0xFFFF0000) == 0)) + return z; + if (z->_type == type) + return z; + if ((z->_type & 0xFFFF0000) == type) + return z; + + } + + + int16 _a, _b, _c, _d, _e, _f; + for (AnimationList::iterator it = _animations.begin(); it != _animations.end(); it++) { + + Animation *a = *it; + + _a = (a->_flags & kFlagsActive) ? 1 : 0; // _a: active Animation + _e = ((_si >= a->_left + a->width()) || (_si <= a->_left)) ? 0 : 1; // _e: horizontal range + _f = ((_di >= a->_top + a->height()) || (_di <= a->_top)) ? 0 : 1; // _f: vertical range + + _b = ((type != 0) || (a->_type == kZoneYou)) ? 0 : 1; // _b: (no type specified) AND (Animation is not the character) + _c = (a->_type & 0xFFFF0000) ? 0 : 1; // _c: Animation is not an object + _d = ((a->_type & 0xFFFF0000) != type) ? 0 : 1; // _d: Animation is an object of the same type + + if ((_a != 0 && _e != 0 && _f != 0) && ((_b != 0 && _c != 0) || (a->_type == type) || (_d != 0))) { + + return a; + + } + + } + + return NULL; +} + + +void Parallaction_ns::initOpcodes() { + + static const OpcodeV1 op1[] = { + INSTRUCTION_OPCODE(invalid), + INSTRUCTION_OPCODE(on), + INSTRUCTION_OPCODE(off), + INSTRUCTION_OPCODE(set), // x + INSTRUCTION_OPCODE(set), // y + INSTRUCTION_OPCODE(set), // z + INSTRUCTION_OPCODE(set), // f + INSTRUCTION_OPCODE(loop), + INSTRUCTION_OPCODE(endloop), + INSTRUCTION_OPCODE(null), + INSTRUCTION_OPCODE(inc), + INSTRUCTION_OPCODE(inc), // dec + INSTRUCTION_OPCODE(set), + INSTRUCTION_OPCODE(put), + INSTRUCTION_OPCODE(call), + INSTRUCTION_OPCODE(wait), + INSTRUCTION_OPCODE(start), + INSTRUCTION_OPCODE(sound), + INSTRUCTION_OPCODE(move), + INSTRUCTION_OPCODE(endscript) + }; + + uint i; + for (i = 0; i < ARRAYSIZE(op1); i++) + _instructionOpcodes.push_back(&op1[i]); + + static const OpcodeV1 op3[] = { + COMMAND_OPCODE(invalid), + COMMAND_OPCODE(set), + COMMAND_OPCODE(clear), + COMMAND_OPCODE(start), + COMMAND_OPCODE(speak), + COMMAND_OPCODE(get), + COMMAND_OPCODE(location), + COMMAND_OPCODE(open), + COMMAND_OPCODE(close), + COMMAND_OPCODE(on), + COMMAND_OPCODE(off), + COMMAND_OPCODE(call), + COMMAND_OPCODE(toggle), + COMMAND_OPCODE(drop), + COMMAND_OPCODE(quit), + COMMAND_OPCODE(move), + COMMAND_OPCODE(stop) + }; + + for (i = 0; i < ARRAYSIZE(op3); i++) + _commandOpcodes.push_back(&op3[i]); + +} + + + +void Parallaction_ns::jobDisplayLabel(void *parm, Job *j) { + + Label *label = (Label*)parm; + debugC(9, kDebugExec, "jobDisplayLabel (%p)", (const void*) label); + + _gfx->drawLabel(*label); + + return; +} + +void Parallaction_ns::jobEraseLabel(void *parm, Job *j) { + Label *label = (Label*)parm; + + debugC(9, kDebugExec, "jobEraseLabel (%p)", (const void*) label); + + int16 _si, _di; + + if (_activeItem._id != 0) { + _si = _mousePos.x + 16 - label->_cnv.w/2; + _di = _mousePos.y + 34; + } else { + _si = _mousePos.x + 8 - label->_cnv.w/2; + _di = _mousePos.y + 21; + } + + if (_si < 0) _si = 0; + if (_di > 190) _di = 190; + + if (label->_cnv.w + _si > _screenWidth) + _si = _screenWidth - label->_cnv.w; + + Common::Rect r; + label->getRect(r, true); + _gfx->restoreBackground(r); + + label->_old = label->_pos; + label->_pos.x = _si; + label->_pos.y = _di; + + return; +} + + + +// this Job uses a static counter to delay removal +// and is in fact only used to remove jEraseLabel jobs +// +void Parallaction_ns::jobWaitRemoveJob(void *parm, Job *j) { + Job *arg = (Job*)parm; + + static uint16 count = 0; + + debugC(9, kDebugExec, "jobWaitRemoveJob: count = %i", count); + + _engineFlags |= kEngineBlockInput; + + count++; + if (count == 2) { + count = 0; + removeJob(arg); + _engineFlags &= ~kEngineBlockInput; + j->_finished = 1; + } + + return; +} + + + +} // namespace Parallaction diff --git a/engines/parallaction/font.cpp b/engines/parallaction/font.cpp index 13e94a4cda..afa00f81af 100644 --- a/engines/parallaction/font.cpp +++ b/engines/parallaction/font.cpp @@ -18,8 +18,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL:https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/branches/gsoc2007-fsnode/engines/parallaction/font.cpp $ - * $Id:font.cpp 26949 2007-05-26 20:23:24Z david_corrales $ + * $URL$ + * $Id$ * */ @@ -34,6 +34,146 @@ namespace Parallaction { extern byte _amigaTopazFont[]; +class BraFont : public Font { + + byte *_cp; + uint _bufPitch; + + uint32 _height; + byte _numGlyphs; + + byte *_widths; + uint *_offsets; + + byte *_data; + + static byte _charMap[]; + + byte mapChar(byte c) { + return _charMap[c]; + } + +public: + BraFont(Common::ReadStream &stream) { + + _numGlyphs = stream.readByte(); + _height = stream.readUint32BE(); + + _widths = (byte*)malloc(_numGlyphs); + stream.read(_widths, _numGlyphs); + + _offsets = (uint*)malloc(_numGlyphs * sizeof(uint)); + _offsets[0] = 0; + for (uint i = 1; i < _numGlyphs; i++) + _offsets[i] = _offsets[i-1] + _widths[i-1] * _height; + + uint size = _offsets[_numGlyphs-1] + _widths[_numGlyphs-1] * _height; + + _data = (byte*)malloc(size); + stream.read(_data, size); + + } + + ~BraFont() { + free(_widths); + free(_offsets); + free(_data); + } + + + uint32 getStringWidth(const char *s) { + uint32 len = 0; + + while (*s) { + byte c = mapChar(*s); + len += (_widths[c] + 2); + s++; + } + + return len; + } + + uint16 height() { + return (uint16)_height; + } + + uint16 drawChar(char c) { + assert(c < _numGlyphs); + + byte *src = _data + _offsets[c]; + byte *dst = _cp; + uint16 w = _widths[c]; + + for (uint16 j = 0; j < height(); j++) { + for (uint16 k = 0; k < w; k++) { + + if (*src) { + *dst = (_color) ? _color : *src; + } + + dst++; + src++; + } + + dst += (_bufPitch - w); + } + + return w + 2; + + } + + void drawString(byte* buffer, uint32 pitch, const char *s) { + if (s == NULL) + return; + + _bufPitch = pitch; + + _cp = buffer; + while (*s) { + byte c = mapChar(*s); + _cp += drawChar(c); + s++; + } + } + +}; + +byte BraFont::_charMap[] = { +// 0 + 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, +// 1 + 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, +// 2 + 0x34, 0x49, 0x48, 0x34, 0x34, 0x34, 0x34, 0x47, 0x34, 0x34, 0x34, 0x34, 0x40, 0x34, 0x3F, 0x34, +// 3 + 0x35, 0x36, 0x37, 0x38, 0x39, 0x3A, 0x3B, 0x3C, 0x3D, 0x3E, 0x46, 0x45, 0x34, 0x34, 0x34, 0x42, +// 4 + 0x34, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, +// 5 + 0x0F, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x34, 0x34, 0x34, 0x34, 0x34, +// 6 + 0x34, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, +// 7 + 0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F, 0x30, 0x31, 0x32, 0x33, 0x34, 0x34, 0x34, 0x34, 0x34, +// 8 + 0x5E, 0x5D, 0x4E, 0x4B, 0x4D, 0x4C, 0x34, 0x5E, 0x4F, 0x51, 0x50, 0x34, 0x34, 0x34, 0x34, 0x34, +// 9 + 0x34, 0x34, 0x34, 0x57, 0x59, 0x58, 0x5B, 0x5C, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, +// A + 0x4A, 0x52, 0x34, 0x5A, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, +// B + 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, +// C + 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, +// D + 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, +// E + 0x34, 0x5F, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, +// F + 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34 +}; + + class DosFont : public Font { protected: @@ -430,19 +570,22 @@ Font *AmigaDisk_ns::createFont(const char *name, Common::SeekableReadStream &str return new AmigaFont(stream); } -void Gfx::initFonts() { +Font *DosDisk_br::createFont(const char *name, Common::ReadStream &stream) { +// printf("DosDisk_br::createFont(%s)\n", name); + return new BraFont(stream); +} - if (_vm->getPlatform() == Common::kPlatformPC) { - _fonts[kFontDialogue] = _vm->_disk->loadFont("comic"); - _fonts[kFontLabel] = _vm->_disk->loadFont("topaz"); - _fonts[kFontMenu] = _vm->_disk->loadFont("slide"); - } else { - _fonts[kFontDialogue] = _vm->_disk->loadFont("comic"); +void Parallaction_ns::initFonts() { + if (getPlatform() == Common::kPlatformPC) { + _dialogueFont = _disk->loadFont("comic"); + _labelFont = _disk->loadFont("topaz"); + _menuFont = _disk->loadFont("slide"); + } else { + _dialogueFont = _disk->loadFont("comic"); Common::MemoryReadStream stream(_amigaTopazFont, 2600, false); - _fonts[kFontLabel] = new AmigaFont(stream); - - _fonts[kFontMenu] = _vm->_disk->loadFont("slide"); + _labelFont = new AmigaFont(stream); + _menuFont = _disk->loadFont("slide"); } } diff --git a/engines/parallaction/graphics.cpp b/engines/parallaction/graphics.cpp index 8d45c4aaa9..6a8ef0718b 100644 --- a/engines/parallaction/graphics.cpp +++ b/engines/parallaction/graphics.cpp @@ -32,12 +32,147 @@ namespace Parallaction { -byte * Gfx::_buffers[]; -#define BALLOON_WIDTH 12 -#define BALLOON_HEIGHT 10 -byte _resBalloon[2][BALLOON_WIDTH*BALLOON_HEIGHT] = { +Palette::Palette() { + + int gameType = _vm->getGameType(); + + if (gameType == GType_Nippon) { + _colors = 32; + _hb = (_vm->getPlatform() == Common::kPlatformAmiga); + } else + if (gameType == GType_BRA) { + _colors = 256; + _hb = false; + } else + error("can't create palette for id = '%i'", gameType); + + _size = _colors * 3; + + makeBlack(); +} + +Palette::Palette(const Palette &pal) { + clone(pal); +} + +void Palette::clone(const Palette &pal) { + _colors = pal._colors; + _hb = pal._hb; + _size = pal._size; + memcpy(_data, pal._data, _size); +} + + +void Palette::makeBlack() { + memset(_data, 0, _size); +} + +void Palette::setEntry(uint index, int red, int green, int blue) { + assert(index < _colors); + + if (red >= 0) + _data[index*3] = red & 0xFF; + + if (green >= 0) + _data[index*3+1] = green & 0xFF; + + if (blue >= 0) + _data[index*3+2] = blue & 0xFF; +} + +void Palette::makeGrayscale() { + byte v; + for (uint16 i = 0; i < _colors; i++) { + v = MAX(_data[i*3+1], _data[i*3+2]); + v = MAX(v, _data[i*3]); + setEntry(i, v, v, v); + } +} + +void Palette::fadeTo(const Palette& target, uint step) { + + if (step == 0) + return; + + for (uint16 i = 0; i < _size; i++) { + if (_data[i] == target._data[i]) continue; + + if (_data[i] < target._data[i]) + _data[i] = CLIP(_data[i] + step, (uint)0, (uint)target._data[i]); + else + _data[i] = CLIP(_data[i] - step, (uint)target._data[i], (uint)255); + } + + return; +} + +uint Palette::fillRGBA(byte *rgba) { + + byte r, g, b; + byte *hbPal = rgba + _size; + + for (uint32 i = 0; i < _colors; i++) { + r = (_data[i*3] << 2) | (_data[i*3] >> 4); + g = (_data[i*3+1] << 2) | (_data[i*3+1] >> 4); + b = (_data[i*3+2] << 2) | (_data[i*3+2] >> 4); + + rgba[i*4] = r; + rgba[i*4+1] = g; + rgba[i*4+2] = b; + rgba[i*4+3] = 0; + + if (_hb) { + hbPal[i*4] = r >> 1; + hbPal[i*4+1] = g >> 1; + hbPal[i*4+2] = b >> 1; + hbPal[i*4+3] = 0; + } + + } + + return ((_hb) ? 2 : 1) * _colors; +} + +void Palette::rotate(uint first, uint last, bool forward) { + + byte tmp[3]; + + if (forward) { // forward + + tmp[0] = _data[first * 3]; + tmp[1] = _data[first * 3 + 1]; + tmp[2] = _data[first * 3 + 2]; + + memmove(_data+first*3, _data+(first+1)*3, (last - first)*3); + + _data[last * 3] = tmp[0]; + _data[last * 3 + 1] = tmp[1]; + _data[last * 3 + 2] = tmp[2]; + + } else { // backward + + tmp[0] = _data[last * 3]; + tmp[1] = _data[last * 3 + 1]; + tmp[2] = _data[last * 3 + 2]; + + memmove(_data+(first+1)*3, _data+first*3, (last - first)*3); + + _data[first * 3] = tmp[0]; + _data[first * 3 + 1] = tmp[1]; + _data[first * 3 + 2] = tmp[2]; + + } + +} + + +#define BALLOON_TAIL_WIDTH 12 +#define BALLOON_TAIL_HEIGHT 10 + + +byte _resBalloonTail[2][BALLOON_TAIL_WIDTH*BALLOON_TAIL_HEIGHT] = { { 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x02, 0x02, 0x02, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x02, 0x02, @@ -69,96 +204,41 @@ void Gfx::drawBalloon(const Common::Rect& r, uint16 winding) { Common::Rect q = r; + // draws balloon q.right += 5; floodFill(kBitFront, q, 0); - - q.left++; - q.top+=2; - q.right--; - q.bottom--; + q.grow(-1); floodFill(kBitFront, q, 1); + // draws tail + // TODO: this bitmap tail should only be used for Dos games. Amiga should use a polygon fill. winding = (winding == 0 ? 1 : 0); - byte *s = _resBalloon[winding]; - byte *d = _buffers[kBitFront] + (r.left + (r.width()+5)/2 - 5) + (r.bottom - 1) * _vm->_screenWidth; - - for (uint16 i = 0; i < BALLOON_HEIGHT; i++) { - for (uint16 j = 0; j < BALLOON_WIDTH; j++) { - if (*s != 2) *d = *s; - d++; - s++; - } - - d += (_vm->_screenWidth - BALLOON_WIDTH); - } - -// printf("done\n"); + Common::Rect s(BALLOON_TAIL_WIDTH, BALLOON_TAIL_HEIGHT); + s.moveTo(r.left + (r.width()+5)/2 - 5, r.bottom - 1); + flatBlit(s, _resBalloonTail[winding], kBitFront, 2); return; } -void Gfx::setPalette(Palette pal, uint32 first, uint32 num) { -// printf("setPalette(%i, %i)\n", first, num); - - if (first + num > BASE_PALETTE_COLORS) - error("wrong parameters for setPalette()"); - - byte sysBasePal[EHB_PALETTE_COLORS*4]; - byte sysExtraPal[BASE_PALETTE_COLORS*4]; - - byte r, g, b; - uint32 j = 0; - for (uint32 i = first; i < first+num; i++) { - r = (pal[i*3] << 2) | (pal[i*3] >> 4); - g = (pal[i*3+1] << 2) | (pal[i*3+1] >> 4); - b = (pal[i*3+2] << 2) | (pal[i*3+2] >> 4); - - sysBasePal[j*4] = r; - sysBasePal[j*4+1] = g; - sysBasePal[j*4+2] = b; - sysBasePal[j*4+3] = 0; - - if (_vm->getPlatform() == Common::kPlatformAmiga) { - sysExtraPal[j*4] = r >> 1; - sysExtraPal[j*4+1] = g >> 1; - sysExtraPal[j*4+2] = b >> 1; - sysExtraPal[j*4+3] = 0; - } else { - sysExtraPal[j*4] = 0; - sysExtraPal[j*4+1] = 0; - sysExtraPal[j*4+2] = 0; - sysExtraPal[j*4+3] = 0; - } - - j++; - } - - g_system->setPalette(sysBasePal, first, num); - if (_vm->getPlatform() == Common::kPlatformAmiga) - g_system->setPalette(sysExtraPal, first+FIRST_EHB_COLOR, num); -// g_system->updateScreen(); +void Gfx::setPalette(Palette pal) { + byte sysPal[256*4]; - return; + uint n = pal.fillRGBA(sysPal); + g_system->setPalette(sysPal, 0, n); } void Gfx::setBlackPalette() { Palette pal; - memset(pal, 0, PALETTE_SIZE); setPalette(pal); } -// -// palette Animation -// -// FIXME: the effect is different from the original -// -void Gfx::animatePalette() { -// printf("Gfx::animatePalette()\n"); - byte tmp[3]; + + +void Gfx::animatePalette() { for (uint16 i = 0; i < 4; i++) { @@ -170,32 +250,7 @@ void Gfx::animatePalette() { _palettefx[i]._timer = 0; // reset timer - if (_palettefx[i]._flags & 2) { // forward - - tmp[0] = _palette[_palettefx[i]._first * 3]; - tmp[1] = _palette[_palettefx[i]._first * 3 + 1]; - tmp[2] = _palette[_palettefx[i]._first * 3 + 2]; - - memmove(_palette+_palettefx[i]._first*3, _palette+(_palettefx[i]._first+1)*3, (_palettefx[i]._last - _palettefx[i]._first)*3); - - _palette[_palettefx[i]._last * 3] = tmp[0]; - _palette[_palettefx[i]._last * 3 + 1] = tmp[1]; - _palette[_palettefx[i]._last * 3 + 2] = tmp[2]; - - } else { // backward - - tmp[0] = _palette[_palettefx[i]._last * 3]; - tmp[1] = _palette[_palettefx[i]._last * 3 + 1]; - tmp[2] = _palette[_palettefx[i]._last * 3 + 2]; - - memmove(_palette+(_palettefx[i]._first+1)*3, _palette+_palettefx[i]._first*3, (_palettefx[i]._last - _palettefx[i]._first)*3); - - _palette[_palettefx[i]._first * 3] = tmp[0]; - _palette[_palettefx[i]._first * 3 + 1] = tmp[1]; - _palette[_palettefx[i]._first * 3 + 2] = tmp[2]; - - } - + _palette.rotate(_palettefx[i]._first, _palettefx[i]._last, (_palettefx[i]._flags & 2) != 0); } setPalette(_palette); @@ -203,39 +258,9 @@ void Gfx::animatePalette() { return; } -void Gfx::makeGrayscalePalette(Palette pal) { - - for (uint16 i = 0; i < BASE_PALETTE_COLORS; i++) { - byte max; - - max = MAX(_palette[i*3+1], _palette[i*3+2]); - max = MAX(max, _palette[i*3]); - - pal[i*3] = max; - pal[i*3+1] = max; - pal[i*3+2] = max; - } - - return; -} - -void Gfx::fadePalette(Palette pal, Palette target, uint step) { - - if (step == 0) - return; - - for (uint16 i = 0; i < BASE_PALETTE_COLORS * 3; i++) { - if (pal[i] == target[i]) continue; - if (pal[i] < target[i]) - pal[i] = CLIP(pal[i] + step, (uint)0, (uint)target[i]); - else - pal[i] = CLIP(pal[i] - step, (uint)target[i], (uint)255); - } - return; -} void Gfx::setHalfbriteMode(bool enable) { #ifdef HALFBRITE @@ -255,15 +280,14 @@ void Gfx::setHalfbriteMode(bool enable) { } void Gfx::updateScreen() { -// printf("Gfx::updateScreen()\n"); - g_system->copyRectToScreen(_buffers[kBitFront], _vm->_screenWidth, 0, 0, _vm->_screenWidth, _vm->_screenHeight); + g_system->copyRectToScreen((const byte*)_buffers[kBitFront]->pixels, _buffers[kBitFront]->pitch, _screenX, _screenY, _vm->_screenWidth, _vm->_screenHeight); g_system->updateScreen(); return; } void Gfx::swapBuffers() { - byte *temp = _buffers[kBitFront]; + Graphics::Surface *temp = _buffers[kBitFront]; _buffers[kBitFront] = _buffers[kBitBack]; _buffers[kBitBack] = temp; updateScreen(); @@ -275,7 +299,7 @@ void Gfx::swapBuffers() { // graphic primitives // void Gfx::clearScreen(Gfx::Buffers buffer) { - memset(_buffers[buffer], 0, _vm->_screenSize); + memset(_buffers[buffer]->pixels, 0, _vm->_screenSize); if (buffer == kBitFront) updateScreen(); @@ -284,24 +308,21 @@ void Gfx::clearScreen(Gfx::Buffers buffer) { void Gfx::copyScreen(Gfx::Buffers srcbuffer, Gfx::Buffers dstbuffer) { - memcpy(_buffers[dstbuffer], _buffers[srcbuffer], _vm->_screenSize); - -// if (dstbuffer == kBitFront) updateScreen(); + memcpy(_buffers[dstbuffer]->pixels, _buffers[srcbuffer]->pixels, _vm->_screenSize); return; } void Gfx::floodFill(Gfx::Buffers buffer, const Common::Rect& r, byte color) { -// printf("Gfx::floodFill(%i, %i, %i, %i, %i)\n", color, left, top, right, bottom); - byte *d = _buffers[buffer] + (r.left + r.top * _vm->_screenWidth); + byte *d = (byte*)_buffers[buffer]->getBasePtr(r.left, r.top); uint16 w = r.width() + 1; uint16 h = r.height() + 1; for (uint16 i = 0; i < h; i++) { memset(d, color, w); - d += _vm->_screenWidth; + d += _backgroundWidth; } return; @@ -325,7 +346,7 @@ void Gfx::screenClip(Common::Rect& r, Common::Point& p) { } -void Gfx::flatBlit(const Common::Rect& r, byte *data, Gfx::Buffers buffer) { +void Gfx::flatBlit(const Common::Rect& r, byte *data, Gfx::Buffers buffer, byte transparentColor) { Common::Point dp; Common::Rect q(r); @@ -333,17 +354,22 @@ void Gfx::flatBlit(const Common::Rect& r, byte *data, Gfx::Buffers buffer) { screenClip(q, dp); byte *s = data + q.left + q.top * r.width(); - byte *d = _buffers[buffer] + dp.x + dp.y * _vm->_screenWidth; + byte *d = (byte*)_buffers[buffer]->getBasePtr(dp.x, dp.y); + + uint sPitch = r.width() - q.width(); + uint dPitch = _backgroundWidth - q.width(); for (uint16 i = q.top; i < q.bottom; i++) { for (uint16 j = q.left; j < q.right; j++) { - if (*s != 0) *d = *s; + if (*s != transparentColor) + *d = *s; + s++; d++; } - s += (r.width() - q.width()); - d += (_vm->_screenWidth - q.width()); + s += sPitch; + d += dPitch; } return; @@ -358,182 +384,91 @@ void Gfx::blit(const Common::Rect& r, uint16 z, byte *data, Gfx::Buffers buffer) screenClip(q, dp); byte *s = data + q.left + q.top * r.width(); - byte *d = _buffers[buffer] + dp.x + dp.y * _vm->_screenWidth; + byte *d = (byte*)_buffers[buffer]->getBasePtr(dp.x, dp.y); - for (uint16 i = q.top; i < q.bottom; i++) { + uint sPitch = r.width() - q.width(); + uint dPitch = _backgroundWidth - q.width(); - uint16 n = dp.x % 4; - byte *m = _buffers[kMask0] + dp.x/4 + (dp.y + i - q.top)*_vm->_screenMaskWidth; + for (uint16 i = 0; i < q.height(); i++) { - for (uint16 j = q.left; j < q.right; j++) { + for (uint16 j = 0; j < q.width(); j++) { if (*s != 0) { - uint16 v = ((3 << (n << 1)) & *m) >> (n << 1); + byte v = _depthMask->getValue(dp.x + j, dp.y + i); if (z >= v) *d = *s; } - n++; - if (n==4) m++; - n &= 0x3; - s++; d++; } - s += (r.width() - q.right + q.left); - d += (_vm->_screenWidth - q.right + q.left); + s += sPitch; + d += dPitch; } return; } - -void jobDisplayLabel(void *parm, Job *j) { - - Label *label = (Label*)parm; - debugC(9, kDebugJobs, "jobDisplayLabel (%p)", (const void*) label); - - if (label->_cnv._width == 0) +void Gfx::drawLabel(Label &label) { + if (label._text == 0) return; - _vm->_gfx->flatBlitCnv(&label->_cnv, _vm->_gfx->_labelPosition[0].x, _vm->_gfx->_labelPosition[0].y, Gfx::kBitBack); - - return; -} - -void jobEraseLabel(void *parm, Job *j) { - Label *label = (Label*)parm; - - debugC(9, kDebugJobs, "jobEraseLabel (%p)", (const void*) label); - - int16 _si, _di; - - if (_vm->_activeItem._id != 0) { - _si = _vm->_mousePos.x + 16 - label->_cnv._width/2; - _di = _vm->_mousePos.y + 34; - } else { - _si = _vm->_mousePos.x + 8 - label->_cnv._width/2; - _di = _vm->_mousePos.y + 21; - } - - if (_si < 0) _si = 0; - if (_di > 190) _di = 190; - - if (label->_cnv._width + _si > _vm->_screenWidth) - _si = _vm->_screenWidth - label->_cnv._width; - - Common::Rect r(label->_cnv._width, label->_cnv._height); - r.moveTo(_vm->_gfx->_labelPosition[1]); - _vm->_gfx->restoreBackground(r); - - _vm->_gfx->_labelPosition[1] = _vm->_gfx->_labelPosition[0]; - _vm->_gfx->_labelPosition[0].x = _si; - _vm->_gfx->_labelPosition[0].y = _di; - - return; -} - -void Gfx::initMouse(uint16 arg_0) { - - _mouseComposedArrow = _vm->_disk->loadPointer(); - - byte temp[MOUSEARROW_WIDTH*MOUSEARROW_HEIGHT]; - memcpy(temp, _mouseArrow, MOUSEARROW_WIDTH*MOUSEARROW_HEIGHT); - - uint16 k = 0; - for (uint16 i = 0; i < 4; i++) { - for (uint16 j = 0; j < 64; j++) _mouseArrow[k++] = temp[i + j * 4]; - } - - return; -} - - -void Gfx::setMousePointer(int16 index) { - - if (index == kCursorArrow) { // standard mouse pointer - - g_system->setMouseCursor(_mouseArrow, MOUSEARROW_WIDTH, MOUSEARROW_HEIGHT, 0, 0, 0); - g_system->showMouse(true); - - } else { - // inventory item pointer - byte *v8 = _mouseComposedArrow->_data0; - // FIXME: destination offseting is not clear - byte* s = _vm->_char._objs->getFramePtr(getInventoryItemIndex(index)); - byte* d = v8 + 7 + MOUSECOMBO_WIDTH * 7; - - for (uint32 i = 0; i < INVENTORYITEM_HEIGHT; i++) { - memcpy(d, s, INVENTORYITEM_WIDTH); - - s += INVENTORYITEM_PITCH; - d += MOUSECOMBO_WIDTH; - } - - g_system->setMouseCursor(v8, MOUSECOMBO_WIDTH, MOUSECOMBO_HEIGHT, 0, 0, 0); - } - - return; + flatBlitCnv(&label._cnv, label._pos.x, label._pos.y, Gfx::kBitBack); } - - // // Cnv management // -void Gfx::flatBlitCnv(Cnv *cnv, uint16 frame, int16 x, int16 y, Gfx::Buffers buffer) { +void Gfx::flatBlitCnv(Frames *cnv, uint16 frame, int16 x, int16 y, Gfx::Buffers buffer) { - StaticCnv scnv; + Graphics::Surface scnv; + Common::Rect r; - scnv._width = cnv->_width; - scnv._height = cnv->_height; - scnv._data0 = cnv->getFramePtr(frame); - scnv._data1 = NULL; // _questioner->field_8[v60->_mood & 0xF]; + cnv->getRect(frame, r); + + scnv.w = r.width(); + scnv.h = r.height(); + scnv.pixels = cnv->getData(frame); flatBlitCnv(&scnv, x, y, buffer); } -void Gfx::flatBlitCnv(StaticCnv *cnv, int16 x, int16 y, Gfx::Buffers buffer) { - Common::Rect r(cnv->_width, cnv->_height); +void Gfx::flatBlitCnv(Graphics::Surface *cnv, int16 x, int16 y, Gfx::Buffers buffer) { + Common::Rect r(cnv->w, cnv->h); r.moveTo(x, y); - flatBlit(r, cnv->_data0, buffer); + flatBlit(r, (byte*)cnv->pixels, buffer, 0); return; } -void Gfx::blitCnv(StaticCnv *cnv, int16 x, int16 y, uint16 z, Gfx::Buffers buffer) { - Common::Rect r(cnv->_width, cnv->_height); +void Gfx::blitCnv(Graphics::Surface *cnv, int16 x, int16 y, uint16 z, Gfx::Buffers buffer) { + Common::Rect r(cnv->w, cnv->h); r.moveTo(x, y); - blit(r, z, cnv->_data0, buffer); + blit(r, z, (byte*)cnv->pixels, buffer); return; } void Gfx::backupDoorBackground(DoorData *data, int16 x, int16 y) { - - byte *s = _buffers[kBit2] + x + y * _vm->_screenWidth; - byte *d = data->_background; - - for (uint16 i = 0; i < data->_cnv->_height ; i++) { - memcpy(d, s, data->_cnv->_width); - - s += _vm->_screenWidth; - d += data->_cnv->_width; - } - + byte *s = (byte*)_buffers[kBit2]->getBasePtr(x, y); + Common::Rect r; + data->_cnv->getRect(0, r); + copyRect(r.width(), r.height(), data->_background, r.width(), s,_backgroundWidth); return; } void Gfx::backupGetBackground(GetData *data, int16 x, int16 y) { - byte *t = data->_cnv->_data0; - byte *s = _buffers[kBitBack] + x + y * _vm->_screenWidth; + byte *t = (byte*)data->_cnv->pixels; + byte *s = (byte*)_buffers[kBitBack]->getBasePtr(x, y); byte *d = data->_backup; - for (uint16 i = 0; i < data->_cnv->_height ; i++) { - for (uint16 j = 0; j < data->_cnv->_width ; j++) { + uint pitch = _backgroundWidth - data->_cnv->w; + + for (uint16 i = 0; i < data->_cnv->h ; i++) { + for (uint16 j = 0; j < data->_cnv->w ; j++) { *d = (*t) ? *s : 0; d++; @@ -541,7 +476,7 @@ void Gfx::backupGetBackground(GetData *data, int16 x, int16 y) { s++; } - s += (_vm->_screenWidth - data->_cnv->_width); + s += pitch; } return; @@ -550,12 +485,14 @@ void Gfx::backupGetBackground(GetData *data, int16 x, int16 y) { // // restores background according to specified frame // -void Gfx::restoreDoorBackground(StaticCnv *cnv, const Common::Rect& r, byte* background) { +void Gfx::restoreDoorBackground(const Common::Rect& r, byte *data, byte* background) { - byte *t = cnv->_data0; + byte *t = data; byte *s = background; - byte *d0 = _buffers[kBitBack] + r.left + r.top * _vm->_screenWidth; - byte *d1 = _buffers[kBit2] + r.left + r.top * _vm->_screenWidth; + byte *d0 = (byte*)_buffers[kBitBack]->getBasePtr(r.left, r.top); + byte *d1 = (byte*)_buffers[kBit2]->getBasePtr(r.left, r.top); + + uint pitch = _backgroundWidth - r.width(); for (uint16 i = 0; i < r.height() ; i++) { for (uint16 j = 0; j < r.width() ; j++) { @@ -570,8 +507,8 @@ void Gfx::restoreDoorBackground(StaticCnv *cnv, const Common::Rect& r, byte* bac s++; } - d0 += (_vm->_screenWidth - r.width()); - d1 += (_vm->_screenWidth - r.width()); + d0 += pitch; + d1 += pitch; } @@ -584,47 +521,16 @@ void Gfx::restoreDoorBackground(StaticCnv *cnv, const Common::Rect& r, byte* bac // void Gfx::restoreGetBackground(const Common::Rect& r, byte *data) { - StaticCnv cnv; - - cnv._data0 = data; - cnv._data1 = NULL; - cnv._width = r.width(); - cnv._height = r.height(); - - flatBlitCnv(&cnv, r.left, r.top, kBitBack); - flatBlitCnv(&cnv, r.left, r.top, kBit2); + flatBlit(r, data, kBitBack, 0); + flatBlit(r, data, kBit2, 0); return; } -void Gfx::makeCnvFromString(StaticCnv *cnv, char *text) { - assert(_font == _fonts[kFontLabel]); - - if (_vm->getPlatform() == Common::kPlatformAmiga) { - cnv->_width = _font->getStringWidth(text) + 16; - cnv->_height = 10; - cnv->_data0 = (byte*)malloc(cnv->_width * cnv->_height); - memset(cnv->_data0, 0, cnv->_width * cnv->_height); - - _font->setColor(7); - _font->drawString(cnv->_data0 + 1, cnv->_width, text); - _font->drawString(cnv->_data0 + 1 + cnv->_width * 2, cnv->_width, text); - _font->drawString(cnv->_data0 + cnv->_width, cnv->_width, text); - _font->drawString(cnv->_data0 + 2 + cnv->_width, cnv->_width, text); - _font->setColor(1); - _font->drawString(cnv->_data0 + 1 + cnv->_width, cnv->_width, text); - } else { - cnv->_width = _font->getStringWidth(text); - cnv->_height = _font->height(); - cnv->_data0 = (byte*)malloc(cnv->_width * cnv->_height); - memset(cnv->_data0, 0, cnv->_width * cnv->_height); - _font->drawString(cnv->_data0, cnv->_width, text); - } -} void Gfx::displayString(uint16 x, uint16 y, const char *text, byte color) { - byte *dst = _buffers[kBitFront] + x + y*_vm->_screenWidth; + byte *dst = (byte*)_buffers[kBitFront]->getBasePtr(x, y); _font->setColor(color); _font->drawString(dst, _vm->_screenWidth, text); } @@ -635,7 +541,6 @@ void Gfx::displayCenteredString(uint16 y, const char *text) { } bool Gfx::displayWrappedString(char *text, uint16 x, uint16 y, byte color, int16 wrapwidth) { -// printf("Gfx::displayWrappedString(%s, %i, %i, %i, %i)...", text, x, y, color, wrapwidth); uint16 lines = 0; bool rv = false; @@ -676,8 +581,6 @@ bool Gfx::displayWrappedString(char *text, uint16 x, uint16 y, byte color, int16 text = Common::ltrim(text); } -// printf("done\n"); - return rv; } @@ -721,9 +624,9 @@ void Gfx::getStringExtent(char *text, uint16 maxwidth, int16* width, int16* heig } -void Gfx::setFont(Fonts name) { - assert(name < 3); - _font = _fonts[name]; +void Gfx::setFont(Font *font) { + assert(font); + _font = font; } @@ -737,107 +640,55 @@ void Gfx::restoreBackground(const Common::Rect& r) { if (left < 0) left = 0; if (top < 0) top = 0; - if (left >= _vm->_screenWidth) return; - if (top >= _vm->_screenHeight) return; + if (left >= _backgroundWidth) return; + if (top >= _backgroundHeight) return; - if (left+width >= _vm->_screenWidth) width = _vm->_screenWidth - left; - if (top+height >= _vm->_screenHeight) height = _vm->_screenHeight - top; + if (left+width >= _backgroundWidth) width = _backgroundWidth - left; + if (top+height >= _backgroundHeight) height = _backgroundHeight - top; Common::Rect q(width, height); q.moveTo(left, top); - copyRect( - kBitBack, - q, - _buffers[kBit2] + q.left + q.top * _vm->_screenWidth, - _vm->_screenWidth - ); - - return; -} - -void Gfx::freeStaticCnv(StaticCnv *cnv) { -// printf("free_static_cnv()\n"); - - if (!cnv) return; - - if (!cnv || !cnv->_data0) return; - free(cnv->_data0); - cnv->_data0 = NULL; + copyRect(kBitBack, q, (byte*)_buffers[kBit2]->getBasePtr(q.left, q.top), _backgroundWidth); return; } -void Gfx::setBackground(byte *background) { - memcpy(_buffers[kBitBack], background, _vm->_screenSize); - copyScreen(kBitBack, kBit2); -} +void Gfx::setBackground(Graphics::Surface *surface) { + _buffers[kBit2] = surface; -void Gfx::setMask(byte *mask) { - memcpy(_buffers[kMask0], mask, _vm->_screenMaskSize); + initBuffers(surface->w, surface->h); + copyScreen(kBit2, kBitBack); } - - -void Gfx::copyRect(Gfx::Buffers dstbuffer, const Common::Rect& r, byte *src, uint16 pitch) { - - byte *d = _buffers[dstbuffer] + r.left + _vm->_screenWidth * r.top; - byte *s = src; - - for (uint16 _si = 0; _si < r.height(); _si++) { - memcpy(d, s, r.width()); - - s += pitch; - d += _vm->_screenWidth; - } - - +void Gfx::setMask(MaskBuffer *buffer) { + _depthMask = buffer; } +void Gfx::copyRect(uint width, uint height, byte *dst, uint dstPitch, byte *src, uint srcPitch) { -void Gfx::grabRect(byte *dst, const Common::Rect& r, Gfx::Buffers srcbuffer, uint16 pitch) { - - byte *s = _buffers[srcbuffer] + r.left + _vm->_screenWidth * r.top; - - for (uint16 i = 0; i < r.height(); i++) { - memcpy(dst, s, r.width()); + for (uint16 _si = 0; _si < height; _si++) { + memcpy(dst, src, width); - s += _vm->_screenWidth; - dst += pitch; + src += srcPitch; + dst += dstPitch; } return; } -/* - the following 3 routines are hacks for Nippon Safes coming from the original code, - so they shouldn't be modified when adding support for other games -*/ - -void Gfx::plotMaskPixel(uint16 x, uint16 y, byte color) { - - uint16 _ax = x + y * _vm->_screenWidth; - _buffers[kMask0][_ax >> 2] &= ~(3 << ((_ax & 3) << 1)); - +void Gfx::copyRect(Gfx::Buffers dstbuffer, const Common::Rect& r, byte *src, uint16 pitch) { + byte *d = (byte*)_buffers[dstbuffer]->getBasePtr(r.left, r.top); + copyRect(r.width(), r.height(), d, _backgroundWidth, src, pitch); return; } -void Gfx::fillMaskRect(const Common::Rect& r, byte color) { - - uint16 _di = r.left/4 + r.top * _vm->_screenMaskWidth; - - for (uint16 _si = r.top; _si < r.bottom; _si++) { - memset(&_buffers[kMask0][_di], color, r.width()/4+1); - _di += _vm->_screenMaskWidth; - } - return; -} -void Gfx::intGrottaHackMask() { - memset(_buffers[kMask0] + 3600, 0, 3600); - _bgLayers[1] = 500; +void Gfx::grabRect(byte *dst, const Common::Rect& r, Gfx::Buffers srcbuffer, uint16 pitch) { + byte *s = (byte*)_buffers[srcbuffer]->getBasePtr(r.left, r.top); + copyRect(r.width(), r.height(), dst, pitch, s, _backgroundWidth); return; } @@ -856,23 +707,26 @@ Gfx::Gfx(Parallaction* vm) : g_system->beginGFXTransaction(); g_system->initSize(_vm->_screenWidth, _vm->_screenHeight); + _vm->initCommonGFX(_vm->getGameType() == GType_BRA); g_system->endGFXTransaction(); - _buffers[kBitFront] = (byte*)malloc(_vm->_screenSize); - _buffers[kBitBack] = (byte*)malloc(_vm->_screenSize); - _buffers[kBit2] = (byte*)malloc(_vm->_screenSize); - _buffers[kMask0] = (byte*)malloc(_vm->_screenMaskWidth * _vm->_screenHeight); + _buffers[kBit2] = 0; + _depthMask = 0; + + _buffers[kBitFront] = 0; + _buffers[kBitBack] = 0; + + initBuffers(_vm->_screenWidth, _vm->_screenHeight); + + setPalette(_palette); - setBlackPalette(); + _screenX = 0; + _screenY = 0; _bgLayers[0] = _bgLayers[1] = _bgLayers[2] = _bgLayers[3] = 0; - memset(_palette, 0, sizeof(_palette)); memset(_palettefx, 0, sizeof(_palettefx)); - initMouse( 0 ); - initFonts(); - _halfbrite = false; _font = NULL; @@ -882,19 +736,48 @@ Gfx::Gfx(Parallaction* vm) : Gfx::~Gfx() { - free(_buffers[kMask0]); - free(_buffers[kBitFront]); - free(_buffers[kBitBack]); - free(_buffers[kBit2]); + freeBuffers(); - delete _fonts[kFontDialogue]; - delete _fonts[kFontLabel]; - delete _fonts[kFontMenu]; + return; +} - freeStaticCnv(_mouseComposedArrow); - delete _mouseComposedArrow; +void Gfx::initBuffers(int w, int h) { - return; + _backgroundWidth = w; + _backgroundHeight = h; + + if (!_buffers[kBitFront]) { + _buffers[kBitFront] = new Graphics::Surface; + } + + if (!_buffers[kBitBack]) { + _buffers[kBitBack] = new Graphics::Surface; + } + + if (_buffers[kBitFront]->w != w || _buffers[kBitFront]->h != h) { + _buffers[kBitFront]->create(w, h, 1); + } + + if (_buffers[kBitBack]->w != w || _buffers[kBitBack]->h != h) { + _buffers[kBitBack]->create(w, h, 1); + } + +} + +void Gfx::freeBuffers() { + + if (_buffers[kBitFront]) { + _buffers[kBitFront]->free(); + delete _buffers[kBitFront]; + } + + if (_buffers[kBitBack]) { + _buffers[kBitBack]->free(); + delete _buffers[kBitBack]; + } + + _buffers[kBitFront] = 0; + _buffers[kBitBack] = 0; } diff --git a/engines/parallaction/graphics.h b/engines/parallaction/graphics.h index f518bd6625..9f1101efa2 100644 --- a/engines/parallaction/graphics.h +++ b/engines/parallaction/graphics.h @@ -29,6 +29,7 @@ #include "common/rect.h" #include "common/stream.h" +#include "graphics/surface.h" #include "parallaction/defs.h" @@ -36,25 +37,6 @@ namespace Parallaction { -#define BASE_PALETTE_COLORS 32 -#define FIRST_BASE_COLOR 0 -#define LAST_BASE_COLOR (FIRST_BASE_COLOR+BASE_PALETTE_COLORS-1) - -#define EHB_PALETTE_COLORS 32 // extra half-brite colors for amiga -#define FIRST_EHB_COLOR (LAST_BASE_COLOR+1) -#define LAST_EHB_COLOR (FIRST_EHB_COLOR+EHB_PALETTE_COLORS-1) - -#define PALETTE_COLORS (BASE_PALETTE_COLORS+EHB_PALETTE_COLORS) - -#define BASE_PALETTE_SIZE BASE_PALETTE_COLORS*3 -#define PALETTE_SIZE PALETTE_COLORS*3 - -#define MOUSEARROW_WIDTH 16 -#define MOUSEARROW_HEIGHT 16 - -#define MOUSECOMBO_WIDTH 32 // sizes for cursor + selected inventory item -#define MOUSECOMBO_HEIGHT 32 - #include "common/pack-start.h" // START STRUCT PACKING struct PaletteFxRange { @@ -90,19 +72,19 @@ public: }; -struct StaticCnv { - uint16 _width; // - uint16 _height; // - byte* _data0; // bitmap - byte* _data1; // unused - StaticCnv() { - _width = _height = 0; - _data0 = _data1 = NULL; - } +struct Frames { + + virtual uint16 getNum() = 0; + virtual byte* getData(uint16 index) = 0; + virtual void getRect(uint16 index, Common::Rect &r) = 0; + + virtual ~Frames() { } + }; -struct Cnv { + +struct Cnv : public Frames { uint16 _count; // # of frames uint16 _width; // uint16 _height; // @@ -129,6 +111,21 @@ public: return NULL; return &_data[index * _width * _height]; } + + uint16 getNum() { + return _count; + } + + byte *getData(uint16 index) { + return getFramePtr(index); + } + + void getRect(uint16 index, Common::Rect &r) { + r.left = 0; + r.top = 0; + r.setWidth(_width); + r.setHeight(_height); + } }; @@ -138,31 +135,83 @@ class Parallaction; struct DoorData; struct GetData; +struct Label; + +struct MaskBuffer { + // handles a 2-bit depth buffer used for z-buffering + + uint16 w; + uint16 internalWidth; + uint16 h; + uint size; + byte *data; + +public: + MaskBuffer() : w(0), internalWidth(0), h(0), size(0), data(0) { + } + + void create(uint16 width, uint16 height) { + w = width; + internalWidth = w >> 2; + h = height; + size = (internalWidth * h); + data = (byte*)calloc(size, 1); + } + + void free() { + if (data) + ::free(data); + data = 0; + w = 0; + h = 0; + internalWidth = 0; + size = 0; + } + + inline byte getValue(uint16 x, uint16 y) { + byte m = data[(x >> 2) + y * internalWidth]; + uint n = (x & 3) << 1; + return ((3 << n) & m) >> n; + } -enum Fonts { - kFontDialogue = 0, - kFontLabel = 1, - kFontMenu = 2 }; -class Gfx { +class Palette { + + byte _data[768]; + uint _colors; + uint _size; + bool _hb; public: - typedef byte Palette[PALETTE_SIZE]; + Palette(); + Palette(const Palette &pal); + + void clone(const Palette &pal); + + void makeBlack(); + void setEntries(byte* data, uint first, uint num); + void setEntry(uint index, int red, int green, int blue); + void makeGrayscale(); + void fadeTo(const Palette& target, uint step); + uint fillRGBA(byte *rgba); + + void rotate(uint first, uint last, bool forward); +}; + +class Gfx { +public: enum Buffers { // bit buffers kBitFront, kBitBack, - kBit2, - // mask buffers - kMask0 + kBit2 }; public: - void screenClip(Common::Rect& r, Common::Point& p); - // dialogue and text + // balloons and text void drawBalloon(const Common::Rect& r, uint16 arg_8); void displayString(uint16 x, uint16 y, const char *text, byte color); void displayCenteredString(uint16 y, const char *text); @@ -170,82 +219,73 @@ public: uint16 getStringWidth(const char *text); void getStringExtent(char *text, uint16 maxwidth, int16* width, int16* height); - // cnv management - void makeCnvFromString(StaticCnv *cnv, char *text); - void freeStaticCnv(StaticCnv *cnv); + void drawLabel(Label &label); + + // cut/paste + void flatBlitCnv(Graphics::Surface *cnv, int16 x, int16 y, Gfx::Buffers buffer); + void flatBlitCnv(Frames *cnv, uint16 frame, int16 x, int16 y, Gfx::Buffers buffer); + void blitCnv(Graphics::Surface *cnv, int16 x, int16 y, uint16 z, Gfx::Buffers buffer); + void restoreBackground(const Common::Rect& r); void backupDoorBackground(DoorData *data, int16 x, int16 y); + void restoreDoorBackground(const Common::Rect& r, byte *data, byte* background); void backupGetBackground(GetData *data, int16 x, int16 y); void restoreGetBackground(const Common::Rect& r, byte *data); - void restoreDoorBackground(StaticCnv *cnv, const Common::Rect& r, byte* background); - - // location - void setBackground(byte *background); - void setMask(byte *mask); - int16 queryMask(int16 v); - void intGrottaHackMask(); - void restoreBackground(const Common::Rect& r); - // intro - void fillMaskRect(const Common::Rect& r, byte color); - void plotMaskPixel(uint16 x, uint16 y, byte color); - // low level - void swapBuffers(); - void updateScreen(); + // low level surfaces void clearScreen(Gfx::Buffers buffer); void copyScreen(Gfx::Buffers srcbuffer, Gfx::Buffers dstbuffer); void copyRect(Gfx::Buffers dstbuffer, const Common::Rect& r, byte *src, uint16 pitch); void grabRect(byte *dst, const Common::Rect& r, Gfx::Buffers srcbuffer, uint16 pitch); void floodFill(Gfx::Buffers buffer, const Common::Rect& r, byte color); - // NOTE: flatBlitCnv used to have an additional unused parameter, - // that was always the _data1 member of the StaticCnv parameter. - // DOS version didn't make use of it, but it is probably needed for Amiga stuff. - void flatBlitCnv(StaticCnv *cnv, int16 x, int16 y, Gfx::Buffers buffer); - void blitCnv(StaticCnv *cnv, int16 x, int16 y, uint16 z, Gfx::Buffers buffer); - void flatBlitCnv(Cnv *cnv, uint16 frame, int16 x, int16 y, Gfx::Buffers buffer); - - // palette - void setPalette(Palette palette, uint32 first = FIRST_BASE_COLOR, uint32 num = BASE_PALETTE_COLORS); + void setPalette(Palette palette); void setBlackPalette(); void animatePalette(); - void fadePalette(Palette palette, Palette target, uint step); // fades palette to target palette, with specified step - void makeGrayscalePalette(Palette palette); // transform palette into black and white // amiga specific void setHalfbriteMode(bool enable); + // misc + int16 queryMask(int16 v); + void setFont(Font* font); + void swapBuffers(); + void updateScreen(); + void setBackground(Graphics::Surface *surf); + void setMask(MaskBuffer *buffer); + // init Gfx(Parallaction* vm); virtual ~Gfx(); - void setMousePointer(int16 index); - - void initFonts(); - void setFont(Fonts name); public: - Common::Point _labelPosition[2]; uint16 _bgLayers[4]; PaletteFxRange _palettefx[6]; Palette _palette; + int _backgroundWidth; + int _backgroundHeight; + + uint _screenX; // scrolling position + uint _screenY; + protected: Parallaction* _vm; - static byte * _buffers[NUM_BUFFERS]; - static byte _mouseArrow[256]; - StaticCnv *_mouseComposedArrow; + Graphics::Surface *_buffers[NUM_BUFFERS]; + MaskBuffer *_depthMask; Font *_font; - Font *_fonts[3]; bool _halfbrite; protected: - byte mapChar(byte c); - void flatBlit(const Common::Rect& r, byte *data, Gfx::Buffers buffer); + void initBuffers(int w, int h); + void freeBuffers(); + + void copyRect(uint width, uint height, byte *dst, uint dstPitch, byte *src, uint srcPitch); + void flatBlit(const Common::Rect& r, byte *data, Gfx::Buffers buffer, byte transparentColor); void blit(const Common::Rect& r, uint16 z, byte *data, Gfx::Buffers buffer); - void initBuffers(); - void initMouse(uint16 arg_0); + void screenClip(Common::Rect& r, Common::Point& p); }; @@ -254,3 +294,7 @@ protected: #endif + + + + diff --git a/engines/parallaction/inventory.cpp b/engines/parallaction/inventory.cpp index c9e74b2074..06d48744be 100644 --- a/engines/parallaction/inventory.cpp +++ b/engines/parallaction/inventory.cpp @@ -117,9 +117,12 @@ void drawInventoryItem(uint16 pos, InventoryItem *item) { uint16 line = pos / INVENTORY_ITEMS_PER_LINE; uint16 col = pos % INVENTORY_ITEMS_PER_LINE; + Common::Rect r; + _vm->_char._objs->getRect(0, r); + // FIXME: this will end up in a general blit function - byte* s = _vm->_char._objs->getFramePtr(item->_index); - byte* d = _buffer + col * INVENTORYITEM_WIDTH + line * _vm->_char._objs->_height * INVENTORY_WIDTH; + byte* s = _vm->_char._objs->getData(item->_index); + byte* d = _buffer + col * INVENTORYITEM_WIDTH + line * r.height() * INVENTORY_WIDTH; for (uint32 i = 0; i < INVENTORYITEM_HEIGHT; i++) { memcpy(d, s, INVENTORYITEM_WIDTH); @@ -157,7 +160,7 @@ void Parallaction::dropItem(uint16 v) { bool found = false; for (uint16 slot = 0; slot < INVENTORY_MAX_ITEMS - 1; slot++) { - if (v + INVENTORY_FIRST_ITEM == _inventory[slot]._index) { + if (v == _inventory[slot]._index) { found = true; } @@ -210,8 +213,10 @@ void highlightInventoryItem(int16 pos, byte color) { uint16 line = pos / INVENTORY_ITEMS_PER_LINE; uint16 col = pos % INVENTORY_ITEMS_PER_LINE; - Common::Rect r(INVENTORYITEM_WIDTH, _vm->_char._objs->_height); - r.moveTo(col * INVENTORYITEM_WIDTH, line * _vm->_char._objs->_height); + Common::Rect r; + _vm->_char._objs->getRect(0, r); + r.setWidth(INVENTORYITEM_WIDTH); + r.moveTo(col * INVENTORYITEM_WIDTH, line * r.height()); drawBorder(r, _buffer, color); @@ -228,7 +233,7 @@ int16 getInventoryItemIndex(int16 pos) { -void jobShowInventory(void *parm, Job *j) { +void Parallaction_ns::jobShowInventory(void *parm, Job *j) { // printf("job_showInventory()..."); int16 slot = getNumUsedSlots(); @@ -238,19 +243,14 @@ void jobShowInventory(void *parm, Job *j) { r.moveTo(_invPosition); - _vm->_gfx->copyRect( - Gfx::kBitBack, - r, - _buffer, - INVENTORY_WIDTH - ); + _gfx->copyRect(Gfx::kBitBack, r, _buffer, INVENTORY_WIDTH); return; } -void jobHideInventory(void *parm, Job *j) { +void Parallaction_ns::jobHideInventory(void *parm, Job *j) { // printf("job_hideInventory()\n"); static uint16 count = 0; @@ -267,7 +267,7 @@ void jobHideInventory(void *parm, Job *j) { Common::Rect r(INVENTORY_WIDTH, _numInvLines * INVENTORYITEM_HEIGHT); r.moveTo(_invPosition); - _vm->_gfx->restoreBackground(r); + _gfx->restoreBackground(r); return; } diff --git a/engines/parallaction/inventory.h b/engines/parallaction/inventory.h index 4a3e07cc97..2ca3559b8f 100644 --- a/engines/parallaction/inventory.h +++ b/engines/parallaction/inventory.h @@ -31,8 +31,6 @@ namespace Parallaction { -struct Cnv; - struct InventoryItem { uint32 _id; // object name (lowest 16 bits are always zero) uint16 _index; // index to frame in objs file diff --git a/engines/parallaction/location.cpp b/engines/parallaction/location.cpp deleted file mode 100644 index 024938074b..0000000000 --- a/engines/parallaction/location.cpp +++ /dev/null @@ -1,466 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ - * - */ - -#include "common/stdafx.h" - -#include "common/system.h" - -#include "parallaction/parallaction.h" -#include "parallaction/sound.h" - -namespace Parallaction { - - -void Parallaction::parseLocation(const char *filename) { - debugC(1, kDebugLocation, "parseLocation('%s')", filename); - - uint16 _si = 1; - _gfx->setFont(kFontLabel); - - Script *_locationScript = _disk->loadLocation(filename); - _hasLocationSound = false; - - fillBuffers(*_locationScript, true); - while (scumm_stricmp(_tokens[0], "ENDLOCATION")) { - - if (!scumm_stricmp(_tokens[0], "LOCATION")) { - // The parameter for location is 'location.mask'. - // If mask is not present, then it is assumed - // that path & mask are encoded in the background - // bitmap, otherwise a separate .msk file exists. - - char *mask = strchr(_tokens[1], '.'); - if (mask) { - mask[0] = '\0'; - mask++; - } - - // WORKAROUND: the original code erroneously incremented - // _currentLocationIndex, thus producing inconsistent - // savegames. This workaround modified the following loop - // and if-statement, so the code exactly matches the one - // in Big Red Adventure. - _currentLocationIndex = -1; - uint16 _di = 0; - while (_locationNames[_di][0] != '\0') { - if (!scumm_stricmp(_locationNames[_di], filename)) { - _currentLocationIndex = _di; - } - _di++; - } - - if (_currentLocationIndex == -1) { - strcpy(_locationNames[_numLocations], filename); - _currentLocationIndex = _numLocations; - - _numLocations++; - _locationNames[_numLocations][0] = '\0'; - _localFlags[_numLocations] = 0; - } else { - _localFlags[_currentLocationIndex] |= kFlagsVisited; // 'visited' - } - - strcpy(_location._name, _tokens[1]); - switchBackground(_location._name, mask); - - if (_tokens[2][0] != '\0') { - _char._ani._left = atoi(_tokens[2]); - _char._ani._top = atoi(_tokens[3]); - } - - if (_tokens[4][0] != '\0') { - _char._ani._frame = atoi(_tokens[4]); - } - } - if (!scumm_stricmp(_tokens[0], "DISK")) { - _disk->selectArchive(_tokens[1]); - } - if (!scumm_stricmp(_tokens[0], "LOCALFLAGS")) { - _si = 1; // _localFlagNames[0] = 'visited' - while (_tokens[_si][0] != '\0') { - _localFlagNames->addData(_tokens[_si]); - _si++; - } - } - if (!scumm_stricmp(_tokens[0], "COMMANDS")) { - parseCommands(*_locationScript, _location._commands); - } - if (!scumm_stricmp(_tokens[0], "ACOMMANDS")) { - parseCommands(*_locationScript, _location._aCommands); - } - if (!scumm_stricmp(_tokens[0], "FLAGS")) { - if ((_localFlags[_currentLocationIndex] & kFlagsVisited) == 0) { - // only for 1st visit - _localFlags[_currentLocationIndex] = 0; - _si = 1; - - do { - byte _al = _localFlagNames->lookup(_tokens[_si]); - _localFlags[_currentLocationIndex] |= 1 << (_al - 1); - - _si++; - if (scumm_stricmp(_tokens[_si], "|")) break; - _si++; - } while (true); - } - } - if (!scumm_stricmp(_tokens[0], "COMMENT")) { - _location._comment = parseComment(*_locationScript); - debugC(3, kDebugLocation, "Location comment: '%s'", _location._comment); - } - if (!scumm_stricmp(_tokens[0], "ENDCOMMENT")) { - _location._endComment = parseComment(*_locationScript); - } - if (!scumm_stricmp(_tokens[0], "ZONE")) { - parseZone(*_locationScript, _zones, _tokens[1]); - } - if (!scumm_stricmp(_tokens[0], "NODES")) { - parseWalkNodes(*_locationScript, _location._walkNodes); - } - if (!scumm_stricmp(_tokens[0], "ANIMATION")) { - parseAnimation(*_locationScript, _animations, _tokens[1]); - } - if (!scumm_stricmp(_tokens[0], "SOUND")) { - if (getPlatform() == Common::kPlatformAmiga) { - strcpy(_locationSound, _tokens[1]); - _hasLocationSound = true; - } - } - if (!scumm_stricmp(_tokens[0], "MUSIC")) { - if (getPlatform() == Common::kPlatformAmiga) - _soundMan->setMusicFile(_tokens[1]); - } - fillBuffers(*_locationScript, true); - } - - resolveLocationForwards(); - - delete _locationScript; - - return; -} - -void Parallaction::resolveLocationForwards() { - - for (uint16 _si = 0; _forwardedCommands[_si]; _si++) { - _forwardedCommands[_si]->u._animation = findAnimation(_forwardedAnimationNames[_si]); - _forwardedCommands[_si] = NULL; - } - - _numForwards = 0; - return; -} - - -void Parallaction::freeLocation() { - debugC(7, kDebugLocation, "freeLocation"); - - _soundMan->stopSfx(0); - _soundMan->stopSfx(1); - _soundMan->stopSfx(2); - _soundMan->stopSfx(3); - - if (_localFlagNames) - delete _localFlagNames; - - // HACK: prevents leakage. A routine like this - // should allocate memory at all, though. - if ((_engineFlags & kEngineQuit) == 0) { - _localFlagNames = new Table(120); - _localFlagNames->addData("visited"); - } - - _location._walkNodes.clear(); - - // TODO (LIST): helperNode should be rendered useless by the use of a Common::List<> - // to store Zones and Animations. Right now, it holds a list of Zones to be preserved - // but that'll pretty meaningless with a single list approach. - freeZones(); - freeAnimations(); - - if (_location._comment) { - free(_location._comment); - } - _location._comment = NULL; - - _location._commands.clear(); - _location._aCommands.clear(); - - return; -} - - - -void Parallaction::parseWalkNodes(Script& script, WalkNodeList &list) { - - fillBuffers(script, true); - while (scumm_stricmp(_tokens[0], "ENDNODES")) { - - if (!scumm_stricmp(_tokens[0], "COORD")) { - - WalkNode *v4 = new WalkNode( - atoi(_tokens[1]) - _char._ani.width()/2, - atoi(_tokens[2]) - _char._ani.height() - ); - - list.push_front(v4); - } - - fillBuffers(script, true); - } - - return; - -} - -void Parallaction::switchBackground(const char* background, const char* mask) { -// printf("switchBackground(%s)", name); - - Gfx::Palette pal; - - uint16 v2 = 0; - if (!scumm_stricmp(background, "final")) { - _gfx->clearScreen(Gfx::kBitBack); - for (uint16 _si = 0; _si <= 93; ) { - pal[_si] = v2; - pal[_si+1] = v2; - pal[_si+2] = v2; - v2 += 4; - _si += 3; - } - - g_system->delayMillis(20); - _gfx->setPalette(pal); - _gfx->updateScreen(); - } - - _disk->loadScenery(background, mask); - - return; -} - -extern Zone *_hoverZone; -extern Job *_jDrawLabel; -extern Job *_jEraseLabel; - -void Parallaction::showSlide(const char *name) { - - _disk->loadSlide(name); - _gfx->setPalette(_gfx->_palette); - _gfx->copyScreen(Gfx::kBitBack, Gfx::kBitFront); - - debugC(1, kDebugLocation, "changeLocation: new background set"); - - _gfx->setFont(kFontMenu); - - _gfx->displayCenteredString(14, _slideText[0]); // displays text on screen - _gfx->updateScreen(); - - waitUntilLeftClick(); - - debugC(2, kDebugLocation, "changeLocation: intro text shown"); - - return; -} - -/* - changeLocation handles transitions between locations, and is able to display slides - between one and the other. The input parameter 'location' exists in some flavours: - - 1 - [S].slide.[L]{.[C]} - 2 - [L]{.[C]} - - where: - - [S] is the slide to be shown - [L] is the location to switch to (immediately in case 2, or right after slide [S] in case 1) - [C] is the character to be selected, and is optional - - The routine tells one form from the other by searching for the '.slide.' - - NOTE: there exists one script in which [L] is not used in the case 1, but its use - is commented out, and would definitely crash the current implementation. -*/ -void Parallaction::changeLocation(char *location) { - debugC(1, kDebugLocation, "changeLocation(%s)", location); - - _soundMan->playLocationMusic(location); - - // WORKAROUND: this if-statement has been added to avoid crashes caused by - // execution of label jobs after a location switch. The other workaround in - // Parallaction::runGame should have been rendered useless by this one. - if (_jDrawLabel != NULL) { - removeJob(_jDrawLabel); - removeJob(_jEraseLabel); - _jDrawLabel = NULL; - _jEraseLabel = NULL; - } - - - _hoverZone = NULL; - if (_engineFlags & kEngineBlockInput) { - changeCursor( kCursorArrow ); - } - - _animations.remove(&_char._ani); - - freeLocation(); - char buf[100]; - strcpy(buf, location); - - Common::StringList list; - char *tok = strtok(location, "."); - while (tok) { - list.push_back(tok); - tok = strtok(NULL, "."); - } - - if (list.size() < 1 || list.size() > 4) - error("changeLocation: ill-formed location string '%s'", location); - - if (list.size() > 1) { - if (list[1] == "slide") { - showSlide(list[0].c_str()); - list.remove_at(0); // removes slide name - list.remove_at(0); // removes 'slide' - } - - // list is now only [L].{[C]} (see above comment) - if (list.size() == 2) { - changeCharacter(list[1].c_str()); - strcpy(_characterName, list[1].c_str()); - } - } - - _animations.push_front(&_char._ani); - - strcpy(_saveData1, list[0].c_str()); - parseLocation(list[0].c_str()); - - _char._ani._oldPos.x = -1000; - _char._ani._oldPos.y = -1000; - - _char._ani.field_50 = 0; - if (_location._startPosition.x != -1000) { - _char._ani._left = _location._startPosition.x; - _char._ani._top = _location._startPosition.y; - _char._ani._frame = _location._startFrame; - _location._startPosition.y = -1000; - _location._startPosition.x = -1000; - } - - - _gfx->copyScreen(Gfx::kBitBack, Gfx::kBitFront); - _gfx->copyScreen(Gfx::kBitBack, Gfx::kBit2); - _gfx->setBlackPalette(); - _gfx->updateScreen(); - - if (_location._commands.size() > 0) { - runCommands(_location._commands); - runJobs(); - _gfx->swapBuffers(); - runJobs(); - _gfx->swapBuffers(); - } - - if (_location._comment) { - doLocationEnterTransition(); - } - - runJobs(); - _gfx->swapBuffers(); - - _gfx->setPalette(_gfx->_palette); - if (_location._aCommands.size() > 0) { - runCommands(_location._aCommands); - } - - if (_hasLocationSound) - _soundMan->playSfx(_locationSound, 0, true); - - debugC(1, kDebugLocation, "changeLocation() done"); - - return; - -} - -// displays transition before a new location -// -// clears screen (in white??) -// shows location comment (if any) -// waits for mouse click -// fades towards game palette -// -// THE FINAL PALETTE IS NOT THE SAME AS THE MAIN PALETTE!!!!!! -// -void Parallaction::doLocationEnterTransition() { - debugC(1, kDebugLocation, "doLocationEnterTransition"); - - if (_localFlags[_currentLocationIndex] & kFlagsVisited) { - debugC(3, kDebugLocation, "skipping location transition"); - return; // visited - } - - byte pal[PALETTE_SIZE]; - _gfx->makeGrayscalePalette(pal); - _gfx->setPalette(pal); - - jobRunScripts(NULL, NULL); - jobEraseAnimations(NULL, NULL); - jobDisplayAnimations(NULL, NULL); - - _gfx->setFont(kFontDialogue); - _gfx->swapBuffers(); - _gfx->copyScreen(Gfx::kBitFront, Gfx::kBitBack); - - int16 w, h; - _gfx->getStringExtent(_location._comment, 130, &w, &h); - - Common::Rect r(10 + w, 5 + h); - r.moveTo(5, 5); - _gfx->floodFill(Gfx::kBitFront, r, 0); - r.grow(-1); - _gfx->floodFill(Gfx::kBitFront, r, 1); - _gfx->displayWrappedString(_location._comment, 3, 5, 0, 130); - - _gfx->updateScreen(); - waitUntilLeftClick(); - - _gfx->copyScreen(Gfx::kBitBack, Gfx::kBitFront ); - - // fades maximum intensity palette towards approximation of main palette - for (uint16 _si = 0; _si<6; _si++) { - _gfx->fadePalette(pal, _gfx->_palette, 4); - _gfx->setPalette(pal); - waitTime( 1 ); - _gfx->updateScreen(); - } - - debugC(1, kDebugLocation, "doLocationEnterTransition completed"); - - return; -} - -} // namespace Parallaction diff --git a/engines/parallaction/menu.cpp b/engines/parallaction/menu.cpp index 12b03ab4b0..14d50c6373 100644 --- a/engines/parallaction/menu.cpp +++ b/engines/parallaction/menu.cpp @@ -114,7 +114,7 @@ void Menu::start() { splash(); - _vm->_gfx->setFont(kFontMenu); + _vm->_gfx->setFont(_vm->_menuFont); _language = chooseLanguage(); _vm->_disk->setLanguage(_language); @@ -128,15 +128,11 @@ void Menu::start() { void Menu::splash() { - _vm->_disk->loadSlide("intro"); - _vm->_gfx->setPalette(_vm->_gfx->_palette); - _vm->_gfx->copyScreen(Gfx::kBitBack, Gfx::kBitFront); + _vm->showSlide("intro"); _vm->_gfx->updateScreen(); g_system->delayMillis(2000); - _vm->_disk->loadSlide("minintro"); - _vm->_gfx->setPalette(_vm->_gfx->_palette); - _vm->_gfx->copyScreen(Gfx::kBitBack, Gfx::kBitFront); + _vm->showSlide("minintro"); _vm->_gfx->updateScreen(); g_system->delayMillis(2000); @@ -155,8 +151,8 @@ void Menu::newGame() { _vm->_disk->selectArchive("disk1"); - _vm->_disk->loadScenery("test", NULL); - _vm->_gfx->setPalette(_vm->_gfx->_palette); + _vm->setBackground("test", NULL, NULL); + _vm->_gfx->swapBuffers(); _vm->_gfx->displayCenteredString(50, v14[0]); @@ -200,11 +196,7 @@ uint16 Menu::chooseLanguage() { } // user can choose language in dos version - - _vm->_disk->loadSlide("lingua"); - _vm->_gfx->setPalette(_vm->_gfx->_palette); - _vm->_gfx->copyScreen(Gfx::kBitBack, Gfx::kBitFront); - + _vm->showSlide("lingua"); _vm->_gfx->displayString(60, 30, "SELECT LANGUAGE", 1); _vm->changeCursor(kCursorArrow); @@ -260,8 +252,7 @@ uint16 Menu::selectGame() { return 0; // can't load a savegame in demo versions } - _vm->_disk->loadSlide("restore"); - _vm->_gfx->setPalette(_vm->_gfx->_palette); + _vm->showSlide("restore"); uint16 _si = 0; uint16 _di = 3; @@ -343,23 +334,17 @@ void Menu::selectCharacter() { uint16 _donna_points, _dino_points, _dough_points; - StaticCnv v14; - - v14._data0 = (byte*)malloc(BLOCK_WIDTH*BLOCK_HEIGHT); - v14._width = BLOCK_WIDTH; - v14._height = BLOCK_HEIGHT; + Graphics::Surface v14; + v14.create(BLOCK_WIDTH, BLOCK_HEIGHT, 1); _vm->changeCursor(kCursorArrow); _vm->_soundMan->stopMusic(); - _vm->_gfx->setFont(kFontMenu); + _vm->_gfx->setFont(_vm->_menuFont); _vm->_disk->selectArchive((_vm->getFeatures() & GF_LANG_MULT) ? "disk1" : "disk0"); - _vm->_disk->loadSlide("password"); // loads background into kBitBack buffer - _vm->_gfx->copyScreen(Gfx::kBitBack, Gfx::kBitFront); // - - _vm->_gfx->setPalette(_vm->_gfx->_palette); + _vm->showSlide("password"); // loads background into kBitBack buffer while (true) { @@ -383,7 +368,7 @@ void Menu::selectCharacter() { Common::Rect r; int _si = getSelectedBlock(_vm->_mousePos, r); if (_si != -1) { - _vm->_gfx->grabRect(v14._data0, r, Gfx::kBitFront, BLOCK_WIDTH); + _vm->_gfx->grabRect((byte*)v14.pixels, r, Gfx::kBitFront, BLOCK_WIDTH); _vm->_gfx->flatBlitCnv(&v14, _di * SLOT_WIDTH + SLOT_X, SLOT_Y, Gfx::kBitFront); // beep(); @@ -435,7 +420,7 @@ void Menu::selectCharacter() { _engineFlags |= kEngineChangeLocation; - free(v14._data0); + v14.free(); return; diff --git a/engines/parallaction/module.mk b/engines/parallaction/module.mk index b7f60eeb32..56eaddac95 100644 --- a/engines/parallaction/module.mk +++ b/engines/parallaction/module.mk @@ -1,29 +1,30 @@ MODULE := engines/parallaction MODULE_OBJS := \ - animation.o \ callables_br.o \ callables_ns.o \ - commands.o \ debug.o \ detection.o \ dialogue.o \ disk_br.o \ disk_ns.o \ + exec_br.o \ + exec_ns.o \ font.o \ graphics.o \ inventory.o \ - location.o \ menu.o \ - parser.o \ + objects.o \ parallaction.o \ parallaction_br.o \ parallaction_ns.o \ + parser.o \ + parser_br.o \ + parser_ns.o \ saveload.o \ sound.o \ staticres.o \ - walk.o \ - zone.o + walk.o # This module can be built as a plugin ifdef BUILD_PLUGINS diff --git a/engines/parallaction/objects.cpp b/engines/parallaction/objects.cpp new file mode 100644 index 0000000000..0e0d7c4c38 --- /dev/null +++ b/engines/parallaction/objects.cpp @@ -0,0 +1,408 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * $URL$ + * $Id$ + * + */ + +#include "common/stdafx.h" +#include "parallaction/objects.h" +#include "parallaction/parser.h" + +namespace Parallaction { + + + +Command::Command() { + _id = 0; + _flagsOn = 0; + _flagsOff = 0; +} + +Command::~Command() { + +} + + +Animation::Animation() { + _cnv = NULL; + _program = NULL; + _scriptName = 0; + _frame = 0; + _z = 0; +} + +Animation::~Animation() { + if (_program) + delete _program; + + if (_scriptName) + free(_scriptName); + + if (_cnv) + delete _cnv; +} + +uint16 Animation::width() const { + if (!_cnv) return 0; + Common::Rect r; + _cnv->getRect(0, r); + return r.width(); +} + +uint16 Animation::height() const { + if (!_cnv) return 0; + Common::Rect r; + _cnv->getRect(0, r); + return r.height(); +} + +uint16 Animation::getFrameNum() const { + if (!_cnv) return 0; + return _cnv->getNum(); +} + +byte* Animation::getFrameData(uint32 index) const { + if (!_cnv) return NULL; + return _cnv->getData(index); +} + + +#define NUM_LOCALS 10 +char _localNames[NUM_LOCALS][10]; + +Program::Program() { + _loopCounter = 0; + _locals = new LocalVariable[NUM_LOCALS]; + _numLocals = 0; +} + +Program::~Program() { + delete[] _locals; +} + +int16 Program::findLocal(const char* name) { + for (uint16 _si = 0; _si < NUM_LOCALS; _si++) { + if (!scumm_stricmp(name, _localNames[_si])) + return _si; + } + + return -1; +} + +int16 Program::addLocal(const char *name, int16 value, int16 min, int16 max) { + assert(_numLocals < NUM_LOCALS); + + strcpy(_localNames[_numLocals], name); + _locals[_numLocals]._value = value; + + _locals[_numLocals]._min = min; + _locals[_numLocals]._max = max; + + return _numLocals++; +} + + + +Zone::Zone() { + _left = _top = _right = _bottom = 0; + + _type = 0; + _flags = 0; +} + +Zone::~Zone() { +// printf("~Zone(%s)\n", _label._text); + + switch (_type & 0xFFFF) { + case kZoneExamine: + free(u.examine->_filename); + free(u.examine->_description); + delete u.examine; + break; + + case kZoneDoor: + free(u.door->_location); + free(u.door->_background); + if (u.door->_cnv) + delete u.door->_cnv; + delete u.door; + break; + + case kZoneSpeak: + delete u.speak->_dialogue; + delete u.speak; + break; + + case kZoneGet: + free(u.get->_backup); + if (u.get->_cnv) { + u.get->_cnv->free(); + delete u.get->_cnv; + } + delete u.get; + break; + + case kZoneHear: + delete u.hear; + break; + + case kZoneMerge: + delete u.merge; + break; + + default: + break; + } +} + +void Zone::getRect(Common::Rect& r) const { + r.left = _left; + r.right = _right; + r.top = _top; + r.bottom = _bottom; +} + +void Zone::translate(int16 x, int16 y) { + _left += x; + _right += x; + _top += y; + _bottom += y; +} + +uint16 Zone::width() const { + return _right - _left; +} + +uint16 Zone::height() const { + return _bottom - _top; +} + +Label::Label() { + resetPosition(); + _text = 0; +} + +Label::~Label() { + free(); +} + +void Label::free() { + _cnv.free(); + if (_text) + ::free(_text); + _text = 0; + + resetPosition(); +} + +void Label::resetPosition() { + _pos.x = -1000; + _pos.y = -1000; + _old.x = -1000; + _old.y = -1000; +} + +void Label::getRect(Common::Rect &r, bool old) { + r.setWidth(_cnv.w); + r.setHeight(_cnv.h); + + if (old) { + r.moveTo(_old); + } else { + r.moveTo(_pos); + } +} + +Answer::Answer() { + _text = NULL; + _mood = 0; + _following._question = NULL; + _noFlags = 0; + _yesFlags = 0; +} + +Answer::~Answer() { + if (_text) + free(_text); +} + +Question::Question() { + _text = NULL; + _mood = 0; + + for (uint32 i = 0; i < NUM_ANSWERS; i++) + _answers[i] = NULL; + +} + +Question::~Question() { + + for (uint32 i = 0; i < NUM_ANSWERS; i++) + if (_answers[i]) delete _answers[i]; + + free(_text); +} + +Instruction::Instruction() { + memset(this, 0, sizeof(Instruction)); +} + +Instruction::~Instruction() { + if (_text) + free(_text); + if (_text2) + free(_text2); +} + +int16 ScriptVar::getRValue() { + + if (_flags & kParaImmediate) { + return _value; + } + + if (_flags & kParaLocal) { + return _local->_value; + } + + if (_flags & kParaField) { + return *_pvalue; + } + + if (_flags & kParaRandom) { + return (rand() * _value) / 32767; + } + + error("Parameter is not an r-value"); + + return 0; +} + +int16* ScriptVar::getLValue() { + + if (_flags & kParaLocal) { + return &_local->_value; + } + + if (_flags & kParaField) { + return _pvalue; + } + + error("Parameter is not an l-value"); + +} + +void ScriptVar::setLocal(LocalVariable *local) { + _local = local; + _flags |= kParaLocal; +} + +void ScriptVar::setField(int16 *field) { + _pvalue = field; + _flags |= kParaField; +} + +void ScriptVar::setImmediate(int16 value) { + _value = value; + _flags |= kParaImmediate; +} + +void ScriptVar::setRandom(int16 seed) { + _value = seed; + _flags |= kParaRandom; +} + + +ScriptVar::ScriptVar() { + _flags = 0; + _local = 0; + _value = 0; + _pvalue = 0; +} + +Table::Table(uint32 size) : _size(size), _used(0), _disposeMemory(true) { + _data = (char**)calloc(size, sizeof(char*)); +} + +Table::Table(uint32 size, const char **data) : _size(size), _used(size), _disposeMemory(false) { + _data = const_cast<char**>(data); +} + +Table::~Table() { + + if (!_disposeMemory) return; + + clear(); + + free(_data); + +} + +void Table::addData(const char* s) { + + if (!(_used < _size)) + error("Table overflow"); + + _data[_used++] = strdup(s); + +} + +uint16 Table::lookup(const char* s) { + + for (uint16 i = 0; i < _used; i++) { + if (!scumm_stricmp(_data[i], s)) return i + 1; + } + + return notFound; +} + +void Table::clear() { + for (uint32 i = 0; i < _used; i++) + free(_data[i]); + + _used = 0; +} + +FixedTable::FixedTable(uint32 size, uint32 fixed) : Table(size), _numFixed(fixed) { +} + +void FixedTable::clear() { + for (uint32 i = _numFixed; i < _used; i++) { + free(_data[i]); + _used--; + } +} + +Table* createTableFromStream(uint32 size, Common::SeekableReadStream &stream) { + + Table *t = new Table(size); + + fillBuffers(stream); + while (scumm_stricmp(_tokens[0], "ENDTABLE")) { + t->addData(_tokens[0]); + fillBuffers(stream); + } + + return t; +} + + +} // namespace Parallaction diff --git a/engines/parallaction/zone.h b/engines/parallaction/objects.h index 634a1364aa..41e8bbcf5d 100644 --- a/engines/parallaction/zone.h +++ b/engines/parallaction/objects.h @@ -30,12 +30,19 @@ #include "parallaction/defs.h" -#include "parallaction/commands.h" #include "parallaction/graphics.h" namespace Parallaction { +struct Zone; +struct Animation; +struct Command; +struct Question; +struct Answer; +struct Instruction; +struct Program; + enum ZoneTypes { kZoneExamine = 1, // zone displays comment if activated kZoneDoor = 2, // zone activated on click (after some walk if needed) @@ -64,16 +71,77 @@ enum ZoneFlags { kFlagsLooping = 0x100, // Animation: script is to be executed repeatedly kFlagsAdded = 0x200, // NEVER USED in Nippon Safes kFlagsCharacter = 0x400, // - kFlagsNoWalk = 0x800 // Zone: character doesn't need to walk towards object to interact + kFlagsNoWalk = 0x800, // Zone: character doesn't need to walk towards object to interact + + // BRA specific + kFlagsYourself = 0x1000, + kFlagsScaled = 0x2000, + kFlagsSelfuse = 0x4000, + kFlagsAnimLinked = 0x2000000 +}; + + +enum CommandFlags { + kFlagsVisited = 1, + kFlagsExit = 0x10000000, + kFlagsEnter = 0x20000000, + kFlagsGlobal = 0x40000000, + + // BRA specific + kFlagsTestTrue = 2 +}; + +struct CommandData { + uint32 _flags; + Animation * _animation; + Zone* _zone; + char* _string; + uint16 _callable; + uint16 _object; + Common::Point _move; + + // BRA specific + Common::Point _startPos; + Common::Point _startPos2; + uint _lvalue; + int _rvalue; + int _zeta0; + int _zeta1; + int _zeta2; + int _characterId; + char* _string2; + int _musicCommand; + int _musicParm; + + + CommandData() { + memset(this, 0, sizeof(CommandData)); + } + + ~CommandData() { + if (_string) + free(_string); + if (_string2) + free(_string2); + } }; +struct Command { + uint16 _id; + CommandData u; + uint32 _flagsOn; + uint32 _flagsOff; + + Command(); + ~Command(); +}; + +typedef ManagedList<Command*> CommandList; + #define NUM_QUESTIONS 20 #define NUM_ANSWERS 5 -struct Command; -struct Question; - struct Answer { char* _text; uint16 _mood; @@ -104,7 +172,7 @@ struct Dialogue { struct GetData { // size = 24 uint32 _icon; - StaticCnv *_cnv; + Graphics::Surface *_cnv; byte *_backup; uint16 field_14; // unused uint16 field_16; // unused @@ -125,7 +193,7 @@ struct SpeakData { // size = 36 } }; struct ExamineData { // size = 28 - StaticCnv *_cnv; + Graphics::Surface *_cnv; uint16 _opBase; // unused uint16 field_12; // unused char* _description; @@ -140,7 +208,7 @@ struct ExamineData { // size = 28 }; struct DoorData { // size = 28 char* _location; - Cnv *_cnv; + Frames *_cnv; byte* _background; Common::Point _startPos; uint16 _startFrame; @@ -192,11 +260,18 @@ struct TypeData { }; struct Label { - char* _text; - StaticCnv _cnv; + char* _text; + Graphics::Surface _cnv; + + Common::Point _pos; + Common::Point _old; Label(); ~Label(); + + void free(); + void resetPosition(); + void getRect(Common::Rect &r, bool old = false); }; struct Zone { @@ -213,6 +288,11 @@ struct Zone { CommandList _commands; Common::Point _moveTo; + // BRA specific + uint _index; + char *_linkedName; + Animation *_linkedAnim; + Zone(); virtual ~Zone(); @@ -237,57 +317,81 @@ struct LocalVariable { } }; -union LValue { +enum ParaFlags { + kParaImmediate = 1, // instruction is using an immediate parameter + kParaLocal = 2, // instruction is using a local variable + kParaField = 0x10, // instruction is using an animation's field + kParaRandom = 0x100 +}; + + +struct ScriptVar { + uint32 _flags; + int16 _value; int16* _pvalue; LocalVariable* _local; - LValue() { - _local = NULL; - } + ScriptVar(); + + int16 getRValue(); + int16* getLValue(); + + void setLocal(LocalVariable *local); + void setField(int16 *field); + void setImmediate(int16 value); + void setRandom(int16 seed); }; enum InstructionFlags { - kInstUsesLiteral = 1, - kInstUsesLocal = 2, kInstMod = 4, - kInstMaskedPut = 8 + kInstMaskedPut = 8, + kInstUnk20 = 0x20 }; -struct Animation; +typedef ManagedList<Instruction*> InstructionList; struct Instruction { uint32 _index; uint32 _flags; - struct { - Animation *_a; - Zone *_z; - uint32 _index; - LValue _loopCounter; - } _opBase; - LValue _opA; - LValue _opB; - - Instruction() { - _index = 0; - _flags = 0; - _opBase._a = NULL; - } + + // common + Animation *_a; + Zone *_z; + int16 _immediate; + ScriptVar _opA; + ScriptVar _opB; + + // BRA specific + byte _colors[3]; + ScriptVar _opC; + char *_text; + char *_text2; + int _y; + InstructionList::iterator _endif; + + Instruction(); + ~Instruction(); + }; -//typedef Common::List<Instruction*> InstructionList; -typedef ManagedList<Instruction*> InstructionList; struct Program { LocalVariable *_locals; + uint16 _loopCounter; + uint16 _numLocals; + InstructionList::iterator _ip; InstructionList::iterator _loopStart; InstructionList _instructions; Program(); ~Program(); + + int16 findLocal(const char* name); + int16 addLocal(const char *name, int16 value = 0, int16 min = -10000, int16 max = 10000); }; @@ -296,7 +400,8 @@ struct Animation : public Zone { Common::Point _oldPos; Program *_program; - Cnv *_cnv; + Frames *_cnv; + char *_scriptName; int16 _frame; uint16 field_50; // unused int16 _z; @@ -319,6 +424,40 @@ typedef Animation* AnimationPointer; typedef ManagedList<AnimationPointer> AnimationList; +class Table { + +protected: + char **_data; + uint16 _size; + uint16 _used; + bool _disposeMemory; + +public: + Table(uint32 size); + Table(uint32 size, const char** data); + + virtual ~Table(); + + enum { + notFound = 0 + }; + + virtual void addData(const char* s); + virtual void clear(); + virtual uint16 lookup(const char* s); +}; + +class FixedTable : public Table { + + uint16 _numFixed; + +public: + FixedTable(uint32 size, uint32 fixed); + void clear(); +}; + +Table* createTableFromStream(uint32 size, Common::SeekableReadStream &stream); + } // namespace Parallaction #endif diff --git a/engines/parallaction/parallaction.cpp b/engines/parallaction/parallaction.cpp index 986bc6ebd7..7b641bf838 100644 --- a/engines/parallaction/parallaction.cpp +++ b/engines/parallaction/parallaction.cpp @@ -35,7 +35,6 @@ #include "parallaction/parallaction.h" #include "parallaction/debug.h" -#include "parallaction/menu.h" #include "parallaction/sound.h" @@ -54,11 +53,9 @@ char _saveData1[30] = { '\0' }; uint16 _language = 0; char _slideText[2][40]; uint32 _engineFlags = 0; -Zone *_activeZone = NULL; uint16 _score = 1; -uint32 _localFlags[120] = { 0 }; Command * _forwardedCommands[20] = { NULL, NULL, @@ -92,15 +89,14 @@ uint16 _introSarcData2 = 1; // private stuff static Job *_jDrawInventory = NULL; -Job *_jDrawLabel = NULL; -Job *_jEraseLabel = NULL; -Zone *_hoverZone = NULL; static Job *_jRunScripts = NULL; Parallaction::Parallaction(OSystem *syst) : Engine(syst) { + // FIXME: Fingolfin asks: why is there a FIXME here? Please either clarify what + // needs fixing, or remove it! // FIXME _vm = this; @@ -109,11 +105,11 @@ Parallaction::Parallaction(OSystem *syst) : Common::File::addDefaultDirectory( _gameDataPath ); Common::addSpecialDebugLevel(kDebugDialogue, "dialogue", "Dialogues debug level"); - Common::addSpecialDebugLevel(kDebugLocation, "location", "Location debug level"); + Common::addSpecialDebugLevel(kDebugParser, "parser", "Parser debug level"); Common::addSpecialDebugLevel(kDebugDisk, "disk", "Disk debug level"); Common::addSpecialDebugLevel(kDebugWalk, "walk", "Walk debug level"); Common::addSpecialDebugLevel(kDebugGraphics, "gfx", "Gfx debug level"); - Common::addSpecialDebugLevel(kDebugJobs, "jobs", "Jobs debug level"); + Common::addSpecialDebugLevel(kDebugExec, "exec", "Execution debug level"); Common::addSpecialDebugLevel(kDebugInput, "input", "Input debug level"); Common::addSpecialDebugLevel(kDebugAudio, "audio", "Audio debug level"); Common::addSpecialDebugLevel(kDebugMenu, "menu", "Menu debug level"); @@ -123,11 +119,13 @@ Parallaction::Parallaction(OSystem *syst) : Parallaction::~Parallaction() { delete _debugger; + freeBackground(); + delete _backgroundInfo; + delete _globalTable; delete _callableNames; - delete _commandsNames; - delete _instructionNames; + delete _localFlagNames; delete _zoneTypeNames; delete _zoneFlagNames; @@ -150,7 +148,6 @@ int Parallaction::init() { _objectsNames = NULL; _globalTable = NULL; _hasLocationSound = false; - _skipMenu = false; _transCurrentHoverItem = 0; _actionAfterWalk = false; // actived when the character needs to move before taking an action _activeItem._index = 0; @@ -164,20 +161,25 @@ int Parallaction::init() { _location._comment = NULL; _location._endComment = NULL; - _screenMaskWidth = _screenWidth / 4; - _screenPathWidth = _screenWidth / 8; + _backgroundInfo = 0; + _pathBuffer = 0; + _activeZone = 0; + _screenSize = _screenWidth * _screenHeight; - _screenMaskSize = _screenMaskWidth * _screenHeight; - _screenPathSize = _screenPathWidth * _screenHeight; + + _backgroundInfo = new BackgroundInfo; strcpy(_characterName1, "null"); strcpy(_characterName, "dough"); - memset(_locationNames, 0, 120*32); + memset(_locationNames, 0, NUM_LOCATIONS * 32); - initWalk(); // needs to be pushed into subclass initInventory(); // needs to be pushed into subclass + _jDrawLabel = NULL; + _jEraseLabel = NULL; + _hoverZone = NULL; + _animations.push_front(&_char._ani); _gfx = new Gfx(this); @@ -190,48 +192,7 @@ int Parallaction::init() { -int Parallaction::go() { - - initGame(); - runGame(); - - return 0; -} - -void Parallaction::initGame() { - - _menu = new Menu(this); - - initGlobals(); - if (_skipMenu == false) { - _menu->start(); - } - - char *v4 = strchr(_location._name, '.'); - if (v4) { - *v4 = '\0'; - } - - _engineFlags &= ~kEngineChangeLocation; - changeCharacter(_characterName); - - strcpy(_saveData1, _location._name); - parseLocation(_location._name); - if (_location._startPosition.x != -1000) { - _char._ani._left = _location._startPosition.x; - _char._ani._top = _location._startPosition.y; - _char._ani._frame = _location._startFrame; - _location._startPosition.y = -1000; - _location._startPosition.x = -1000; - } - - return; -} - -void Parallaction::initGlobals() { - _globalTable = _disk->loadTable("global"); -} // FIXME: the engine has 3 event loops. The following routine hosts the main one, // and it's called from 8 different places in the code. There exist 2 more specialised @@ -324,9 +285,9 @@ void waitUntilLeftClick() { void Parallaction::runGame() { - addJob(&jobEraseAnimations, (void*)1, kPriority20); - _jRunScripts = addJob(&jobRunScripts, 0, kPriority15); - addJob(&jobDisplayAnimations, 0, kPriority3); + addJob(kJobEraseAnimations, (void*)1, kPriority20); + _jRunScripts = addJob(kJobRunScripts, 0, kPriority15); + addJob(kJobDisplayAnimations, 0, kPriority3); _gfx->copyScreen(Gfx::kBitBack, Gfx::kBit2); @@ -391,11 +352,34 @@ void Parallaction::runGame() { } - delete _menu; - return; } +void Parallaction::showLabel(Label &label) { + label.resetPosition(); + _jDrawLabel = addJob(kJobDisplayLabel, (void*)&label, kPriority0); + _jEraseLabel = addJob(kJobEraseLabel, (void*)&label, kPriority20); +} + +void Parallaction::hideLabel(uint priority) { + + if (!_jDrawLabel) + return; + + removeJob(_jDrawLabel); + _jDrawLabel = 0; + + if (priority == kPriority99) { + // remove job immediately + removeJob(_jEraseLabel); + _jEraseLabel = 0; + } else { + // schedule job for deletion + addJob(kJobWaitRemoveJob, _jEraseLabel, priority); + } + +} + void Parallaction::processInput(InputData *data) { Zone *z; @@ -403,19 +387,12 @@ void Parallaction::processInput(InputData *data) { switch (data->_event) { case kEvEnterZone: debugC(2, kDebugInput, "processInput: kEvEnterZone"); - _gfx->_labelPosition[1].x = -1000; - _gfx->_labelPosition[1].y = -1000; - _gfx->_labelPosition[0].x = -1000; - _gfx->_labelPosition[0].y = -1000; - _jDrawLabel = addJob(&jobDisplayLabel, (void*)data->_label, kPriority0); - _jEraseLabel = addJob(&jobEraseLabel, (void*)data->_label, kPriority20); + showLabel(*data->_label); break; case kEvExitZone: debugC(2, kDebugInput, "processInput: kEvExitZone"); - removeJob(_jDrawLabel); - addJob(&jobWaitRemoveJob, _jEraseLabel, kPriority15); - _jDrawLabel = NULL; + hideLabel(kPriority15); break; case kEvAction: @@ -433,15 +410,12 @@ void Parallaction::processInput(InputData *data) { case kEvOpenInventory: _procCurrentHoverItem = -1; _hoverZone = NULL; - if (_jDrawLabel != 0) { - removeJob(_jDrawLabel); - _jDrawLabel = NULL; - addJob(&jobWaitRemoveJob, _jEraseLabel, kPriority2); + hideLabel(kPriority2); + if (hitZone(kZoneYou, _mousePos.x, _mousePos.y) == 0) { + changeCursor(kCursorArrow); } - if (hitZone(kZoneYou, _mousePos.x, _mousePos.y) == 0) - changeCursor(kCursorArrow); removeJob(_jRunScripts); - _jDrawInventory = addJob(&jobShowInventory, 0, kPriority2); + _jDrawInventory = addJob(kJobShowInventory, 0, kPriority2); openInventory(); break; @@ -451,8 +425,8 @@ void Parallaction::processInput(InputData *data) { // activates item changeCursor(data->_inventoryIndex); } - _jRunScripts = addJob(&jobRunScripts, 0, kPriority15); - addJob(&jobHideInventory, 0, kPriority20); + _jRunScripts = addJob(kJobRunScripts, 0, kPriority15); + addJob(kJobHideInventory, 0, kPriority20); removeJob(_jDrawInventory); break; @@ -469,7 +443,7 @@ void Parallaction::processInput(InputData *data) { if (_char._ani._flags & kFlagsRemove) break; if ((_char._ani._flags & kFlagsActive) == 0) break; WalkNodeList *v4 = _char._builder.buildPath(data->_mousePos.x, data->_mousePos.y); - addJob(&jobWalk, v4, kPriority19); + addJob(kJobWalk, v4, kPriority19); _engineFlags |= kEngineWalking; // inhibits processing of input until walking is over } break; @@ -662,11 +636,7 @@ void Parallaction::changeCursor(int32 index) { debugC(1, kDebugInput, "changeCursor(%i), label: %p", index, (const void*)_jDrawLabel); - if (_jDrawLabel != NULL) { - removeJob(_jDrawLabel); - addJob(&jobWaitRemoveJob, _jEraseLabel, kPriority15 ); - _jDrawLabel = NULL; - } + hideLabel(kPriority15); _activeItem._id = 0; @@ -674,7 +644,7 @@ void Parallaction::changeCursor(int32 index) { _activeItem._id = _inventory[index]._id; } - _gfx->setMousePointer(index); + setMousePointer(index); return; } @@ -682,7 +652,7 @@ void Parallaction::changeCursor(int32 index) { void Parallaction::freeCharacter() { - debugC(3, kDebugLocation, "freeCharacter()"); + debugC(1, kDebugExec, "freeCharacter()"); if (!IS_DUMMY_CHARACTER(_characterName)) { if (_objectsNames) @@ -697,9 +667,7 @@ void Parallaction::freeCharacter() { delete _char._talk; _char._talk = NULL; - _gfx->freeStaticCnv(_char._head); - if (_char._head) - delete _char._head; + delete _char._head; _char._head = NULL; if (_char._objs) @@ -710,96 +678,49 @@ void Parallaction::freeCharacter() { return; } -void Parallaction::changeCharacter(const char *name) { - debugC(1, kDebugLocation, "changeCharacter(%s)", name); - - char baseName[20]; - if (IS_MINI_CHARACTER(name)) { - strcpy(baseName, name+4); - } else { - strcpy(baseName, name); - } - - char fullName[20]; - strcpy(fullName, name); - if (_engineFlags & kEngineTransformedDonna) - strcat(fullName, "tras"); - - if (scumm_stricmp(fullName, _characterName1)) { - - // freeCharacter takes responsibility for checking - // character for sanity before memory is freed - freeCharacter(); - - Common::String oldArchive = _disk->selectArchive((getFeatures() & GF_LANG_MULT) ? "disk1" : "disk0"); - _char._ani._cnv = _disk->loadFrames(fullName); - - if (!IS_DUMMY_CHARACTER(name)) { - if (getPlatform() == Common::kPlatformAmiga && (getFeatures() & GF_LANG_MULT)) - _disk->selectArchive("disk0"); - _char._head = _disk->loadHead(baseName); - _char._talk = _disk->loadTalk(baseName); - _char._objs = _disk->loadObjects(baseName); - _objectsNames = _disk->loadTable(baseName); - - _soundMan->playCharacterMusic(name); - - if (!(getFeatures() & GF_DEMO)) - parseLocation("common"); - } - - if (!oldArchive.empty()) - _disk->selectArchive(oldArchive); - } - - strcpy(_characterName1, fullName); - - debugC(1, kDebugLocation, "changeCharacter() done"); - - return; -} /* helper function to provide *descending* ordering of the job list (higher priorities values comes first in the list) */ int compareJobPriority(const JobPointer &j1, const JobPointer &j2) { - return (j1->_tag >= j2->_tag ? -1 : 1); + return (j1->_job->_tag >= j2->_job->_tag ? -1 : 1); } -Job *Parallaction::addJob(JobFn fn, void *parm, uint16 tag) { - debugC(3, kDebugJobs, "addJob(%i)", tag); +Job *Parallaction::addJob(uint functionId, void *parm, uint16 tag) { + debugC(9, kDebugExec, "addJob(%i)", tag); Job *v8 = new Job; v8->_parm = parm; - v8->_fn = fn; v8->_tag = tag; v8->_finished = 0; v8->_count = 0; - _jobs.insertSorted(v8, compareJobPriority); + JobOpcode *op = createJobOpcode(functionId, v8); + + _jobs.insertSorted(op, compareJobPriority); return v8; } void Parallaction::removeJob(Job *j) { - debugC(3, kDebugJobs, "addJob(%i)", j->_tag); + debugC(9, kDebugExec, "addJob(%i)", j->_tag); j->_finished = 1; return; } void Parallaction::pauseJobs() { - debugC(3, kDebugJobs, "pausing jobs execution"); + debugC(9, kDebugExec, "pausing jobs execution"); _engineFlags |= kEnginePauseJobs; return; } void Parallaction::resumeJobs() { - debugC(3, kDebugJobs, "resuming jobs execution"); + debugC(9, kDebugExec, "resuming jobs execution"); _engineFlags &= ~kEnginePauseJobs; return; @@ -811,7 +732,8 @@ void Parallaction::runJobs() { JobList::iterator it = _jobs.begin(); while (it != _jobs.end()) { - if ((*it)->_finished == 1) + Job *job = (*it)->_job; + if (job->_finished == 1) it = _jobs.erase(it); else it++; @@ -819,8 +741,9 @@ void Parallaction::runJobs() { it = _jobs.begin(); while (it != _jobs.end()) { - debugC(9, kDebugJobs, "runJobs: %i", (*it)->_tag); - (*(*it)->_fn)((*it)->_parm, (*it)); + Job *job = (*it)->_job; + debugC(9, kDebugExec, "runJobs: %i", job->_tag); + (*(*it))(); it++; } @@ -828,66 +751,317 @@ void Parallaction::runJobs() { return; } -// this Job uses a static counter to delay removal -// and is in fact only used to remove jEraseLabel jobs -// -void jobWaitRemoveJob(void *parm, Job *j) { - Job *arg = (Job*)parm; - static uint16 count = 0; - debugC(3, kDebugJobs, "jobWaitRemoveJob: count = %i", count); - _engineFlags |= kEngineBlockInput; +void Parallaction::pushParserTables(OpcodeSet *opcodes, Table *statements) { + _opcodes.push(_currentOpcodes); + _statements.push(_currentStatements); + + _currentOpcodes = opcodes; + _currentStatements = statements; +} + +void Parallaction::popParserTables() { + assert(_opcodes.size() > 0); + + _currentOpcodes = _opcodes.pop(); + _currentStatements = _statements.pop(); +} + +void Parallaction::parseStatement() { + assert(_currentOpcodes != 0); + + _lookup = _currentStatements->lookup(_tokens[0]); + + debugC(9, kDebugParser, "parseStatement: %s (lookup = %i)", _tokens[0], _lookup); + + (*(*_currentOpcodes)[_lookup])(); +} + + + + +Animation *Parallaction::findAnimation(const char *name) { + + for (AnimationList::iterator it = _animations.begin(); it != _animations.end(); it++) + if (!scumm_stricmp((*it)->_label._text, name)) return *it; + + return NULL; +} + +void Parallaction::freeAnimations() { + _animations.clear(); + return; +} + +int compareAnimationZ(const AnimationPointer &a1, const AnimationPointer &a2) { + if (a1->_z == a2->_z) return 0; + return (a1->_z < a2->_z ? -1 : 1); +} + +void Parallaction::sortAnimations() { + _char._ani._z = _char._ani.height() + _char._ani._top; + _animations.sort(compareAnimationZ); + return; +} + - count++; - if (count == 2) { - count = 0; - _vm->removeJob(arg); - _engineFlags &= ~kEngineBlockInput; - j->_finished = 1; +void Parallaction::allocateLocationSlot(const char *name) { + // WORKAROUND: the original code erroneously incremented + // _currentLocationIndex, thus producing inconsistent + // savegames. This workaround modified the following loop + // and if-statement, so the code exactly matches the one + // in Big Red Adventure. + _currentLocationIndex = -1; + uint16 _di = 0; + while (_locationNames[_di][0] != '\0') { + if (!scumm_stricmp(_locationNames[_di], name)) { + _currentLocationIndex = _di; + } + _di++; } + if (_di == 120) + error("No more location slots available. Please report this immediately to ScummVM team."); + + if (_currentLocationIndex == -1) { + strcpy(_locationNames[_numLocations], name); + _currentLocationIndex = _numLocations; + + _numLocations++; + _locationNames[_numLocations][0] = '\0'; + _localFlags[_numLocations] = 0; + } else { + _localFlags[_currentLocationIndex] |= kFlagsVisited; // 'visited' + } +} + + + +void Parallaction::freeLocation() { + debugC(2, kDebugExec, "freeLocation"); + + _soundMan->stopSfx(0); + _soundMan->stopSfx(1); + _soundMan->stopSfx(2); + _soundMan->stopSfx(3); + + _localFlagNames->clear(); + + _location._walkNodes.clear(); + + freeZones(); + freeAnimations(); + + if (_location._comment) { + free(_location._comment); + } + _location._comment = NULL; + + _location._commands.clear(); + _location._aCommands.clear(); + return; } -Table::Table(uint32 size) : _size(size), _used(0), _disposeMemory(true) { - _data = (char**)malloc(sizeof(char*)*size); + +void Parallaction::freeBackground() { + + if (!_backgroundInfo) + return; + + _backgroundInfo->bg.free(); + _backgroundInfo->mask.free(); + _backgroundInfo->path.free(); + + _pathBuffer = 0; + +} + +void Parallaction::setBackground(const char* name, const char* mask, const char* path) { + + _disk->loadScenery(*_backgroundInfo, name, mask, path); + + _gfx->setPalette(_backgroundInfo->palette); + _gfx->_palette.clone(_backgroundInfo->palette); + _gfx->setBackground(&_backgroundInfo->bg); + + if (_backgroundInfo->mask.data) + _gfx->setMask(&_backgroundInfo->mask); + + if (_backgroundInfo->path.data) + _pathBuffer = &_backgroundInfo->path; + + return; } -Table::Table(uint32 size, const char **data) : _size(size), _used(size), _disposeMemory(false) { - _data = const_cast<char**>(data); +void Parallaction::showLocationComment(const char *text, bool end) { + + _gfx->setFont(_dialogueFont); + + int16 w, h; + _gfx->getStringExtent(const_cast<char*>(text), 130, &w, &h); + + Common::Rect r(w + (end ? 5 : 10), h + 5); + r.moveTo(5, 5); + + _gfx->floodFill(Gfx::kBitFront, r, 0); + r.grow(-2); + _gfx->floodFill(Gfx::kBitFront, r, 1); + _gfx->displayWrappedString(const_cast<char*>(text), 3, 5, 0, 130); + + _gfx->updateScreen(); + + return; } -Table::~Table() { +void Parallaction::switchBackground(const char* background, const char* mask) { +// printf("switchBackground(%s)", name); + + Palette pal; - if (!_disposeMemory) return; + uint16 v2 = 0; + if (!scumm_stricmp(background, "final")) { + _gfx->clearScreen(Gfx::kBitBack); + for (uint16 _si = 0; _si <= 32; _si++) { + pal.setEntry(_si, v2, v2, v2); + v2 += 4; + } - for (uint32 i = 0; i < _used; i++) - free(_data[i]); + g_system->delayMillis(20); + _gfx->setPalette(pal); + _gfx->updateScreen(); + } - free(_data); + setBackground(background, mask, mask); + return; } -void Table::addData(const char* s) { - if (!(_used < _size)) - error("Table overflow"); +void Parallaction::showSlide(const char *name) { - _data[_used++] = strdup(s); + BackgroundInfo info; + + _disk->loadSlide(info, name); + + // TODO: avoid using screen buffers for displaying slides. Using a generic buffer + // allows for positioning of graphics as needed by Big Red Adventure. + // The main problem lies with menu, which relies on multiple buffers, mainly because + // it is crappy code. + _gfx->setBackground(&info.bg); + _gfx->setPalette(info.palette); + _gfx->copyScreen(Gfx::kBitBack, Gfx::kBitFront); + info.bg.free(); + info.mask.free(); + info.path.free(); + + return; } -int16 Table::lookup(const char* s) { - for (uint16 i = 0; i < _used; i++) { - if (!scumm_stricmp(_data[i], s)) return i + 1; + +// displays transition before a new location +// +// clears screen (in white??) +// shows location comment (if any) +// waits for mouse click +// fades towards game palette +// +void Parallaction::doLocationEnterTransition() { + debugC(2, kDebugExec, "doLocationEnterTransition"); + + if (_localFlags[_currentLocationIndex] & kFlagsVisited) { + debugC(2, kDebugExec, "skipping location transition"); + return; // visited + } + + Palette pal(_gfx->_palette); + pal.makeGrayscale(); + _gfx->setPalette(pal); + + jobRunScripts(NULL, NULL); + jobEraseAnimations(NULL, NULL); + jobDisplayAnimations(NULL, NULL); + + _gfx->swapBuffers(); + _gfx->copyScreen(Gfx::kBitFront, Gfx::kBitBack); + + showLocationComment(_location._comment, false); + waitUntilLeftClick(); + + _gfx->copyScreen(Gfx::kBitBack, Gfx::kBitFront ); + + // fades maximum intensity palette towards approximation of main palette + for (uint16 _si = 0; _si<6; _si++) { + pal.fadeTo(_gfx->_palette, 4); + _gfx->setPalette(pal); + waitTime( 1 ); + _gfx->updateScreen(); + } + + debugC(2, kDebugExec, "doLocationEnterTransition completed"); + + return; +} + + + +Zone *Parallaction::findZone(const char *name) { + + for (ZoneList::iterator it = _zones.begin(); it != _zones.end(); it++) { + if (!scumm_stricmp((*it)->_label._text, name)) return *it; } - return -1; + return findAnimation(name); } + +void Parallaction::freeZones() { + debugC(2, kDebugExec, "freeZones: kEngineQuit = %i", _engineFlags & kEngineQuit); + + ZoneList::iterator it = _zones.begin(); + + while ( it != _zones.end() ) { + + Zone* z = *it; + + // WORKAROUND: this huge condition is needed because we made TypeData a collection of structs + // instead of an union. So, merge->_obj1 and get->_icon were just aliases in the original engine, + // but we need to check it separately here. The same workaround is applied in hitZone. + if (((z->_top == -1) || + ((z->_left == -2) && ( + (((z->_type & 0xFFFF) == kZoneMerge) && ((isItemInInventory(MAKE_INVENTORY_ID(z->u.merge->_obj1)) != 0) || (isItemInInventory(MAKE_INVENTORY_ID(z->u.merge->_obj2)) != 0))) || + (((z->_type & 0xFFFF) == kZoneGet) && ((isItemInInventory(MAKE_INVENTORY_ID(z->u.get->_icon)) != 0))) + ))) && + ((_engineFlags & kEngineQuit) == 0)) { + + debugC(2, kDebugExec, "freeZones preserving zone '%s'", z->_label._text); + + it++; + + } else + + it = _zones.erase(it); + + } + + return; +} + + + + + + + + + + + + } // namespace Parallaction diff --git a/engines/parallaction/parallaction.h b/engines/parallaction/parallaction.h index 31b125c92a..c0975d4c85 100644 --- a/engines/parallaction/parallaction.h +++ b/engines/parallaction/parallaction.h @@ -27,21 +27,18 @@ #define PARALLACTION_H #include "common/str.h" - +#include "common/stack.h" +#include "common/array.h" #include "engines/engine.h" #include "parallaction/defs.h" #include "parallaction/inventory.h" #include "parallaction/parser.h" +#include "parallaction/objects.h" #include "parallaction/disk.h" #include "parallaction/walk.h" -#include "parallaction/zone.h" -namespace GUI { - class ListWidget; - class CommandSender; -} extern OSystem *g_system; @@ -50,10 +47,10 @@ namespace Parallaction { enum { kDebugDisk = 1 << 0, kDebugWalk = 1 << 1, - kDebugLocation = 1 << 2, + kDebugParser = 1 << 2, kDebugDialogue = 1 << 3, kDebugGraphics = 1 << 4, - kDebugJobs = 1 << 5, + kDebugExec = 1 << 5, kDebugInput = 1 << 6, kDebugAudio = 1 << 7, kDebugMenu = 1 << 8 @@ -93,7 +90,8 @@ enum { kPriority18 = 18, kPriority19 = 19, kPriority20 = 20, - kPriority21 = 21 + kPriority21 = 21, + kPriority99 = 99 // fictitious priority value used as a flag to handle quick label deletion }; enum { @@ -143,32 +141,23 @@ struct PARALLACTIONGameDescription; struct Job; -typedef void (*JobFn)(void*, Job*); struct Job { uint16 _count; // # of executions left uint16 _tag; // used for ordering uint16 _finished; void * _parm; - JobFn _fn; public: - Job() : _count(0), _tag(0), _finished(0), _parm(NULL), _fn(NULL) { + Job() : _count(0), _tag(0), _finished(0), _parm(NULL) { } }; -typedef Job* JobPointer; -typedef ManagedList<JobPointer> JobList; - -typedef void (*callable)(void*); extern uint16 _mouseButtons; extern uint16 _score; extern uint16 _language; -extern Zone *_activeZone; extern uint32 _engineFlags; -extern callable _callables[]; -extern uint32 _localFlags[]; extern Command *_forwardedCommands[]; extern char _forwardedAnimationNames[][20]; extern uint16 _numForwards; @@ -200,19 +189,6 @@ extern const char *_minidrkiName; void waitUntilLeftClick(); -void jobRemovePickedItem(void*, Job *j); -void jobDisplayDroppedItem(void*, Job *j); -void jobToggleDoor(void*, Job *j); -void jobEraseAnimations(void *arg_0, Job *j); -void jobWalk(void*, Job *j); -void jobRunScripts(void*, Job *j); -void jobDisplayAnimations(void*, Job *j); -void jobDisplayLabel(void *parm, Job *j); -void jobWaitRemoveJob(void *parm, Job *j); -void jobShowInventory(void *parm, Job *j); -void jobHideInventory(void *parm, Job *j); -void jobEraseLabel(void *parm, Job *j); - class Debugger; @@ -221,12 +197,10 @@ class Menu; class SoundMan; - struct Location { Common::Point _startPosition; uint16 _startFrame; - WalkNodeList _walkNodes; char _name[100]; CommandList _aCommands; @@ -234,13 +208,18 @@ struct Location { char *_comment; char *_endComment; + // NS specific + WalkNodeList _walkNodes; + + // BRA specific + CommandList _escapeCommands; }; struct Character { Animation _ani; - StaticCnv *_head; - Cnv *_talk; - Cnv *_objs; + Graphics::Surface *_head; + Frames *_talk; + Frames *_objs; PathBuilder _builder; Character() : _builder(&_ani) { @@ -256,31 +235,133 @@ struct Character { _ani._frame = 0; _ani._flags = kFlagsActive | kFlagsNoName; _ani._type = kZoneYou; - _ani._label._cnv._data0 = NULL; + _ani._label._cnv.pixels = NULL; _ani._label._text = strdup("yourself"); } + void getFoot(Common::Point &foot) { + foot.x = _ani._left + _ani.width() / 2; + foot.y = _ani._top + _ani.height(); + } + + void setFoot(const Common::Point &foot) { + _ani._left = foot.x - _ani.width() / 2; + _ani._top = foot.y - _ani.height(); + } + + +}; + + + + +struct BackgroundInfo { + uint width; + uint height; + + Graphics::Surface bg; + MaskBuffer mask; + PathBuffer path; + + Palette palette; }; +class Opcode { + +public: + virtual void operator()() const = 0; + virtual ~Opcode() { } +}; -class Table { +template <class T> +class OpcodeImpl : public Opcode { - char **_data; - uint16 _size; - uint16 _used; - bool _disposeMemory; + typedef void (T::*Fn)(); + + T* _instance; + Fn _fn; public: - Table(uint32 size); - Table(uint32 size, const char** data); + OpcodeImpl(T* instance, const Fn &fn) : _instance(instance), _fn(fn) { } + + void operator()() const { + (_instance->*_fn)(); + } + +}; + +typedef Common::Array<const Opcode*> OpcodeSet; - ~Table(); +class JobOpcode { - void addData(const char* s); +public: + Job *_job; - int16 lookup(const char* s); + JobOpcode(Job *job) : _job(job) { } + + virtual void operator()() const = 0; + virtual ~JobOpcode() { + delete _job; + } }; +template <class T> +class OpcodeImpl2 : public JobOpcode { + + typedef void (T::*Fn)(void *, Job*); + + T* _instance; + Fn _fn; + +public: + OpcodeImpl2(T* instance, const Fn &fn, Job* job) : JobOpcode(job), _instance(instance), _fn(fn) { } + + void operator()() const { + (_instance->*_fn)(_job->_parm, _job); + } + +}; + +typedef JobOpcode* JobPointer; +typedef ManagedList<JobPointer> JobList; + +enum Jobs { + kJobDisplayAnimations = 0, + kJobEraseAnimations = 1, + kJobDisplayDroppedItem = 2, + kJobRemovePickedItem = 3, + kJobRunScripts = 4, + kJobWalk = 5, + kJobDisplayLabel = 6, + kJobEraseLabel = 7, + kJobWaitRemoveJob = 8, + kJobToggleDoor = 9, + + // NS specific + kJobShowInventory = 10, + kJobHideInventory, + + // BRA specific + kJobEraseSubtitle = 10, + kJobDisplaySubtitle, + kJobWaitRemoveSubtitleJob, + kJobPauseSfx, + kJobStopFollower, + kJobScroll +}; + + +#define DECLARE_UNQUALIFIED_ZONE_PARSER(sig) void locZoneParse_##sig() +#define DECLARE_UNQUALIFIED_ANIM_PARSER(sig) void locAnimParse_##sig() +#define DECLARE_UNQUALIFIED_COMMAND_PARSER(sig) void cmdParse_##sig() +#define DECLARE_UNQUALIFIED_LOCATION_PARSER(sig) void locParse_##sig() +#define DECLARE_UNQUALIFIED_INSTRUCTION_PARSER(sig) void instParse_##sig() + +#define DECLARE_UNQUALIFIED_COMMAND_OPCODE(op) void cmdOp_##op() +#define DECLARE_UNQUALIFIED_INSTRUCTION_OPCODE(op) void instOp_##op() + + +#define NUM_LOCATIONS 120 class Parallaction : public Engine { friend class Debugger; @@ -291,31 +372,50 @@ public: ~Parallaction(); int init(); - int go(); - void loadGame(); - void saveGame(); + virtual void loadGame() = 0; + virtual void saveGame() = 0; uint16 updateInput(); void waitTime(uint32 t); - void parseLocation(const char *filename); + uint _lookup; + Common::Stack<OpcodeSet*> _opcodes; + Common::Stack<Table*> _statements; + OpcodeSet *_currentOpcodes; + Table *_currentStatements; + void pushParserTables(OpcodeSet *opcodes, Table* statements); + void popParserTables(); + void parseStatement(); + + OpcodeSet _commandOpcodes; + + struct { + Command *cmd; + Zone *z; + } _cmdRunCtxt; + + OpcodeSet _instructionOpcodes; + + struct { + Animation *a; + InstructionList::iterator inst; + uint16 modCounter; + bool suspend; + } _instRunCtxt; + + void changeCursor(int32 index); void showCursor(bool visible); - void changeCharacter(const char *name); - - char *parseComment(Script &script); - char *parseDialogueString(Script &script); - Dialogue *parseDialogue(Script &script); - Job *addJob(JobFn fn, void *parm, uint16 tag); + Job *addJob(uint functionId, void *parm, uint16 tag); void removeJob(Job *j); void pauseJobs(); void resumeJobs(); void runJobs(); + virtual JobOpcode* createJobOpcode(uint functionId, Job *job) = 0; - void setPath(byte *path); void finalizeWalk(WalkNodeList *list); int16 selectWalkFrame(const Common::Point& pos, const WalkNode* from); void clipMove(Common::Point& pos, const WalkNode* from); @@ -333,16 +433,20 @@ public: void sortAnimations(); void freeAnimations(); + void showSlide(const char *name); + void setBackground(const char *background, const char *mask, const char *path); + void freeBackground(); + Table *_globalTable; Table *_objectsNames; Table *_zoneTypeNames; Table *_zoneFlagNames; - Table *_commandsNames; Table *_callableNames; - Table *_instructionNames; Table *_localFlagNames; + void showLabel(Label &label); + void hideLabel(uint priority); public: int getGameType() const; @@ -359,21 +463,18 @@ public: int32 _screenHeight; int32 _screenSize; - int32 _screenMaskWidth; - int32 _screenMaskSize; - int32 _screenPathWidth; - int32 _screenPathSize; + PathBuffer *_pathBuffer; SoundMan *_soundMan; Gfx* _gfx; - Menu* _menu; Disk* _disk; Character _char; char _characterName[30]; - char _locationNames[120][32]; + uint32 _localFlags[NUM_LOCATIONS]; + char _locationNames[NUM_LOCATIONS][32]; int16 _currentLocationIndex; uint16 _numLocations; Location _location; @@ -382,9 +483,16 @@ public: Common::Point _mousePos; + Zone *_activeZone; + ZoneList _zones; AnimationList _animations; + Font *_labelFont; + Font *_menuFont; + Font *_dialogueFont; + + protected: // data Debugger *_debugger; @@ -397,8 +505,6 @@ protected: // data Label* _label; }; - bool _skipMenu; - bool _mouseHidden; // input-only @@ -422,11 +528,15 @@ protected: // data bool _hasLocationSound; char _locationSound[50]; + BackgroundInfo *_backgroundInfo; + + Job *_jDrawLabel; + Job *_jEraseLabel; + Zone *_hoverZone; protected: // members bool detectGame(void); - void initGame(); void initGlobals(); void runGame(); uint32 getElapsedTime(); @@ -435,34 +545,20 @@ protected: // members InputData *translateInput(); void processInput(InputData*); - int buildSaveFileList(Common::StringList& l); - int selectSaveFile(uint16 arg_0, const char* caption, const char* button); - void doLoadGame(uint16 slot); - void doSaveGame(uint16 slot, const char* name); - void doLocationEnterTransition(); - void changeLocation(char *location); - void showSlide(const char *name); - void resolveLocationForwards(); + virtual void changeLocation(char *location) = 0; + virtual void changeCharacter(const char *name) = 0; + void allocateLocationSlot(const char *name); + void finalizeLocationParsing(); void switchBackground(const char* background, const char* mask); void freeLocation(); + void showLocationComment(const char *text, bool end); - void parseZone(Script &script, ZoneList &list, char *name); - void parseZoneTypeBlock(Script &script, Zone *z); void displayCharacterComment(ExamineData *data); void displayItemComment(ExamineData *data); - void parseWalkNodes(Script& script, WalkNodeList &list); - void initWalk(); uint16 checkDoor(); - Animation * parseAnimation(Script &script, AnimationList &list, char *name); - void parseScriptLine(Instruction *inst, Animation *a, LocalVariable *locals); - void loadProgram(Animation *a, char *filename); - LValue getLValue(Instruction *inst, char *str, LocalVariable *locals, Animation *a); - - void parseCommands(Script &script, CommandList&); - void freeCharacter(); int addInventoryItem(uint16 item); @@ -473,6 +569,23 @@ protected: // members public: virtual void callFunction(uint index, void* parm) { } + virtual void renderLabel(Graphics::Surface *cnv, char *text) { } + virtual void setMousePointer(int16 index) = 0; + + + virtual void parseLocation(const char* name) = 0; + + virtual void jobDisplayAnimations(void*, Job *j) = 0; + virtual void jobEraseAnimations(void *arg_0, Job *j) = 0; + virtual void jobRunScripts(void*, Job *j) = 0; + virtual void jobDisplayDroppedItem(void*, Job *j) = 0; + virtual void jobRemovePickedItem(void*, Job *j) = 0; + virtual void jobToggleDoor(void*, Job *j) = 0; + virtual void jobWalk(void*, Job *j) = 0; + virtual void jobDisplayLabel(void *parm, Job *j) = 0; + virtual void jobEraseLabel(void *parm, Job *j) = 0; + virtual void jobWaitRemoveJob(void *parm, Job *j) = 0; + public: const char **_zoneFlagNamesRes; @@ -483,21 +596,54 @@ public: }; + class Parallaction_ns : public Parallaction { public: Parallaction_ns(OSystem* syst) : Parallaction(syst) { } - ~Parallaction_ns() { } + ~Parallaction_ns(); int init(); + int go(); public: typedef void (Parallaction_ns::*Callable)(void*); virtual void callFunction(uint index, void* parm); + void renderLabel(Graphics::Surface *cnv, char *text); + void setMousePointer(int16 index); + + void initJobs(); + + typedef void (Parallaction_ns::*JobFn)(void*, Job*); + + const JobFn *_jobsFn; + JobOpcode* createJobOpcode(uint functionId, Job *job); + + void loadGame(); + void saveGame(); + private: - void initResources(); + Menu* _menu; + + void initFonts(); + void freeFonts(); + +private: + void changeLocation(char *location); + void changeCharacter(const char *name); + + void doLoadGame(uint16 slot); + void doSaveGame(uint16 slot, const char* name); + int buildSaveFileList(Common::StringList& l); + int selectSaveFile(uint16 arg_0, const char* caption, const char* button); + + void initResources(); + void initCursors(); + + static byte _mouseArrow[256]; + Graphics::Surface *_mouseComposedArrow; static const Callable _dosCallables[25]; static const Callable _amigaCallables[25]; @@ -536,26 +682,266 @@ private: void _c_HBOn(void*); const Callable *_callables; + +protected: + void jobDisplayAnimations(void*, Job *j); + void jobEraseAnimations(void *arg_0, Job *j); + void jobRunScripts(void*, Job *j); + void jobDisplayDroppedItem(void*, Job *j); + void jobRemovePickedItem(void*, Job *j); + void jobToggleDoor(void*, Job *j); + void jobWalk(void*, Job *j); + void jobDisplayLabel(void *parm, Job *j); + void jobEraseLabel(void *parm, Job *j); + void jobWaitRemoveJob(void *parm, Job *j); + void jobShowInventory(void *parm, Job *j); + void jobHideInventory(void *parm, Job *j); + + // location parser + OpcodeSet _locationParsers; + OpcodeSet _locationZoneParsers; + OpcodeSet _locationAnimParsers; + OpcodeSet _commandParsers; + Table *_commandsNames; + Table *_locationStmt; + Table *_locationZoneStmt; + Table *_locationAnimStmt; + + struct LocationParserContext { + bool end; + + const char *filename; + Script *script; + Zone *z; + Animation *a; + int nextToken; + CommandList *list; + bool endcommands; + Command *cmd; + + // BRA specific + int numZones; + } _locParseCtxt; + + DECLARE_UNQUALIFIED_LOCATION_PARSER(invalid); + DECLARE_UNQUALIFIED_LOCATION_PARSER(endlocation); + DECLARE_UNQUALIFIED_LOCATION_PARSER(location); + DECLARE_UNQUALIFIED_LOCATION_PARSER(disk); + DECLARE_UNQUALIFIED_LOCATION_PARSER(nodes); + DECLARE_UNQUALIFIED_LOCATION_PARSER(zone); + DECLARE_UNQUALIFIED_LOCATION_PARSER(animation); + DECLARE_UNQUALIFIED_LOCATION_PARSER(localflags); + DECLARE_UNQUALIFIED_LOCATION_PARSER(commands); + DECLARE_UNQUALIFIED_LOCATION_PARSER(acommands); + DECLARE_UNQUALIFIED_LOCATION_PARSER(flags); + DECLARE_UNQUALIFIED_LOCATION_PARSER(comment); + DECLARE_UNQUALIFIED_LOCATION_PARSER(endcomment); + DECLARE_UNQUALIFIED_LOCATION_PARSER(sound); + DECLARE_UNQUALIFIED_LOCATION_PARSER(music); + DECLARE_UNQUALIFIED_LOCATION_PARSER(redundant); + DECLARE_UNQUALIFIED_ZONE_PARSER(invalid); + DECLARE_UNQUALIFIED_ZONE_PARSER(limits); + DECLARE_UNQUALIFIED_ZONE_PARSER(moveto); + DECLARE_UNQUALIFIED_ZONE_PARSER(type); + DECLARE_UNQUALIFIED_ZONE_PARSER(commands); + DECLARE_UNQUALIFIED_ZONE_PARSER(label); + DECLARE_UNQUALIFIED_ZONE_PARSER(flags); + DECLARE_UNQUALIFIED_ZONE_PARSER(endzone); + DECLARE_UNQUALIFIED_ANIM_PARSER(invalid); + DECLARE_UNQUALIFIED_ANIM_PARSER(script); + DECLARE_UNQUALIFIED_ANIM_PARSER(commands); + DECLARE_UNQUALIFIED_ANIM_PARSER(type); + DECLARE_UNQUALIFIED_ANIM_PARSER(label); + DECLARE_UNQUALIFIED_ANIM_PARSER(flags); + DECLARE_UNQUALIFIED_ANIM_PARSER(file); + DECLARE_UNQUALIFIED_ANIM_PARSER(position); + DECLARE_UNQUALIFIED_ANIM_PARSER(moveto); + DECLARE_UNQUALIFIED_ANIM_PARSER(endanimation); + DECLARE_UNQUALIFIED_COMMAND_PARSER(invalid); + DECLARE_UNQUALIFIED_COMMAND_PARSER(flags); + DECLARE_UNQUALIFIED_COMMAND_PARSER(animation); + DECLARE_UNQUALIFIED_COMMAND_PARSER(zone); + DECLARE_UNQUALIFIED_COMMAND_PARSER(location); + DECLARE_UNQUALIFIED_COMMAND_PARSER(drop); + DECLARE_UNQUALIFIED_COMMAND_PARSER(call); + DECLARE_UNQUALIFIED_COMMAND_PARSER(simple); + DECLARE_UNQUALIFIED_COMMAND_PARSER(move); + DECLARE_UNQUALIFIED_COMMAND_PARSER(endcommands); + + virtual void parseGetData(Script &script, Zone *z); + virtual void parseExamineData(Script &script, Zone *z); + virtual void parseDoorData(Script &script, Zone *z); + virtual void parseMergeData(Script &script, Zone *z); + virtual void parseHearData(Script &script, Zone *z); + virtual void parseSpeakData(Script &script, Zone *z); + + void parseLocation(const char *filename); + char *parseComment(Script &script); + char *parseDialogueString(Script &script); + Dialogue *parseDialogue(Script &script); + void parseZone(Script &script, ZoneList &list, char *name); + void parseZoneTypeBlock(Script &script, Zone *z); + void parseWalkNodes(Script& script, WalkNodeList &list); + Animation *parseAnimation(Script &script, AnimationList &list, char *name); + void parseCommands(Script &script, CommandList&); + void parseCommandFlags(); + void createCommand(uint id); + void addCommand(); + void initOpcodes(); + void initParsers(); + + + // program parser + OpcodeSet _instructionParsers; + Table *_instructionNames; + + struct { + bool end; + Animation *a; + Instruction *inst; + LocalVariable *locals; + Program *program; + + // BRA specific + Instruction *openIf; + } _instParseCtxt; + + DECLARE_UNQUALIFIED_INSTRUCTION_PARSER(defLocal); + DECLARE_UNQUALIFIED_INSTRUCTION_PARSER(animation); + DECLARE_UNQUALIFIED_INSTRUCTION_PARSER(loop); + DECLARE_UNQUALIFIED_INSTRUCTION_PARSER(x); + DECLARE_UNQUALIFIED_INSTRUCTION_PARSER(y); + DECLARE_UNQUALIFIED_INSTRUCTION_PARSER(z); + DECLARE_UNQUALIFIED_INSTRUCTION_PARSER(f); + DECLARE_UNQUALIFIED_INSTRUCTION_PARSER(inc); + DECLARE_UNQUALIFIED_INSTRUCTION_PARSER(set); + DECLARE_UNQUALIFIED_INSTRUCTION_PARSER(move); + DECLARE_UNQUALIFIED_INSTRUCTION_PARSER(put); + DECLARE_UNQUALIFIED_INSTRUCTION_PARSER(call); + DECLARE_UNQUALIFIED_INSTRUCTION_PARSER(sound); + DECLARE_UNQUALIFIED_INSTRUCTION_PARSER(null); + DECLARE_UNQUALIFIED_INSTRUCTION_PARSER(endscript); + + void parseInstruction(Animation *a, LocalVariable *locals); + void loadProgram(Animation *a, const char *filename); + void parseLValue(ScriptVar &var, const char *str); + virtual void parseRValue(ScriptVar &var, const char *str); + void wrapLocalVar(LocalVariable *local); + + DECLARE_UNQUALIFIED_COMMAND_OPCODE(invalid); + DECLARE_UNQUALIFIED_COMMAND_OPCODE(set); + DECLARE_UNQUALIFIED_COMMAND_OPCODE(clear); + DECLARE_UNQUALIFIED_COMMAND_OPCODE(start); + DECLARE_UNQUALIFIED_COMMAND_OPCODE(speak); + DECLARE_UNQUALIFIED_COMMAND_OPCODE(get); + DECLARE_UNQUALIFIED_COMMAND_OPCODE(location); + DECLARE_UNQUALIFIED_COMMAND_OPCODE(open); + DECLARE_UNQUALIFIED_COMMAND_OPCODE(close); + DECLARE_UNQUALIFIED_COMMAND_OPCODE(on); + DECLARE_UNQUALIFIED_COMMAND_OPCODE(off); + DECLARE_UNQUALIFIED_COMMAND_OPCODE(call); + DECLARE_UNQUALIFIED_COMMAND_OPCODE(toggle); + DECLARE_UNQUALIFIED_COMMAND_OPCODE(drop); + DECLARE_UNQUALIFIED_COMMAND_OPCODE(quit); + DECLARE_UNQUALIFIED_COMMAND_OPCODE(move); + DECLARE_UNQUALIFIED_COMMAND_OPCODE(stop); + + DECLARE_UNQUALIFIED_INSTRUCTION_OPCODE(invalid); + DECLARE_UNQUALIFIED_INSTRUCTION_OPCODE(on); + DECLARE_UNQUALIFIED_INSTRUCTION_OPCODE(off); + DECLARE_UNQUALIFIED_INSTRUCTION_OPCODE(loop); + DECLARE_UNQUALIFIED_INSTRUCTION_OPCODE(endloop); + DECLARE_UNQUALIFIED_INSTRUCTION_OPCODE(null); + DECLARE_UNQUALIFIED_INSTRUCTION_OPCODE(call); + DECLARE_UNQUALIFIED_INSTRUCTION_OPCODE(inc); + DECLARE_UNQUALIFIED_INSTRUCTION_OPCODE(set); + DECLARE_UNQUALIFIED_INSTRUCTION_OPCODE(put); + DECLARE_UNQUALIFIED_INSTRUCTION_OPCODE(wait); + DECLARE_UNQUALIFIED_INSTRUCTION_OPCODE(start); + DECLARE_UNQUALIFIED_INSTRUCTION_OPCODE(sound); + DECLARE_UNQUALIFIED_INSTRUCTION_OPCODE(move); + DECLARE_UNQUALIFIED_INSTRUCTION_OPCODE(endscript); + }; -class Parallaction_br : public Parallaction { + + +#define NUM_ZONES 100 + +class Parallaction_br : public Parallaction_ns { + + typedef Parallaction_ns Super; public: - Parallaction_br(OSystem* syst) : Parallaction(syst) { } - ~Parallaction_br() { } + Parallaction_br(OSystem* syst) : Parallaction_ns(syst) { } + ~Parallaction_br(); int init(); + int go(); public: typedef void (Parallaction_br::*Callable)(void*); virtual void callFunction(uint index, void* parm); public: + Table *_countersNames; + Table *_audioCommandsNames; const char **_audioCommandsNamesRes; + int _part; + int _progress; + + int _zeta0; + int _zeta1; + int _zeta2; + + int16 _lipSyncVal; + uint _subtitleLipSync; + + Label _subtitle0; + Label _subtitle1; + + Zone *_activeZone2; + + int32 _counters[32]; + + uint32 _zoneFlags[NUM_LOCATIONS][NUM_ZONES]; + private: void initResources(); + void initFonts(); + void freeFonts(); + void initOpcodes(); + void initParsers(); + void initJobs(); + + typedef void (Parallaction_br::*JobFn)(void*, Job*); + const JobFn *_jobsFn; + JobOpcode* createJobOpcode(uint functionId, Job *job); + + + void changeLocation(char *location); + void changeCharacter(const char *name); + + void initPart(); + void freePart(); + void startPart(); + + void setMousePointer(int16 index); + void initCursors(); + + Graphics::Surface *_dinoCursor; + Graphics::Surface *_dougCursor; + Graphics::Surface *_donnaCursor; + Graphics::Surface *_mouseArrow; + + + int showMenu(); + void renderMenuItem(Graphics::Surface &surf, const char *text); + void invertMenuItem(Graphics::Surface &surf); + + void splash(const char *name); static const Callable _dosCallables[6]; @@ -567,6 +953,130 @@ private: void _c_password(void*); const Callable *_callables; + + DECLARE_UNQUALIFIED_LOCATION_PARSER(location); + DECLARE_UNQUALIFIED_LOCATION_PARSER(zone); + DECLARE_UNQUALIFIED_LOCATION_PARSER(animation); + DECLARE_UNQUALIFIED_LOCATION_PARSER(localflags); + DECLARE_UNQUALIFIED_LOCATION_PARSER(flags); + DECLARE_UNQUALIFIED_LOCATION_PARSER(comment); + DECLARE_UNQUALIFIED_LOCATION_PARSER(endcomment); + DECLARE_UNQUALIFIED_LOCATION_PARSER(sound); + DECLARE_UNQUALIFIED_LOCATION_PARSER(music); + DECLARE_UNQUALIFIED_LOCATION_PARSER(redundant); + DECLARE_UNQUALIFIED_LOCATION_PARSER(ifchar); + DECLARE_UNQUALIFIED_LOCATION_PARSER(character); + DECLARE_UNQUALIFIED_LOCATION_PARSER(mask); + DECLARE_UNQUALIFIED_LOCATION_PARSER(path); + DECLARE_UNQUALIFIED_LOCATION_PARSER(escape); + DECLARE_UNQUALIFIED_LOCATION_PARSER(zeta); + DECLARE_UNQUALIFIED_LOCATION_PARSER(null); + DECLARE_UNQUALIFIED_COMMAND_PARSER(ifchar); + DECLARE_UNQUALIFIED_COMMAND_PARSER(endif); + DECLARE_UNQUALIFIED_COMMAND_PARSER(zone); + DECLARE_UNQUALIFIED_COMMAND_PARSER(location); + DECLARE_UNQUALIFIED_COMMAND_PARSER(toggle); + DECLARE_UNQUALIFIED_COMMAND_PARSER(string); + DECLARE_UNQUALIFIED_COMMAND_PARSER(math); + DECLARE_UNQUALIFIED_COMMAND_PARSER(test); + DECLARE_UNQUALIFIED_COMMAND_PARSER(music); + DECLARE_UNQUALIFIED_COMMAND_PARSER(zeta); + DECLARE_UNQUALIFIED_COMMAND_PARSER(swap); + DECLARE_UNQUALIFIED_COMMAND_PARSER(give); + DECLARE_UNQUALIFIED_COMMAND_PARSER(text); + DECLARE_UNQUALIFIED_COMMAND_PARSER(unary); + + void parseLocation(const char* name); + + DECLARE_UNQUALIFIED_INSTRUCTION_PARSER(zone); + DECLARE_UNQUALIFIED_INSTRUCTION_PARSER(color); + DECLARE_UNQUALIFIED_INSTRUCTION_PARSER(mask); + DECLARE_UNQUALIFIED_INSTRUCTION_PARSER(print); + DECLARE_UNQUALIFIED_INSTRUCTION_PARSER(text); + DECLARE_UNQUALIFIED_INSTRUCTION_PARSER(if_op); + DECLARE_UNQUALIFIED_INSTRUCTION_PARSER(endif); + + virtual void parseRValue(ScriptVar &var, const char *str); + + DECLARE_UNQUALIFIED_COMMAND_OPCODE(location); + DECLARE_UNQUALIFIED_COMMAND_OPCODE(open); + DECLARE_UNQUALIFIED_COMMAND_OPCODE(close); + DECLARE_UNQUALIFIED_COMMAND_OPCODE(on); + DECLARE_UNQUALIFIED_COMMAND_OPCODE(off); + DECLARE_UNQUALIFIED_COMMAND_OPCODE(call); + DECLARE_UNQUALIFIED_COMMAND_OPCODE(drop); + DECLARE_UNQUALIFIED_COMMAND_OPCODE(move); + DECLARE_UNQUALIFIED_COMMAND_OPCODE(start); + DECLARE_UNQUALIFIED_COMMAND_OPCODE(stop); + DECLARE_UNQUALIFIED_COMMAND_OPCODE(character); + DECLARE_UNQUALIFIED_COMMAND_OPCODE(followme); + DECLARE_UNQUALIFIED_COMMAND_OPCODE(onmouse); + DECLARE_UNQUALIFIED_COMMAND_OPCODE(offmouse); + DECLARE_UNQUALIFIED_COMMAND_OPCODE(add); + DECLARE_UNQUALIFIED_COMMAND_OPCODE(leave); + DECLARE_UNQUALIFIED_COMMAND_OPCODE(inc); + DECLARE_UNQUALIFIED_COMMAND_OPCODE(dec); + DECLARE_UNQUALIFIED_COMMAND_OPCODE(ifeq); + DECLARE_UNQUALIFIED_COMMAND_OPCODE(iflt); + DECLARE_UNQUALIFIED_COMMAND_OPCODE(ifgt); + DECLARE_UNQUALIFIED_COMMAND_OPCODE(let); + DECLARE_UNQUALIFIED_COMMAND_OPCODE(music); + DECLARE_UNQUALIFIED_COMMAND_OPCODE(fix); + DECLARE_UNQUALIFIED_COMMAND_OPCODE(unfix); + DECLARE_UNQUALIFIED_COMMAND_OPCODE(zeta); + DECLARE_UNQUALIFIED_COMMAND_OPCODE(scroll); + DECLARE_UNQUALIFIED_COMMAND_OPCODE(swap); + DECLARE_UNQUALIFIED_COMMAND_OPCODE(give); + DECLARE_UNQUALIFIED_COMMAND_OPCODE(text); + DECLARE_UNQUALIFIED_COMMAND_OPCODE(part); + DECLARE_UNQUALIFIED_COMMAND_OPCODE(testsfx); + DECLARE_UNQUALIFIED_COMMAND_OPCODE(ret); + DECLARE_UNQUALIFIED_COMMAND_OPCODE(onsave); + DECLARE_UNQUALIFIED_COMMAND_OPCODE(offsave); + DECLARE_UNQUALIFIED_ZONE_PARSER(limits); + DECLARE_UNQUALIFIED_ZONE_PARSER(moveto); + DECLARE_UNQUALIFIED_ZONE_PARSER(type); + DECLARE_UNQUALIFIED_ANIM_PARSER(file); + DECLARE_UNQUALIFIED_ANIM_PARSER(position); + DECLARE_UNQUALIFIED_ANIM_PARSER(moveto); + DECLARE_UNQUALIFIED_ANIM_PARSER(endanimation); + + DECLARE_UNQUALIFIED_INSTRUCTION_OPCODE(on); + DECLARE_UNQUALIFIED_INSTRUCTION_OPCODE(off); + DECLARE_UNQUALIFIED_INSTRUCTION_OPCODE(loop); + DECLARE_UNQUALIFIED_INSTRUCTION_OPCODE(inc); + DECLARE_UNQUALIFIED_INSTRUCTION_OPCODE(dec); + DECLARE_UNQUALIFIED_INSTRUCTION_OPCODE(set); + DECLARE_UNQUALIFIED_INSTRUCTION_OPCODE(put); + DECLARE_UNQUALIFIED_INSTRUCTION_OPCODE(wait); + DECLARE_UNQUALIFIED_INSTRUCTION_OPCODE(start); + DECLARE_UNQUALIFIED_INSTRUCTION_OPCODE(process); + DECLARE_UNQUALIFIED_INSTRUCTION_OPCODE(move); + DECLARE_UNQUALIFIED_INSTRUCTION_OPCODE(color); + DECLARE_UNQUALIFIED_INSTRUCTION_OPCODE(mask); + DECLARE_UNQUALIFIED_INSTRUCTION_OPCODE(print); + DECLARE_UNQUALIFIED_INSTRUCTION_OPCODE(text); + DECLARE_UNQUALIFIED_INSTRUCTION_OPCODE(mul); + DECLARE_UNQUALIFIED_INSTRUCTION_OPCODE(div); + DECLARE_UNQUALIFIED_INSTRUCTION_OPCODE(ifeq); + DECLARE_UNQUALIFIED_INSTRUCTION_OPCODE(iflt); + DECLARE_UNQUALIFIED_INSTRUCTION_OPCODE(ifgt); + DECLARE_UNQUALIFIED_INSTRUCTION_OPCODE(endif); + DECLARE_UNQUALIFIED_INSTRUCTION_OPCODE(stop); + DECLARE_UNQUALIFIED_INSTRUCTION_OPCODE(endscript); + + Job *_jDisplaySubtitle; + Job *_jEraseSubtitle; + void setupSubtitles(char *s, char *s2, int y); + + void jobWaitRemoveLabelJob(void *parm, Job *job); + void jobDisplaySubtitle(void *parm, Job *job); + void jobEraseSubtitle(void *parm, Job *job); + void jobWaitRemoveSubtitleJob(void *parm, Job *job); + void jobPauseSfx(void *parm, Job *job); + void jobStopFollower(void *parm, Job *job); + void jobScroll(void *parm, Job *job); + }; // FIXME: remove global diff --git a/engines/parallaction/parallaction_br.cpp b/engines/parallaction/parallaction_br.cpp index 7dcc94d7c6..f2b9626ead 100644 --- a/engines/parallaction/parallaction_br.cpp +++ b/engines/parallaction/parallaction_br.cpp @@ -24,11 +24,39 @@ */ #include "common/stdafx.h" +#include "common/system.h" + #include "parallaction/parallaction.h" #include "parallaction/sound.h" namespace Parallaction { +enum MenuOptions { + kMenuPart0 = 0, + kMenuPart1 = 1, + kMenuPart2 = 2, + kMenuPart3 = 3, + kMenuPart4 = 4, + kMenuLoadGame = 5, + kMenuQuit = 6 +}; + +const char *partNames[] = { + "PART0", + "PART1", + "PART2", + "PART3", + "PART4" +}; + +const char *partFirstLocation[] = { + "intro", + "museo", + "start", + "bolscoi", + "treno" +}; + int Parallaction_br::init() { // Detect game @@ -43,6 +71,7 @@ int Parallaction_br::init() { if (getGameType() == GType_BRA) { if (getPlatform() == Common::kPlatformPC) { _disk = new DosDisk_br(this); + _disk->setLanguage(2); // NOTE: language is now hardcoded to English. Original used command-line parameters. } else error("unsupported platform for Big Red Adventure"); } else @@ -50,17 +79,311 @@ int Parallaction_br::init() { _soundMan = new DummySoundMan(this); + _activeZone2 = 0; + + initJobs(); initResources(); + initFonts(); + initCursors(); + initOpcodes(); + initParsers(); + + _part = -1; Parallaction::init(); return 0; } +Parallaction_br::~Parallaction_br() { + freeFonts(); + + _dinoCursor->free(); + _dougCursor->free(); + _donnaCursor->free(); + + delete _dinoCursor; + delete _dougCursor; + delete _donnaCursor; + +} + void Parallaction_br::callFunction(uint index, void* parm) { assert(index < 6); // magic value 6 is maximum # of callables for Big Red Adventure (this->*_callables[index])(parm); } +int Parallaction_br::go() { + splash("dyna"); + splash("core"); + + // TODO: load progress value from special save game + _progress = 3; + + while ((_engineFlags & kEngineQuit) == 0) { + +// initCharacter(); + + int option = showMenu(); + switch (option) { + case kMenuQuit: + _engineFlags |= kEngineQuit; + break; + + case kMenuLoadGame: + warning("loadgame not yet implemented"); + break; + + default: + _part = option; + _disk->selectArchive(partNames[_part]); + startPart(); + break; + } + + + runGame(); + + freePart(); +// freeLocation(); +// freeCharacter(); + + } + + return 0; +} + +void Parallaction_br::splash(const char *name) { + + BackgroundInfo info; + + _gfx->clearScreen(Gfx::kBitFront); + + _disk->loadSlide(info, name); + _gfx->setPalette(info.palette); + _gfx->flatBlitCnv(&info.bg, (640 - info.width) >> 1, (400 - info.height) >> 1, Gfx::kBitFront); + _gfx->updateScreen(); + _system->delayMillis(600); + + Palette pal; + for (uint i = 0; i < 64; i++) { + info.palette.fadeTo(pal, 1); + _gfx->setPalette(info.palette); + _gfx->updateScreen(); + _system->delayMillis(20); + } + info.bg.free(); + + return; +} + +#define MENUITEMS_X 250 +#define MENUITEMS_Y 200 + +#define MENUITEM_WIDTH 190 +#define MENUITEM_HEIGHT 18 + +void Parallaction_br::renderMenuItem(Graphics::Surface &surf, const char *text) { + surf.create(MENUITEM_WIDTH, MENUITEM_HEIGHT, 1); + _menuFont->setColor(0); + _menuFont->drawString((byte*)surf.getBasePtr(5, 2), MENUITEM_WIDTH, text); +} + +void Parallaction_br::invertMenuItem(Graphics::Surface &surf) { + for (int i = 0; i < surf.w * surf.h; i++) + ((byte*)surf.pixels)[i] ^= 0xD; +} + +int Parallaction_br::showMenu() { + // TODO: filter menu entries according to progress in game + + _gfx->clearScreen(Gfx::kBitFront); + + BackgroundInfo info; + + Graphics::Surface _menuItems[7]; + + const char *menuStrings[7] = { + "SEE INTRO", + "NEW GAME", + "SAVED GAME", + "EXIT TO DOS", + "PART 2", + "PART 3", + "PART 4" + }; + + MenuOptions options[7] = { + kMenuPart0, + kMenuPart1, + kMenuLoadGame, + kMenuQuit, + kMenuPart2, + kMenuPart3, + kMenuPart4 + }; + + _disk->loadSlide(info, "tbra"); + _gfx->setPalette(info.palette); + _gfx->flatBlitCnv(&info.bg, 20, 50, Gfx::kBitFront); + + int availItems = 4 + _progress; + + for (int i = 0; i < availItems; i++) + renderMenuItem(_menuItems[i], menuStrings[i]); + + int selectedItem = -1, oldSelectedItem = -2; + + setMousePointer(0); + + while (true) { + + if ((_mouseButtons == kMouseLeftUp) && selectedItem >= 0) + break; + + updateInput(); + + if ((_mousePos.x > MENUITEMS_X) && (_mousePos.x < (MENUITEMS_X+MENUITEM_WIDTH)) && (_mousePos.y > MENUITEMS_Y)) { + selectedItem = (_mousePos.y - MENUITEMS_Y) / MENUITEM_HEIGHT; + + if (!(selectedItem < availItems)) + selectedItem = -1; + } else + selectedItem = -1; + + + if (selectedItem != oldSelectedItem) { + + if (selectedItem >= 0 && selectedItem < availItems) + invertMenuItem(_menuItems[selectedItem]); + + if (oldSelectedItem >= 0 && oldSelectedItem < availItems) + invertMenuItem(_menuItems[oldSelectedItem]); + + Common::Rect r(MENUITEM_WIDTH, MENUITEM_HEIGHT); + + for (int i = 0; i < availItems; i++) { + r.moveTo(MENUITEMS_X, MENUITEMS_Y + i * 20); + _gfx->copyRect(Gfx::kBitFront, r, (byte*)_menuItems[i].pixels, _menuItems[i].pitch); + } + + oldSelectedItem = selectedItem; + } + + _gfx->updateScreen(); + _system->delayMillis(20); + } + + _system->showMouse(false); + + info.bg.free(); + + for (int i = 0; i < availItems; i++) + _menuItems[i].free(); + + return options[selectedItem]; +} + + +void Parallaction_br::initFonts() { + + _menuFont = _disk->loadFont("russia"); + _dialogueFont = _disk->loadFont("comic"); + _labelFont = _menuFont; + +} + +void Parallaction_br::freeFonts() { + + delete _menuFont; + delete _dialogueFont; + + return; +} + +void Parallaction_br::initCursors() { + + _dinoCursor = _disk->loadPointer("pointer1"); + _dougCursor = _disk->loadPointer("pointer2"); + _donnaCursor = _disk->loadPointer("pointer3"); + + _mouseArrow = _donnaCursor; + +} + +void Parallaction_br::setMousePointer(int16 index) { + + _system->setMouseCursor((byte*)_mouseArrow->pixels, _mouseArrow->w, _mouseArrow->h, 0, 0, 0); + _system->showMouse(true); + +} + +void Parallaction_br::initPart() { + + memset(_counters, 0, ARRAYSIZE(_counters)); + + _globalTable = _disk->loadTable("global"); + _objectsNames = _disk->loadTable("objects"); + _countersNames = _disk->loadTable("counters"); + +// _disk->loadObjects("icone.ico"); + +} + +void Parallaction_br::freePart() { + + delete _globalTable; + delete _objectsNames; + delete _countersNames; + +} + +void Parallaction_br::startPart() { + + initPart(); + + strcpy(_location._name, partFirstLocation[_part]); + + parseLocation("common"); + parseLocation(_location._name); + +} + +void Parallaction_br::changeLocation(char *location) { + +} + +void Parallaction_br::changeCharacter(const char *name) { + +} + +void Parallaction_br::initJobs() { + + static const JobFn jobs[] = { + &Parallaction_br::jobDisplayAnimations, + &Parallaction_br::jobEraseAnimations, + &Parallaction_br::jobDisplayDroppedItem, + &Parallaction_br::jobRemovePickedItem, + &Parallaction_br::jobRunScripts, + &Parallaction_br::jobWalk, + &Parallaction_br::jobDisplayLabel, + &Parallaction_br::jobEraseLabel, + &Parallaction_br::jobWaitRemoveLabelJob, + &Parallaction_br::jobToggleDoor, + &Parallaction_br::jobEraseSubtitle, + &Parallaction_br::jobDisplaySubtitle, + &Parallaction_br::jobWaitRemoveSubtitleJob, + &Parallaction_br::jobPauseSfx, + &Parallaction_br::jobStopFollower, + &Parallaction_br::jobScroll + }; + + _jobsFn = jobs; +} + +JobOpcode* Parallaction_br::createJobOpcode(uint functionId, Job *job) { + return new OpcodeImpl2<Parallaction_br>(this, _jobsFn[functionId], job); +} + } // namespace Parallaction diff --git a/engines/parallaction/parallaction_ns.cpp b/engines/parallaction/parallaction_ns.cpp index 947cb22a7f..46161c5021 100644 --- a/engines/parallaction/parallaction_ns.cpp +++ b/engines/parallaction/parallaction_ns.cpp @@ -24,13 +24,23 @@ */ #include "common/stdafx.h" +#include "common/system.h" + #include "common/config-manager.h" #include "parallaction/parallaction.h" #include "parallaction/sound.h" +#include "parallaction/menu.h" + namespace Parallaction { +#define MOUSEARROW_WIDTH 16 +#define MOUSEARROW_HEIGHT 16 + +#define MOUSECOMBO_WIDTH 32 // sizes for cursor + selected inventory item +#define MOUSECOMBO_HEIGHT 32 + int Parallaction_ns::init() { // Detect game @@ -61,13 +71,103 @@ int Parallaction_ns::init() { _soundMan = new AmigaSoundMan(this); } + initJobs(); initResources(); + initFonts(); + initCursors(); + initOpcodes(); + initParsers(); Parallaction::init(); return 0; } +Parallaction_ns::~Parallaction_ns() { + freeFonts(); + + _mouseComposedArrow->free(); + delete _mouseComposedArrow; + + + delete _commandsNames; + delete _instructionNames; + delete _locationStmt; + +} + + +void Parallaction_ns::freeFonts() { + + delete _dialogueFont; + delete _labelFont; + delete _menuFont; + + return; +} + +void Parallaction_ns::renderLabel(Graphics::Surface *cnv, char *text) { + + if (getPlatform() == Common::kPlatformAmiga) { + cnv->create(_labelFont->getStringWidth(text) + 16, 10, 1); + + _labelFont->setColor(7); + _labelFont->drawString((byte*)cnv->pixels + 1, cnv->w, text); + _labelFont->drawString((byte*)cnv->pixels + 1 + cnv->w * 2, cnv->w, text); + _labelFont->drawString((byte*)cnv->pixels + cnv->w, cnv->w, text); + _labelFont->drawString((byte*)cnv->pixels + 2 + cnv->w, cnv->w, text); + _labelFont->setColor(1); + _labelFont->drawString((byte*)cnv->pixels + 1 + cnv->w, cnv->w, text); + } else { + cnv->create(_labelFont->getStringWidth(text), _labelFont->height(), 1); + _labelFont->drawString((byte*)cnv->pixels, cnv->w, text); + } + +} + +void Parallaction_ns::initCursors() { + + _mouseComposedArrow = _disk->loadPointer("pointer"); + + byte temp[MOUSEARROW_WIDTH*MOUSEARROW_HEIGHT]; + memcpy(temp, _mouseArrow, MOUSEARROW_WIDTH*MOUSEARROW_HEIGHT); + + uint16 k = 0; + for (uint16 i = 0; i < 4; i++) { + for (uint16 j = 0; j < 64; j++) _mouseArrow[k++] = temp[i + j * 4]; + } + + return; +} + +void Parallaction_ns::setMousePointer(int16 index) { + + if (index == kCursorArrow) { // standard mouse pointer + + _system->setMouseCursor(_mouseArrow, MOUSEARROW_WIDTH, MOUSEARROW_HEIGHT, 0, 0, 0); + _system->showMouse(true); + + } else { + // inventory item pointer + byte *v8 = (byte*)_mouseComposedArrow->pixels; + + // FIXME: destination offseting is not clear + byte* s = _char._objs->getData(getInventoryItemIndex(index)); + byte* d = v8 + 7 + MOUSECOMBO_WIDTH * 7; + + for (uint i = 0; i < INVENTORYITEM_HEIGHT; i++) { + memcpy(d, s, INVENTORYITEM_WIDTH); + + s += INVENTORYITEM_PITCH; + d += MOUSECOMBO_WIDTH; + } + + _system->setMouseCursor(v8, MOUSECOMBO_WIDTH, MOUSECOMBO_HEIGHT, 0, 0, 0); + } + + return; +} + void Parallaction_ns::callFunction(uint index, void* parm) { assert(index < 25); // magic value 25 is maximum # of callables for Nippon Safes @@ -75,4 +175,232 @@ void Parallaction_ns::callFunction(uint index, void* parm) { } +int Parallaction_ns::go() { + + _menu = new Menu(this); + _menu->start(); + + char *v4 = strchr(_location._name, '.'); + if (v4) { + *v4 = '\0'; + } + + _globalTable = _disk->loadTable("global"); + + _engineFlags &= ~kEngineChangeLocation; + changeCharacter(_characterName); + + strcpy(_saveData1, _location._name); + parseLocation(_location._name); + + if (_location._startPosition.x != -1000) { + _char._ani._left = _location._startPosition.x; + _char._ani._top = _location._startPosition.y; + _char._ani._frame = _location._startFrame; + _location._startPosition.y = -1000; + _location._startPosition.x = -1000; + }; + + runGame(); + + delete _menu; + + return 0; +} + + +/* + changeLocation handles transitions between locations, and is able to display slides + between one and the other. The input parameter 'location' exists in some flavours: + + 1 - [S].slide.[L]{.[C]} + 2 - [L]{.[C]} + + where: + + [S] is the slide to be shown + [L] is the location to switch to (immediately in case 2, or right after slide [S] in case 1) + [C] is the character to be selected, and is optional + + The routine tells one form from the other by searching for the '.slide.' + + NOTE: there exists one script in which [L] is not used in the case 1, but its use + is commented out, and would definitely crash the current implementation. +*/ +void Parallaction_ns::changeLocation(char *location) { + debugC(1, kDebugExec, "changeLocation(%s)", location); + + _soundMan->playLocationMusic(location); + + // WORKAROUND: this hideLabel has been added to avoid crashes caused by + // execution of label jobs after a location switch. The other workaround in + // Parallaction::runGame should have been rendered useless by this one. + hideLabel(kPriority99); + + _hoverZone = NULL; + if (_engineFlags & kEngineBlockInput) { + changeCursor( kCursorArrow ); + } + + _animations.remove(&_char._ani); + + freeLocation(); + char buf[100]; + strcpy(buf, location); + + Common::StringList list; + char *tok = strtok(location, "."); + while (tok) { + list.push_back(tok); + tok = strtok(NULL, "."); + } + + if (list.size() < 1 || list.size() > 4) + error("changeLocation: ill-formed location string '%s'", location); + + if (list.size() > 1) { + if (list[1] == "slide") { + showSlide(list[0].c_str()); + _gfx->setFont(_menuFont); + _gfx->displayCenteredString(14, _slideText[0]); // displays text on screen + _gfx->updateScreen(); + waitUntilLeftClick(); + + list.remove_at(0); // removes slide name + list.remove_at(0); // removes 'slide' + } + + // list is now only [L].{[C]} (see above comment) + if (list.size() == 2) { + changeCharacter(list[1].c_str()); + strcpy(_characterName, list[1].c_str()); + } + } + + _animations.push_front(&_char._ani); + + strcpy(_saveData1, list[0].c_str()); + parseLocation(list[0].c_str()); + + _char._ani._oldPos.x = -1000; + _char._ani._oldPos.y = -1000; + + _char._ani.field_50 = 0; + if (_location._startPosition.x != -1000) { + _char._ani._left = _location._startPosition.x; + _char._ani._top = _location._startPosition.y; + _char._ani._frame = _location._startFrame; + _location._startPosition.y = -1000; + _location._startPosition.x = -1000; + } + + + _gfx->copyScreen(Gfx::kBitBack, Gfx::kBitFront); + _gfx->copyScreen(Gfx::kBitBack, Gfx::kBit2); + _gfx->setBlackPalette(); + _gfx->updateScreen(); + + if (_location._commands.size() > 0) { + runCommands(_location._commands); + runJobs(); + _gfx->swapBuffers(); + runJobs(); + _gfx->swapBuffers(); + } + + if (_location._comment) { + doLocationEnterTransition(); + } + + runJobs(); + _gfx->swapBuffers(); + + _gfx->setPalette(_gfx->_palette); + if (_location._aCommands.size() > 0) { + runCommands(_location._aCommands); + } + + if (_hasLocationSound) + _soundMan->playSfx(_locationSound, 0, true); + + debugC(1, kDebugExec, "changeLocation() done"); + + return; + +} + +void Parallaction_ns::changeCharacter(const char *name) { + debugC(1, kDebugExec, "changeCharacter(%s)", name); + + char baseName[20]; + if (IS_MINI_CHARACTER(name)) { + strcpy(baseName, name+4); + } else { + strcpy(baseName, name); + } + + char fullName[20]; + strcpy(fullName, name); + if (_engineFlags & kEngineTransformedDonna) + strcat(fullName, "tras"); + + if (scumm_stricmp(fullName, _characterName1)) { + + // freeCharacter takes responsibility for checking + // character for sanity before memory is freed + freeCharacter(); + + Common::String oldArchive = _disk->selectArchive((getFeatures() & GF_LANG_MULT) ? "disk1" : "disk0"); + _char._ani._cnv = _disk->loadFrames(fullName); + + if (!IS_DUMMY_CHARACTER(name)) { + if (getPlatform() == Common::kPlatformAmiga && (getFeatures() & GF_LANG_MULT)) + _disk->selectArchive("disk0"); + + _char._head = _disk->loadHead(baseName); + _char._talk = _disk->loadTalk(baseName); + _char._objs = _disk->loadObjects(baseName); + _objectsNames = _disk->loadTable(baseName); + + _soundMan->playCharacterMusic(name); + + if (!(getFeatures() & GF_DEMO)) + parseLocation("common"); + } + + if (!oldArchive.empty()) + _disk->selectArchive(oldArchive); + } + + strcpy(_characterName1, fullName); + + debugC(1, kDebugExec, "changeCharacter() done"); + + return; +} + +void Parallaction_ns::initJobs() { + + static const JobFn jobs[] = { + &Parallaction_ns::jobDisplayAnimations, + &Parallaction_ns::jobEraseAnimations, + &Parallaction_ns::jobDisplayDroppedItem, + &Parallaction_ns::jobRemovePickedItem, + &Parallaction_ns::jobRunScripts, + &Parallaction_ns::jobWalk, + &Parallaction_ns::jobDisplayLabel, + &Parallaction_ns::jobEraseLabel, + &Parallaction_ns::jobWaitRemoveJob, + &Parallaction_ns::jobToggleDoor, + &Parallaction_ns::jobShowInventory, + &Parallaction_ns::jobHideInventory + }; + + _jobsFn = jobs; +} + +JobOpcode* Parallaction_ns::createJobOpcode(uint functionId, Job *job) { + return new OpcodeImpl2<Parallaction_ns>(this, _jobsFn[functionId], job); +} + } // namespace Parallaction diff --git a/engines/parallaction/parser.cpp b/engines/parallaction/parser.cpp index 44aae6c1cc..dfda083392 100644 --- a/engines/parallaction/parser.cpp +++ b/engines/parallaction/parser.cpp @@ -48,7 +48,7 @@ char *Script::readLine(char *buf, size_t bufSize) { v2 = _input->readSByte(); - if (v2 == 0xA || _input->eos()) break; + if (v2 == 0xA || v2 == 0xD || _input->eos()) break; if (!_input->eos() && _si < bufSize) buf[_si] = v2; } @@ -82,34 +82,6 @@ void Script::seek(int32 offset, int whence) { error("seek not supported on Script streams"); } -// -// a comment can appear both at location and Zone levels -// comments are displayed into rectangles on the screen -// -char *Parallaction::parseComment(Script &script) { - - char _tmp_comment[1000] = "\0"; - char *v194; - - do { - char v190[400]; - v194 = script.readLine(v190, 400); - - v194[strlen(v194)-1] = '\0'; - if (!scumm_stricmp(v194, "endtext")) - break; - - strcat(_tmp_comment, v194); - strcat(_tmp_comment, " "); - } while (true); - - v194 = (char*)malloc(strlen(_tmp_comment)+1); - strcpy(v194, _tmp_comment); - _tmp_comment[0] = '\0'; - - return v194; -} - void clearTokens() { for (uint16 i = 0; i < 20; i++) @@ -119,6 +91,14 @@ void clearTokens() { } +void skip(Script* script, const char* endToken) { + + while (scumm_stricmp(_tokens[0], endToken)) { + fillBuffers(*script, true); + } + +} + // // Scans 's' until one of the stop-chars in 'brk' is found, building a token. // If the routine encounters quotes, it will extract the contained text and diff --git a/engines/parallaction/parser.h b/engines/parallaction/parser.h index aa3929a52c..3d1b32ec3a 100644 --- a/engines/parallaction/parser.h +++ b/engines/parallaction/parser.h @@ -57,6 +57,9 @@ public: void seek(int32 offset, int whence = SEEK_SET); }; +void skip(Script* script, const char* endToken); + + } // namespace Parallaction #endif diff --git a/engines/parallaction/parser_br.cpp b/engines/parallaction/parser_br.cpp new file mode 100644 index 0000000000..94f5b0d790 --- /dev/null +++ b/engines/parallaction/parser_br.cpp @@ -0,0 +1,935 @@ +#include "common/stdafx.h" + +#include "parallaction/parallaction.h" +#include "parallaction/sound.h" + +namespace Parallaction { + +#define CMD_SET 1 +#define CMD_CLEAR 2 +#define CMD_START 3 +#define CMD_SPEAK 4 +#define CMD_GET 5 +#define CMD_LOCATION 6 +#define CMD_OPEN 7 +#define CMD_CLOSE 8 +#define CMD_ON 9 +#define CMD_OFF 10 +#define CMD_CALL 11 +#define CMD_TOGGLE 12 +#define CMD_DROP 13 +#define CMD_QUIT 14 +#define CMD_MOVE 15 +#define CMD_STOP 16 +#define CMD_CHARACTER 17 +#define CMD_FOLLOWME 18 +#define CMD_ONMOUSE 19 +#define CMD_OFFMOUSE 20 +#define CMD_ADD 21 +#define CMD_LEAVE 22 +#define CMD_INC 23 +#define CMD_DEC 24 +#define CMD_TEST 25 +#define CMD_TEST_GT 26 +#define CMD_TEST_LT 27 +#define CMD_LET 28 +#define CMD_MUSIC 29 +#define CMD_FIX 30 +#define CMD_UNFIX 31 +#define CMD_ZETA 32 +#define CMD_SCROLL 33 +#define CMD_SWAP 34 +#define CMD_GIVE 35 +#define CMD_TEXT 36 +#define CMD_PART 37 +#define CMD_TEST_SFX 38 +#define CMD_RETURN 39 +#define CMD_ONSAVE 40 +#define CMD_OFFSAVE 41 + + +#define INST_ON 1 +#define INST_OFF 2 +#define INST_X 3 +#define INST_Y 4 +#define INST_Z 5 +#define INST_F 6 +#define INST_LOOP 7 +#define INST_ENDLOOP 8 +#define INST_SHOW 9 +#define INST_INC 10 +#define INST_DEC 11 +#define INST_SET 12 +#define INST_PUT 13 +#define INST_CALL 14 +#define INST_WAIT 15 +#define INST_START 16 +#define INST_PROCESS 17 +#define INST_MOVE 18 +#define INST_COLOR 19 +#define INST_SOUND 20 +#define INST_MASK 21 +#define INST_PRINT 22 +#define INST_TEXT 23 +#define INST_MUL 24 +#define INST_DIV 25 +#define INST_IF 26 +#define INST_IFEQ 27 +#define INST_IFLT 28 +#define INST_IFGT 29 +#define INST_ENDIF 30 +#define INST_STOP 31 + +#define DECLARE_ZONE_PARSER(sig) void Parallaction_br::locZoneParse_##sig() +#define DECLARE_ANIM_PARSER(sig) void Parallaction_br::locAnimParse_##sig() +#define DECLARE_COMMAND_PARSER(sig) void Parallaction_br::cmdParse_##sig() +#define DECLARE_INSTRUCTION_PARSER(sig) void Parallaction_br::instParse_##sig() +#define DECLARE_LOCATION_PARSER(sig) void Parallaction_br::locParse_##sig() + + +DECLARE_LOCATION_PARSER(location) { + debugC(7, kDebugParser, "LOCATION_PARSER(location) "); + + strcpy(_location._name, _tokens[1]); + + bool flip = false; + int nextToken; + + if (!scumm_stricmp("flip", _tokens[2])) { + flip = true; + nextToken = 3; + } else { + nextToken = 2; + } + + _disk->loadScenery(*_backgroundInfo, _location._name, NULL, NULL); + +// if (flip) { +// flip(); +// } + + _gfx->setBackground(&_backgroundInfo->bg); + _gfx->_palette.clone(_backgroundInfo->palette); + _gfx->setPalette(_backgroundInfo->palette); + + + if (_tokens[nextToken][0] != '\0') { + _char._ani._left = atoi(_tokens[nextToken]); + nextToken++; + _char._ani._top = atoi(_tokens[nextToken]); + nextToken++; + } + + if (_tokens[nextToken][0] != '\0') { + _char._ani._frame = atoi(_tokens[nextToken]); + } +} + + + +DECLARE_LOCATION_PARSER(zone) { + debugC(7, kDebugParser, "LOCATION_PARSER(zone) "); + + parseZone(*_locParseCtxt.script, _zones, _tokens[1]); + + _locParseCtxt.z->_index = _locParseCtxt.numZones++; + + if (_localFlags[_currentLocationIndex] & kFlagsVisited) { + _locParseCtxt.z->_flags = _zoneFlags[_currentLocationIndex][_locParseCtxt.z->_index]; + } else { + _zoneFlags[_currentLocationIndex][_locParseCtxt.z->_index] = _locParseCtxt.z->_flags; + } + +} + + +DECLARE_LOCATION_PARSER(animation) { + debugC(7, kDebugParser, "LOCATION_PARSER(animation) "); + + parseAnimation(*_locParseCtxt.script, _animations, _tokens[1]); + + _locParseCtxt.a->_index = _locParseCtxt.numZones++; + + if (_localFlags[_currentLocationIndex] & kFlagsVisited) { + _locParseCtxt.a->_flags = _zoneFlags[_currentLocationIndex][_locParseCtxt.a->_index]; + } else { + _zoneFlags[_currentLocationIndex][_locParseCtxt.a->_index] = _locParseCtxt.a->_flags; + } + +} + + +DECLARE_LOCATION_PARSER(localflags) { + debugC(7, kDebugParser, "LOCATION_PARSER(localflags) "); + + int _si = 1; + while (_tokens[_si][0] != '\0') { + _localFlagNames->addData(_tokens[_si]); + _si++; + } +} + + +DECLARE_LOCATION_PARSER(flags) { + debugC(7, kDebugParser, "LOCATION_PARSER(flags) "); + + if ((_localFlags[_currentLocationIndex] & kFlagsVisited) == 0) { + // only for 1st visit + _localFlags[_currentLocationIndex] = 0; + int _si = 1; + + do { + byte _al = _localFlagNames->lookup(_tokens[_si]); + _localFlags[_currentLocationIndex] |= 1 << (_al - 1); + + _si++; + if (scumm_stricmp(_tokens[_si], "|")) break; + _si++; + } while (true); + } +} + + +DECLARE_LOCATION_PARSER(comment) { + debugC(7, kDebugParser, "LOCATION_PARSER(comment) "); + + _location._comment = parseComment(*_locParseCtxt.script); +} + + +DECLARE_LOCATION_PARSER(endcomment) { + debugC(7, kDebugParser, "LOCATION_PARSER(endcomment) "); + + _location._endComment = parseComment(*_locParseCtxt.script); +} + + +DECLARE_LOCATION_PARSER(sound) { + debugC(7, kDebugParser, "LOCATION_PARSER(sound) "); + +// _soundMan->loadSound(_tokens[1]); +} + + +DECLARE_LOCATION_PARSER(music) { + debugC(7, kDebugParser, "LOCATION_PARSER(music) "); + +// _soundMan->loadMusic(_tokens[1]); +} + +DECLARE_LOCATION_PARSER(redundant) { + debugC(7, kDebugParser, "LOCATION_PARSER(redundant) "); + + warning("redundant '%s' line found in script '%s'", _tokens[0], _locParseCtxt.filename); +} + + +DECLARE_LOCATION_PARSER(character) { + debugC(7, kDebugParser, "LOCATION_PARSER(character) "); + +// changeCharacter(character); +} + + +DECLARE_LOCATION_PARSER(ifchar) { + debugC(7, kDebugParser, "LOCATION_PARSER(ifchar) "); + + skip(_locParseCtxt.script, "ENDIF"); +} + + +DECLARE_LOCATION_PARSER(null) { + debugC(7, kDebugParser, "LOCATION_PARSER(null) "); + + +} + + +DECLARE_LOCATION_PARSER(mask) { + debugC(7, kDebugParser, "LOCATION_PARSER(mask) "); + + _disk->loadScenery(*_backgroundInfo, NULL, _tokens[1], NULL); + _gfx->setMask(&_backgroundInfo->mask); + + _gfx->_bgLayers[0] = atoi(_tokens[2]); + _gfx->_bgLayers[1] = atoi(_tokens[3]); + _gfx->_bgLayers[2] = atoi(_tokens[4]); +} + + +DECLARE_LOCATION_PARSER(path) { + debugC(7, kDebugParser, "LOCATION_PARSER(path) "); + + _disk->loadScenery(*_backgroundInfo, NULL, NULL, _tokens[1]); + _pathBuffer = &_backgroundInfo->path; +} + + +DECLARE_LOCATION_PARSER(escape) { + debugC(7, kDebugParser, "LOCATION_PARSER(escape) "); + + parseCommands(*_locParseCtxt.script, _location._escapeCommands); +} + + +DECLARE_LOCATION_PARSER(zeta) { + debugC(7, kDebugParser, "LOCATION_PARSER(zeta) "); + + _zeta0 = atoi(_tokens[1]); + _zeta1 = atoi(_tokens[2]); + + if (_tokens[3][0] != '\0') { + _zeta2 = atoi(_tokens[1]); + } else { + _zeta2 = 50; + } +} + +DECLARE_COMMAND_PARSER(ifchar) { + debugC(7, kDebugParser, "COMMAND_PARSER(ifchar) "); + + if (!scumm_stricmp(_characterName, _tokens[1])) + skip(_locParseCtxt.script, "endif"); +} + + +DECLARE_COMMAND_PARSER(endif) { + debugC(7, kDebugParser, "COMMAND_PARSER(endif) "); + + +} + + +DECLARE_COMMAND_PARSER(location) { + debugC(7, kDebugParser, "COMMAND_PARSER(location) "); + + createCommand(_lookup); + + _locParseCtxt.cmd->u._string = strdup(_tokens[1]); + _locParseCtxt.nextToken++; + + if (_tokens[_locParseCtxt.nextToken][0] != '\0') { + _locParseCtxt.cmd->u._startPos.x = atoi(_tokens[_locParseCtxt.nextToken]); + _locParseCtxt.nextToken++; + _locParseCtxt.cmd->u._startPos.y = atoi(_tokens[_locParseCtxt.nextToken]); + _locParseCtxt.nextToken++; + } + + if (_tokens[_locParseCtxt.nextToken][0] != '\0') { + _locParseCtxt.cmd->u._startPos2.x = atoi(_tokens[_locParseCtxt.nextToken]); + _locParseCtxt.nextToken++; + _locParseCtxt.cmd->u._startPos2.y = atoi(_tokens[_locParseCtxt.nextToken]); + _locParseCtxt.nextToken++; + } + + parseCommandFlags(); + addCommand(); +} + + +DECLARE_COMMAND_PARSER(string) { + debugC(7, kDebugParser, "COMMAND_PARSER(string) "); + + createCommand(_lookup); + + _locParseCtxt.cmd->u._string = strdup(_tokens[1]); + _locParseCtxt.nextToken++; + + parseCommandFlags(); + addCommand(); +} + +DECLARE_COMMAND_PARSER(math) { + debugC(7, kDebugParser, "COMMAND_PARSER(math) "); + + createCommand(_lookup); + + _locParseCtxt.cmd->u._lvalue = _countersNames->lookup(_tokens[1]); + _locParseCtxt.nextToken++; + _locParseCtxt.cmd->u._rvalue = atoi(_tokens[2]); + _locParseCtxt.nextToken++; + + parseCommandFlags(); + addCommand(); +} + + +DECLARE_COMMAND_PARSER(test) { + debugC(7, kDebugParser, "COMMAND_PARSER(test) "); + + createCommand(_lookup); + + uint counter = _countersNames->lookup(_tokens[1]); + _locParseCtxt.nextToken++; + + if (counter == Table::notFound) { + if (!scumm_stricmp("SFX", _tokens[1])) { + _locParseCtxt.cmd->_id = CMD_TEST_SFX; + } else { + error("unknown counter '%s' in test opcode", _tokens[1]); + } + } else { + _locParseCtxt.cmd->u._lvalue = counter; + _locParseCtxt.cmd->u._rvalue = atoi(_tokens[3]); + _locParseCtxt.nextToken++; + + if (_tokens[2][0] == '>') { + _locParseCtxt.cmd->_id = CMD_TEST_GT; + } else + if (_tokens[2][0] == '<') { + _locParseCtxt.cmd->_id = CMD_TEST_LT; + } + _locParseCtxt.nextToken++; + } + + parseCommandFlags(); + addCommand(); +} + + +DECLARE_COMMAND_PARSER(music) { + debugC(7, kDebugParser, "COMMAND_PARSER(music) "); + + createCommand(_lookup); + + _locParseCtxt.cmd->u._musicCommand = _audioCommandsNames->lookup(_tokens[1]); + _locParseCtxt.nextToken++; + + if (_tokens[2][0] != '\0' && scumm_stricmp("flags", _tokens[2]) && scumm_stricmp("gflags", _tokens[2])) { + _locParseCtxt.cmd->u._musicParm = atoi(_tokens[2]); + _locParseCtxt.nextToken++; + } + + parseCommandFlags(); + addCommand(); +} + + +DECLARE_COMMAND_PARSER(zone) { + debugC(7, kDebugParser, "COMMAND_PARSER(zone) "); + + createCommand(_lookup); + + _locParseCtxt.cmd->u._zone = findZone(_tokens[_locParseCtxt.nextToken]); + _locParseCtxt.nextToken++; + + if (_locParseCtxt.cmd->u._zone == NULL) { + strcpy(_forwardedAnimationNames[_numForwards], _tokens[_locParseCtxt.nextToken-1]); + _forwardedCommands[_numForwards] = _locParseCtxt.cmd; + _numForwards++; + } + + parseCommandFlags(); + addCommand(); +} + + +DECLARE_COMMAND_PARSER(zeta) { + debugC(7, kDebugParser, "COMMAND_PARSER(zeta) "); + + createCommand(_lookup); + + _locParseCtxt.cmd->u._zeta0 = atoi(_tokens[1]); + _locParseCtxt.nextToken++; + _locParseCtxt.cmd->u._zeta1 = atoi(_tokens[2]); + _locParseCtxt.nextToken++; + + if (_tokens[3][0] != '\0') { + _locParseCtxt.cmd->u._zeta2 = atoi(_tokens[3]); + _locParseCtxt.nextToken++; + } else { + _locParseCtxt.cmd->u._zeta2 = 50; + } + + parseCommandFlags(); + addCommand(); +} + + +DECLARE_COMMAND_PARSER(give) { + debugC(7, kDebugParser, "COMMAND_PARSER(give) "); + + createCommand(_lookup); + + _locParseCtxt.cmd->u._object = 4 + atoi(_tokens[1]); + _locParseCtxt.nextToken++; + + if (!scumm_stricmp("dino", _tokens[2])) { + _locParseCtxt.cmd->u._characterId = 1; + } else + if (!scumm_stricmp("doug", _tokens[2])) { + _locParseCtxt.cmd->u._characterId = 2; + } else + if (!scumm_stricmp("donna", _tokens[2])) { + _locParseCtxt.cmd->u._characterId = 3; + } else + error("unknown recipient '%s' in give command", _tokens[2]); + + _locParseCtxt.nextToken++; + + parseCommandFlags(); + addCommand(); +} + + +DECLARE_COMMAND_PARSER(text) { + debugC(7, kDebugParser, "COMMAND_PARSER(text) "); + + createCommand(_lookup); + + if (isdigit(_tokens[1][1])) { + _locParseCtxt.cmd->u._zeta0 = atoi(_tokens[1]); + _locParseCtxt.nextToken++; + } else { + _locParseCtxt.cmd->u._zeta0 = 0; + } + + _locParseCtxt.cmd->u._string = strdup(_tokens[_locParseCtxt.nextToken]); + _locParseCtxt.nextToken++; + + if (_tokens[_locParseCtxt.nextToken][0] != '\0' && scumm_stricmp("flags", _tokens[_locParseCtxt.nextToken])) { + _locParseCtxt.cmd->u._string2 = strdup(_tokens[_locParseCtxt.nextToken]); + _locParseCtxt.nextToken++; + } + + + parseCommandFlags(); + addCommand(); +} + + +DECLARE_COMMAND_PARSER(unary) { + debugC(7, kDebugParser, "COMMAND_PARSER(unary) "); + + createCommand(_lookup); + + _locParseCtxt.cmd->u._rvalue = atoi(_tokens[1]); + _locParseCtxt.nextToken++; + + parseCommandFlags(); + addCommand(); +} + + +DECLARE_ZONE_PARSER(limits) { + debugC(7, kDebugParser, "ZONE_PARSER(limits) "); + + if (isalpha(_tokens[1][1])) { + _locParseCtxt.z->_flags |= kFlagsAnimLinked; + _locParseCtxt.z->_linkedAnim = findAnimation(_tokens[1]); + _locParseCtxt.z->_linkedName = strdup(_tokens[1]); + } else { + _locParseCtxt.z->_left = atoi(_tokens[1]); + _locParseCtxt.z->_top = atoi(_tokens[2]); + _locParseCtxt.z->_right = atoi(_tokens[3]); + _locParseCtxt.z->_bottom = atoi(_tokens[4]); + } +} + + +DECLARE_ZONE_PARSER(moveto) { + debugC(7, kDebugParser, "ZONE_PARSER(moveto) "); + + _locParseCtxt.z->_moveTo.x = atoi(_tokens[1]); + _locParseCtxt.z->_moveTo.y = atoi(_tokens[2]); +// _locParseCtxt.z->_moveTo.z = atoi(_tokens[3]); +} + + +DECLARE_ZONE_PARSER(type) { + debugC(7, kDebugParser, "ZONE_PARSER(type) "); + + if (_tokens[2][0] != '\0') { + _locParseCtxt.z->_type = (4 + _objectsNames->lookup(_tokens[2])) << 16; + } + int16 _si = _zoneTypeNames->lookup(_tokens[1]); + if (_si != Table::notFound) { + _locParseCtxt.z->_type |= 1 << (_si - 1); + parseZoneTypeBlock(*_locParseCtxt.script, _locParseCtxt.z); + +// if (_locParseCtxt.z->_type & kZoneHear) { +// _soundMan->sfxCommand(START...); +// } + } + + popParserTables(); +} + + +DECLARE_ANIM_PARSER(file) { + debugC(7, kDebugParser, "ANIM_PARSER(file) "); + + _locParseCtxt.a->_cnv = _disk->loadFrames(_tokens[1]); +} + + +DECLARE_ANIM_PARSER(position) { + debugC(7, kDebugParser, "ANIM_PARSER(position) "); + + _locParseCtxt.a->_left = atoi(_tokens[1]); + _locParseCtxt.a->_top = atoi(_tokens[2]); + _locParseCtxt.a->_z = atoi(_tokens[3]); + _locParseCtxt.a->_frame = atoi(_tokens[4]); +} + + +DECLARE_ANIM_PARSER(moveto) { + debugC(7, kDebugParser, "ANIM_PARSER(moveto) "); + + _locParseCtxt.a->_moveTo.x = atoi(_tokens[1]); + _locParseCtxt.a->_moveTo.y = atoi(_tokens[2]); +// _locParseCtxt.a->_moveTo.z = atoi(_tokens[3]); +} + + +DECLARE_ANIM_PARSER(endanimation) { + debugC(7, kDebugParser, "ANIM_PARSER(endanimation) "); + + + if (_locParseCtxt.a->_cnv) { + _locParseCtxt.a->_right = _locParseCtxt.a->width(); + _locParseCtxt.a->_bottom = _locParseCtxt.a->height(); + } + + _locParseCtxt.a->_oldPos.x = -1000; + _locParseCtxt.a->_oldPos.y = -1000; + + _locParseCtxt.a->_flags |= 0x1000000; + + popParserTables(); +} + + + + + + + + + + +DECLARE_INSTRUCTION_PARSER(zone) { + debugC(7, kDebugParser, "INSTRUCTION_PARSER(zone) "); + + _instParseCtxt.inst->_z = findZone(_tokens[1]); +} + + + +DECLARE_INSTRUCTION_PARSER(color) { + debugC(7, kDebugParser, "INSTRUCTION_PARSER(color) "); + + + parseRValue(_instParseCtxt.inst->_opB, _tokens[1]); + + _instParseCtxt.inst->_colors[0] = atoi(_tokens[2]); + _instParseCtxt.inst->_colors[1] = atoi(_tokens[3]); + _instParseCtxt.inst->_colors[2] = atoi(_tokens[4]); + +} + + +DECLARE_INSTRUCTION_PARSER(mask) { + debugC(7, kDebugParser, "INSTRUCTION_PARSER(mask) "); + + + parseRValue(_instParseCtxt.inst->_opA, _tokens[1]); + parseRValue(_instParseCtxt.inst->_opB, _tokens[2]); + parseRValue(_instParseCtxt.inst->_opC, _tokens[3]); + +} + + +DECLARE_INSTRUCTION_PARSER(print) { + debugC(7, kDebugParser, "INSTRUCTION_PARSER(print) "); + + parseRValue(_instParseCtxt.inst->_opB, _tokens[1]); +} + + +DECLARE_INSTRUCTION_PARSER(text) { + debugC(7, kDebugParser, "INSTRUCTION_PARSER(text) "); + + + int _si = 1; + + if (isdigit(_tokens[1][1])) { + _instParseCtxt.inst->_y = atoi(_tokens[1]); + _si = 2; + } else { + _instParseCtxt.inst->_y = -1; + } + + _instParseCtxt.inst->_text = strdup(_tokens[_si]); + _si++; + + if (_tokens[_si][0] != '\0' && scumm_stricmp("flags", _tokens[_si])) { + _instParseCtxt.inst->_text2 = strdup(_tokens[_si]); + } + +} + + +DECLARE_INSTRUCTION_PARSER(if_op) { + debugC(7, kDebugParser, "INSTRUCTION_PARSER(if_op) "); + + + if (_instParseCtxt.openIf) + error("cannot nest 'if' blocks"); + + parseLValue(_instParseCtxt.inst->_opA, _tokens[1]); + parseRValue(_instParseCtxt.inst->_opB, _tokens[3]); + + if (_tokens[2][0] == '=') { + _instParseCtxt.inst->_index = INST_IFEQ; + } else + if (_tokens[2][0] == '>') { + _instParseCtxt.inst->_index = INST_IFGT; + } else + if (_tokens[2][0] == '<') { + _instParseCtxt.inst->_index = INST_IFLT; + } else + error("unknown test operator '%s' in if-clause", _tokens[2]); + + _instParseCtxt.openIf = _instParseCtxt.inst; + +} + + +DECLARE_INSTRUCTION_PARSER(endif) { + debugC(7, kDebugParser, "INSTRUCTION_PARSER(endif) "); + + if (_instParseCtxt.openIf == 0) + error("unexpected 'endif'"); + +// _instParseCtxt.openIf->_endif = _instParseCtxt.inst; + _instParseCtxt.openIf = NULL; +} + + +void Parallaction_br::parseRValue(ScriptVar &v, const char *str) { + + if (isdigit(str[0]) || str[0] == '-') { + v.setImmediate(atoi(str)); + return; + } + + int index = _instParseCtxt.program->findLocal(str); + if (index != -1) { + v.setLocal(&_instParseCtxt.locals[index]); + return; + } + + Animation *a; + if (str[1] == '.') { + a = findAnimation(&str[2]); + if (!a) { + error("unknown animation '%s' in script", &str[2]); + } + } else + a = _instParseCtxt.a; + + if (str[0] == 'X') { + v.setField(&a->_left); + } else + if (str[0] == 'Y') { + v.setField(&a->_top); + } else + if (str[0] == 'Z') { + v.setField(&a->_z); + } else + if (str[0] == 'F') { + v.setField(&a->_frame); + } else + if (str[0] == 'N') { + v.setImmediate(a->getFrameNum()); + } else + if (str[0] == 'R') { + v.setRandom(atoi(&str[1])); + } else + if (str[0] == 'L') { + v.setField(&_lipSyncVal); + } + +} + +typedef OpcodeImpl<Parallaction_br> OpcodeV2; +#define INSTRUCTION_PARSER(sig) OpcodeV2(this, &Parallaction_br::instParse_##sig) +#define ZONE_PARSER(sig) OpcodeV2(this, &Parallaction_br::locZoneParse_##sig) +#define ANIM_PARSER(sig) OpcodeV2(this, &Parallaction_br::locAnimParse_##sig) +#define LOCATION_PARSER(sig) OpcodeV2(this, &Parallaction_br::locParse_##sig) +#define COMMAND_PARSER(sig) OpcodeV2(this, &Parallaction_br::cmdParse_##sig) + +void Parallaction_br::initParsers() { + + static const OpcodeV2 op0[] = { + INSTRUCTION_PARSER(defLocal), // invalid opcode -> local definition + INSTRUCTION_PARSER(zone), // on + INSTRUCTION_PARSER(zone), // off + INSTRUCTION_PARSER(x), + INSTRUCTION_PARSER(y), + INSTRUCTION_PARSER(z), + INSTRUCTION_PARSER(f), + INSTRUCTION_PARSER(loop), + INSTRUCTION_PARSER(null), // endloop + INSTRUCTION_PARSER(null), // show + INSTRUCTION_PARSER(inc), + INSTRUCTION_PARSER(inc), // dec + INSTRUCTION_PARSER(set), + INSTRUCTION_PARSER(put), + INSTRUCTION_PARSER(call), + INSTRUCTION_PARSER(null), // wait + INSTRUCTION_PARSER(zone), // start + INSTRUCTION_PARSER(zone), // process + INSTRUCTION_PARSER(move), + INSTRUCTION_PARSER(color), + INSTRUCTION_PARSER(zone), // sound + INSTRUCTION_PARSER(mask), + INSTRUCTION_PARSER(print), + INSTRUCTION_PARSER(text), + INSTRUCTION_PARSER(inc), // mul + INSTRUCTION_PARSER(inc), // div + INSTRUCTION_PARSER(if_op), + INSTRUCTION_PARSER(null), + INSTRUCTION_PARSER(null), + INSTRUCTION_PARSER(endif), + INSTRUCTION_PARSER(zone), // stop + INSTRUCTION_PARSER(endscript) + }; + + uint i; + for (i = 0; i < ARRAYSIZE(op0); i++) + _instructionParsers.push_back(&op0[i]); + + + static const OpcodeV2 op2[] = { + COMMAND_PARSER(invalid), + COMMAND_PARSER(flags), // set + COMMAND_PARSER(flags), // clear + COMMAND_PARSER(animation), // start + COMMAND_PARSER(zone), // speak + COMMAND_PARSER(zone), // get + COMMAND_PARSER(location), + COMMAND_PARSER(zone), // open + COMMAND_PARSER(zone), // close + COMMAND_PARSER(zone), // on + COMMAND_PARSER(zone), // off + COMMAND_PARSER(call), + COMMAND_PARSER(flags), // toggle + COMMAND_PARSER(drop), + COMMAND_PARSER(simple), // quit + COMMAND_PARSER(move), + COMMAND_PARSER(animation), // stop + COMMAND_PARSER(string), // character + COMMAND_PARSER(string), // followme + COMMAND_PARSER(simple), // onmouse + COMMAND_PARSER(simple), // offmouse + COMMAND_PARSER(drop), // add + COMMAND_PARSER(zone), // leave + COMMAND_PARSER(math), // inc + COMMAND_PARSER(math), // dec + COMMAND_PARSER(test), // test + COMMAND_PARSER(invalid), + COMMAND_PARSER(invalid), + COMMAND_PARSER(math), // let + COMMAND_PARSER(music), + COMMAND_PARSER(zone), // fix + COMMAND_PARSER(zone), // unfix + COMMAND_PARSER(zeta), + COMMAND_PARSER(unary), // scroll + COMMAND_PARSER(string), // swap + COMMAND_PARSER(give), + COMMAND_PARSER(text), + COMMAND_PARSER(unary), // part + COMMAND_PARSER(invalid), + COMMAND_PARSER(simple), // return + COMMAND_PARSER(simple), // onsave + COMMAND_PARSER(simple), // offsave + COMMAND_PARSER(endcommands), // endcommands + COMMAND_PARSER(ifchar), + COMMAND_PARSER(endif) + }; + + for (i = 0; i < ARRAYSIZE(op2); i++) + _commandParsers.push_back(&op2[i]); + + static const OpcodeV2 op4[] = { + LOCATION_PARSER(invalid), + LOCATION_PARSER(character), + LOCATION_PARSER(endlocation), + LOCATION_PARSER(ifchar), + LOCATION_PARSER(null), // endif + LOCATION_PARSER(location), + LOCATION_PARSER(mask), + LOCATION_PARSER(path), + LOCATION_PARSER(null), // disk + LOCATION_PARSER(localflags), + LOCATION_PARSER(commands), + LOCATION_PARSER(escape), + LOCATION_PARSER(acommands), + LOCATION_PARSER(flags), + LOCATION_PARSER(comment), + LOCATION_PARSER(endcomment), + LOCATION_PARSER(zone), + LOCATION_PARSER(animation), + LOCATION_PARSER(zeta), + LOCATION_PARSER(music), + LOCATION_PARSER(sound) +// LOCATION_PARSER(redundant) // for redundant endanimation + }; + + for (i = 0; i < ARRAYSIZE(op4); i++) + _locationParsers.push_back(&op4[i]); + + static const OpcodeV2 op5[] = { + ZONE_PARSER(invalid), + ZONE_PARSER(endzone), + ZONE_PARSER(limits), + ZONE_PARSER(moveto), + ZONE_PARSER(type), + ZONE_PARSER(commands), + ZONE_PARSER(label), + ZONE_PARSER(flags) + }; + + for (i = 0; i < ARRAYSIZE(op5); i++) + _locationZoneParsers.push_back(&op5[i]); + + static const OpcodeV2 op6[] = { + ANIM_PARSER(invalid), + ANIM_PARSER(endanimation), + ANIM_PARSER(endanimation), // endzone + ANIM_PARSER(script), + ANIM_PARSER(commands), + ANIM_PARSER(type), + ANIM_PARSER(label), + ANIM_PARSER(flags), + ANIM_PARSER(file), + ANIM_PARSER(position), + ANIM_PARSER(moveto) + }; + + for (i = 0; i < ARRAYSIZE(op6); i++) + _locationAnimParsers.push_back(&op6[i]); + + _currentOpcodes = 0; + _currentStatements = 0; + +} + +void Parallaction_br::parseLocation(const char* filename) { + + _locParseCtxt.numZones = 0; + + Super::parseLocation(filename); + +// drawZones(); + + return; +} + + + + + +} // namespace Parallaction diff --git a/engines/parallaction/parser_ns.cpp b/engines/parallaction/parser_ns.cpp new file mode 100644 index 0000000000..1b47f2fe3d --- /dev/null +++ b/engines/parallaction/parser_ns.cpp @@ -0,0 +1,1494 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * $URL$ + * $Id$ + * + */ + +#include "common/stdafx.h" + +#include "parallaction/parallaction.h" +#include "parallaction/sound.h" + +namespace Parallaction { + +#define CMD_SET 1 +#define CMD_CLEAR 2 +#define CMD_START 3 +#define CMD_SPEAK 4 +#define CMD_GET 5 +#define CMD_LOCATION 6 +#define CMD_OPEN 7 +#define CMD_CLOSE 8 +#define CMD_ON 9 +#define CMD_OFF 10 +#define CMD_CALL 11 +#define CMD_TOGGLE 12 +#define CMD_DROP 13 +#define CMD_QUIT 14 +#define CMD_MOVE 15 +#define CMD_STOP 16 + +#define INST_ON 1 +#define INST_OFF 2 +#define INST_X 3 +#define INST_Y 4 +#define INST_Z 5 +#define INST_F 6 +#define INST_LOOP 7 +#define INST_ENDLOOP 8 +#define INST_SHOW 9 +#define INST_INC 10 +#define INST_DEC 11 +#define INST_SET 12 +#define INST_PUT 13 +#define INST_CALL 14 +#define INST_WAIT 15 +#define INST_START 16 +#define INST_SOUND 17 +#define INST_MOVE 18 +#define INST_END 19 + + +#define DECLARE_ZONE_PARSER(sig) void Parallaction_ns::locZoneParse_##sig() +#define DECLARE_ANIM_PARSER(sig) void Parallaction_ns::locAnimParse_##sig() +#define DECLARE_COMMAND_PARSER(sig) void Parallaction_ns::cmdParse_##sig() +#define DECLARE_INSTRUCTION_PARSER(sig) void Parallaction_ns::instParse_##sig() +#define DECLARE_LOCATION_PARSER(sig) void Parallaction_ns::locParse_##sig() + + + + +DECLARE_ANIM_PARSER(invalid) { + debugC(7, kDebugParser, "ANIM_PARSER(invalid) "); + + error("unknown statement '%s' in animation %s", _tokens[0], _locParseCtxt.a->_label._text); +} + + +DECLARE_ANIM_PARSER(script) { + debugC(7, kDebugParser, "ANIM_PARSER(script) "); + + _locParseCtxt.a->_scriptName = strdup(_tokens[1]); +} + + +DECLARE_ANIM_PARSER(commands) { + debugC(7, kDebugParser, "ANIM_PARSER(commands) "); + + parseCommands(*_locParseCtxt.script, _locParseCtxt.a->_commands); +} + + +DECLARE_ANIM_PARSER(type) { + debugC(7, kDebugParser, "ANIM_PARSER(type) "); + + if (_tokens[2][0] != '\0') { + _locParseCtxt.a->_type = ((4 + _objectsNames->lookup(_tokens[2])) << 16) & 0xFFFF0000; + } + int16 _si = _zoneTypeNames->lookup(_tokens[1]); + if (_si != Table::notFound) { + _locParseCtxt.a->_type |= 1 << (_si-1); + if (((_locParseCtxt.a->_type & 0xFFFF) != kZoneNone) && ((_locParseCtxt.a->_type & 0xFFFF) != kZoneCommand)) { + parseZoneTypeBlock(*_locParseCtxt.script, _locParseCtxt.a); + } + } + + _locParseCtxt.a->_oldPos.x = -1000; + _locParseCtxt.a->_oldPos.y = -1000; + + _locParseCtxt.a->_flags |= 0x1000000; + + popParserTables(); +} + + +DECLARE_ANIM_PARSER(label) { + debugC(7, kDebugParser, "ANIM_PARSER(label) "); + + renderLabel(&_locParseCtxt.a->_label._cnv, _tokens[1]); +} + + +DECLARE_ANIM_PARSER(flags) { + debugC(7, kDebugParser, "ANIM_PARSER(flags) "); + + uint16 _si = 1; + + do { + byte _al = _zoneFlagNames->lookup(_tokens[_si]); + _si++; + _locParseCtxt.a->_flags |= 1 << (_al - 1); + } while (!scumm_stricmp(_tokens[_si++], "|")); +} + + +DECLARE_ANIM_PARSER(file) { + debugC(7, kDebugParser, "ANIM_PARSER(file) "); + + char vC8[200]; + strcpy(vC8, _tokens[1]); + if (_engineFlags & kEngineTransformedDonna) { + if (!scumm_stricmp(_tokens[1], "donnap") || !scumm_stricmp(_tokens[1], "donnapa")) { + strcat(vC8, "tras"); + } + } + _locParseCtxt.a->_cnv = _disk->loadFrames(vC8); +} + + +DECLARE_ANIM_PARSER(position) { + debugC(7, kDebugParser, "ANIM_PARSER(position) "); + + _locParseCtxt.a->_left = atoi(_tokens[1]); + _locParseCtxt.a->_top = atoi(_tokens[2]); + _locParseCtxt.a->_z = atoi(_tokens[3]); +} + + +DECLARE_ANIM_PARSER(moveto) { + debugC(7, kDebugParser, "ANIM_PARSER(moveto) "); + + _locParseCtxt.a->_moveTo.x = atoi(_tokens[1]); + _locParseCtxt.a->_moveTo.y = atoi(_tokens[2]); +} + + +DECLARE_ANIM_PARSER(endanimation) { + debugC(7, kDebugParser, "ANIM_PARSER(endanimation) "); + + + _locParseCtxt.a->_oldPos.x = -1000; + _locParseCtxt.a->_oldPos.y = -1000; + + _locParseCtxt.a->_flags |= 0x1000000; + + popParserTables(); +} + +Animation *Parallaction_ns::parseAnimation(Script& script, AnimationList &list, char *name) { + debugC(5, kDebugParser, "parseAnimation(name: %s)", name); + + Animation *a = new Animation; + + a->_label._text = strdup(name); + + list.push_front(a); + + _locParseCtxt.a = a; + _locParseCtxt.script = &script; + + pushParserTables(&_locationAnimParsers, _locationAnimStmt); + + return a; +} + +void Parallaction_ns::parseInstruction(Animation *a, LocalVariable *locals) { + + Instruction *inst = new Instruction; + + if (_tokens[0][1] == '.') { + _tokens[0][1] = '\0'; + _instParseCtxt.a = findAnimation(&_tokens[0][2]); + } else + if (_tokens[1][1] == '.') { + _tokens[1][1] = '\0'; + _instParseCtxt.a = findAnimation(&_tokens[1][2]); + } else + _instParseCtxt.a = a; + + inst->_index = _instructionNames->lookup(_tokens[0]); + _instParseCtxt.inst = inst; + _instParseCtxt.locals = locals; + + (*(_instructionParsers[inst->_index]))(); + + a->_program->_instructions.push_back(inst); + + return; +} + +void Parallaction_ns::loadProgram(Animation *a, const char *filename) { + debugC(1, kDebugParser, "loadProgram(Animation: %s, script: %s)", a->_label._text, filename); + + Script *script = _disk->loadScript(filename); + + a->_program = new Program; + + _instParseCtxt.openIf = NULL; + _instParseCtxt.end = false; + _instParseCtxt.program = a->_program; + + do { + fillBuffers(*script); + parseInstruction(a, a->_program->_locals); + } while (!_instParseCtxt.end); + + a->_program->_ip = a->_program->_instructions.begin(); + + delete script; + + debugC(1, kDebugParser, "loadProgram() done"); + + return; +} + +DECLARE_INSTRUCTION_PARSER(animation) { + debugC(7, kDebugParser, "INSTRUCTION_PARSER(animation) "); + + if (!scumm_stricmp(_tokens[1], _instParseCtxt.a->_label._text)) { + _instParseCtxt.inst->_a = _instParseCtxt.a; + } else { + _instParseCtxt.inst->_a = findAnimation(_tokens[1]); + } +} + + +DECLARE_INSTRUCTION_PARSER(loop) { + debugC(7, kDebugParser, "INSTRUCTION_PARSER(loop) "); + + parseRValue(_instParseCtxt.inst->_opB, _tokens[1]); +} + + +DECLARE_INSTRUCTION_PARSER(x) { + debugC(7, kDebugParser, "INSTRUCTION_PARSER(x) "); + + parseLValue(_instParseCtxt.inst->_opA, "X"); + parseRValue(_instParseCtxt.inst->_opB, _tokens[1]); +} + + +DECLARE_INSTRUCTION_PARSER(y) { + debugC(7, kDebugParser, "INSTRUCTION_PARSER(y) "); + + parseLValue(_instParseCtxt.inst->_opA, "Y"); + parseRValue(_instParseCtxt.inst->_opB, _tokens[1]); +} + + +DECLARE_INSTRUCTION_PARSER(z) { + debugC(7, kDebugParser, "INSTRUCTION_PARSER(z) "); + + parseLValue(_instParseCtxt.inst->_opA, "Z"); + parseRValue(_instParseCtxt.inst->_opB, _tokens[1]); +} + + +DECLARE_INSTRUCTION_PARSER(f) { + debugC(7, kDebugParser, "INSTRUCTION_PARSER(f) "); + + parseLValue(_instParseCtxt.inst->_opA, "F"); + parseRValue(_instParseCtxt.inst->_opB, _tokens[1]); +} + + +DECLARE_INSTRUCTION_PARSER(inc) { + debugC(7, kDebugParser, "INSTRUCTION_PARSER(inc) "); + + parseLValue(_instParseCtxt.inst->_opA, _tokens[1]); + parseRValue(_instParseCtxt.inst->_opB, _tokens[2]); + + if (!scumm_stricmp(_tokens[3], "mod")) { + _instParseCtxt.inst->_flags |= kInstMod; + } +} + + +DECLARE_INSTRUCTION_PARSER(set) { + debugC(7, kDebugParser, "INSTRUCTION_PARSER(set) "); + + // WORKAROUND: At least one script (balzo.script) in Amiga versions didn't declare + // local variables before using them, thus leading to crashes. The line launching the + // script was commented out on Dos version. This workaround enables the engine + // to dynamically add a local variable when it is encountered the first time in + // the script, so should fix any other occurrence as well. + if (_instParseCtxt.program->findLocal(_tokens[1]) == -1) { + _instParseCtxt.program->addLocal(_tokens[1]); + } + + parseLValue(_instParseCtxt.inst->_opA, _tokens[1]); + parseRValue(_instParseCtxt.inst->_opB, _tokens[2]); +} + + +DECLARE_INSTRUCTION_PARSER(move) { + debugC(7, kDebugParser, "INSTRUCTION_PARSER(move) "); + + parseRValue(_instParseCtxt.inst->_opA, _tokens[1]); + parseRValue(_instParseCtxt.inst->_opB, _tokens[2]); +} + + +DECLARE_INSTRUCTION_PARSER(put) { + debugC(7, kDebugParser, "INSTRUCTION_PARSER(put) "); + + if (!scumm_stricmp(_tokens[1], _instParseCtxt.a->_label._text)) { + _instParseCtxt.inst->_a = _instParseCtxt.a; + } else { + _instParseCtxt.inst->_a = findAnimation(_tokens[1]); + } + + parseRValue(_instParseCtxt.inst->_opA, _tokens[2]); + parseRValue(_instParseCtxt.inst->_opB, _tokens[3]); + if (!scumm_stricmp(_tokens[4], "masked")) { + _instParseCtxt.inst->_flags |= kInstMaskedPut; + } +} + + +DECLARE_INSTRUCTION_PARSER(call) { + debugC(7, kDebugParser, "INSTRUCTION_PARSER(call) "); + + int index = _callableNames->lookup(_tokens[1]); + if (index == Table::notFound) + error("unknown callable '%s'", _tokens[1]); + _instParseCtxt.inst->_immediate = index - 1; +} + + +DECLARE_INSTRUCTION_PARSER(sound) { + debugC(7, kDebugParser, "INSTRUCTION_PARSER(sound) "); + + _instParseCtxt.inst->_z = findZone(_tokens[1]); +} + + +DECLARE_INSTRUCTION_PARSER(null) { + debugC(7, kDebugParser, "INSTRUCTION_PARSER(null) "); + + +} + + +DECLARE_INSTRUCTION_PARSER(defLocal) { + debugC(7, kDebugParser, "INSTRUCTION_PARSER(defLocal) "); + + int16 val = atoi(_tokens[2]); + int16 index; + + if (_tokens[3][0] != '\0') { + index = _instParseCtxt.program->addLocal(_tokens[0], val, atoi(_tokens[3]), atoi(_tokens[4])); + } else { + index = _instParseCtxt.program->addLocal(_tokens[0], val); + } + + _instParseCtxt.inst->_opA.setLocal(&_instParseCtxt.locals[index]); + _instParseCtxt.inst->_opB.setImmediate(_instParseCtxt.locals[index]._value); + + _instParseCtxt.inst->_index = INST_SET; +} + +DECLARE_INSTRUCTION_PARSER(endscript) { + debugC(7, kDebugParser, "INSTRUCTION_PARSER(endscript) "); + + _instParseCtxt.end = true; +} + + + +void Parallaction_ns::parseRValue(ScriptVar &v, const char *str) { + + if (isdigit(str[0]) || str[0] == '-') { + v.setImmediate(atoi(str)); + return; + } + + int index = _instParseCtxt.program->findLocal(str); + if (index != -1) { + v.setLocal(&_instParseCtxt.locals[index]); + return; + } + + Animation *a; + if (str[1] == '.') { + a = findAnimation(&str[2]); + } else { + a = _instParseCtxt.a; + } + + if (str[0] == 'X') { + v.setField(&a->_left); + } else + if (str[0] == 'Y') { + v.setField(&a->_top); + } else + if (str[0] == 'Z') { + v.setField(&a->_z); + } else + if (str[0] == 'F') { + v.setField(&a->_frame); + } + +} + +void Parallaction_ns::parseLValue(ScriptVar &v, const char *str) { + + int index = _instParseCtxt.program->findLocal(str); + if (index != -1) { + v.setLocal(&_instParseCtxt.locals[index]); + return; + } + + Animation *a; + if (str[1] == '.') { + a = findAnimation(&str[2]); + } else { + a = _instParseCtxt.a; + } + + if (str[0] == 'X') { + v.setField(&a->_left); + } else + if (str[0] == 'Y') { + v.setField(&a->_top); + } else + if (str[0] == 'Z') { + v.setField(&a->_z); + } else + if (str[0] == 'F') { + v.setField(&a->_frame); + } + +} + + +DECLARE_COMMAND_PARSER(flags) { + debugC(7, kDebugParser, "COMMAND_PARSER(flags) "); + + createCommand(_lookup); + + if (_globalTable->lookup(_tokens[1]) == Table::notFound) { + do { + char _al = _localFlagNames->lookup(_tokens[_locParseCtxt.nextToken]); + _locParseCtxt.nextToken++; + _locParseCtxt.cmd->u._flags |= 1 << (_al - 1); + } while (!scumm_stricmp(_tokens[_locParseCtxt.nextToken++], "|")); + _locParseCtxt.nextToken--; + } else { + _locParseCtxt.cmd->u._flags |= kFlagsGlobal; + do { + char _al = _globalTable->lookup(_tokens[1]); + _locParseCtxt.nextToken++; + _locParseCtxt.cmd->u._flags |= 1 << (_al - 1); + } while (!scumm_stricmp(_tokens[_locParseCtxt.nextToken++], "|")); + _locParseCtxt.nextToken--; + } + + parseCommandFlags(); + addCommand(); +} + + +DECLARE_COMMAND_PARSER(animation) { + debugC(7, kDebugParser, "COMMAND_PARSER(animation) "); + + createCommand(_lookup); + + _locParseCtxt.cmd->u._animation = findAnimation(_tokens[_locParseCtxt.nextToken]); + _locParseCtxt.nextToken++; + if (_locParseCtxt.cmd->u._animation == NULL) { + strcpy(_forwardedAnimationNames[_numForwards], _tokens[_locParseCtxt.nextToken-1]); + _forwardedCommands[_numForwards] = _locParseCtxt.cmd; + _numForwards++; + } + + parseCommandFlags(); + addCommand(); +} + + +DECLARE_COMMAND_PARSER(zone) { + debugC(7, kDebugParser, "COMMAND_PARSER(zone) "); + + createCommand(_lookup); + + _locParseCtxt.cmd->u._zone = findZone(_tokens[_locParseCtxt.nextToken]); + _locParseCtxt.nextToken++; + + parseCommandFlags(); + addCommand(); +} + + +DECLARE_COMMAND_PARSER(location) { + debugC(7, kDebugParser, "COMMAND_PARSER(location) "); + + createCommand(_lookup); + + _locParseCtxt.cmd->u._string = (char*)malloc(strlen(_tokens[_locParseCtxt.nextToken])+1); + strcpy(_locParseCtxt.cmd->u._string, _tokens[_locParseCtxt.nextToken]); + _locParseCtxt.nextToken++; + + parseCommandFlags(); + addCommand(); +} + + +DECLARE_COMMAND_PARSER(drop) { + debugC(7, kDebugParser, "COMMAND_PARSER(drop) "); + + createCommand(_lookup); + + _locParseCtxt.cmd->u._object = 4 + _objectsNames->lookup(_tokens[_locParseCtxt.nextToken]); + _locParseCtxt.nextToken++; + + parseCommandFlags(); + addCommand(); +} + + +DECLARE_COMMAND_PARSER(call) { + debugC(7, kDebugParser, "COMMAND_PARSER(call) "); + + createCommand(_lookup); + + _locParseCtxt.cmd->u._callable = _callableNames->lookup(_tokens[_locParseCtxt.nextToken]) - 1; + _locParseCtxt.nextToken++; + + parseCommandFlags(); + addCommand(); +} + + +DECLARE_COMMAND_PARSER(simple) { + debugC(7, kDebugParser, "COMMAND_PARSER(simple) "); + + createCommand(_lookup); + addCommand(); +} + + +DECLARE_COMMAND_PARSER(move) { + debugC(7, kDebugParser, "COMMAND_PARSER(move) "); + + createCommand(_lookup); + + _locParseCtxt.cmd->u._move.x = atoi(_tokens[_locParseCtxt.nextToken]); + _locParseCtxt.nextToken++; + _locParseCtxt.cmd->u._move.y = atoi(_tokens[_locParseCtxt.nextToken]); + _locParseCtxt.nextToken++; + + parseCommandFlags(); + addCommand(); +} + +DECLARE_COMMAND_PARSER(invalid) { + debugC(7, kDebugParser, "COMMAND_PARSER(invalid) "); + + error("Can't parse unknown command '%s'", _tokens[0]); +} + +DECLARE_COMMAND_PARSER(endcommands) { + debugC(7, kDebugParser, "COMMAND_PARSER(endcommands) "); + + popParserTables(); + + // temporary trick to handle dialogue commands + _locParseCtxt.endcommands = true; +} + +void Parallaction_ns::parseCommandFlags() { + + int _si = _locParseCtxt.nextToken; + Command *cmd = _locParseCtxt.cmd; + + if (!scumm_stricmp(_tokens[_si], "flags")) { + _si++; + + do { + if (!scumm_stricmp(_tokens[_si], "exit") || !scumm_stricmp(_tokens[_si], "exittrap")) { + cmd->_flagsOn |= kFlagsExit; + } else + if (!scumm_stricmp(_tokens[_si], "enter") || !scumm_stricmp(_tokens[_si], "entertrap")) { + cmd->_flagsOn |= kFlagsEnter; + } else + if (!scumm_strnicmp(_tokens[_si], "no", 2)) { + byte _al = _localFlagNames->lookup(&_tokens[_si][2]); + cmd->_flagsOff |= 1 << (_al - 1); + } else { + byte _al = _localFlagNames->lookup(_tokens[_si]); + cmd->_flagsOn |= 1 << (_al - 1); + } + + _si++; + + } while (!scumm_stricmp(_tokens[_si++], "|")); + + } + + if (!scumm_stricmp(_tokens[_si], "gflags")) { + _si++; + cmd->_flagsOn |= kFlagsGlobal; + + do { + if (!scumm_stricmp(_tokens[_si], "exit")) { + cmd->_flagsOn |= kFlagsExit; + } else + if (!scumm_stricmp(_tokens[_si], "enter")) { + cmd->_flagsOn |= kFlagsEnter; + } else + if (!scumm_strnicmp(_tokens[_si], "no", 2)) { + byte _al = _globalTable->lookup(&_tokens[_si][2]); + cmd->_flagsOff |= 1 << (_al - 1); + } else { + byte _al = _globalTable->lookup(_tokens[_si]); + cmd->_flagsOn |= 1 << (_al - 1); + } + + _si++; + + } while (!scumm_stricmp(_tokens[_si++], "|")); + + } + + _si = _locParseCtxt.nextToken; + +} + +void Parallaction_ns::addCommand() { + _locParseCtxt.list->push_front(_locParseCtxt.cmd); // NOTE: command lists are written backwards in scripts +} + +void Parallaction_ns::createCommand(uint id) { + + _locParseCtxt.nextToken = 1; + _locParseCtxt.cmd = new Command; + _locParseCtxt.cmd->_id = id; + +} + +void Parallaction_ns::parseCommands(Script &script, CommandList& list) { + debugC(5, kDebugParser, "parseCommands()"); + + _locParseCtxt.list = &list; + _locParseCtxt.endcommands = false; + _locParseCtxt.script = &script; + + pushParserTables(&_commandParsers, _commandsNames); +} + +Dialogue *Parallaction_ns::parseDialogue(Script &script) { + debugC(7, kDebugParser, "parseDialogue()"); + + uint16 numQuestions = 0; + + Dialogue *dialogue = new Dialogue; + + Table forwards(20); + + fillBuffers(script, true); + + while (scumm_stricmp(_tokens[0], "enddialogue")) { + if (scumm_stricmp(_tokens[0], "Question")) continue; + + Question *question = new Question; + dialogue->_questions[numQuestions] = question; + + forwards.addData(_tokens[1]); + + question->_text = parseDialogueString(script); + + fillBuffers(script, true); + question->_mood = atoi(_tokens[0]); + + uint16 numAnswers = 0; + + fillBuffers(script, true); + while (scumm_stricmp(_tokens[0], "endquestion")) { // parse answers + + Answer *answer = new Answer; + question->_answers[numAnswers] = answer; + + if (_tokens[1][0]) { + + Table* flagNames; + uint16 token; + + if (!scumm_stricmp(_tokens[1], "global")) { + token = 2; + flagNames = _globalTable; + answer->_yesFlags |= kFlagsGlobal; + } else { + token = 1; + flagNames = _localFlagNames; + } + + do { + + if (!scumm_strnicmp(_tokens[token], "no", 2)) { + byte _al = flagNames->lookup(_tokens[token]+2); + answer->_noFlags |= 1 << (_al - 1); + } else { + byte _al = flagNames->lookup(_tokens[token]); + answer->_yesFlags |= 1 << (_al - 1); + } + + token++; + + } while (!scumm_stricmp(_tokens[token++], "|")); + + } + + answer->_text = parseDialogueString(script); + + fillBuffers(script, true); + answer->_mood = atoi(_tokens[0]); + answer->_following._name = parseDialogueString(script); + + fillBuffers(script, true); + if (!scumm_stricmp(_tokens[0], "commands")) { + + parseCommands(script, answer->_commands); + _locParseCtxt.endcommands = false; + do { + fillBuffers(script, true); + parseStatement(); + } while (!_locParseCtxt.endcommands); + + fillBuffers(script, true); + } + + numAnswers++; + } + + fillBuffers(script, true); + numQuestions++; + + } + + // link questions + byte v50[20]; + memset(v50, 0, 20); + + for (uint16 i = 0; i < numQuestions; i++) { + Question *question = dialogue->_questions[i]; + + for (uint16 j = 0; j < NUM_ANSWERS; j++) { + Answer *answer = question->_answers[j]; + if (answer == 0) continue; + + int16 index = forwards.lookup(answer->_following._name); + free(answer->_following._name); + + if (index == Table::notFound) + answer->_following._question = 0; + else + answer->_following._question = dialogue->_questions[index - 1]; + + + } + } + + debugC(7, kDebugParser, "parseDialogue() done"); + + return dialogue; +} + + +char *Parallaction_ns::parseDialogueString(Script &script) { + + char vC8[200]; + char *vD0 = NULL; + do { + + vD0 = script.readLine(vC8, 200); + if (vD0 == 0) return NULL; + + vD0 = Common::ltrim(vD0); + + } while (strlen(vD0) == 0); + + vD0[strlen(vD0)-1] = '\0'; // deletes the trailing '0xA' + // this is critical for Gfx::displayWrappedString to work properly + return strdup(vD0); +} + + +DECLARE_LOCATION_PARSER(invalid) { + debugC(7, kDebugParser, "LOCATION_PARSER(invalid) "); + + error("unknown keyword '%s' in location '%s'", _tokens[0], _locParseCtxt.filename); +} + +DECLARE_LOCATION_PARSER(endlocation) { + debugC(7, kDebugParser, "LOCATION_PARSER(endlocation) "); + + _locParseCtxt.end = true; +} + + +DECLARE_LOCATION_PARSER(location) { + debugC(7, kDebugParser, "LOCATION_PARSER(location) "); + + // The parameter for location is 'location.mask'. + // If mask is not present, then it is assumed + // that path & mask are encoded in the background + // bitmap, otherwise a separate .msk file exists. + + char *mask = strchr(_tokens[1], '.'); + if (mask) { + mask[0] = '\0'; + mask++; + } + + strcpy(_location._name, _tokens[1]); + switchBackground(_location._name, mask); + + if (_tokens[2][0] != '\0') { + _char._ani._left = atoi(_tokens[2]); + _char._ani._top = atoi(_tokens[3]); + } + + if (_tokens[4][0] != '\0') { + _char._ani._frame = atoi(_tokens[4]); + } +} + + +DECLARE_LOCATION_PARSER(disk) { + debugC(7, kDebugParser, "LOCATION_PARSER(disk) "); + + _disk->selectArchive(_tokens[1]); +} + + +DECLARE_LOCATION_PARSER(nodes) { + debugC(7, kDebugParser, "LOCATION_PARSER(nodes) "); + + parseWalkNodes(*_locParseCtxt.script, _location._walkNodes); +} + + +DECLARE_LOCATION_PARSER(zone) { + debugC(7, kDebugParser, "LOCATION_PARSER(zone) "); + + parseZone(*_locParseCtxt.script, _zones, _tokens[1]); +} + + +DECLARE_LOCATION_PARSER(animation) { + debugC(7, kDebugParser, "LOCATION_PARSER(animation) "); + + parseAnimation(*_locParseCtxt.script, _animations, _tokens[1]); +} + + +DECLARE_LOCATION_PARSER(localflags) { + debugC(7, kDebugParser, "LOCATION_PARSER(localflags) "); + + int _si = 1; + while (_tokens[_si][0] != '\0') { + _localFlagNames->addData(_tokens[_si]); + _si++; + } +} + + +DECLARE_LOCATION_PARSER(commands) { + debugC(7, kDebugParser, "LOCATION_PARSER(commands) "); + + parseCommands(*_locParseCtxt.script, _location._commands); +} + + +DECLARE_LOCATION_PARSER(acommands) { + debugC(7, kDebugParser, "LOCATION_PARSER(acommands) "); + + parseCommands(*_locParseCtxt.script, _location._aCommands); +} + + +DECLARE_LOCATION_PARSER(flags) { + debugC(7, kDebugParser, "LOCATION_PARSER(flags) "); + + if ((_localFlags[_currentLocationIndex] & kFlagsVisited) == 0) { + // only for 1st visit + _localFlags[_currentLocationIndex] = 0; + int _si = 1; + + do { + byte _al = _localFlagNames->lookup(_tokens[_si]); + _localFlags[_currentLocationIndex] |= 1 << (_al - 1); + + _si++; + if (scumm_stricmp(_tokens[_si], "|")) break; + _si++; + } while (true); + } +} + + +DECLARE_LOCATION_PARSER(comment) { + debugC(7, kDebugParser, "LOCATION_PARSER(comment) "); + + _location._comment = parseComment(*_locParseCtxt.script); +} + + +DECLARE_LOCATION_PARSER(endcomment) { + debugC(7, kDebugParser, "LOCATION_PARSER(endcomment) "); + + _location._endComment = parseComment(*_locParseCtxt.script); +} + + +DECLARE_LOCATION_PARSER(sound) { + debugC(7, kDebugParser, "LOCATION_PARSER(sound) "); + + if (getPlatform() == Common::kPlatformAmiga) { + strcpy(_locationSound, _tokens[1]); + _hasLocationSound = true; + } +} + + +DECLARE_LOCATION_PARSER(music) { + debugC(7, kDebugParser, "LOCATION_PARSER(music) "); + + if (getPlatform() == Common::kPlatformAmiga) + _soundMan->setMusicFile(_tokens[1]); +} + +DECLARE_LOCATION_PARSER(redundant) { + debugC(7, kDebugParser, "LOCATION_PARSER(redundant) "); + + warning("redundant '%s' line found in script '%s'", _tokens[0], _locParseCtxt.filename); +} + + +void Parallaction_ns::parseLocation(const char *filename) { + debugC(1, kDebugParser, "parseLocation('%s')", filename); + + allocateLocationSlot(filename); +// printf("got location slot #%i for %s\n", _currentLocationIndex, filename); + + Script *script = _disk->loadLocation(filename); + + // TODO: the following two lines are specific to Nippon Safes + // and should be moved into something like 'initializeParsing()' + _gfx->setFont(_labelFont); + _hasLocationSound = false; + + _locParseCtxt.end = false; + _locParseCtxt.script = script; + _locParseCtxt.filename = filename; + + pushParserTables(&_locationParsers, _locationStmt); + do { + fillBuffers(*script, true); + parseStatement(); + } while (!_locParseCtxt.end); + popParserTables(); + + delete script; + + // this resolves any forward references in the script + for (uint16 _si = 0; _forwardedCommands[_si]; _si++) { + _forwardedCommands[_si]->u._animation = findAnimation(_forwardedAnimationNames[_si]); + _forwardedCommands[_si] = NULL; + } + _numForwards = 0; + + // this loads animation scripts + AnimationList::iterator it = _animations.begin(); + for ( ; it != _animations.end(); it++) { + if ((*it)->_scriptName) + loadProgram(*it, (*it)->_scriptName); + } + + debugC(1, kDebugParser, "parseLocation('%s') done", filename); + return; +} + + +void Parallaction_ns::parseWalkNodes(Script& script, WalkNodeList &list) { + debugC(5, kDebugParser, "parseWalkNodes()"); + + fillBuffers(script, true); + while (scumm_stricmp(_tokens[0], "ENDNODES")) { + + if (!scumm_stricmp(_tokens[0], "COORD")) { + + WalkNode *v4 = new WalkNode( + atoi(_tokens[1]), + atoi(_tokens[2]) + ); + + list.push_front(v4); + } + + fillBuffers(script, true); + } + + debugC(5, kDebugParser, "parseWalkNodes() done"); + + return; +} + +typedef OpcodeImpl<Parallaction_ns> OpcodeV1; +#define INSTRUCTION_PARSER(sig) OpcodeV1(this, &Parallaction_ns::instParse_##sig) +#define ZONE_PARSER(sig) OpcodeV1(this, &Parallaction_ns::locZoneParse_##sig) +#define ANIM_PARSER(sig) OpcodeV1(this, &Parallaction_ns::locAnimParse_##sig) +#define LOCATION_PARSER(sig) OpcodeV1(this, &Parallaction_ns::locParse_##sig) +#define COMMAND_PARSER(sig) OpcodeV1(this, &Parallaction_ns::cmdParse_##sig) + +void Parallaction_ns::initParsers() { + + static const OpcodeV1 op0[] = { + INSTRUCTION_PARSER(defLocal), // invalid opcode -> local definition + INSTRUCTION_PARSER(animation), // on + INSTRUCTION_PARSER(animation), // off + INSTRUCTION_PARSER(x), + INSTRUCTION_PARSER(y), + INSTRUCTION_PARSER(z), + INSTRUCTION_PARSER(f), + INSTRUCTION_PARSER(loop), + INSTRUCTION_PARSER(null), // endloop + INSTRUCTION_PARSER(null), // show + INSTRUCTION_PARSER(inc), + INSTRUCTION_PARSER(inc), // dec + INSTRUCTION_PARSER(set), + INSTRUCTION_PARSER(put), + INSTRUCTION_PARSER(call), + INSTRUCTION_PARSER(null), // wait + INSTRUCTION_PARSER(animation), // start + INSTRUCTION_PARSER(sound), + INSTRUCTION_PARSER(move), + INSTRUCTION_PARSER(endscript) + }; + + uint i; + for (i = 0; i < ARRAYSIZE(op0); i++) + _instructionParsers.push_back(&op0[i]); + + + static const OpcodeV1 op2[] = { + COMMAND_PARSER(invalid), + COMMAND_PARSER(flags), // set + COMMAND_PARSER(flags), // clear + COMMAND_PARSER(animation), // start + COMMAND_PARSER(zone), // speak + COMMAND_PARSER(zone), // get + COMMAND_PARSER(location), // location + COMMAND_PARSER(zone), // open + COMMAND_PARSER(zone), // close + COMMAND_PARSER(zone), // on + COMMAND_PARSER(zone), // off + COMMAND_PARSER(call), // call + COMMAND_PARSER(flags), // toggle + COMMAND_PARSER(drop), // drop + COMMAND_PARSER(simple), // quit + COMMAND_PARSER(move), // move + COMMAND_PARSER(animation), // stop + COMMAND_PARSER(endcommands), // endcommands + COMMAND_PARSER(endcommands) // endzone + }; + + for (i = 0; i < ARRAYSIZE(op2); i++) + _commandParsers.push_back(&op2[i]); + + + static const OpcodeV1 op4[] = { + LOCATION_PARSER(invalid), + LOCATION_PARSER(endlocation), + LOCATION_PARSER(location), + LOCATION_PARSER(disk), + LOCATION_PARSER(nodes), + LOCATION_PARSER(zone), + LOCATION_PARSER(animation), + LOCATION_PARSER(localflags), + LOCATION_PARSER(commands), + LOCATION_PARSER(acommands), + LOCATION_PARSER(flags), + LOCATION_PARSER(comment), + LOCATION_PARSER(endcomment), + LOCATION_PARSER(sound), + LOCATION_PARSER(music), + LOCATION_PARSER(redundant) // for redundant endanimation + }; + + for (i = 0; i < ARRAYSIZE(op4); i++) + _locationParsers.push_back(&op4[i]); + + static const OpcodeV1 op5[] = { + ZONE_PARSER(invalid), + ZONE_PARSER(limits), + ZONE_PARSER(moveto), + ZONE_PARSER(type), + ZONE_PARSER(commands), + ZONE_PARSER(label), + ZONE_PARSER(flags), + ZONE_PARSER(endzone) + }; + + for (i = 0; i < ARRAYSIZE(op5); i++) + _locationZoneParsers.push_back(&op5[i]); + + static const OpcodeV1 op6[] = { + ANIM_PARSER(invalid), + ANIM_PARSER(script), + ANIM_PARSER(commands), + ANIM_PARSER(type), + ANIM_PARSER(label), + ANIM_PARSER(flags), + ANIM_PARSER(file), + ANIM_PARSER(position), + ANIM_PARSER(moveto), + ANIM_PARSER(endanimation) + }; + + for (i = 0; i < ARRAYSIZE(op6); i++) + _locationAnimParsers.push_back(&op6[i]); + + _currentOpcodes = 0; + _currentStatements = 0; + +} + +// +// a comment can appear both at location and Zone levels +// comments are displayed into rectangles on the screen +// +char *Parallaction_ns::parseComment(Script &script) { + + char _tmp_comment[1000] = "\0"; + char *v194; + + do { + char v190[400]; + v194 = script.readLine(v190, 400); + + v194[strlen(v194)-1] = '\0'; + if (!scumm_stricmp(v194, "endtext")) + break; + + strcat(_tmp_comment, v194); + strcat(_tmp_comment, " "); + } while (true); + + v194 = strdup(_tmp_comment); + _tmp_comment[0] = '\0'; + + return v194; +} + + +DECLARE_ZONE_PARSER(invalid) { + debugC(7, kDebugParser, "ZONE_PARSER(invalid) "); + + error("unknown statement '%s' in zone %s", _tokens[0], _locParseCtxt.z->_label._text); +} + +DECLARE_ZONE_PARSER(endzone) { + debugC(7, kDebugParser, "ZONE_PARSER(endzone) "); + + popParserTables(); +} + +DECLARE_ZONE_PARSER(limits) { + debugC(7, kDebugParser, "ZONE_PARSER(limits) "); + + _locParseCtxt.z->_left = atoi(_tokens[1]); + _locParseCtxt.z->_top = atoi(_tokens[2]); + _locParseCtxt.z->_right = atoi(_tokens[3]); + _locParseCtxt.z->_bottom = atoi(_tokens[4]); +} + + +DECLARE_ZONE_PARSER(moveto) { + debugC(7, kDebugParser, "ZONE_PARSER(moveto) "); + + _locParseCtxt.z->_moveTo.x = atoi(_tokens[1]); + _locParseCtxt.z->_moveTo.y = atoi(_tokens[2]); +} + + +DECLARE_ZONE_PARSER(type) { + debugC(7, kDebugParser, "ZONE_PARSER(type) "); + + if (_tokens[2][0] != '\0') { + _locParseCtxt.z->_type = (4 + _objectsNames->lookup(_tokens[2])) << 16; + } + int16 _si = _zoneTypeNames->lookup(_tokens[1]); + if (_si != Table::notFound) { + _locParseCtxt.z->_type |= 1 << (_si - 1); + parseZoneTypeBlock(*_locParseCtxt.script, _locParseCtxt.z); + } + + popParserTables(); +} + + +DECLARE_ZONE_PARSER(commands) { + debugC(7, kDebugParser, "ZONE_PARSER(commands) "); + + parseCommands(*_locParseCtxt.script, _locParseCtxt.z->_commands); +} + + +DECLARE_ZONE_PARSER(label) { + debugC(7, kDebugParser, "ZONE_PARSER(label) "); + +// printf("label: %s", _tokens[1]); + renderLabel(&_locParseCtxt.z->_label._cnv, _tokens[1]); +} + + +DECLARE_ZONE_PARSER(flags) { + debugC(7, kDebugParser, "ZONE_PARSER(flags) "); + + uint16 _si = 1; + + do { + char _al = _zoneFlagNames->lookup(_tokens[_si]); + _si++; + _locParseCtxt.z->_flags |= 1 << (_al - 1); + } while (!scumm_stricmp(_tokens[_si++], "|")); +} + +void Parallaction_ns::parseZone(Script &script, ZoneList &list, char *name) { + debugC(5, kDebugParser, "parseZone(name: %s)", name); + + if (findZone(name)) { + while (scumm_stricmp(_tokens[0], "endzone")) { + fillBuffers(script, true); + } + return; + } + + Zone *z = new Zone; + + z->_label._text = strdup(name); + + _locParseCtxt.z = z; + _locParseCtxt.script = &script; + + list.push_front(z); + + pushParserTables(&_locationZoneParsers, _locationZoneStmt); + + return; +} + + + + +void Parallaction_ns::parseGetData(Script &script, Zone *z) { + + GetData *data = new GetData; + + do { + + if (!scumm_stricmp(_tokens[0], "file")) { + data->_cnv = _disk->loadStatic(_tokens[1]); + data->_backup = (byte*)malloc(data->_cnv->w*data->_cnv->h); + + if ((z->_flags & kFlagsRemove) == 0) { + _gfx->backupGetBackground(data, z->_left, z->_top); + _gfx->flatBlitCnv(data->_cnv, z->_left, z->_top, Gfx::kBitBack); + } + } + + if (!scumm_stricmp(_tokens[0], "icon")) { + data->_icon = 4 + _objectsNames->lookup(_tokens[1]); + } + + fillBuffers(script, true); + } while (scumm_stricmp(_tokens[0], "endzone")); + + z->u.get = data; + +} + + +void Parallaction_ns::parseExamineData(Script &script, Zone *z) { + + ExamineData *data = new ExamineData; + + do { + + if (!scumm_stricmp(_tokens[0], "file")) { + data->_filename = strdup(_tokens[1]); + } + if (!scumm_stricmp(_tokens[0], "desc")) { + data->_description = parseComment(script); + } + + fillBuffers(script, true); + } while (scumm_stricmp(_tokens[0], "endzone")); + + z->u.examine = data; + +} + + +void Parallaction_ns::parseDoorData(Script &script, Zone *z) { + + DoorData *data = new DoorData; + + do { + + if (!scumm_stricmp(_tokens[0], "slidetext")) { + strcpy(_slideText[0], _tokens[1]); +// printf("%s\t", _slideText[0]); + strcpy(_slideText[1], _tokens[2]); + } + + if (!scumm_stricmp(_tokens[0], "location")) { + data->_location = strdup(_tokens[1]); + } + + if (!scumm_stricmp(_tokens[0], "file")) { +// printf("file: '%s'", _tokens[0]); + + data->_cnv = _disk->loadFrames(_tokens[1]); + uint16 _ax = (z->_flags & kFlagsClosed ? 0 : 1); + + Common::Rect r; + data->_cnv->getRect(0, r); + + data->_background = (byte*)malloc(r.width() * r.height()); + _gfx->backupDoorBackground(data, z->_left, z->_top); + + _gfx->flatBlitCnv(data->_cnv, _ax, z->_left, z->_top, Gfx::kBitBack); + } + + if (!scumm_stricmp(_tokens[0], "startpos")) { + data->_startPos.x = atoi(_tokens[1]); + data->_startPos.y = atoi(_tokens[2]); + data->_startFrame = atoi(_tokens[3]); + } + + fillBuffers(script, true); + } while (scumm_stricmp(_tokens[0], "endzone")); + + z->u.door = data; + +} + + +void Parallaction_ns::parseMergeData(Script &script, Zone *z) { + + MergeData *data = new MergeData; + + do { + + if (!scumm_stricmp(_tokens[0], "obj1")) { + data->_obj1 = 4 + _objectsNames->lookup(_tokens[1]); + } + if (!scumm_stricmp(_tokens[0], "obj2")) { + data->_obj2 = 4 + _objectsNames->lookup(_tokens[1]); + } + if (!scumm_stricmp(_tokens[0], "newobj")) { + data->_obj3 = 4 + _objectsNames->lookup(_tokens[1]); + } + + fillBuffers(script, true); + } while (scumm_stricmp(_tokens[0], "endzone")); + + z->u.merge = data; + +} + +void Parallaction_ns::parseHearData(Script &script, Zone *z) { + + HearData *data = new HearData; + + do { + + if (!scumm_stricmp(_tokens[0], "sound")) { + strcpy(data->_name, _tokens[1]); + data->_channel = atoi(_tokens[2]); + } + if (!scumm_stricmp(_tokens[0], "freq")) { + data->_freq = atoi(_tokens[1]); + } + + fillBuffers(script, true); + } while (scumm_stricmp(_tokens[0], "endzone")); + + z->u.hear = data; + +} + +void Parallaction_ns::parseSpeakData(Script &script, Zone *z) { + + SpeakData *data = new SpeakData; + + do { + + if (!scumm_stricmp(_tokens[0], "file")) { + strcpy(data->_name, _tokens[1]); + } + if (!scumm_stricmp(_tokens[0], "Dialogue")) { + data->_dialogue = parseDialogue(script); + } + + fillBuffers(script, true); + } while (scumm_stricmp(_tokens[0], "endzone")); + + z->u.speak = data; + +} + + +void Parallaction_ns::parseZoneTypeBlock(Script &script, Zone *z) { + debugC(7, kDebugParser, "parseZoneTypeBlock(name: %s, type: %x)", z->_label._text, z->_type); + + switch (z->_type & 0xFFFF) { + case kZoneExamine: // examine Zone alloc + parseExamineData(script, z); + break; + + case kZoneDoor: // door Zone alloc + parseDoorData(script, z); + break; + + case kZoneGet: // get Zone alloc + parseGetData(script, z); + break; + + case kZoneMerge: // merge Zone alloc + parseMergeData(script, z); + break; + + case kZoneHear: // hear Zone alloc + parseHearData(script, z); + break; + + case kZoneSpeak: // speak Zone alloc + parseSpeakData(script, z); + break; + + default: + // eats up 'ENDZONE' line for unprocessed zone types + fillBuffers(script, true); + break; + } + + debugC(7, kDebugParser, "parseZoneTypeBlock() done"); + + return; +} + + +} // namespace Parallaction diff --git a/engines/parallaction/saveload.cpp b/engines/parallaction/saveload.cpp index 279dbda1b9..299eba18a3 100644 --- a/engines/parallaction/saveload.cpp +++ b/engines/parallaction/saveload.cpp @@ -47,8 +47,6 @@ namespace Parallaction { -extern char _gameNames[][20]; - class SaveLoadChooser : public GUI::Dialog { typedef Common::String String; @@ -61,12 +59,12 @@ protected: GUI::StaticTextWidget *_time; GUI::StaticTextWidget *_playtime; GUI::ContainerWidget *_container; - Parallaction *_vm; + Parallaction_ns *_vm; uint8 _fillR, _fillG, _fillB; public: - SaveLoadChooser(const String &title, const String &buttonLabel, Parallaction *engine); + SaveLoadChooser(const String &title, const String &buttonLabel, Parallaction_ns *engine); ~SaveLoadChooser(); virtual void handleCommand(GUI::CommandSender *sender, uint32 cmd, uint32 data); @@ -80,7 +78,7 @@ public: -void Parallaction::doLoadGame(uint16 slot) { +void Parallaction_ns::doLoadGame(uint16 slot) { _introSarcData3 = 200; _introSarcData2 = 1; @@ -179,7 +177,7 @@ void Parallaction::doLoadGame(uint16 slot) { } -void Parallaction::doSaveGame(uint16 slot, const char* name) { +void Parallaction_ns::doSaveGame(uint16 slot, const char* name) { char path[PATH_LEN]; sprintf(path, "game.%i", slot); @@ -251,8 +249,7 @@ enum { }; - -SaveLoadChooser::SaveLoadChooser(const String &title, const String &buttonLabel, Parallaction *engine) +SaveLoadChooser::SaveLoadChooser(const String &title, const String &buttonLabel, Parallaction_ns *engine) : Dialog("scummsaveload"), _list(0), _chooseButton(0), _gfxWidget(0), _vm(engine) { // _drawingHints |= GUI::THEME_HINT_SPECIAL_COLOR; @@ -340,7 +337,7 @@ void SaveLoadChooser::reflowLayout() { Dialog::reflowLayout(); } -int Parallaction::buildSaveFileList(Common::StringList& l) { +int Parallaction_ns::buildSaveFileList(Common::StringList& l) { char name[16]; char buf[30]; @@ -367,7 +364,7 @@ int Parallaction::buildSaveFileList(Common::StringList& l) { } -int Parallaction::selectSaveFile(uint16 arg_0, const char* caption, const char* button) { +int Parallaction_ns::selectSaveFile(uint16 arg_0, const char* caption, const char* button) { SaveLoadChooser* slc = new SaveLoadChooser(caption, button, this); @@ -388,7 +385,7 @@ int Parallaction::selectSaveFile(uint16 arg_0, const char* caption, const char* -void Parallaction::loadGame() { +void Parallaction_ns::loadGame() { int _di = selectSaveFile( 0, "Load file", "Load" ); if (_di == -1) { @@ -406,7 +403,7 @@ void Parallaction::loadGame() { } -void Parallaction::saveGame() { +void Parallaction_ns::saveGame() { if (!scumm_stricmp(_location._name, "caveau")) return; diff --git a/engines/parallaction/sound.cpp b/engines/parallaction/sound.cpp index 21dcc3c788..9b8e179ccb 100644 --- a/engines/parallaction/sound.cpp +++ b/engines/parallaction/sound.cpp @@ -18,8 +18,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL:https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/branches/gsoc2007-fsnode/engines/parallaction/sound.cpp $ - * $Id:sound.cpp 26949 2007-05-26 20:23:24Z david_corrales $ + * $URL$ + * $Id$ * */ @@ -265,7 +265,7 @@ void DosSoundMan::playCharacterMusic(const char *character) { setMusicFile("dino"); } else if (!scumm_stricmp(name, _donnaName)) { - setMusicFile("dough"); + setMusicFile("donna"); } else if (!scumm_stricmp(name, _doughName)) { setMusicFile("nuts"); @@ -281,14 +281,14 @@ void DosSoundMan::playLocationMusic(const char *location) { if (_musicData1 != 0) { playCharacterMusic(_vm->_characterName); _musicData1 = 0; - debugC(2, kDebugLocation, "changeLocation: started character specific music"); + debugC(2, kDebugExec, "changeLocation: started character specific music"); } if (!scumm_stricmp(location, "night") || !scumm_stricmp(location, "intsushi")) { setMusicFile("nuts"); playMusic(); - debugC(2, kDebugLocation, "changeLocation: started music 'soft'"); + debugC(2, kDebugExec, "changeLocation: started music 'soft'"); } if (!scumm_stricmp(location, "museo") || @@ -302,7 +302,7 @@ void DosSoundMan::playLocationMusic(const char *location) { stopMusic(); _musicData1 = 1; - debugC(2, kDebugLocation, "changeLocation: music stopped"); + debugC(2, kDebugExec, "changeLocation: music stopped"); } } diff --git a/engines/parallaction/sound.h b/engines/parallaction/sound.h index 7a903ec790..f8f1a9e6b0 100644 --- a/engines/parallaction/sound.h +++ b/engines/parallaction/sound.h @@ -18,8 +18,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL:https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/branches/gsoc2007-fsnode/engines/parallaction/sound.h $ - * $Id:sound.h 26949 2007-05-26 20:23:24Z david_corrales $ + * $URL$ + * $Id$ * */ diff --git a/engines/parallaction/staticres.cpp b/engines/parallaction/staticres.cpp index 046176a933..94d2692ff1 100644 --- a/engines/parallaction/staticres.cpp +++ b/engines/parallaction/staticres.cpp @@ -30,7 +30,7 @@ namespace Parallaction { -byte Gfx::_mouseArrow[256] = { +byte Parallaction_ns::_mouseArrow[256] = { 0x12, 0x11, 0x11, 0x11, 0x13, 0x12, 0x12, 0x12, 0x13, 0x12, 0x12, 0x11, 0x13, 0x12, 0x12, 0x00, 0x13, 0x12, 0x12, 0x11, 0x13, 0x12, 0x12, 0x12, 0x13, 0x12, 0x12, 0x12, 0x13, 0x12, 0x12, 0x12, 0x13, 0x12, 0x12, 0x12, 0x13, 0x12, 0x12, 0x12, 0x13, 0x12, 0x12, 0x13, 0x13, 0x13, 0x12, 0x00, @@ -50,8 +50,7 @@ byte Gfx::_mouseArrow[256] = { }; -byte _amigaTopazFont[2600] = -{ +byte _amigaTopazFont[2600] = { 0x00, 0x00, 0x03, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x79, 0x00, 0x00, 0x03, 0xe9, 0x00, 0x00, 0x02, 0x79, 0x70, 0xff, 0x4e, 0x75, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, @@ -249,19 +248,6 @@ const char *_zoneTypeNamesRes_ns[] = { "Command" }; -const char _gameNames[10][20] = { - "GAME1", - "GAME2", - "GAME3", - "GAME4", - "GAME5", - "GAME6", - "GAME7", - "GAME8", - "GAME9", - "GAME10" -}; - const char *_commandsNamesRes_ns[] = { "set", "clear", @@ -278,7 +264,9 @@ const char *_commandsNamesRes_ns[] = { "drop", "quit", "move", - "stop" + "stop", + "endcommands", + "endzone" }; const char *_instructionNamesRes_ns[] = { @@ -299,7 +287,8 @@ const char *_instructionNamesRes_ns[] = { "wait", "start", "sound", - "move" + "move", + "endscript" }; const char *_callableNamesRes_ns[] = { @@ -330,6 +319,46 @@ const char *_callableNamesRes_ns[] = { "TestResult" }; +const char *_locationStmtRes_ns[] = { + "endlocation", + "location", + "disk", + "nodes", + "zone", + "animation", + "localflags", + "commands", + "acommands", + "flags", + "comment", + "endcomment", + "sound", + "music", + "endanimation" +}; + +const char *_locationZoneStmtRes_ns[] = { + "limits", + "moveto", + "type", + "commands", + "label", + "flags", + "endzone" +}; + +const char *_locationAnimStmtRes_ns[] = { + "script", + "commands", + "type", + "label", + "flags", + "file", + "position", + "moveto", + "endanimation" +}; + const char *_zoneTypeNamesRes_br[] = { "examine", "door", @@ -392,11 +421,11 @@ const char *_instructionNamesRes_br[] = { "mul", "div", "if", - "ifeq", - "iflt", - "ifgt", + "dummy", + "dummy", "endif", - "stop" + "stop", + "endscript" }; const char *_commandsNamesRes_br[] = { @@ -404,7 +433,7 @@ const char *_commandsNamesRes_br[] = { "clear", "start", "speak", - "get" + "get", "location", "open", "close", @@ -424,7 +453,7 @@ const char *_commandsNamesRes_br[] = { "leave", "inc", "dec", - "text", + "test", "dummy", "dummy", "let", @@ -440,7 +469,10 @@ const char *_commandsNamesRes_br[] = { "dummy", "return", "onsave", - "offsave" + "offsave", + "endcommands", + "ifchar", + "endif" }; const char *_callableNamesRes_br[] = { @@ -472,6 +504,52 @@ const char *_audioCommandsNamesRes_br[] = { "loop" }; +const char *_locationStmtRes_br[] = { + "character", + "endlocation", + "ifchar", + "endif", + "location", + "mask", + "path", + "disk", + "localflags", + "commands", + "escape", + "acommands", + "flags", + "comment", + "endcomment", + "zone", + "animation", + "zeta", + "music", + "sound" +}; + +const char *_locationZoneStmtRes_br[] = { + "endzone", + "limits", + "moveto", + "type", + "commands", + "label", + "flags" +}; + +const char *_locationAnimStmtRes_br[] = { + "endanimation", + "endzone", + "script", + "commands", + "type", + "label", + "flags", + "file", + "position", + "moveto" +}; + const char *_dinoName = "dino"; const char *_donnaName = "donna"; const char *_doughName = "dough"; @@ -525,7 +603,7 @@ const Parallaction_ns::Callable Parallaction_ns::_amigaCallables[] = { CALLABLE_NS(_c_startMusic), CALLABLE_NS(_c_closeMusic), CALLABLE_NS(_c_fade), - CALLABLE_NS(_c_play_boogie), + CALLABLE_NS(_c_HBOn), CALLABLE_NS(_c_moveSarc), CALLABLE_NS(_c_contaFoglie), CALLABLE_NS(_c_zeroFoglie), @@ -564,8 +642,11 @@ void Parallaction_ns::initResources() { _zoneFlagNames = new Table(ARRAYSIZE(_zoneFlagNamesRes_ns), _zoneFlagNamesRes_ns); _zoneTypeNames = new Table(ARRAYSIZE(_zoneTypeNamesRes_ns), _zoneTypeNamesRes_ns); _commandsNames = new Table(ARRAYSIZE(_commandsNamesRes_ns), _commandsNamesRes_ns); + _locationStmt = new Table(ARRAYSIZE(_locationStmtRes_ns), _locationStmtRes_ns); + _locationZoneStmt = new Table(ARRAYSIZE(_locationZoneStmtRes_ns), _locationZoneStmtRes_ns); + _locationAnimStmt = new Table(ARRAYSIZE(_locationAnimStmtRes_ns), _locationAnimStmtRes_ns); - _localFlagNames = new Table(120); + _localFlagNames = new FixedTable(NUM_LOCATIONS, 1); _localFlagNames->addData("visited"); if (getPlatform() == Common::kPlatformPC) { @@ -591,10 +672,13 @@ void Parallaction_br::initResources() { _zoneTypeNames = new Table(ARRAYSIZE(_zoneTypeNamesRes_br), _zoneTypeNamesRes_br); _commandsNames = new Table(ARRAYSIZE(_commandsNamesRes_br), _commandsNamesRes_br); _audioCommandsNames = new Table(ARRAYSIZE(_audioCommandsNamesRes_br), _audioCommandsNamesRes_br); + _locationStmt = new Table(ARRAYSIZE(_locationStmtRes_br), _locationStmtRes_br); + _locationZoneStmt = new Table(ARRAYSIZE(_locationZoneStmtRes_br), _locationZoneStmtRes_br); + _locationAnimStmt = new Table(ARRAYSIZE(_locationAnimStmtRes_br), _locationAnimStmtRes_br); - // TODO: make sure there are 120 max locations in Big Red Adventure - _localFlagNames = new Table(120); + _localFlagNames = new FixedTable(NUM_LOCATIONS, 2); _localFlagNames->addData("visited"); + _localFlagNames->addData("testtrue"); if (getPlatform() == Common::kPlatformPC) { _callables = _dosCallables; diff --git a/engines/parallaction/walk.cpp b/engines/parallaction/walk.cpp index d57e9d2532..73b7407308 100644 --- a/engines/parallaction/walk.cpp +++ b/engines/parallaction/walk.cpp @@ -29,8 +29,6 @@ namespace Parallaction { -static byte *_buffer; - static uint16 _doorData1 = 1000; static Zone *_zoneTrap = NULL; @@ -38,32 +36,27 @@ static uint16 walkData1 = 0; static uint16 walkData2 = 0; // next walk frame -uint16 queryPath(uint16 x, uint16 y) { - - // NOTE: a better solution would have us mirror each byte in the mask in the loading routine - // AmigaDisk_ns::loadPath() instead of doing it here. - - byte _al = _buffer[y*40 + x/8]; - byte _dl = (_vm->getPlatform() == Common::kPlatformPC) ? (x & 7) : (7 - (x & 7)); - - return _al & (1 << _dl); +inline byte PathBuffer::getValue(uint16 x, uint16 y) { + byte m = data[(x >> 3) + y * internalWidth]; + uint n = (_vm->getPlatform() == Common::kPlatformPC) ? (x & 7) : (7 - (x & 7)); + return ((1 << n) & m) >> n; } // adjusts position towards nearest walkable point // void PathBuilder::correctPathPoint(Common::Point &to) { - if (queryPath(to.x, to.y)) return; + if (_vm->_pathBuffer->getValue(to.x, to.y)) return; int16 right = to.x; int16 left = to.x; do { right++; - } while ((queryPath(right, to.y) == 0) && (right < _vm->_screenWidth)); + } while ((_vm->_pathBuffer->getValue(right, to.y) == 0) && (right < _vm->_pathBuffer->w)); do { left--; - } while ((queryPath(left, to.y) == 0) && (left > 0)); - right = (right == _vm->_screenWidth) ? 1000 : right - to.x; + } while ((_vm->_pathBuffer->getValue(left, to.y) == 0) && (left > 0)); + right = (right == _vm->_pathBuffer->w) ? 1000 : right - to.x; left = (left == 0) ? 1000 : to.x - left; @@ -71,12 +64,12 @@ void PathBuilder::correctPathPoint(Common::Point &to) { int16 bottom = to.y; do { top--; - } while ((queryPath(to.x, top) == 0) && (top > 0)); + } while ((_vm->_pathBuffer->getValue(to.x, top) == 0) && (top > 0)); do { bottom++; - } while ((queryPath(to.x, bottom) == 0) && (bottom < _vm->_screenHeight)); + } while ((_vm->_pathBuffer->getValue(to.x, bottom) == 0) && (bottom < _vm->_pathBuffer->h)); top = (top == 0) ? 1000 : to.y - top; - bottom = (bottom == _vm->_screenHeight) ? 1000 : bottom - to.y; + bottom = (bottom == _vm->_pathBuffer->h) ? 1000 : bottom - to.y; int16 closeX = (right >= left) ? left : right; @@ -163,7 +156,7 @@ WalkNodeList *PathBuilder::buildPath(uint16 x, uint16 y) { correctPathPoint(to); debugC(1, kDebugWalk, "found closest path point at (%i, %i)", to.x, to.y); - WalkNode *v48 = new WalkNode(to.x - _vm->_char._ani.width() / 2, to.y - _vm->_char._ani.height()); + WalkNode *v48 = new WalkNode(to.x, to.y); WalkNode *v44 = new WalkNode(*v48); uint16 v38 = walkFunc1(to.x, to.y, v44); @@ -185,7 +178,9 @@ WalkNodeList *PathBuilder::buildPath(uint16 x, uint16 y) { #endif Common::Point stop(v48->_x, v48->_y); - Common::Point pos(_vm->_char._ani._left, _vm->_char._ani._top); + Common::Point pos; + _vm->_char.getFoot(pos); + uint32 v34 = buildSubPath(pos, stop); if (v38 != 0 && v34 > v38) { // no alternative path (gap?) @@ -223,19 +218,17 @@ uint16 PathBuilder::walkFunc1(int16 x, int16 y, WalkNode *Node) { Common::Point v4(0, 0); - Common::Point foot( - _vm->_char._ani._left + _vm->_char._ani.width()/2, - _vm->_char._ani._top + _vm->_char._ani.height() - ); + Common::Point foot; + _vm->_char.getFoot(foot); Common::Point v8(foot); while (foot != arg) { - if (foot.x < x && queryPath(foot.x + 1, foot.y) != 0) foot.x++; - if (foot.x > x && queryPath(foot.x - 1, foot.y) != 0) foot.x--; - if (foot.y < y && queryPath(foot.x, foot.y + 1) != 0) foot.y++; - if (foot.y > y && queryPath(foot.x, foot.y - 1) != 0) foot.y--; + if (foot.x < x && _vm->_pathBuffer->getValue(foot.x + 1, foot.y) != 0) foot.x++; + if (foot.x > x && _vm->_pathBuffer->getValue(foot.x - 1, foot.y) != 0) foot.x--; + if (foot.y < y && _vm->_pathBuffer->getValue(foot.x, foot.y + 1) != 0) foot.y++; + if (foot.y > y && _vm->_pathBuffer->getValue(foot.x, foot.y - 1) != 0) foot.y--; if (foot == v8 && foot != arg) { @@ -245,10 +238,10 @@ uint16 PathBuilder::walkFunc1(int16 x, int16 y, WalkNode *Node) { while (foot != arg) { - if (foot.x < x && queryPath(foot.x + 1, foot.y) == 0) foot.x++; - if (foot.x > x && queryPath(foot.x - 1, foot.y) == 0) foot.x--; - if (foot.y < y && queryPath(foot.x, foot.y + 1) == 0) foot.y++; - if (foot.y > y && queryPath(foot.x, foot.y - 1) == 0) foot.y--; + if (foot.x < x && _vm->_pathBuffer->getValue(foot.x + 1, foot.y) == 0) foot.x++; + if (foot.x > x && _vm->_pathBuffer->getValue(foot.x - 1, foot.y) == 0) foot.x--; + if (foot.y < y && _vm->_pathBuffer->getValue(foot.x, foot.y + 1) == 0) foot.y++; + if (foot.y > y && _vm->_pathBuffer->getValue(foot.x, foot.y - 1) == 0) foot.y--; if (foot == v8 && foot != arg) return 0; @@ -256,8 +249,8 @@ uint16 PathBuilder::walkFunc1(int16 x, int16 y, WalkNode *Node) { v8 = foot; } - Node->_x = v4.x - _vm->_char._ani.width() / 2; - Node->_y = v4.y - _vm->_char._ani.height(); + Node->_x = v4.x; + Node->_y = v4.y; return (x - v4.x) * (x - v4.x) + (y - v4.y) * (y - v4.y); } @@ -272,19 +265,19 @@ uint16 PathBuilder::walkFunc1(int16 x, int16 y, WalkNode *Node) { void Parallaction::clipMove(Common::Point& pos, const WalkNode* from) { - if ((pos.x < from->_x) && (pos.x < _screenWidth) && (queryPath(_char._ani.width()/2 + pos.x + 2, _char._ani.height() + pos.y) != 0)) { + if ((pos.x < from->_x) && (pos.x < _pathBuffer->w) && (_pathBuffer->getValue(pos.x + 2, pos.y) != 0)) { pos.x = (pos.x + 2 < from->_x) ? pos.x + 2 : from->_x; } - if ((pos.x > from->_x) && (pos.x > -20) && (queryPath(_char._ani.width()/2 + pos.x - 2, _char._ani.height() + pos.y) != 0)) { + if ((pos.x > from->_x) && (pos.x > 0) && (_pathBuffer->getValue(pos.x - 2, pos.y) != 0)) { pos.x = (pos.x - 2 > from->_x) ? pos.x - 2 : from->_x; } - if ((pos.y < from->_y) && (pos.y < (_screenHeight - _char._ani.height())) && (queryPath(_char._ani.width()/2 + pos.x, _char._ani.height() + pos.y + 2) != 0)) { + if ((pos.y < from->_y) && (pos.y < _pathBuffer->h) && (_pathBuffer->getValue(pos.x, pos.y + 2) != 0)) { pos.y = (pos.y + 2 <= from->_y) ? pos.y + 2 : from->_y; } - if ((pos.y > from->_y) && (pos.y > -20) && (queryPath(_char._ani.width()/2 + pos.x, _char._ani.height() + pos.y- 2) != 0)) { + if ((pos.y > from->_y) && (pos.y > 0) && (_pathBuffer->getValue(pos.x, pos.y - 2) != 0)) { pos.y = (pos.y - 2 >= from->_y) ? pos.y - 2 :from->_y; } @@ -342,13 +335,16 @@ uint16 Parallaction::checkDoor() { } _engineFlags &= ~kEngineWalking; - Zone *z = hitZone(kZoneDoor, _char._ani._left + _char._ani.width() / 2, _char._ani._top + _char._ani.height()); + + Common::Point foot; + + _char.getFoot(foot); + Zone *z = hitZone(kZoneDoor, foot.x, foot.y); if (z != NULL) { if ((z->_flags & kFlagsClosed) == 0) { - _location._startPosition.x = z->u.door->_startPos.x; - _location._startPosition.y = z->u.door->_startPos.y; + _location._startPosition = z->u.door->_startPos; _location._startFrame = z->u.door->_startFrame; strcpy(_location._name, z->u.door->_location); @@ -360,7 +356,8 @@ uint16 Parallaction::checkDoor() { } } - z = hitZone(kZoneTrap, _char._ani._left + _char._ani.width() / 2, _char._ani._top + _char._ani.height()); + _char.getFoot(foot); + z = hitZone(kZoneTrap, foot.x, foot.y); if (z != NULL) { _localFlags[_currentLocationIndex] |= kFlagsEnter; @@ -387,11 +384,14 @@ void Parallaction::finalizeWalk(WalkNodeList *list) { delete list; } -void jobWalk(void *parm, Job *j) { +void Parallaction_ns::jobWalk(void *parm, Job *j) { WalkNodeList *list = (WalkNodeList*)parm; - Common::Point pos(_vm->_char._ani._left, _vm->_char._ani._top); - _vm->_char._ani._oldPos = pos; + _char._ani._oldPos.x = _char._ani._left; + _char._ani._oldPos.y = _char._ani._top; + + Common::Point pos; + _char.getFoot(pos); WalkNodeList::iterator it = list->begin(); @@ -404,39 +404,31 @@ void jobWalk(void *parm, Job *j) { if (it == list->end()) { debugC(1, kDebugWalk, "jobWalk reached last node"); j->_finished = 1; - _vm->finalizeWalk(list); + finalizeWalk(list); return; } j->_parm = list; // selectWalkFrame must be performed before position is changed by clipMove - int16 v16 = _vm->selectWalkFrame(pos, *it); - _vm->clipMove(pos, *it); + int16 v16 = selectWalkFrame(pos, *it); + clipMove(pos, *it); - _vm->_char._ani._left = pos.x; - _vm->_char._ani._top = pos.y; + _char.setFoot(pos); - if (pos == _vm->_char._ani._oldPos) { + Common::Point newpos(_char._ani._left, _char._ani._top); + + if (newpos == _char._ani._oldPos) { debugC(1, kDebugWalk, "jobWalk was blocked by an unforeseen obstacle"); j->_finished = 1; - _vm->finalizeWalk(list); + finalizeWalk(list); } else { - _vm->_char._ani._frame = v16 + walkData2 + 1; + _char._ani._frame = v16 + walkData2 + 1; } return; } -void Parallaction::setPath(byte *path) { - memcpy(_buffer, path, _screenPathSize); -} - -void Parallaction::initWalk() { - _buffer = (byte*)malloc(_screenPathSize); -} - - WalkNode::WalkNode() : _x(0), _y(0) { } @@ -459,3 +451,4 @@ PathBuilder::PathBuilder(Animation *anim) : _anim(anim), _list(0) { + diff --git a/engines/parallaction/walk.h b/engines/parallaction/walk.h index 476f5cc47a..dcbc3d5aa9 100644 --- a/engines/parallaction/walk.h +++ b/engines/parallaction/walk.h @@ -50,6 +50,40 @@ typedef ManagedList<WalkNode*> WalkNodeList; void jobWalk(void*, Job *j); +struct PathBuffer { + // handles a 1-bit depth buffer used for masking non-walkable areas + + uint16 w; + uint16 internalWidth; + uint16 h; + uint size; + byte *data; + +public: + PathBuffer() : w(0), internalWidth(0), h(0), size(0), data(0) { + } + + void create(uint16 width, uint16 height) { + w = width; + internalWidth = w >> 3; + h = height; + size = (internalWidth * h); + data = (byte*)calloc(size, 1); + } + + void free() { + if (data) + ::free(data); + data = 0; + w = 0; + h = 0; + internalWidth = 0; + size = 0; + } + + inline byte getValue(uint16 x, uint16 y); +}; + class PathBuilder { diff --git a/engines/parallaction/zone.cpp b/engines/parallaction/zone.cpp deleted file mode 100644 index 50f63b3b75..0000000000 --- a/engines/parallaction/zone.cpp +++ /dev/null @@ -1,690 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ - * - */ - - -#include "common/stdafx.h" - -#include "parallaction/parallaction.h" -#include "parallaction/sound.h" - -namespace Parallaction { - - - - -Zone *Parallaction::findZone(const char *name) { - - for (ZoneList::iterator it = _zones.begin(); it != _zones.end(); it++) - if (!scumm_stricmp((*it)->_label._text, name)) return *it; - - return findAnimation(name); -} - - - - -void Parallaction::parseZone(Script &script, ZoneList &list, char *name) { -// printf("parseZone(%s)", name); - - if (findZone(name)) { - while (scumm_stricmp(_tokens[0], "endzone")) { - fillBuffers(script, true); - } - return; - } - - Zone *z = new Zone; - - z->_label._text = (char*)malloc(strlen(name)+1); - strcpy(z->_label._text, name); - - list.push_front(z); - - fillBuffers(script, true); - while (scumm_stricmp(_tokens[0], "endzone")) { -// printf("token[0] = %s", _tokens[0]); - - if (!scumm_stricmp(_tokens[0], "limits")) { - z->_left = atoi(_tokens[1]); - z->_top = atoi(_tokens[2]); - z->_right = atoi(_tokens[3]); - z->_bottom = atoi(_tokens[4]); - } - if (!scumm_stricmp(_tokens[0], "moveto")) { - z->_moveTo.x = atoi(_tokens[1]); - z->_moveTo.y = atoi(_tokens[2]); - } - if (!scumm_stricmp(_tokens[0], "type")) { - if (_tokens[2][0] != '\0') { - z->_type = (4 + _objectsNames->lookup(_tokens[2])) << 16; - } - int16 _si = _zoneTypeNames->lookup(_tokens[1]); - if (_si != -1) { - z->_type |= 1 << (_si - 1); - parseZoneTypeBlock(script, z); - continue; - } - } - if (!scumm_stricmp(_tokens[0], "commands")) { - parseCommands(script, z->_commands); - } - if (!scumm_stricmp(_tokens[0], "label")) { -// printf("label: %s", _tokens[1]); - _gfx->makeCnvFromString(&z->_label._cnv, _tokens[1]); - } - if (!scumm_stricmp(_tokens[0], "flags")) { - uint16 _si = 1; - - do { - char _al = _zoneFlagNames->lookup(_tokens[_si]); - _si++; - z->_flags |= 1 << (_al - 1); - } while (!scumm_stricmp(_tokens[_si++], "|")); - } - - fillBuffers(script, true); - } - - return; -} - -void Parallaction::freeZones() { - debugC(1, kDebugLocation, "freeZones: kEngineQuit = %i", _engineFlags & kEngineQuit); - - ZoneList::iterator it = _zones.begin(); - - while ( it != _zones.end() ) { - - Zone* z = *it; - - // WORKAROUND: this huge condition is needed because we made TypeData a collection of structs - // instead of an union. So, merge->_obj1 and get->_icon were just aliases in the original engine, - // but we need to check it separately here. The same workaround is applied in hitZone. - if (((z->_top == -1) || - ((z->_left == -2) && ( - (((z->_type & 0xFFFF) == kZoneMerge) && ((isItemInInventory(MAKE_INVENTORY_ID(z->u.merge->_obj1)) != 0) || (isItemInInventory(MAKE_INVENTORY_ID(z->u.merge->_obj2)) != 0))) || - (((z->_type & 0xFFFF) == kZoneGet) && ((isItemInInventory(MAKE_INVENTORY_ID(z->u.get->_icon)) != 0))) - ))) && - ((_engineFlags & kEngineQuit) == 0)) { - - debugC(1, kDebugLocation, "freeZones preserving zone '%s'", z->_label._text); - - it++; - - } else - - it = _zones.erase(it); - - } - - return; -} - - - - - - - - - -void Parallaction::parseZoneTypeBlock(Script &script, Zone *z) { -// printf("parseZoneTypeBlock()"); - - TypeData *u = &z->u; - - switch (z->_type & 0xFFFF) { - case kZoneExamine: // examine Zone alloc - u->examine = new ExamineData; - break; - - case kZoneDoor: // door Zone alloc - u->door = new DoorData; - break; - - case kZoneGet: // get Zone alloc - u->get = new GetData; - break; - - case kZoneMerge: // merge Zone alloc - u->merge = new MergeData; - break; - - case kZoneHear: // hear Zone alloc - u->hear = new HearData; - break; - - case kZoneSpeak: // speak Zone alloc - u->speak = new SpeakData; - break; - - } - - char vC8[PATH_LEN]; - -// printf("type = %x", z->_type); - - do { - - switch (z->_type & 0xFFFF) { - case kZoneExamine: // examine Zone init - if (!scumm_stricmp(_tokens[0], "file")) { - u->examine->_filename = (char*)malloc(strlen(_tokens[1])+1); - strcpy(u->examine->_filename, _tokens[1]); - } - if (!scumm_stricmp(_tokens[0], "desc")) { - u->examine->_description = parseComment(script); - } - break; - - case kZoneDoor: // door Zone init - if (!scumm_stricmp(_tokens[0], "slidetext")) { - strcpy(_slideText[0], _tokens[1]); -// printf("%s\t", _slideText[0]); - strcpy(_slideText[1], _tokens[2]); - } - - if (!scumm_stricmp(_tokens[0], "location")) { - u->door->_location = (char*)malloc(strlen(_tokens[1])+1); - strcpy(u->door->_location, _tokens[1]); - } - - if (!scumm_stricmp(_tokens[0], "file")) { -// printf("file: '%s'", _tokens[0]); - - strcpy(vC8, _tokens[1]); - - u->door->_cnv = _disk->loadFrames(vC8); - uint16 _ax = (z->_flags & kFlagsClosed ? 0 : 1); - - u->door->_background = (byte*)malloc(u->door->_cnv->_width * u->door->_cnv->_height); - _gfx->backupDoorBackground(u->door, z->_left, z->_top); - - _gfx->flatBlitCnv(u->door->_cnv, _ax, z->_left, z->_top, Gfx::kBitBack); - } - - if (!scumm_stricmp(_tokens[0], "startpos")) { - u->door->_startPos.x = atoi(_tokens[1]); - u->door->_startPos.y = atoi(_tokens[2]); - u->door->_startFrame = atoi(_tokens[3]); - } - break; - - case kZoneGet: // get Zone init - if (!scumm_stricmp(_tokens[0], "file")) { - strcpy(vC8, _tokens[1]); - u->get->_cnv = _disk->loadStatic(vC8); - u->get->_backup = (byte*)malloc(u->get->_cnv->_width*u->get->_cnv->_height); - - if ((z->_flags & kFlagsRemove) == 0) { - _gfx->backupGetBackground(u->get, z->_left, z->_top); - _gfx->flatBlitCnv(u->get->_cnv, z->_left, z->_top, Gfx::kBitBack); - } - } - - if (!scumm_stricmp(_tokens[0], "icon")) { - u->get->_icon = 4 + _objectsNames->lookup(_tokens[1]); - } - break; - - case kZoneMerge: // merge Zone init - if (!scumm_stricmp(_tokens[0], "obj1")) { - u->merge->_obj1 = 4 + _objectsNames->lookup(_tokens[1]); - } - if (!scumm_stricmp(_tokens[0], "obj2")) { - u->merge->_obj2 = 4 + _objectsNames->lookup(_tokens[1]); - } - if (!scumm_stricmp(_tokens[0], "newobj")) { - u->merge->_obj3 = 4 + _objectsNames->lookup(_tokens[1]); - } - break; - - case kZoneHear: // hear Zone init - if (!scumm_stricmp(_tokens[0], "sound")) { - strcpy(u->hear->_name, _tokens[1]); - z->u.hear->_channel = atoi(_tokens[2]); - } - if (!scumm_stricmp(_tokens[0], "freq")) { - z->u.hear->_freq = atoi(_tokens[1]); - } - break; - - case kZoneSpeak: // speak Zone init - if (!scumm_stricmp(_tokens[0], "file")) { - strcpy(u->speak->_name, _tokens[1]); -// printf("speak file name: %s", u.speak._name); - } - if (!scumm_stricmp(_tokens[0], "Dialogue")) { - u->speak->_dialogue = parseDialogue(script); - } - break; - } - - fillBuffers(script, true); - } while (scumm_stricmp(_tokens[0], "endzone")); - - return; -} - -// displays character head commenting an examined object -// -// works on the frontbuffer -// -void Parallaction::displayCharacterComment(ExamineData *data) { - if (data->_description == NULL) return; - - // NOTE: saving visible screen before displaying comment allows - // to restore the exact situation after the comment is deleted. - // This means animations are restored in the exact position as - // they were, thus avoiding clipping effect as signalled in - // BUG item #1762614. - _gfx->copyScreen(Gfx::kBitFront, Gfx::kBitBack); - - _gfx->setFont(kFontDialogue); - _gfx->flatBlitCnv(_char._talk, 0, 190, 80, Gfx::kBitFront); - - int16 v26, v28; - _gfx->getStringExtent(data->_description, 130, &v28, &v26); - Common::Rect r(v28, v26); - r.moveTo(140, 10); - _gfx->drawBalloon(r, 0); - _gfx->displayWrappedString(data->_description, 140, 10, 0, 130); - - waitUntilLeftClick(); - - _gfx->copyScreen(Gfx::kBitBack, Gfx::kBitFront); - _gfx->updateScreen(); - - return; -} - -// -// ZONE TYPE: EXAMINE -// - -// display detail view of an item (and eventually comments) -// -// works on the frontbuffer -// - -void Parallaction::displayItemComment(ExamineData *data) { - - if (data->_description == NULL) return; - - _gfx->setHalfbriteMode(true); - - char v68[PATH_LEN]; - strcpy(v68, data->_filename); - data->_cnv = _disk->loadStatic(v68); - _gfx->flatBlitCnv(data->_cnv, 140, (_screenHeight - data->_cnv->_height)/2, Gfx::kBitFront); - _gfx->freeStaticCnv(data->_cnv); - delete data->_cnv; - - int16 v6A = 0, v6C = 0; - - _gfx->setFont(kFontDialogue); - _gfx->getStringExtent(data->_description, 130, &v6C, &v6A); - Common::Rect r(v6C, v6A); - r.moveTo(0, 90); - _gfx->drawBalloon(r, 0); - _gfx->flatBlitCnv(_char._head, 100, 152, Gfx::kBitFront); - _gfx->displayWrappedString(data->_description, 0, 90, 0, 130); - - jobEraseAnimations((void*)1, NULL); - _gfx->updateScreen(); - - waitUntilLeftClick(); - - _gfx->setHalfbriteMode(false); - _gfx->copyScreen(Gfx::kBitBack, Gfx::kBitFront); - _gfx->updateScreen(); - - return; -} - - - -uint16 Parallaction::runZone(Zone *z) { - debugC(3, kDebugLocation, "runZone (%s)", z->_label._text); - - uint16 subtype = z->_type & 0xFFFF; - - debugC(3, kDebugLocation, "type = %x, object = %x", subtype, (z->_type & 0xFFFF0000) >> 16); - switch(subtype) { - - case kZoneExamine: - if (z->u.examine->_filename) { - displayItemComment(z->u.examine); - } else { - displayCharacterComment(z->u.examine); - } - break; - - case kZoneGet: - if (z->_flags & kFlagsFixed) break; - if (pickupItem(z) != 0) { - return 1; - } - z->_flags |= kFlagsRemove; - break; - - case kZoneDoor: - if (z->_flags & kFlagsLocked) break; - z->_flags ^= kFlagsClosed; - if (z->u.door->_cnv == NULL) break; - addJob(&jobToggleDoor, z, kPriority18 ); - break; - - case kZoneHear: - _soundMan->playSfx(z->u.hear->_name, z->u.hear->_channel, (z->_flags & kFlagsLooping) == kFlagsLooping, 60); - break; - - case kZoneSpeak: - runDialogue(z->u.speak); - break; - - } - - debugC(3, kDebugLocation, "runZone completed"); - - return 0; -} - -// -// ZONE TYPE: DOOR -// -void jobToggleDoor(void *parm, Job *j) { - - static byte count = 0; - - Zone *z = (Zone*)parm; - - StaticCnv v14; - - if (z->u.door->_cnv) { - Common::Rect r(z->_left, z->_top, z->_left+z->u.door->_cnv->_width, z->_top+z->u.door->_cnv->_height); - - uint16 _ax = (z->_flags & kFlagsClosed ? 1 : 0); - - v14._width = z->u.door->_cnv->_width; - v14._height = z->u.door->_cnv->_height; - v14._data0 = z->u.door->_cnv->getFramePtr(_ax); - - _vm->_gfx->restoreDoorBackground(&v14, r, z->u.door->_background); - - _ax = (z->_flags & kFlagsClosed ? 0 : 1); - - _vm->_gfx->flatBlitCnv(z->u.door->_cnv, _ax, z->_left, z->_top, Gfx::kBitBack); - _vm->_gfx->flatBlitCnv(z->u.door->_cnv, _ax, z->_left, z->_top, Gfx::kBit2); - } - - count++; - if (count == 2) { - j->_finished = 1; - count = 0; - } - - return; -} - - - -// -// ZONE TYPE: GET -// - -int16 Parallaction::pickupItem(Zone *z) { - int r = addInventoryItem(z->u.get->_icon); - if (r == 0) - addJob(&jobRemovePickedItem, z, kPriority17 ); - - return r; -} - -void jobRemovePickedItem(void *parm, Job *j) { - - Zone *z = (Zone*)parm; - - static uint16 count = 0; - - if (z->u.get->_cnv) { - Common::Rect r(z->_left, z->_top, z->_left + z->u.get->_cnv->_width, z->_top + z->u.get->_cnv->_height); - - _vm->_gfx->restoreGetBackground(r, z->u.get->_backup); - } - - count++; - if (count == 2) { - count = 0; - j->_finished = 1; - } - - return; -} - -void jobDisplayDroppedItem(void *parm, Job *j) { -// printf("jobDisplayDroppedItem..."); - - Zone *z = (Zone*)parm; - - if (z->u.get->_cnv) { - if (j->_count == 0) { - _vm->_gfx->backupGetBackground(z->u.get, z->_left, z->_top); - } - - _vm->_gfx->flatBlitCnv(z->u.get->_cnv, z->_left, z->_top, Gfx::kBitBack); - _vm->_gfx->flatBlitCnv(z->u.get->_cnv, z->_left, z->_top, Gfx::kBit2); - } - - j->_count++; - if (j->_count == 2) { - j->_count = 0; - j->_finished = 1; - } - -// printf("done"); - - return; -} - - - - -Zone *Parallaction::hitZone(uint32 type, uint16 x, uint16 y) { -// printf("hitZone(%i, %i, %i)", type, x, y); - - uint16 _di = y; - uint16 _si = x; - - for (ZoneList::iterator it = _zones.begin(); it != _zones.end(); it++) { -// printf("Zone name: %s", z->_name); - - Zone *z = *it; - - if (z->_flags & kFlagsRemove) continue; - - Common::Rect r; - z->getRect(r); - r.right++; // adjust border because Common::Rect doesn't include bottom-right edge - r.bottom++; - - r.grow(-1); // allows some tolerance for mouse click - - if (!r.contains(_si, _di)) { - - // out of Zone, so look for special values - if ((z->_left == -2) || (z->_left == -3)) { - - // WORKAROUND: this huge condition is needed because we made TypeData a collection of structs - // instead of an union. So, merge->_obj1 and get->_icon were just aliases in the original engine, - // but we need to check it separately here. The same workaround is applied in freeZones. - if ((((z->_type & 0xFFFF) == kZoneMerge) && (((_si == z->u.merge->_obj1) && (_di == z->u.merge->_obj2)) || ((_si == z->u.merge->_obj2) && (_di == z->u.merge->_obj1)))) || - (((z->_type & 0xFFFF) == kZoneGet) && ((_si == z->u.get->_icon) || (_di == z->u.get->_icon)))) { - - // special Zone - if ((type == 0) && ((z->_type & 0xFFFF0000) == 0)) - return z; - if (z->_type == type) - return z; - if ((z->_type & 0xFFFF0000) == type) - return z; - - } - } - - if (z->_left != -1) - continue; - if (_si < _char._ani._left) - continue; - if (_si > (_char._ani._left + _char._ani.width())) - continue; - if (_di < _char._ani._top) - continue; - if (_di > (_char._ani._top + _char._ani.height())) - continue; - - } - - // normal Zone - if ((type == 0) && ((z->_type & 0xFFFF0000) == 0)) - return z; - if (z->_type == type) - return z; - if ((z->_type & 0xFFFF0000) == type) - return z; - - } - - - int16 _a, _b, _c, _d, _e, _f; - for (AnimationList::iterator it = _animations.begin(); it != _animations.end(); it++) { - - Animation *a = *it; - - _a = (a->_flags & kFlagsActive) ? 1 : 0; // _a: active Animation - _e = ((_si >= a->_left + a->width()) || (_si <= a->_left)) ? 0 : 1; // _e: horizontal range - _f = ((_di >= a->_top + a->height()) || (_di <= a->_top)) ? 0 : 1; // _f: vertical range - - _b = ((type != 0) || (a->_type == kZoneYou)) ? 0 : 1; // _b: (no type specified) AND (Animation is not the character) - _c = (a->_type & 0xFFFF0000) ? 0 : 1; // _c: Animation is not an object - _d = ((a->_type & 0xFFFF0000) != type) ? 0 : 1; // _d: Animation is an object of the same type - - if ((_a != 0 && _e != 0 && _f != 0) && ((_b != 0 && _c != 0) || (a->_type == type) || (_d != 0))) { - - return a; - - } - - } - - return NULL; -} - - -Zone::Zone() { - _left = _top = _right = _bottom = 0; - - _type = 0; - _flags = 0; -} - -Zone::~Zone() { -// printf("~Zone(%s)\n", _label._text); - - switch (_type & 0xFFFF) { - case kZoneExamine: - free(u.examine->_filename); - free(u.examine->_description); - delete u.examine; - break; - - case kZoneDoor: - free(u.door->_location); - free(u.door->_background); - if (u.door->_cnv) - delete u.door->_cnv; - delete u.door; - break; - - case kZoneSpeak: - delete u.speak->_dialogue; - delete u.speak; - break; - - case kZoneGet: - free(u.get->_backup); - _vm->_gfx->freeStaticCnv(u.get->_cnv); - if (u.get->_cnv) - delete u.get->_cnv; - delete u.get; - break; - - case kZoneHear: - delete u.hear; - break; - - case kZoneMerge: - delete u.merge; - break; - - default: - break; - } -} - -void Zone::getRect(Common::Rect& r) const { - r.left = _left; - r.right = _right; - r.top = _top; - r.bottom = _bottom; -} - -void Zone::translate(int16 x, int16 y) { - _left += x; - _right += x; - _top += y; - _bottom += y; -} - -uint16 Zone::width() const { - return _right - _left; -} - -uint16 Zone::height() const { - return _bottom - _top; -} - -Label::Label() { - _text = NULL; -} - -Label::~Label() { - _vm->_gfx->freeStaticCnv(&_cnv); - if (_text) - free(_text); -} - - -} // namespace Parallaction diff --git a/engines/queen/cutaway.cpp b/engines/queen/cutaway.cpp index 1f34128820..721d7bb318 100644 --- a/engines/queen/cutaway.cpp +++ b/engines/queen/cutaway.cpp @@ -181,8 +181,7 @@ void Cutaway::loadStrings(uint16 offset) { debug(6, "_talkTo = %i", _talkTo); } -const byte *Cutaway::getCutawayObject(const byte *ptr, CutawayObject &object) -{ +const byte *Cutaway::getCutawayObject(const byte *ptr, CutawayObject &object) { const byte *oldPtr = ptr; object.objectNumber = (int16)READ_BE_INT16(ptr); ptr += 2; @@ -216,8 +215,7 @@ const byte *Cutaway::getCutawayObject(const byte *ptr, CutawayObject &object) return ptr; } -void Cutaway::dumpCutawayObject(int index, CutawayObject &object) -{ +void Cutaway::dumpCutawayObject(int index, CutawayObject &object) { debug(6, "----- CutawayObject[%i] -----", index); const char *objectNumberStr; @@ -367,7 +365,7 @@ void Cutaway::changeRooms(CutawayObject &object) { _vm->logic()->oldRoom(_initialRoom); - // FIXME - Cutaway c41f is played at the end of the command 0x178. This command + // FIXME: Cutaway c41f is played at the end of the command 0x178. This command // setups some persons and associates bob slots to them. They should be hidden as // their y coordinate is > 150, but they aren't ! As a workaround, we display the room // with the panel area enabled. We do the same problem for cutaway c62c. diff --git a/engines/queen/display.cpp b/engines/queen/display.cpp index a8c2747753..9c4101f1d3 100644 --- a/engines/queen/display.cpp +++ b/engines/queen/display.cpp @@ -36,14 +36,6 @@ namespace Queen { -#ifdef PALMOS_68K -static const uint8 *_fontRegular; -static const uint8 *_fontHebrew; -static const uint8 *_fontRussian; -static const uint8 *_palJoeClothes; -static const uint8 *_palJoeDress; -#endif - Display::Display(QueenEngine *vm, OSystem *system) : _fullscreen(true), _horizontalScroll(0), _bdWidth(0), _bdHeight(0), _system(system), _vm(vm) { @@ -1230,7 +1222,6 @@ void Display::blankScreenEffect3() { } } -#ifndef PALMOS_68K const uint8 Display::_fontRegular[] = { 0xF8, 0xB0, 0xB0, 0x80, 0xB0, 0xB0, 0xC0, 0x00, 0xF8, 0xB0, 0xB0, 0x80, 0xB0, 0xB0, 0xC0, 0x00, 0xF8, 0xB0, 0xB0, 0x80, 0xB0, 0xB0, 0xC0, 0x00, 0xF8, 0xB0, 0xB0, 0x80, 0xB0, 0xB0, 0xC0, 0x00, @@ -1636,25 +1627,4 @@ const uint8 Display::_palJoeDress[] = { 0x22, 0xED, 0x42, 0x42, 0x80, 0x45, 0x45, 0xA3, 0x5F, 0x5F, 0xC8, 0x7C, 0x7C, 0xEC, 0x9C, 0x9C }; -#endif - } // End of namespace Queen - -#ifdef PALMOS_68K -#include "scumm_globals.h" - -_GINIT(Queen_Display) -_GSETPTR(Queen::_fontRegular, GBVARS_DISPLAYFONTREGULAR_INDEX, uint8, GBVARS_QUEEN) -_GSETPTR(Queen::_fontHebrew, GBVARS_DISPLAYFONTHEBREW_INDEX, uint8, GBVARS_QUEEN) -_GSETPTR(Queen::_palJoeClothes, GBVARS_DISPLAYPALJOECLOTHES_INDEX, uint8, GBVARS_QUEEN) -_GSETPTR(Queen::_palJoeDress, GBVARS_DISPLAYPALJOEDRESS_INDEX, uint8, GBVARS_QUEEN) -_GEND - -_GRELEASE(Queen_Display) -_GRELEASEPTR(GBVARS_DISPLAYFONTREGULAR_INDEX, GBVARS_QUEEN) -_GRELEASEPTR(GBVARS_DISPLAYFONTHEBREW_INDEX, GBVARS_QUEEN) -_GRELEASEPTR(GBVARS_DISPLAYPALJOECLOTHES_INDEX, GBVARS_QUEEN) -_GRELEASEPTR(GBVARS_DISPLAYPALJOEDRESS_INDEX, GBVARS_QUEEN) -_GEND - -#endif diff --git a/engines/queen/display.h b/engines/queen/display.h index 23316f880a..b26ae1fac0 100644 --- a/engines/queen/display.h +++ b/engines/queen/display.h @@ -254,13 +254,12 @@ private: QueenEngine *_vm; const uint8 *_font; -#ifndef PALMOS_68K + static const uint8 _fontRegular[]; static const uint8 _fontHebrew[]; static const uint8 _fontRussian[]; static const uint8 _palJoeClothes[]; static const uint8 _palJoeDress[]; -#endif }; diff --git a/engines/queen/graphics.cpp b/engines/queen/graphics.cpp index 4beca6556d..6199a75e7c 100644 --- a/engines/queen/graphics.cpp +++ b/engines/queen/graphics.cpp @@ -36,13 +36,6 @@ namespace Queen { -#ifdef PALMOS_68K -static const BamScene::BamDataBlock *_carData; -static const BamScene::BamDataBlock *_fight1Data; -static const BamScene::BamDataBlock *_fight2Data; -static const BamScene::BamDataBlock *_fight3Data; -#endif - const Box BobSlot::_defaultBox(-1, -1, -1, -1); void BobSlot::curPos(int16 xx, int16 yy) { @@ -1311,7 +1304,6 @@ void BamScene::loadState(uint32 ver, byte *&ptr) { _flag = READ_BE_UINT16(ptr); ptr += 2; } -#ifndef PALMOS_68K const BamScene::BamDataBlock BamScene::_carData[] = { { { 310, 105, 1 }, { 314, 106, 17 }, { 366, 101, 1 }, 0 }, { { 303, 105, 1 }, { 307, 106, 17 }, { 214, 0, 10 }, 0 }, @@ -1630,25 +1622,5 @@ const BamScene::BamDataBlock BamScene::_fight4Data[] = { { { 75, 96, 1 }, { 187, 96, -23 }, { 0, 0, 0 }, 0 }, { { 75, 96, 1 }, { 187, 96, -23 }, { 0, 0, 0 }, 99 } }; -#endif } // End of namespace Queen - -#ifdef PALMOS_68K -#include "scumm_globals.h" - -_GINIT(Queen_Graphics) -_GSETPTR(Queen::_carData, GBVARS_GRAPHICSCARDATA_INDEX, Queen::BamScene::BamDataBlock, GBVARS_QUEEN) -_GSETPTR(Queen::_fight1Data, GBVARS_GRAPHICSFIGHT1DATA_INDEX, Queen::BamScene::BamDataBlock, GBVARS_QUEEN) -_GSETPTR(Queen::_fight2Data, GBVARS_GRAPHICSFIGHT2DATA_INDEX, Queen::BamScene::BamDataBlock, GBVARS_QUEEN) -_GSETPTR(Queen::_fight3Data, GBVARS_GRAPHICSFIGHT3DATA_INDEX, Queen::BamScene::BamDataBlock, GBVARS_QUEEN) -_GEND - -_GRELEASE(Queen_Graphics) -_GRELEASEPTR(GBVARS_GRAPHICSCARDATA_INDEX, GBVARS_QUEEN) -_GRELEASEPTR(GBVARS_GRAPHICSFIGHT1DATA_INDEX, GBVARS_QUEEN) -_GRELEASEPTR(GBVARS_GRAPHICSFIGHT2DATA_INDEX, GBVARS_QUEEN) -_GRELEASEPTR(GBVARS_GRAPHICSFIGHT3DATA_INDEX, GBVARS_QUEEN) -_GEND - -#endif diff --git a/engines/queen/graphics.h b/engines/queen/graphics.h index 3963224069..9684217ef0 100644 --- a/engines/queen/graphics.h +++ b/engines/queen/graphics.h @@ -261,18 +261,12 @@ private: int16 frame; }; -#ifdef PALMOS_68K -public: -#endif struct BamDataBlock { BamDataObj obj1; // truck / Frank BamDataObj obj2; // Rico / robot BamDataObj fx; int16 sfx; }; -#ifdef PALMOS_68K -private: -#endif BobSlot *_obj1; BobSlot *_obj2; @@ -283,13 +277,11 @@ private: QueenEngine *_vm; -#ifndef PALMOS_68K static const BamDataBlock _carData[]; static const BamDataBlock _fight1Data[]; static const BamDataBlock _fight2Data[]; static const BamDataBlock _fight3Data[]; static const BamDataBlock _fight4Data[]; -#endif }; } // End of namespace Queen diff --git a/engines/queen/musicdata.cpp b/engines/queen/musicdata.cpp index bfb843766c..a0b2a73697 100644 --- a/engines/queen/musicdata.cpp +++ b/engines/queen/musicdata.cpp @@ -28,16 +28,6 @@ namespace Queen { -#ifdef PALMOS_68K - -const songData *Sound::_songDemo; -const songData *Sound::_song; -const tuneData *Sound::_tuneDemo; -const tuneData *Sound::_tune; -const char *Sound::_sfxName; -const int16 *Sound::_jungleList; - -#else const songData Sound::_songDemo[] = { /* 1 - Hotel Gangsters */ { { 1, 0 }, 128, 128, 128, 1, 0 }, @@ -1919,29 +1909,6 @@ const char *Sound::_sfxName[] = { }; const int16 Sound::_jungleList[] = { 15, 16, 17, 18, 7, 8, 9, 10, 11, 12, 13, 14, 0 }; -#endif -} // End of namespace Queen -#ifdef PALMOS_68K -#include "scumm_globals.h" - -_GINIT(Queen_Musicdata) -_GSETPTR(Queen::Sound::_songDemo, GBVARS_MUSICDATASONGDEMO_INDEX, Queen::songData, GBVARS_QUEEN) -_GSETPTR(Queen::Sound::_song, GBVARS_MUSICDATASONG_INDEX, Queen::songData, GBVARS_QUEEN) -_GSETPTR(Queen::Sound::_tuneDemo, GBVARS_MUSICDATATUNEDEMO_INDEX, Queen::tuneData, GBVARS_QUEEN) -_GSETPTR(Queen::Sound::_tune, GBVARS_MUSICDATATUNE_INDEX, Queen::tuneData, GBVARS_QUEEN) -_GSETPTR(Queen::Sound::_sfxName, GBVARS_MUSICDATASFXNAME_INDEX, char, GBVARS_QUEEN) -_GSETPTR(Queen::Sound::_jungleList, GBVARS_MUSICDATAJUNGLELIST_INDEX, int16, GBVARS_QUEEN) -_GEND - -_GRELEASE(Queen_Musicdata) -_GRELEASEPTR(GBVARS_MUSICDATASONGDEMO_INDEX, GBVARS_QUEEN) -_GRELEASEPTR(GBVARS_MUSICDATASONG_INDEX, GBVARS_QUEEN) -_GRELEASEPTR(GBVARS_MUSICDATATUNEDEMO_INDEX, GBVARS_QUEEN) -_GRELEASEPTR(GBVARS_MUSICDATATUNE_INDEX, GBVARS_QUEEN) -_GRELEASEPTR(GBVARS_MUSICDATASFXNAME_INDEX, GBVARS_QUEEN) -_GRELEASEPTR(GBVARS_MUSICDATAJUNGLELIST_INDEX, GBVARS_QUEEN) -_GEND - -#endif +} // End of namespace Queen diff --git a/engines/queen/resource.cpp b/engines/queen/resource.cpp index 999a86d432..20b047cb71 100644 --- a/engines/queen/resource.cpp +++ b/engines/queen/resource.cpp @@ -30,9 +30,6 @@ namespace Queen { -#ifdef PALMOS_68K -static ResourceEntry *_resourceTablePEM10; -#endif const char *Resource::_tableFilename = "queen.tbl"; @@ -325,16 +322,3 @@ Common::File *Resource::findSound(const char *filename, uint32 *size) { } } // End of namespace Queen - -#ifdef PALMOS_68K -#include "scumm_globals.h" - -_GINIT(Queen_Restables) -_GSETPTR(Queen::_resourceTablePEM10, GBVARS_RESOURCETABLEPM10_INDEX, Queen::ResourceEntry, GBVARS_QUEEN) -_GEND - -_GRELEASE(Queen_Restables) -_GRELEASEPTR(GBVARS_RESOURCETABLEPM10_INDEX, GBVARS_QUEEN) -_GEND - -#endif diff --git a/engines/queen/resource.h b/engines/queen/resource.h index 16094193d9..43c8e68939 100644 --- a/engines/queen/resource.h +++ b/engines/queen/resource.h @@ -165,10 +165,8 @@ protected: //! known FOTAQ versions static const RetailGameVersion _gameVersions[]; -#ifndef PALMOS_68K //! resource table for english floppy version static ResourceEntry _resourceTablePEM10[]; -#endif }; } // End of namespace Queen diff --git a/engines/queen/restables.cpp b/engines/queen/restables.cpp index 721bde626f..d4c30c7bea 100644 --- a/engines/queen/restables.cpp +++ b/engines/queen/restables.cpp @@ -27,7 +27,6 @@ namespace Queen { -#ifndef PALMOS_68K //English Floppy Version ResourceEntry Resource::_resourceTablePEM10[] = { { "1000SSSS.SB", 1, 0x00000000, 0x000027fe }, @@ -1107,5 +1106,5 @@ ResourceEntry Resource::_resourceTablePEM10[] = { { "ZOMBIE1.DOG", 1, 0x0159ecef, 0x00000f6a }, { "ZOMBIE2.DOG", 1, 0x0159fc59, 0x00000c40 } }; -#endif + } // End of namespace Queen diff --git a/engines/queen/sound.cpp b/engines/queen/sound.cpp index a4cac2417e..1da07cf97c 100644 --- a/engines/queen/sound.cpp +++ b/engines/queen/sound.cpp @@ -173,13 +173,8 @@ PCSound::~PCSound() { } void PCSound::playSfx(uint16 sfx) { - if (sfxOn() && sfx != 0) { -#ifndef PALMOS_68K + if (sfxOn() && sfx != 0) playSound(_sfxName[sfx - 1], false); -#else - playSound(_sfxName + 10 * (sfx - 1), false); // saved as 8char + /0/0 -#endif - } } void PCSound::playSong(int16 songNum) { diff --git a/engines/queen/sound.h b/engines/queen/sound.h index 145a2d1384..d87ab63a18 100644 --- a/engines/queen/sound.h +++ b/engines/queen/sound.h @@ -103,21 +103,12 @@ public: void saveState(byte *&ptr); void loadState(uint32 ver, byte *&ptr); -#ifndef PALMOS_68K static const songData _songDemo[]; static const songData _song[]; static const tuneData _tuneDemo[]; static const tuneData _tune[]; static const char *_sfxName[]; static const int16 _jungleList[]; -#else - static const songData *_songDemo; - static const songData *_song; - static const tuneData *_tuneDemo; - static const tuneData *_tune; - static const char *_sfxName; - static const int16 *_jungleList; -#endif protected: diff --git a/engines/queen/talk.cpp b/engines/queen/talk.cpp index a47584a003..8396356685 100644 --- a/engines/queen/talk.cpp +++ b/engines/queen/talk.cpp @@ -46,10 +46,6 @@ namespace Queen { -#ifdef PALMOS_68K -static const Talk::SpeechParameters *_speechParameters; -#endif - void Talk::talk( const char *filename, int personInRoom, @@ -1357,7 +1353,6 @@ int16 Talk::selectSentence() { return selectedSentence; } -#ifndef PALMOS_68K const Talk::SpeechParameters Talk::_speechParameters[] = { { "JOE", 0, 1, 1, 10, 2, 3, "", 0 }, { "JOE", 0, 3, 3, 28, 2, 3, "", 0 }, @@ -1818,19 +1813,5 @@ const Talk::SpeechParameters Talk::_speechParameters[] = { { "*", 0, 0, 0, 0, 0, 0, "", 0 } }; -#endif } // End of namespace Queen - -#ifdef PALMOS_68K -#include "scumm_globals.h" - -_GINIT(Queen_Talk) -_GSETPTR(Queen::_speechParameters, GBVARS_SPEECHPARAMETERS_INDEX, Queen::Talk::SpeechParameters, GBVARS_QUEEN) -_GEND - -_GRELEASE(Queen_Talk) -_GRELEASEPTR(GBVARS_SPEECHPARAMETERS_INDEX, GBVARS_QUEEN) -_GEND - -#endif diff --git a/engines/queen/talk.h b/engines/queen/talk.h index 1548d0ba27..036dfadbcd 100644 --- a/engines/queen/talk.h +++ b/engines/queen/talk.h @@ -81,7 +81,6 @@ private: int16 gameStateValue; }; -#ifndef PALMOS_68K struct SpeechParameters { const char *name; signed char state,faceDirection; @@ -89,17 +88,6 @@ private: const char *animation; signed char ff; }; -#else -public: - struct SpeechParameters { - const char name[11]; - signed char state,faceDirection; - signed char body,bf,rf,af; - const char animation[80]; - signed char ff; - }; -private: -#endif QueenEngine *_vm; @@ -154,9 +142,7 @@ private: char _talkString[5][MAX_STRING_SIZE]; char _joeVoiceFilePrefix[5][MAX_STRING_SIZE]; -#ifndef PALMOS_68K static const SpeechParameters _speechParameters[]; -#endif Talk(QueenEngine *vm); ~Talk(); diff --git a/engines/saga/actor.cpp b/engines/saga/actor.cpp index c2ecff4a1a..6d996d2d40 100644 --- a/engines/saga/actor.cpp +++ b/engines/saga/actor.cpp @@ -29,18 +29,12 @@ #include "saga/animation.h" #include "saga/console.h" #include "saga/events.h" -#include "saga/gfx.h" -#include "saga/interface.h" #include "saga/isomap.h" -#include "saga/itedata.h" #include "saga/objectmap.h" #include "saga/sagaresnames.h" #include "saga/rscfile.h" #include "saga/script.h" #include "saga/sndres.h" -#include "saga/sprite.h" -#include "saga/stream.h" -#include "saga/font.h" #include "saga/sound.h" #include "saga/scene.h" @@ -48,24 +42,6 @@ namespace Saga { -enum ActorFrameIds { -//ITE - kFrameITEStand = 0, - kFrameITEWalk = 1, - kFrameITESpeak = 2, - kFrameITEGive = 3, - kFrameITEGesture = 4, - kFrameITEWait = 5, - kFrameITEPickUp = 6, - kFrameITELook = 7, -//IHNM - kFrameIHNMStand = 0, - kFrameIHNMSpeak = 1, - kFrameIHNMWait = 2, - kFrameIHNMGesture = 3, - kFrameIHNMWalk = 4 -}; - static int commonObjectCompare(const CommonObjectDataPointer& obj1, const CommonObjectDataPointer& obj2) { int p1 = obj1->_location.y - obj1->_location.z; int p2 = obj2->_location.y - obj2->_location.z; @@ -76,6 +52,16 @@ static int commonObjectCompare(const CommonObjectDataPointer& obj1, const Common return 1; } +static int commonObjectCompareIHNM(const CommonObjectDataPointer& obj1, const CommonObjectDataPointer& obj2) { + int p1 = obj1->_location.y; + int p2 = obj2->_location.y; + if (p1 == p2) + return 0; + if (p1 < p2) + return -1; + return 1; +} + static int tileCommonObjectCompare(const CommonObjectDataPointer& obj1, const CommonObjectDataPointer& obj2) { int p1 = -obj1->_location.u() - obj1->_location.v() - obj1->_location.z; int p2 = -obj2->_location.u() - obj2->_location.v() - obj2->_location.z; @@ -89,140 +75,6 @@ static int tileCommonObjectCompare(const CommonObjectDataPointer& obj1, const Co return 1; } -inline int16 int16Compare(int16 i1, int16 i2) { - return ((i1) > (i2) ? 1 : ((i1) < (i2) ? -1 : 0)); -} - -inline int16 quickDistance(const Point &point1, const Point &point2, int16 compressX) { - Point delta; - delta.x = ABS(point1.x - point2.x) / compressX; - delta.y = ABS(point1.y - point2.y); - return ((delta.x < delta.y) ? (delta.y + delta.x / 2) : (delta.x + delta.y / 2)); -} - -inline void calcDeltaS(const Point &point1, const Point &point2, Point &delta, Point &s) { - - delta.x = point2.x - point1.x; - if (delta.x == 0) { - s.x = 0; - } else { - if (delta.x > 0) { - s.x = 1; - } else { - s.x = -1; - delta.x = -delta.x; - } - } - - - delta.y = point2.y - point1.y; - if (delta.y == 0) { - s.y = 0; - } else { - if (delta.y > 0) { - s.y = 1; - } else { - s.y = -1; - delta.y = -delta.y; - } - } -} - -// Lookup table to convert 8 cardinal directions to 4 -static const int actorDirectectionsLUT[8] = { - ACTOR_DIRECTION_BACK, // kDirUp - ACTOR_DIRECTION_RIGHT, // kDirUpRight - ACTOR_DIRECTION_RIGHT, // kDirRight - ACTOR_DIRECTION_RIGHT, // kDirDownRight - ACTOR_DIRECTION_FORWARD,// kDirDown - ACTOR_DIRECTION_LEFT, // kDirDownLeft - ACTOR_DIRECTION_LEFT, // kDirLeft - ACTOR_DIRECTION_LEFT, // kDirUpLeft -}; - -static const PathDirectionData pathDirectionLUT[8][3] = { - { { 0, Point( 0, -1) }, { 7, Point(-1, -1) }, { 4, Point( 1, -1) } }, - { { 1, Point( 1, 0) }, { 4, Point( 1, -1) }, { 5, Point( 1, 1) } }, - { { 2, Point( 0, 1) }, { 5, Point( 1, 1) }, { 6, Point(-1, 1) } }, - { { 3, Point(-1, 0) }, { 6, Point(-1, 1) }, { 7, Point(-1, -1) } }, - { { 0, Point( 0, -1) }, { 1, Point( 1, 0) }, { 4, Point( 1, -1) } }, - { { 1, Point( 1, 0) }, { 2, Point( 0, 1) }, { 5, Point( 1, 1) } }, - { { 2, Point( 0, 1) }, { 3, Point(-1, 0) }, { 6, Point(-1, 1) } }, - { { 3, Point(-1, 0) }, { 0, Point( 0, -1) }, { 7, Point(-1, -1) } } -}; - -static const int pathDirectionLUT2[8][2] = { - { 0, -1 }, - { 1, 0 }, - { 0, 1 }, - { -1, 0 }, - { 1, -1 }, - { 1, 1 }, - { -1, 1 }, - { -1, -1 } -}; - -static const int angleLUT[16][2] = { - { 0, -256 }, - { 98, -237 }, - { 181, -181 }, - { 237, -98 }, - { 256, 0 }, - { 237, 98 }, - { 181, 181 }, - { 98, 237 }, - { 0, 256 }, - { -98, 237 }, - { -181, 181 }, - { -237, 98 }, - { -256, 0 }, - { -237, -98 }, - { -181, -181 }, - { -98, -237 } -}; - -static const int directionLUT[8][2] = { - { 0 * 2, -2 * 2 }, - { 2 * 2, -1 * 2 }, - { 3 * 2, 0 * 2 }, - { 2 * 2, 1 * 2 }, - { 0 * 2, 2 * 2 }, - { -2 * 2, 1 * 2 }, - { -4 * 2, 0 * 2 }, - { -2 * 2, -1 * 2 } -}; - -static const int tileDirectionLUT[8][2] = { - { 1, 1 }, - { 2, 0 }, - { 1, -1 }, - { 0, -2 }, - { -1, -1 }, - { -2, 0 }, - { -1, 1 }, - { 0, 2 } -}; - -struct DragonMove { - uint16 baseFrame; - int16 offset[4][2]; -}; - -static const DragonMove dragonMoveTable[12] = { - { 0, { { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 } } }, - { 0, { { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 } } }, - { 0, { { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 } } }, - { 0, { { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 } } }, - { 28, { { -0, 0 }, { -1, 6 }, { -5, 11 }, { -10, 15 } } }, - { 56, { { 0, 0 }, { 1, 6 }, { 5, 11 }, { 10, 15 } } }, - { 40, { { 0, 0 }, { 6, 1 }, { 11, 5 }, { 15, 10 } } }, - { 44, { { 0, 0 }, { 6, -1 }, { 11, -5 }, { 15, -10 } } }, - { 32, { { -0, -0 }, { -6, -1 }, { -11, -5 }, { -15, -10 } } }, - { 52, { { -0, 0 }, { -6, 1 }, { -11, 5 }, { -15, 10 } } }, - { 36, { { 0, -0 }, { 1, -6 }, { 5, -11 }, { 10, -15 } } }, - { 48, { { -0, -0 }, { -1, -6 }, { -5, -11 }, { -10, -15 } } } -}; - Actor::Actor(SagaEngine *vm) : _vm(vm) { int i; byte *stringsPointer; @@ -268,8 +120,6 @@ Actor::Actor(SagaEngine *vm) : _vm(vm) { _pathRect.top = _vm->getDisplayInfo().pathStartY; _pathRect.bottom = _vm->_scene->getHeight(); - _showActors = true; - // Get actor resource file context _actorContext = _vm->_resource->getContext(GAME_RESOURCEFILE); if (_actorContext == NULL) { @@ -723,76 +573,6 @@ void Actor::stepZoneAction(ActorData *actor, const HitZone *hitZone, bool exit, } } -void Actor::realLocation(Location &location, uint16 objectId, uint16 walkFlags) { - int angle; - int distance; - ActorData *actor; - ObjectData *obj; - debug (8, "Actor::realLocation objectId=%i", objectId); - if (walkFlags & kWalkUseAngle) { - if (_vm->_scene->getFlags() & kSceneFlagISO) { - angle = (location.x + 2) & 15; - distance = location.y; - - location.u() = (angleLUT[angle][0] * distance) >> 8; - location.v() = -(angleLUT[angle][1] * distance) >> 8; - } else { - angle = location.x & 15; - distance = location.y; - - location.x = (angleLUT[angle][0] * distance) >> 6; - location.y = (angleLUT[angle][1] * distance) >> 6; - } - } - - if (objectId != ID_NOTHING) { - if (validActorId(objectId)) { - actor = getActor(objectId); - location.addXY(actor->_location); - } else if (validObjId(objectId)) { - obj = getObj(objectId); - location.addXY(obj->_location); - } - } -} - -void Actor::actorFaceTowardsPoint(uint16 actorId, const Location &toLocation) { - ActorData *actor; - Location delta; - //debug (8, "Actor::actorFaceTowardsPoint actorId=%i", actorId); - actor = getActor(actorId); - - toLocation.delta(actor->_location, delta); - - if (_vm->_scene->getFlags() & kSceneFlagISO) { - if (delta.u() > 0) { - actor->_facingDirection = (delta.v() > 0) ? kDirUp : kDirRight; - } else { - actor->_facingDirection = (delta.v() > 0) ? kDirLeft : kDirDown; - } - } else { - if (ABS(delta.y) > ABS(delta.x * 2)) { - actor->_facingDirection = (delta.y > 0) ? kDirDown : kDirUp; - } else { - actor->_facingDirection = (delta.x > 0) ? kDirRight : kDirLeft; - } - } -} - -void Actor::actorFaceTowardsObject(uint16 actorId, uint16 objectId) { - ActorData *actor; - ObjectData *obj; - - if (validActorId(objectId)) { - actor = getActor(objectId); - actorFaceTowardsPoint(actorId, actor->_location); - } else if (validObjId(objectId)) { - obj = getObj(objectId); - actorFaceTowardsPoint(actorId, obj->_location); - } -} - - ObjectData *Actor::getObj(uint16 objId) { ObjectData *obj; @@ -830,18 +610,6 @@ ActorData *Actor::getActor(uint16 actorId) { return actor; } -bool Actor::validFollowerLocation(const Location &location) { - Point point; - location.toScreenPointXY(point); - - if ((point.x < 5) || (point.x >= _vm->getDisplayWidth() - 5) || - (point.y < 0) || (point.y > _vm->_scene->getHeight())) { - return false; - } - - return (_vm->_scene->canWalk(point)); -} - void Actor::setProtagState(int state) { _protagState = state; @@ -855,149 +623,6 @@ void Actor::setProtagState(int state) { } } -void Actor::updateActorsScene(int actorsEntrance) { - int i, j; - int followerDirection; - ActorData *actor; - Location tempLocation; - Location possibleLocation; - Point delta; - const SceneEntry *sceneEntry; - - if (_vm->_scene->currentSceneNumber() == 0) { - error("Actor::updateActorsScene _vm->_scene->currentSceneNumber() == 0"); - } - - _vm->_sound->stopVoice(); - _activeSpeech.stringsCount = 0; - _activeSpeech.playing = false; - _protagonist = NULL; - - for (i = 0; i < _actorsCount; i++) { - actor = _actors[i]; - actor->_inScene = false; - actor->_spriteList.freeMem(); - if (actor->_disabled) { - continue; - } - if ((actor->_flags & (kProtagonist | kFollower)) || (i == 0)) { - if (actor->_flags & kProtagonist) { - actor->_finalTarget = actor->_location; - _centerActor = _protagonist = actor; - } else if (_vm->getGameType() == GType_ITE && - _vm->_scene->currentSceneResourceId() == RID_ITE_OVERMAP_SCENE) { - continue; - } - - actor->_sceneNumber = _vm->_scene->currentSceneNumber(); - } - if (actor->_sceneNumber == _vm->_scene->currentSceneNumber()) { - actor->_inScene = true; - actor->_actionCycle = (_vm->_rnd.getRandomNumber(7) & 0x7) * 4; // 1/8th chance - } - } - - // _protagonist can be null while loading a game from the command line - if (_protagonist == NULL) - return; - - if ((actorsEntrance >= 0) && (_vm->_scene->_entryList.entryListCount > 0)) { - if (_vm->_scene->_entryList.entryListCount <= actorsEntrance) { - actorsEntrance = 0; //OCEAN bug - } - - sceneEntry = _vm->_scene->_entryList.getEntry(actorsEntrance); - if (_vm->_scene->getFlags() & kSceneFlagISO) { - _protagonist->_location = sceneEntry->location; - } else { - _protagonist->_location.x = sceneEntry->location.x * ACTOR_LMULT; - _protagonist->_location.y = sceneEntry->location.y * ACTOR_LMULT; - _protagonist->_location.z = sceneEntry->location.z * ACTOR_LMULT; - } - // Workaround for bug #1328045: - // "When entering any of the houses at the start of the - // game if you click on anything inside the building you - // start walking through the door, turn around and leave." - // - // After steping of action zone - Rif trying to exit. - // This piece of code shift Rif's entry position to non action zone area. - if (_vm->getGameType() == GType_ITE) { - if ((_vm->_scene->currentSceneNumber() >= 53) && (_vm->_scene->currentSceneNumber() <= 66)) - _protagonist->_location.y += 10; - } - - _protagonist->_facingDirection = _protagonist->_actionDirection = sceneEntry->facing; - } - - _protagonist->_currentAction = kActionWait; - - if (_vm->_scene->getFlags() & kSceneFlagISO) { - //nothing? - } else { - _vm->_scene->initDoorsState(); //TODO: move to _scene - } - - followerDirection = _protagonist->_facingDirection + 3; - calcScreenPosition(_protagonist); - - for (i = 0; i < _actorsCount; i++) { - actor = _actors[i]; - if (actor->_flags & (kFollower)) { - actor->_facingDirection = actor->_actionDirection = _protagonist->_facingDirection; - actor->_currentAction = kActionWait; - actor->_walkStepsCount = actor->_walkStepIndex = 0; - actor->_location.z = _protagonist->_location.z; - - - if (_vm->_scene->getFlags() & kSceneFlagISO) { - _vm->_isoMap->placeOnTileMap(_protagonist->_location, actor->_location, 3, followerDirection & 0x07); - } else { - followerDirection &= 0x07; - - possibleLocation = _protagonist->_location; - - - delta.x = directionLUT[followerDirection][0]; - delta.y = directionLUT[followerDirection][1]; - - - for (j = 0; j < 30; j++) { - tempLocation = possibleLocation; - tempLocation.x += delta.x; - tempLocation.y += delta.y; - - if (validFollowerLocation(tempLocation)) { - possibleLocation = tempLocation; - } else { - tempLocation = possibleLocation; - tempLocation.x += delta.x; - if (validFollowerLocation(tempLocation)) { - possibleLocation = tempLocation; - } else { - tempLocation = possibleLocation; - tempLocation.y += delta.y; - if (validFollowerLocation(tempLocation)) { - possibleLocation = tempLocation; - } else { - break; - } - } - } - } - - actor->_location = possibleLocation; - } - followerDirection += 2; - } - - } - - handleActions(0, true); - if (_vm->_scene->getFlags() & kSceneFlagISO) { - _vm->_isoMap->adjustScroll(true); - } -} - int Actor::getFrameType(ActorFrameTypes frameType) { if (_vm->getGameType() == GType_ITE) { @@ -1235,413 +860,6 @@ void Actor::handleSpeech(int msec) { _activeSpeech.playing = true; } -void Actor::handleActions(int msec, bool setup) { - int i; - ActorData *actor; - ActorFrameRange *frameRange; - int state; - int speed; - int32 framesLeft; - Location delta; - Location addDelta; - int hitZoneIndex; - const HitZone *hitZone; - Point hitPoint; - Location pickLocation; - - for (i = 0; i < _actorsCount; i++) { - actor = _actors[i]; - if (!actor->_inScene) - continue; - - if ((_vm->getGameType() == GType_ITE) && (i == ACTOR_DRAGON_INDEX)) { - moveDragon(actor); - continue; - } - - switch (actor->_currentAction) { - case kActionWait: - if (!setup && (actor->_flags & kFollower)) { - followProtagonist(actor); - if (actor->_currentAction != kActionWait) - break; - } - - if (actor->_targetObject != ID_NOTHING) { - actorFaceTowardsObject(actor->_id, actor->_targetObject); - } - - if (actor->_flags & kCycle) { - frameRange = getActorFrameRange(actor->_id, getFrameType(kFrameStand)); - if (frameRange->frameCount > 0) { - actor->_actionCycle++; - actor->_actionCycle = (actor->_actionCycle) % frameRange->frameCount; - } else { - actor->_actionCycle = 0; - } - actor->_frameNumber = frameRange->frameIndex + actor->_actionCycle; - break; - } - - if ((actor->_actionCycle & 3) == 0) { - actor->cycleWrap(100); - - frameRange = getActorFrameRange(actor->_id, getFrameType(kFrameWait)); - if ((frameRange->frameCount < 1 || actor->_actionCycle > 33)) - frameRange = getActorFrameRange(actor->_id, getFrameType(kFrameStand)); - - if (frameRange->frameCount) { - actor->_frameNumber = frameRange->frameIndex + (uint16)_vm->_rnd.getRandomNumber(frameRange->frameCount - 1); - } else { - actor->_frameNumber = frameRange->frameIndex; - } - } - actor->_actionCycle++; - break; - - case kActionWalkToPoint: - case kActionWalkToLink: - if (_vm->_scene->getFlags() & kSceneFlagISO) { - actor->_partialTarget.delta(actor->_location, delta); - - while ((delta.u() == 0) && (delta.v() == 0)) { - - if ((actor == _protagonist) && (_vm->mouseButtonPressed())) { - _vm->_isoMap->screenPointToTileCoords(_vm->mousePos(), pickLocation); - - if (!actorWalkTo(_protagonist->_id, pickLocation)) { - break; - } - } else if (!_vm->_isoMap->nextTileTarget(actor) && !actorEndWalk(actor->_id, true)) { - break; - } - - actor->_partialTarget.delta(actor->_location, delta); - actor->_partialTarget.z = 0; - } - - if (actor->_flags & kFastest) { - speed = 8; - } else if (actor->_flags & kFaster) { - speed = 6; - } else { - speed = 4; - } - - if (_vm->_scene->currentSceneResourceId() == RID_ITE_OVERMAP_SCENE) { - speed = 2; - } - - if ((actor->_actionDirection == 2) || (actor->_actionDirection == 6)) { - speed = speed / 2; - } - - if (ABS(delta.v()) > ABS(delta.u())) { - addDelta.v() = clamp(-speed, delta.v(), speed); - if (addDelta.v() == delta.v()) { - addDelta.u() = delta.u(); - } else { - addDelta.u() = delta.u() * addDelta.v(); - addDelta.u() += (addDelta.u() > 0) ? (delta.v() / 2) : (-delta.v() / 2); - addDelta.u() /= delta.v(); - } - } else { - addDelta.u() = clamp(-speed, delta.u(), speed); - if (addDelta.u() == delta.u()) { - addDelta.v() = delta.v(); - } else { - addDelta.v() = delta.v() * addDelta.u(); - addDelta.v() += (addDelta.v() > 0) ? (delta.u() / 2) : (-delta.u() / 2); - addDelta.v() /= delta.u(); - } - } - - actor->_location.add(addDelta); - } else { - actor->_partialTarget.delta(actor->_location, delta); - - while ((delta.x == 0) && (delta.y == 0)) { - - if (actor->_walkStepIndex >= actor->_walkStepsCount) { - actorEndWalk(actor->_id, true); - break; - } - - actor->_partialTarget.fromScreenPoint(actor->_walkStepsPoints[actor->_walkStepIndex++]); - if (_vm->getGameType() == GType_ITE) { - if (actor->_partialTarget.x > 224 * 2 * ACTOR_LMULT) { - actor->_partialTarget.x -= 256 * 2 * ACTOR_LMULT; - } - } else { - if (actor->_partialTarget.x > 224 * 4 * ACTOR_LMULT) { - actor->_partialTarget.x -= 256 * 4 * ACTOR_LMULT; - } - } - - actor->_partialTarget.delta(actor->_location, delta); - - if (ABS(delta.y) > ABS(delta.x)) { - actor->_actionDirection = delta.y > 0 ? kDirDown : kDirUp; - } else { - actor->_actionDirection = delta.x > 0 ? kDirRight : kDirLeft; - } - } - - if(_vm->getGameType() == GType_ITE) - speed = (ACTOR_LMULT * 2 * actor->_screenScale + 63) / 256; - else - speed = (ACTOR_SPEED * actor->_screenScale + 128) >> 8; - - if (speed < 1) - speed = 1; - - if(_vm->getGameType() == GType_IHNM) - speed = speed / 2; - - if ((actor->_actionDirection == kDirUp) || (actor->_actionDirection == kDirDown)) { - addDelta.y = clamp(-speed, delta.y, speed); - if (addDelta.y == delta.y) { - addDelta.x = delta.x; - } else { - addDelta.x = delta.x * addDelta.y; - addDelta.x += (addDelta.x > 0) ? (delta.y / 2) : (-delta.y / 2); - addDelta.x /= delta.y; - actor->_facingDirection = actor->_actionDirection; - } - } else { - addDelta.x = clamp(-2 * speed, delta.x, 2 * speed); - if (addDelta.x == delta.x) { - addDelta.y = delta.y; - } else { - addDelta.y = delta.y * addDelta.x; - addDelta.y += (addDelta.y > 0) ? (delta.x / 2) : (-delta.x / 2); - addDelta.y /= delta.x; - actor->_facingDirection = actor->_actionDirection; - } - } - - actor->_location.add(addDelta); - } - - if (actor->_actorFlags & kActorBackwards) { - actor->_facingDirection = (actor->_actionDirection + 4) & 7; - actor->_actionCycle--; - } else { - actor->_actionCycle++; - } - - frameRange = getActorFrameRange(actor->_id, actor->_walkFrameSequence); - - if (actor->_actionCycle < 0) { - actor->_actionCycle = frameRange->frameCount - 1; - } else if (actor->_actionCycle >= frameRange->frameCount) { - actor->_actionCycle = 0; - } - - actor->_frameNumber = frameRange->frameIndex + actor->_actionCycle; - break; - - case kActionWalkDir: - if (_vm->_scene->getFlags() & kSceneFlagISO) { - actor->_location.u() += tileDirectionLUT[actor->_actionDirection][0]; - actor->_location.v() += tileDirectionLUT[actor->_actionDirection][1]; - - frameRange = getActorFrameRange(actor->_id, actor->_walkFrameSequence); - - actor->_actionCycle++; - actor->cycleWrap(frameRange->frameCount); - actor->_frameNumber = frameRange->frameIndex + actor->_actionCycle; - } else { - if (_vm->getGameType() == GType_ITE) { - actor->_location.x += directionLUT[actor->_actionDirection][0] * 2; - actor->_location.y += directionLUT[actor->_actionDirection][1] * 2; - } else { - // FIXME: The original does not multiply by 8 here, but we do - actor->_location.x += (directionLUT[actor->_actionDirection][0] * 8 * actor->_screenScale + 128) >> 8; - actor->_location.y += (directionLUT[actor->_actionDirection][1] * 8 * actor->_screenScale + 128) >> 8; - } - - frameRange = getActorFrameRange(actor->_id, actor->_walkFrameSequence); - actor->_actionCycle++; - actor->cycleWrap(frameRange->frameCount); - actor->_frameNumber = frameRange->frameIndex + actor->_actionCycle; - } - break; - - case kActionSpeak: - actor->_actionCycle++; - actor->cycleWrap(64); - - frameRange = getActorFrameRange(actor->_id, getFrameType(kFrameGesture)); - if (actor->_actionCycle >= frameRange->frameCount) { - if (actor->_actionCycle & 1) - break; - frameRange = getActorFrameRange(actor->_id, getFrameType(kFrameSpeak)); - - state = (uint16)_vm->_rnd.getRandomNumber(frameRange->frameCount); - - if (state == 0) { - frameRange = getActorFrameRange(actor->_id, getFrameType(kFrameStand)); - } else { - state--; - } - } else { - state = actor->_actionCycle; - } - - actor->_frameNumber = frameRange->frameIndex + state; - break; - - case kActionAccept: - case kActionStoop: - break; - - case kActionCycleFrames: - case kActionPongFrames: - if (actor->_cycleTimeCount > 0) { - actor->_cycleTimeCount--; - break; - } - - actor->_cycleTimeCount = actor->_cycleDelay; - actor->_actionCycle++; - - frameRange = getActorFrameRange(actor->_id, actor->_cycleFrameSequence); - - if (actor->_currentAction == kActionPongFrames) { - if (actor->_actionCycle >= frameRange->frameCount * 2 - 2) { - if (actor->_actorFlags & kActorContinuous) { - actor->_actionCycle = 0; - } else { - actor->_currentAction = kActionFreeze; - break; - } - } - - state = actor->_actionCycle; - if (state >= frameRange->frameCount) { - state = frameRange->frameCount * 2 - 2 - state; - } - } else { - if (actor->_actionCycle >= frameRange->frameCount) { - if (actor->_actorFlags & kActorContinuous) { - actor->_actionCycle = 0; - } else { - actor->_currentAction = kActionFreeze; - break; - } - } - state = actor->_actionCycle; - } - - if (frameRange->frameCount && (actor->_actorFlags & kActorRandom)) { - state = _vm->_rnd.getRandomNumber(frameRange->frameCount - 1); - } - - if (actor->_actorFlags & kActorBackwards) { - actor->_frameNumber = frameRange->frameIndex + frameRange->frameCount - 1 - state; - } else { - actor->_frameNumber = frameRange->frameIndex + state; - } - break; - - case kActionFall: - if (actor->_actionCycle > 0) { - framesLeft = actor->_actionCycle--; - actor->_finalTarget.delta(actor->_location, delta); - delta.x /= framesLeft; - delta.y /= framesLeft; - actor->_location.addXY(delta); - actor->_fallVelocity += actor->_fallAcceleration; - actor->_fallPosition += actor->_fallVelocity; - actor->_location.z = actor->_fallPosition >> 4; - } else { - actor->_location = actor->_finalTarget; - actor->_currentAction = kActionFreeze; - _vm->_script->wakeUpActorThread(kWaitTypeWalk, actor); - } - break; - - case kActionClimb: - actor->_cycleDelay++; - if (actor->_cycleDelay & 3) { - break; - } - - if (actor->_location.z >= actor->_finalTarget.z + ACTOR_CLIMB_SPEED) { - actor->_location.z -= ACTOR_CLIMB_SPEED; - actor->_actionCycle--; - } else if (actor->_location.z <= actor->_finalTarget.z - ACTOR_CLIMB_SPEED) { - actor->_location.z += ACTOR_CLIMB_SPEED; - actor->_actionCycle++; - } else { - actor->_location.z = actor->_finalTarget.z; - actor->_currentAction = kActionFreeze; - _vm->_script->wakeUpActorThread(kWaitTypeWalk, actor); - } - - frameRange = getActorFrameRange(actor->_id, actor->_cycleFrameSequence); - - if (actor->_actionCycle < 0) { - actor->_actionCycle = frameRange->frameCount - 1; - } - actor->cycleWrap(frameRange->frameCount); - actor->_frameNumber = frameRange->frameIndex + actor->_actionCycle; - break; - } - - if ((actor->_currentAction >= kActionWalkToPoint) && (actor->_currentAction <= kActionWalkDir)) { - hitZone = NULL; - - if (_vm->_scene->getFlags() & kSceneFlagISO) { - actor->_location.toScreenPointUV(hitPoint); - } else { - actor->_location.toScreenPointXY(hitPoint); - } - hitZoneIndex = _vm->_scene->_actionMap->hitTest(hitPoint); - if (hitZoneIndex != -1) { - hitZone = _vm->_scene->_actionMap->getHitZone(hitZoneIndex); - } - - if (hitZone != actor->_lastZone) { - if (actor->_lastZone) - stepZoneAction(actor, actor->_lastZone, true, false); - actor->_lastZone = hitZone; - // WORKAROUND for graphics glitch in the rat caves. Don't do this step zone action in the rat caves - // (room 51) to avoid the glitch - if (hitZone && !(_vm->getGameType() == GType_ITE && _vm->_scene->currentSceneNumber() == 51)) - stepZoneAction(actor, hitZone, false, false); - } - } - } - // Update frameCount for sfWaitFrames in IHNM - _vm->_frameCount++; -} - -void Actor::direct(int msec) { - - if (_vm->_scene->_entryList.entryListCount == 0) { - return; - } - - if (_vm->_interface->_statusTextInput) { - return; - } - - // FIXME: HACK. This should be turned into cycle event. - _lastTickMsec += msec; - - if (_lastTickMsec > 1000 / _handleActionDiv) { - _lastTickMsec = 0; - //process actions - handleActions(msec, false); - } - -//process speech - handleSpeech(msec); -} - - bool Actor::calcScreenPosition(CommonObjectData *commonObjectData) { int beginSlope, endSlope, middle; bool result; @@ -1738,7 +956,10 @@ void Actor::createDrawOrderList() { if (_vm->_scene->getFlags() & kSceneFlagISO) { compareFunction = &tileCommonObjectCompare; } else { - compareFunction = &commonObjectCompare; + if (_vm->getGameType() == GType_ITE) + compareFunction = &commonObjectCompare; + else + compareFunction = &commonObjectCompareIHNM; } _drawOrderList.clear(); @@ -1814,10 +1035,6 @@ void Actor::drawActors() { return; } - if (!_showActors) { - return; - } - CommonObjectOrderList::iterator drawOrderIterator; CommonObjectDataPointer drawObject; int frameNumber; @@ -1891,382 +1108,6 @@ void Actor::drawSpeech(void) { free(outputString); } -bool Actor::followProtagonist(ActorData *actor) { - Location protagonistLocation; - Location newLocation; - Location delta; - int protagonistBGMaskType; - Point prefer1; - Point prefer2; - Point prefer3; - int16 prefU; - int16 prefV; - int16 newU; - int16 newV; - - assert(_protagonist); - - actor->_flags &= ~(kFaster | kFastest); - protagonistLocation = _protagonist->_location; - calcScreenPosition(_protagonist); - - if (_vm->_scene->getFlags() & kSceneFlagISO) { - prefU = 60; - prefV = 60; - - - actor->_location.delta(protagonistLocation, delta); - - if (actor->_id == actorIndexToId(2)) { - prefU = prefV = 48; - } - - if ((delta.u() > prefU) || (delta.u() < -prefU) || (delta.v() > prefV) || (delta.v() < -prefV)) { - - if ((delta.u() > prefU * 2) || (delta.u() < -prefU * 2) || (delta.v() > prefV * 2) || (delta.v() < -prefV * 2)) { - actor->_flags |= kFaster; - - if ((delta.u() > prefU * 3) || (delta.u() < -prefU*3) || (delta.v() > prefV * 3) || (delta.v() < -prefV * 3)) { - actor->_flags |= kFastest; - } - } - - prefU /= 2; - prefV /= 2; - - newU = clamp(-prefU, delta.u(), prefU) + protagonistLocation.u(); - newV = clamp(-prefV, delta.v(), prefV) + protagonistLocation.v(); - - newLocation.u() = newU + _vm->_rnd.getRandomNumber(prefU - 1) - prefU / 2; - newLocation.v() = newV + _vm->_rnd.getRandomNumber(prefV - 1) - prefV / 2; - newLocation.z = 0; - - return actorWalkTo(actor->_id, newLocation); - } - - } else { - prefer1.x = (100 * _protagonist->_screenScale) >> 8; - prefer1.y = (50 * _protagonist->_screenScale) >> 8; - - if (_protagonist->_currentAction == kActionWalkDir) { - prefer1.x /= 2; - } - - if (prefer1.x < 8) { - prefer1.x = 8; - } - - if (prefer1.y < 8) { - prefer1.y = 8; - } - - prefer2.x = prefer1.x * 2; - prefer2.y = prefer1.y * 2; - prefer3.x = prefer1.x + prefer1.x / 2; - prefer3.y = prefer1.y + prefer1.y / 2; - - actor->_location.delta(protagonistLocation, delta); - - protagonistBGMaskType = 0; - if (_vm->_scene->isBGMaskPresent() && _vm->_scene->validBGMaskPoint(_protagonist->_screenPosition)) { - protagonistBGMaskType = _vm->_scene->getBGMaskType(_protagonist->_screenPosition); - } - - if ((_vm->_rnd.getRandomNumber(7) & 0x7) == 0) // 1/8th chance - actor->_actorFlags &= ~kActorNoFollow; - - if (actor->_actorFlags & kActorNoFollow) { - return false; - } - - if ((delta.x > prefer2.x) || (delta.x < -prefer2.x) || - (delta.y > prefer2.y) || (delta.y < -prefer2.y) || - ((_protagonist->_currentAction == kActionWait) && - (delta.x * 2 < prefer1.x) && (delta.x * 2 > -prefer1.x) && - (delta.y < prefer1.y) && (delta.y > -prefer1.y))) { - - if (ABS(delta.x) > ABS(delta.y)) { - - delta.x = (delta.x > 0) ? prefer3.x : -prefer3.x; - - newLocation.x = delta.x + protagonistLocation.x; - newLocation.y = clamp(-prefer2.y, delta.y, prefer2.y) + protagonistLocation.y; - } else { - delta.y = (delta.y > 0) ? prefer3.y : -prefer3.y; - - newLocation.x = clamp(-prefer2.x, delta.x, prefer2.x) + protagonistLocation.x; - newLocation.y = delta.y + protagonistLocation.y; - } - newLocation.z = 0; - - if (protagonistBGMaskType != 3) { - newLocation.x += _vm->_rnd.getRandomNumber(prefer1.x - 1) - prefer1.x / 2; - newLocation.y += _vm->_rnd.getRandomNumber(prefer1.y - 1) - prefer1.y / 2; - } - - newLocation.x = clamp(-31*4, newLocation.x, (_vm->getDisplayWidth() + 31) * 4); //fixme - - return actorWalkTo(actor->_id, newLocation); - } - } - return false; -} - -bool Actor::actorEndWalk(uint16 actorId, bool recurse) { - bool walkMore = false; - ActorData *actor; - const HitZone *hitZone; - int hitZoneIndex; - Point testPoint; - - actor = getActor(actorId); - actor->_actorFlags &= ~kActorBackwards; - - if (_vm->getGameType() == GType_ITE) { - - if (actor->_location.distance(actor->_finalTarget) > 8 && (actor->_flags & kProtagonist) && recurse && !(actor->_actorFlags & kActorNoCollide)) { - actor->_actorFlags |= kActorNoCollide; - return actorWalkTo(actorId, actor->_finalTarget); - } - } - - actor->_currentAction = kActionWait; - if (actor->_actorFlags & kActorFinalFace) { - actor->_facingDirection = actor->_actionDirection = (actor->_actorFlags >> 6) & 0x07; //? - } - - actor->_actorFlags &= ~(kActorNoCollide | kActorCollided | kActorFinalFace | kActorFacingMask); - actor->_flags &= ~(kFaster | kFastest); - - if (actor == _protagonist) { - _vm->_script->wakeUpActorThread(kWaitTypeWalk, actor); - if (_vm->_script->_pendingVerb == _vm->_script->getVerbType(kVerbWalkTo)) { - if (_vm->getGameType() == GType_ITE) - actor->_location.toScreenPointUV(testPoint); // it's wrong calculation, but it is used in ITE - else - actor->_location.toScreenPointXY(testPoint); - - hitZoneIndex = _vm->_scene->_actionMap->hitTest(testPoint); - if (hitZoneIndex != -1) { - hitZone = _vm->_scene->_actionMap->getHitZone(hitZoneIndex); - stepZoneAction(actor, hitZone, false, true); - } else { - _vm->_script->setNoPendingVerb(); - } - } else if (_vm->_script->_pendingVerb != _vm->_script->getVerbType(kVerbNone)) { - _vm->_script->doVerb(); - } - } else { - if (recurse && (actor->_flags & kFollower)) - walkMore = followProtagonist(actor); - - _vm->_script->wakeUpActorThread(kWaitTypeWalk, actor); - } - return walkMore; -} - -bool Actor::actorWalkTo(uint16 actorId, const Location &toLocation) { - ActorData *actor; - ActorData *anotherActor; - int i; - - Rect testBox; - Rect testBox2; - Point anotherActorScreenPosition; - Point collision; - Point pointFrom, pointTo, pointBest, pointAdd; - Point delta, bestDelta; - Point tempPoint; - bool extraStartNode; - bool extraEndNode; - - actor = getActor(actorId); - - if (actor == _protagonist) { - _vm->_scene->setDoorState(2, 0xff); - _vm->_scene->setDoorState(3, 0); - } else { - _vm->_scene->setDoorState(2, 0); - _vm->_scene->setDoorState(3, 0xff); - } - - if (_vm->_scene->getFlags() & kSceneFlagISO) { - - if ((_vm->getGameType() == GType_ITE) && (actor->_index == ACTOR_DRAGON_INDEX)) { - return false; - } - - actor->_finalTarget = toLocation; - actor->_walkStepsCount = 0; - _vm->_isoMap->findTilePath(actor, actor->_location, toLocation); - - - if ((actor->_walkStepsCount == 0) && (actor->_flags & kProtagonist)) { - actor->_actorFlags |= kActorNoCollide; - _vm->_isoMap->findTilePath(actor, actor->_location, toLocation); - } - - actor->_walkStepIndex = 0; - if (_vm->_isoMap->nextTileTarget(actor)) { - actor->_currentAction = kActionWalkToPoint; - actor->_walkFrameSequence = getFrameType(kFrameWalk); - } else { - actorEndWalk(actorId, false); - return false; - } - } else { - - actor->_location.toScreenPointXY(pointFrom); - pointFrom.x &= ~1; - - extraStartNode = _vm->_scene->offscreenPath(pointFrom); - - toLocation.toScreenPointXY(pointTo); - pointTo.x &= ~1; - - extraEndNode = _vm->_scene->offscreenPath(pointTo); - - if (_vm->_scene->isBGMaskPresent()) { - - if ((((actor->_currentAction >= kActionWalkToPoint) && - (actor->_currentAction <= kActionWalkDir)) || (actor == _protagonist)) && - !_vm->_scene->canWalk(pointFrom)) { - - int max = _vm->getGameType() == GType_ITE ? 8 : 4; - - for (i = 1; i < max; i++) { - pointAdd = pointFrom; - pointAdd.y += i; - if (_vm->_scene->canWalk(pointAdd)) { - pointFrom = pointAdd; - break; - } - pointAdd = pointFrom; - pointAdd.y -= i; - if (_vm->_scene->canWalk(pointAdd)) { - pointFrom = pointAdd; - break; - } - if (_vm->getGameType() == GType_ITE) { - pointAdd = pointFrom; - pointAdd.x += i; - if (_vm->_scene->canWalk(pointAdd)) { - pointFrom = pointAdd; - break; - } - pointAdd = pointFrom; - pointAdd.x -= i; - if (_vm->_scene->canWalk(pointAdd)) { - pointFrom = pointAdd; - break; - } - } - } - } - - _barrierCount = 0; - if (!(actor->_actorFlags & kActorNoCollide)) { - collision.x = ACTOR_COLLISION_WIDTH * actor->_screenScale / (256 * 2); - collision.y = ACTOR_COLLISION_HEIGHT * actor->_screenScale / (256 * 2); - - - for (i = 0; (i < _actorsCount) && (_barrierCount < ACTOR_BARRIERS_MAX); i++) { - anotherActor = _actors[i]; - if (!anotherActor->_inScene) - continue; - if (anotherActor == actor) - continue; - - anotherActorScreenPosition = anotherActor->_screenPosition; - testBox.left = (anotherActorScreenPosition.x - collision.x) & ~1; - testBox.right = (anotherActorScreenPosition.x + collision.x) & ~1 + 1; - testBox.top = anotherActorScreenPosition.y - collision.y; - testBox.bottom = anotherActorScreenPosition.y + collision.y + 1; - testBox2 = testBox; - testBox2.right += 2; - testBox2.left -= 2; - testBox2.top -= 1; - testBox2.bottom += 1; - - if (testBox2.contains(pointFrom)) { - if (pointFrom.x > anotherActorScreenPosition.x + 4) { - testBox.right = pointFrom.x - 1; - } else if (pointFrom.x < anotherActorScreenPosition.x - 4) { - testBox.left = pointFrom.x + 2; - } else if (pointFrom.y > anotherActorScreenPosition.y) { - testBox.bottom = pointFrom.y; - } else { - testBox.top = pointFrom.y + 1 ; - } - } - - if ((testBox.width() > 0) && (testBox.height() > 0)) { - _barrierList[_barrierCount++] = testBox; - } - } - } - - - pointBest = pointTo; - actor->_walkStepsCount = 0; - findActorPath(actor, pointFrom, pointTo); - - if (actor->_walkStepsCount == 0) { - error("actor->_walkStepsCount == 0"); - } - - if (extraStartNode) { - actor->_walkStepIndex = 0; - } else { - actor->_walkStepIndex = 1; - } - - if (extraEndNode) { - toLocation.toScreenPointXY(tempPoint); - actor->_walkStepsCount--; - actor->addWalkStepPoint(tempPoint); - } - - - pointBest = actor->_walkStepsPoints[actor->_walkStepsCount - 1]; - - pointBest.x &= ~1; - delta.x = ABS(pointFrom.x - pointTo.x); - delta.y = ABS(pointFrom.y - pointTo.y); - - bestDelta.x = ABS(pointBest.x - pointTo.x); - bestDelta.y = ABS(pointBest.y - pointTo.y); - - if ((delta.x + delta.y <= bestDelta.x + bestDelta.y) && (actor->_flags & kFollower)) { - actor->_actorFlags |= kActorNoFollow; - } - - if (pointBest == pointFrom) { - actor->_walkStepsCount = 0; - } - } else { - actor->_walkStepsCount = 0; - actor->addWalkStepPoint(pointTo); - actor->_walkStepIndex = 0; - } - - actor->_partialTarget = actor->_location; - actor->_finalTarget = toLocation; - if (actor->_walkStepsCount == 0) { - actorEndWalk(actorId, false); - return false; - } else { - if (actor->_flags & kProtagonist) { - _actors[1]->_actorFlags &= ~kActorNoFollow; // TODO: mark all actors with kFollower flag, not only 1 and 2 - _actors[2]->_actorFlags &= ~kActorNoFollow; - } - actor->_currentAction = (actor->_walkStepsCount >= ACTOR_MAX_STEPS_COUNT) ? kActionWalkToLink : kActionWalkToPoint; - actor->_walkFrameSequence = getFrameType(kFrameWalk); - } - } - return true; -} - void Actor::actorSpeech(uint16 actorId, const char **strings, int stringsCount, int sampleResourceId, int speechFlags) { ActorData *actor; int i; @@ -2303,11 +1144,11 @@ void Actor::actorSpeech(uint16 actorId, const char **strings, int stringsCount, _activeSpeech.speechBox.right = _vm->getDisplayWidth() - 10; } - // WORKAROUND for the compact disk in Ellen's chapter + // HACK for the compact disk in Ellen's chapter // Once Ellen starts saying that "Something is different", bring the compact disk in the // scene. After speaking with AM, the compact disk is visible. She always says this line // when entering room 59, after speaking with AM, if the compact disk is not picked up yet - // Check Script::sfDropObject for the other part of this workaround + // Check Script::sfDropObject for the other part of this hack if (_vm->getGameType() == GType_IHNM && _vm->_scene->currentChapterNumber() == 3 && _vm->_scene->currentSceneNumber() == 59 && _activeSpeech.sampleResourceId == 286) { for (i = 0; i < _objsCount; i++) { @@ -2383,759 +1224,6 @@ void Actor::abortSpeech() { _activeSpeech.playingTime = 0; } -void Actor::moveDragon(ActorData *actor) { - int16 dir0, dir1, dir2, dir3; - int16 moveType; - Event event; - const DragonMove *dragonMove; - - if ((actor->_actionCycle < 0) || - ((actor->_actionCycle == 0) && (actor->_dragonMoveType >= ACTOR_DRAGON_TURN_MOVES))) { - - moveType = kDragonMoveInvalid; - if (actor->_location.distance(_protagonist->_location) < 24) { - if (_dragonHunt && (_protagonist->_currentAction != kActionFall)) { - event.type = kEvTOneshot; - event.code = kScriptEvent; - event.op = kEventExecNonBlocking; - event.time = 0; - event.param = _vm->_scene->getScriptModuleNumber(); // module number - event.param2 = ACTOR_EXP_KNOCK_RIF; // script entry point number - event.param3 = -1; // Action - event.param4 = -1; // Object - event.param5 = -1; // With Object - event.param6 = -1; // Actor - - _vm->_events->queue(&event); - _dragonHunt = false; - } - } else { - _dragonHunt = true; - } - - if (actor->_walkStepIndex + 2 > actor->_walkStepsCount) { - - _vm->_isoMap->findDragonTilePath(actor, actor->_location, _protagonist->_location, actor->_actionDirection); - - if (actor->_walkStepsCount == 0) { - _vm->_isoMap->findDragonTilePath(actor, actor->_location, _protagonist->_location, 0); - } - - if (actor->_walkStepsCount < 2) { - return; - } - - actor->_partialTarget = actor->_location; - actor->_finalTarget = _protagonist->_location; - actor->_walkStepIndex = 0; - } - - dir0 = actor->_actionDirection; - dir1 = actor->_tileDirections[actor->_walkStepIndex++]; - dir2 = actor->_tileDirections[actor->_walkStepIndex]; - dir3 = actor->_tileDirections[actor->_walkStepIndex + 1]; - - if (dir0 != dir1){ - actor->_actionDirection = dir0 = dir1; - } - - actor->_location = actor->_partialTarget; - - if ((dir1 != dir2) && (dir1 == dir3)) { - switch (dir1) { - case kDirUpLeft: - actor->_partialTarget.v() += 16; - moveType = kDragonMoveUpLeft; - break; - case kDirDownLeft: - actor->_partialTarget.u() -= 16; - moveType = kDragonMoveDownLeft; - break; - case kDirDownRight: - actor->_partialTarget.v() -= 16; - moveType = kDragonMoveDownRight; - break; - case kDirUpRight: - actor->_partialTarget.u() += 16; - moveType = kDragonMoveUpRight; - break; - } - - switch (dir2) { - case kDirUpLeft: - actor->_partialTarget.v() += 16; - break; - case kDirDownLeft: - actor->_partialTarget.u() -= 16; - break; - case kDirDownRight: - actor->_partialTarget.v() -= 16; - break; - case kDirUpRight: - actor->_partialTarget.u() += 16; - break; - } - - actor->_walkStepIndex++; - } else { - switch (dir1) { - case kDirUpLeft: - actor->_partialTarget.v() += 16; - switch (dir2) { - case kDirDownLeft: - moveType = kDragonMoveUpLeft_Left; - actor->_partialTarget.u() -= 16; - break; - case kDirUpLeft: - moveType = kDragonMoveUpLeft; - break; - case kDirUpRight: - actor->_partialTarget.u() += 16; - moveType = kDragonMoveUpLeft_Right; - break; - default: - actor->_actionDirection = dir1; - actor->_walkStepsCount = 0; - break; - } - break; - case kDirDownLeft: - actor->_partialTarget.u() -= 16; - switch (dir2) { - case kDirDownRight: - moveType = kDragonMoveDownLeft_Left; - actor->_partialTarget.v() -= 16; - break; - case kDirDownLeft: - moveType = kDragonMoveDownLeft; - break; - case kDirUpLeft: - moveType = kDragonMoveDownLeft_Right; - actor->_partialTarget.v() += 16; - break; - default: - actor->_actionDirection = dir1; - actor->_walkStepsCount = 0; - break; - } - break; - case kDirDownRight: - actor->_partialTarget.v() -= 16; - switch (dir2) { - case kDirUpRight: - moveType = kDragonMoveDownRight_Left; - actor->_partialTarget.u() += 16; - break; - case kDirDownRight: - moveType = kDragonMoveDownRight; - break; - case kDirDownLeft: - moveType = kDragonMoveDownRight_Right; - actor->_partialTarget.u() -= 16; - break; - default: - actor->_actionDirection = dir1; - actor->_walkStepsCount = 0; - break; - } - break; - case kDirUpRight: - actor->_partialTarget.u() += 16; - switch (dir2) { - case kDirUpLeft: - moveType = kDragonMoveUpRight_Left; - actor->_partialTarget.v() += 16; - break; - case kDirUpRight: - moveType = kDragonMoveUpRight; - break; - case kDirDownRight: - moveType = kDragonMoveUpRight_Right; - actor->_partialTarget.v() -= 16; - break; - default: - actor->_actionDirection = dir1; - actor->_walkStepsCount = 0; - break; - } - break; - - default: - actor->_actionDirection = dir1; - actor->_walkStepsCount = 0; - break; - } - } - - actor->_dragonMoveType = moveType; - - if (moveType >= ACTOR_DRAGON_TURN_MOVES) { - actor->_dragonStepCycle = 0; - actor->_actionCycle = 4; - actor->_walkStepIndex++; - } else { - actor->_actionCycle = 4; - } - } - - actor->_actionCycle--; - - if ((actor->_walkStepsCount < 1) || (actor->_actionCycle < 0)) { - return; - } - - if (actor->_dragonMoveType < ACTOR_DRAGON_TURN_MOVES) { - - actor->_dragonStepCycle++; - if (actor->_dragonStepCycle >= 7) { - actor->_dragonStepCycle = 0; - } - - actor->_dragonBaseFrame = actor->_dragonMoveType * 7; - - if (actor->_location.u() > actor->_partialTarget.u() + 3) { - actor->_location.u() -= 4; - } else if (actor->_location.u() < actor->_partialTarget.u() - 3) { - actor->_location.u() += 4; - } else { - actor->_location.u() = actor->_partialTarget.u(); - } - - if (actor->_location.v() > actor->_partialTarget.v() + 3) { - actor->_location.v() -= 4; - } else if (actor->_location.v() < actor->_partialTarget.v() - 3) { - actor->_location.v() += 4; - } else { - actor->_location.v() = actor->_partialTarget.v(); - } - } else { - dragonMove = &dragonMoveTable[actor->_dragonMoveType]; - actor->_dragonBaseFrame = dragonMove->baseFrame; - - - actor->_location.u() = actor->_partialTarget.u() - dragonMove->offset[actor->_actionCycle][0]; - actor->_location.v() = actor->_partialTarget.v() - dragonMove->offset[actor->_actionCycle][1]; - - actor->_dragonStepCycle++; - if (actor->_dragonStepCycle >= 3) { - actor->_dragonStepCycle = 3; - } - } - - actor->_frameNumber = actor->_dragonBaseFrame + actor->_dragonStepCycle; -} - -void Actor::findActorPath(ActorData *actor, const Point &fromPoint, const Point &toPoint) { - Point iteratorPoint; - Point bestPoint; - int maskType; - int i; - Rect intersect; - -#ifdef ACTOR_DEBUG - _debugPointsCount = 0; -#endif - - actor->_walkStepsCount = 0; - if (fromPoint == toPoint) { - actor->addWalkStepPoint(toPoint); - return; - } - - for (iteratorPoint.y = 0; iteratorPoint.y < _yCellCount; iteratorPoint.y++) { - for (iteratorPoint.x = 0; iteratorPoint.x < _xCellCount; iteratorPoint.x++) { - if (_vm->_scene->validBGMaskPoint(iteratorPoint)) { - maskType = _vm->_scene->getBGMaskType(iteratorPoint); - setPathCell(iteratorPoint, _vm->_scene->getDoorState(maskType) ? kPathCellBarrier : kPathCellEmpty); - } else { - setPathCell(iteratorPoint, kPathCellBarrier); - } - } - } - - for (i = 0; i < _barrierCount; i++) { - intersect.left = MAX(_pathRect.left, _barrierList[i].left); - intersect.top = MAX(_pathRect.top, _barrierList[i].top); - intersect.right = MIN(_pathRect.right, _barrierList[i].right); - intersect.bottom = MIN(_pathRect.bottom, _barrierList[i].bottom); - - for (iteratorPoint.y = intersect.top; iteratorPoint.y < intersect.bottom; iteratorPoint.y++) { - for (iteratorPoint.x = intersect.left; iteratorPoint.x < intersect.right; iteratorPoint.x++) { - setPathCell(iteratorPoint, kPathCellBarrier); - } - } - } - -#ifdef ACTOR_DEBUG - for (iteratorPoint.y = 0; iteratorPoint.y < _yCellCount; iteratorPoint.y++) { - for (iteratorPoint.x = 0; iteratorPoint.x < _xCellCount; iteratorPoint.x++) { - if (getPathCell(iteratorPoint) == kPathCellBarrier) { - addDebugPoint(iteratorPoint, 24); - } - } - } -#endif - - if (scanPathLine(fromPoint, toPoint)) { - actor->addWalkStepPoint(fromPoint); - actor->addWalkStepPoint(toPoint); - return; - } - - i = fillPathArray(fromPoint, toPoint, bestPoint); - - if (fromPoint == bestPoint) { - actor->addWalkStepPoint(bestPoint); - return; - } - - if (i == 0) { - error("fillPathArray returns zero"); - } - - setActorPath(actor, fromPoint, bestPoint); -} - -bool Actor::scanPathLine(const Point &point1, const Point &point2) { - Point point; - Point delta; - Point s; - Point fDelta; - int16 errterm; - - calcDeltaS(point1, point2, delta, s); - point = point1; - - fDelta.x = delta.x * 2; - fDelta.y = delta.y * 2; - - if (delta.y > delta.x) { - - errterm = fDelta.x - delta.y; - - while (delta.y > 0) { - while (errterm >= 0) { - point.x += s.x; - errterm -= fDelta.y; - } - - point.y += s.y; - errterm += fDelta.x; - - if (!validPathCellPoint(point)) { - return false; - } - if (getPathCell(point) == kPathCellBarrier) { - return false; - } - delta.y--; - } - } else { - - errterm = fDelta.y - delta.x; - - while (delta.x > 0) { - while (errterm >= 0) { - point.y += s.y; - errterm -= fDelta.x; - } - - point.x += s.x; - errterm += fDelta.y; - - if (!validPathCellPoint(point)) { - return false; - } - if (getPathCell(point) == kPathCellBarrier) { - return false; - } - delta.x--; - } - } - return true; -} - -int Actor::fillPathArray(const Point &fromPoint, const Point &toPoint, Point &bestPoint) { - int bestRating; - int currentRating; - int i; - Point bestPath; - int pointCounter; - int startDirection; - PathDirectionData *pathDirection; - PathDirectionData *newPathDirection; - const PathDirectionData *samplePathDirection; - Point nextPoint; - int directionCount; - int16 compressX = (_vm->getGameType() == GType_ITE) ? 2 : 1; - - _pathDirectionListCount = 0; - pointCounter = 0; - bestRating = quickDistance(fromPoint, toPoint, compressX); - bestPath = fromPoint; - - for (startDirection = 0; startDirection < 4; startDirection++) { - newPathDirection = addPathDirectionListData(); - newPathDirection->coord = fromPoint; - newPathDirection->direction = startDirection; - } - - if (validPathCellPoint(fromPoint)) { - setPathCell(fromPoint, kDirUp); - -#ifdef ACTOR_DEBUG - addDebugPoint(fromPoint, 24+36); -#endif - } - - i = 0; - - do { - pathDirection = &_pathDirectionList[i]; - for (directionCount = 0; directionCount < 3; directionCount++) { - samplePathDirection = &pathDirectionLUT[pathDirection->direction][directionCount]; - nextPoint = pathDirection->coord; - nextPoint.x += samplePathDirection->coord.x; - nextPoint.y += samplePathDirection->coord.y; - - if (!validPathCellPoint(nextPoint)) { - continue; - } - - if (getPathCell(nextPoint) != kPathCellEmpty) { - continue; - } - - setPathCell(nextPoint, samplePathDirection->direction); - -#ifdef ACTOR_DEBUG - addDebugPoint(nextPoint, samplePathDirection->direction + 96); -#endif - newPathDirection = addPathDirectionListData(); - newPathDirection->coord = nextPoint; - newPathDirection->direction = samplePathDirection->direction; - ++pointCounter; - if (nextPoint == toPoint) { - bestPoint = toPoint; - return pointCounter; - } - currentRating = quickDistance(nextPoint, toPoint, compressX); - if (currentRating < bestRating) { - bestRating = currentRating; - bestPath = nextPoint; - } - pathDirection = &_pathDirectionList[i]; - } - ++i; - } while (i < _pathDirectionListCount); - - bestPoint = bestPath; - return pointCounter; -} - -void Actor::setActorPath(ActorData *actor, const Point &fromPoint, const Point &toPoint) { - Point nextPoint; - int8 direction; - int i; - - _pathListIndex = -1; - addPathListPoint(toPoint); - nextPoint = toPoint; - - while (!(nextPoint == fromPoint)) { - direction = getPathCell(nextPoint); - if ((direction < 0) || (direction >= 8)) { - error("Actor::setActorPath error direction 0x%X", direction); - } - nextPoint.x -= pathDirectionLUT2[direction][0]; - nextPoint.y -= pathDirectionLUT2[direction][1]; - addPathListPoint(nextPoint); - -#ifdef ACTOR_DEBUG - addDebugPoint(nextPoint, 0x8a); -#endif - } - - pathToNode(); - removeNodes(); - nodeToPath(); - removePathPoints(); - - for (i = 0; i <= _pathNodeListIndex; i++) { - actor->addWalkStepPoint(_pathNodeList[i].point); - } -} - -void Actor::pathToNode() { - Point point1, point2, delta; - int direction; - int i; - Point *point; - - point= &_pathList[_pathListIndex]; - direction = 0; - - _pathNodeListIndex = -1; - addPathNodeListPoint(*point); - - for (i = _pathListIndex; i > 0; i--) { - point1 = *point; - --point; - point2 = *point; - if (direction == 0) { - delta.x = int16Compare(point2.x, point1.x); - delta.y = int16Compare(point2.y, point1.y); - direction++; - } - if ((point1.x + delta.x != point2.x) || (point1.y + delta.y != point2.y)) { - addPathNodeListPoint(point1); - direction--; - i++; - point++; - } - } - addPathNodeListPoint(*_pathList); -} - -int pathLine(Point *pointList, const Point &point1, const Point &point2) { - Point point; - Point delta; - Point tempPoint; - Point s; - int16 errterm; - int16 res; - - calcDeltaS(point1, point2, delta, s); - - point = point1; - - tempPoint.x = delta.x * 2; - tempPoint.y = delta.y * 2; - - if (delta.y > delta.x) { - - errterm = tempPoint.x - delta.y; - res = delta.y; - - while (delta.y > 0) { - while (errterm >= 0) { - point.x += s.x; - errterm -= tempPoint.y; - } - - point.y += s.y; - errterm += tempPoint.x; - - *pointList = point; - pointList++; - delta.y--; - } - } else { - - errterm = tempPoint.y - delta.x; - res = delta.x; - - while (delta.x > 0) { - while (errterm >= 0) { - point.y += s.y; - errterm -= tempPoint.x; - } - - point.x += s.x; - errterm += tempPoint.y; - - *pointList = point; - pointList++; - delta.x--; - } - } - return res; -} - -void Actor::nodeToPath() { - int i; - Point point1, point2; - PathNode *node; - Point *point; - - for (i = 0, point = _pathList; i < _pathListAlloced; i++, point++) { - point->x = point->y = PATH_NODE_EMPTY; - } - - _pathListIndex = 1; - _pathList[0] = _pathNodeList[0].point; - _pathNodeList[0].link = 0; - for (i = 0, node = _pathNodeList; i < _pathNodeListIndex; i++) { - point1 = node->point; - node++; - point2 = node->point; - _pathListIndex += pathLine(&_pathList[_pathListIndex], point1, point2); - node->link = _pathListIndex - 1; - } - _pathListIndex--; - _pathNodeList[_pathNodeListIndex].link = _pathListIndex; - -} - -void Actor::removeNodes() { - int i, j, k; - PathNode *iNode, *jNode, *kNode, *fNode; - fNode = &_pathNodeList[_pathNodeListIndex]; - - if (scanPathLine(_pathNodeList[0].point, fNode->point)) { - _pathNodeList[1] = *fNode; - _pathNodeListIndex = 1; - } - - if (_pathNodeListIndex < 4) { - return; - } - - for (i = _pathNodeListIndex - 1, iNode = fNode-1; i > 1 ; i--, iNode--) { - if (iNode->point.x == PATH_NODE_EMPTY) { - continue; - } - - if (scanPathLine(_pathNodeList[0].point, iNode->point)) { - for (j = 1, jNode = _pathNodeList + 1; j < i; j++, jNode++) { - jNode->point.x = PATH_NODE_EMPTY; - } - } - } - - for (i = 1, iNode = _pathNodeList + 1; i < _pathNodeListIndex - 1; i++, iNode++) { - if (iNode->point.x == PATH_NODE_EMPTY) { - continue; - } - - if (scanPathLine(fNode->point, iNode->point)) { - for (j = i + 1, jNode = iNode + 1; j < _pathNodeListIndex; j++, jNode++) { - jNode->point.x = PATH_NODE_EMPTY; - } - } - } - condenseNodeList(); - - for (i = 1, iNode = _pathNodeList + 1; i < _pathNodeListIndex - 1; i++, iNode++) { - if (iNode->point.x == PATH_NODE_EMPTY) { - continue; - } - for (j = i + 2, jNode = iNode + 2; j < _pathNodeListIndex; j++, jNode++) { - if (jNode->point.x == PATH_NODE_EMPTY) { - continue; - } - - if (scanPathLine(iNode->point, jNode->point)) { - for (k = i + 1,kNode = iNode + 1; k < j; k++, kNode++) { - kNode->point.x = PATH_NODE_EMPTY; - } - } - } - } - condenseNodeList(); -} - -void Actor::condenseNodeList() { - int i, j, count; - PathNode *iNode, *jNode; - - count = _pathNodeListIndex; - - for (i = 1, iNode = _pathNodeList + 1; i < _pathNodeListIndex; i++, iNode++) { - if (iNode->point.x == PATH_NODE_EMPTY) { - j = i + 1; - jNode = iNode + 1; - while (jNode->point.x == PATH_NODE_EMPTY) { - j++; - jNode++; - } - *iNode = *jNode; - count = i; - jNode->point.x = PATH_NODE_EMPTY; - if (j == _pathNodeListIndex) { - break; - } - } - } - _pathNodeListIndex = count; -} - -void Actor::removePathPoints() { - int i, j, k, l; - PathNode *node; - int start; - int end; - Point point1, point2; - - if (_pathNodeListIndex < 2) - return; - - _newPathNodeListIndex = -1; - addNewPathNodeListPoint(_pathNodeList[0]); - - for (i = 1, node = _pathNodeList + 1; i < _pathNodeListIndex; i++, node++) { - addNewPathNodeListPoint(*node); - - for (j = 5; j > 0; j--) { - start = node->link - j; - end = node->link + j; - - if (start < 0 || end > _pathListIndex) { - continue; - } - - point1 = _pathList[start]; - point2 = _pathList[end]; - if ((point1.x == PATH_NODE_EMPTY) || (point2.x == PATH_NODE_EMPTY)) { - continue; - } - - if (scanPathLine(point1, point2)) { - for (l = 1; l <= _newPathNodeListIndex; l++) { - if (start <= _newPathNodeList[l].link) { - _newPathNodeListIndex = l; - _newPathNodeList[_newPathNodeListIndex].point = point1; - _newPathNodeList[_newPathNodeListIndex].link = start; - incrementNewPathNodeListIndex(); - break; - } - } - _newPathNodeList[_newPathNodeListIndex].point = point2; - _newPathNodeList[_newPathNodeListIndex].link = end; - - for (k = start + 1; k < end; k++) { - _pathList[k].x = PATH_NODE_EMPTY; - } - break; - } - } - } - - addNewPathNodeListPoint(_pathNodeList[_pathNodeListIndex]); - - for (i = 0, j = 0; i <= _newPathNodeListIndex; i++) { - if (_newPathNodeListIndex == i || (_newPathNodeList[i].point != _newPathNodeList[i+1].point)) { - _pathNodeList[j++] = _newPathNodeList[i]; - } - } - _pathNodeListIndex = j - 1; -} - -void Actor::drawPathTest() { -#ifdef ACTOR_DEBUG - int i; - Surface *surface; - surface = _vm->_gfx->getBackBuffer(); - if (_debugPoints == NULL) { - return; - } - - for (i = 0; i < _debugPointsCount; i++) { - *((byte *)surface->pixels + (_debugPoints[i].point.y * surface->pitch) + _debugPoints[i].point.x) = _debugPoints[i].color; - } -#endif -} - void Actor::saveState(Common::OutSaveFile *out) { uint16 i; @@ -3156,7 +1244,7 @@ void Actor::loadState(Common::InSaveFile *in) { int32 i; int16 protagState = in->readSint16LE(); - if (protagState != 0) + if (protagState != 0 || _protagonist->_shareFrames) setProtagState(protagState); for (i = 0; i < _actorsCount; i++) { @@ -3178,24 +1266,4 @@ void Actor::loadState(Common::InSaveFile *in) { } } -// Console wrappers - must be safe to run - -void Actor::cmdActorWalkTo(int argc, const char **argv) { - uint16 actorId = (uint16) atoi(argv[1]); - Location location; - Point movePoint; - - movePoint.x = atoi(argv[2]); - movePoint.y = atoi(argv[3]); - - location.fromScreenPoint(movePoint); - - if (!validActorId(actorId)) { - _vm->_console->DebugPrintf("Actor::cmActorWalkTo Invalid actorId 0x%X.\n", actorId); - return; - } - - actorWalkTo(actorId, location); -} - } // End of namespace Saga diff --git a/engines/saga/actor.h b/engines/saga/actor.h index ef62661c6c..7022ef1289 100644 --- a/engines/saga/actor.h +++ b/engines/saga/actor.h @@ -94,6 +94,24 @@ enum ActorActions { kActionClimb = 12 }; +enum ActorFrameIds { +//ITE + kFrameITEStand = 0, + kFrameITEWalk = 1, + kFrameITESpeak = 2, + kFrameITEGive = 3, + kFrameITEGesture = 4, + kFrameITEWait = 5, + kFrameITEPickUp = 6, + kFrameITELook = 7, +//IHNM + kFrameIHNMStand = 0, + kFrameIHNMSpeak = 1, + kFrameIHNMWait = 2, + kFrameIHNMGesture = 3, + kFrameIHNMWalk = 4 +}; + enum SpeechFlags { kSpeakNoAnimate = 1, kSpeakAsync = 2, @@ -112,6 +130,18 @@ enum ActorFrameTypes { kFrameLook }; +// Lookup table to convert 8 cardinal directions to 4 +static const int actorDirectectionsLUT[8] = { + ACTOR_DIRECTION_BACK, // kDirUp + ACTOR_DIRECTION_RIGHT, // kDirUpRight + ACTOR_DIRECTION_RIGHT, // kDirRight + ACTOR_DIRECTION_RIGHT, // kDirDownRight + ACTOR_DIRECTION_FORWARD,// kDirDown + ACTOR_DIRECTION_LEFT, // kDirDownLeft + ACTOR_DIRECTION_LEFT, // kDirLeft + ACTOR_DIRECTION_LEFT, // kDirUpLeft +}; + enum ActorFlagsEx { kActorNoCollide = (1 << 0), kActorNoFollow = (1 << 1), @@ -612,8 +642,6 @@ public: void freeObjList(); void loadObjList(int objectCount, int objectsResourceID); - void showActors(bool flag) { _showActors = flag; } - protected: friend class Script; bool loadActorResources(ActorData *actor); @@ -709,7 +737,6 @@ private: int _xCellCount; int _yCellCount; Rect _pathRect; - bool _showActors; PathDirectionData *_pathDirectionList; int _pathDirectionListCount; diff --git a/engines/saga/actor_walk.cpp b/engines/saga/actor_walk.cpp new file mode 100644 index 0000000000..47bf804edb --- /dev/null +++ b/engines/saga/actor_walk.cpp @@ -0,0 +1,1942 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * $URL$ + * $Id$ + * + */ + +#include "saga/saga.h" + +#include "saga/actor.h" +#include "saga/console.h" +#include "saga/events.h" +#include "saga/isomap.h" +#include "saga/objectmap.h" +#include "saga/sagaresnames.h" +#include "saga/script.h" +#include "saga/sound.h" +#include "saga/scene.h" + +namespace Saga { + +static const PathDirectionData pathDirectionLUT[8][3] = { + { { 0, Point( 0, -1) }, { 7, Point(-1, -1) }, { 4, Point( 1, -1) } }, + { { 1, Point( 1, 0) }, { 4, Point( 1, -1) }, { 5, Point( 1, 1) } }, + { { 2, Point( 0, 1) }, { 5, Point( 1, 1) }, { 6, Point(-1, 1) } }, + { { 3, Point(-1, 0) }, { 6, Point(-1, 1) }, { 7, Point(-1, -1) } }, + { { 0, Point( 0, -1) }, { 1, Point( 1, 0) }, { 4, Point( 1, -1) } }, + { { 1, Point( 1, 0) }, { 2, Point( 0, 1) }, { 5, Point( 1, 1) } }, + { { 2, Point( 0, 1) }, { 3, Point(-1, 0) }, { 6, Point(-1, 1) } }, + { { 3, Point(-1, 0) }, { 0, Point( 0, -1) }, { 7, Point(-1, -1) } } +}; + +static const int pathDirectionLUT2[8][2] = { + { 0, -1 }, + { 1, 0 }, + { 0, 1 }, + { -1, 0 }, + { 1, -1 }, + { 1, 1 }, + { -1, 1 }, + { -1, -1 } +}; + +static const int angleLUT[16][2] = { + { 0, -256 }, + { 98, -237 }, + { 181, -181 }, + { 237, -98 }, + { 256, 0 }, + { 237, 98 }, + { 181, 181 }, + { 98, 237 }, + { 0, 256 }, + { -98, 237 }, + { -181, 181 }, + { -237, 98 }, + { -256, 0 }, + { -237, -98 }, + { -181, -181 }, + { -98, -237 } +}; + +static const int directionLUT[8][2] = { + { 0 * 2, -2 * 2 }, + { 2 * 2, -1 * 2 }, + { 3 * 2, 0 * 2 }, + { 2 * 2, 1 * 2 }, + { 0 * 2, 2 * 2 }, + { -2 * 2, 1 * 2 }, + { -4 * 2, 0 * 2 }, + { -2 * 2, -1 * 2 } +}; + +static const int tileDirectionLUT[8][2] = { + { 1, 1 }, + { 2, 0 }, + { 1, -1 }, + { 0, -2 }, + { -1, -1 }, + { -2, 0 }, + { -1, 1 }, + { 0, 2 } +}; + +struct DragonMove { + uint16 baseFrame; + int16 offset[4][2]; +}; + +static const DragonMove dragonMoveTable[12] = { + { 0, { { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 } } }, + { 0, { { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 } } }, + { 0, { { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 } } }, + { 0, { { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 } } }, + { 28, { { -0, 0 }, { -1, 6 }, { -5, 11 }, { -10, 15 } } }, + { 56, { { 0, 0 }, { 1, 6 }, { 5, 11 }, { 10, 15 } } }, + { 40, { { 0, 0 }, { 6, 1 }, { 11, 5 }, { 15, 10 } } }, + { 44, { { 0, 0 }, { 6, -1 }, { 11, -5 }, { 15, -10 } } }, + { 32, { { -0, -0 }, { -6, -1 }, { -11, -5 }, { -15, -10 } } }, + { 52, { { -0, 0 }, { -6, 1 }, { -11, 5 }, { -15, 10 } } }, + { 36, { { 0, -0 }, { 1, -6 }, { 5, -11 }, { 10, -15 } } }, + { 48, { { -0, -0 }, { -1, -6 }, { -5, -11 }, { -10, -15 } } } +}; + +inline int16 quickDistance(const Point &point1, const Point &point2, int16 compressX) { + Point delta; + delta.x = ABS(point1.x - point2.x) / compressX; + delta.y = ABS(point1.y - point2.y); + return ((delta.x < delta.y) ? (delta.y + delta.x / 2) : (delta.x + delta.y / 2)); +} + +inline void calcDeltaS(const Point &point1, const Point &point2, Point &delta, Point &s) { + + delta.x = point2.x - point1.x; + if (delta.x == 0) { + s.x = 0; + } else { + if (delta.x > 0) { + s.x = 1; + } else { + s.x = -1; + delta.x = -delta.x; + } + } + + + delta.y = point2.y - point1.y; + if (delta.y == 0) { + s.y = 0; + } else { + if (delta.y > 0) { + s.y = 1; + } else { + s.y = -1; + delta.y = -delta.y; + } + } +} + +inline int16 int16Compare(int16 i1, int16 i2) { + return ((i1) > (i2) ? 1 : ((i1) < (i2) ? -1 : 0)); +} + +bool Actor::validFollowerLocation(const Location &location) { + Point point; + location.toScreenPointXY(point); + + if ((point.x < 5) || (point.x >= _vm->getDisplayWidth() - 5) || + (point.y < 0) || (point.y > _vm->_scene->getHeight())) { + return false; + } + + return (_vm->_scene->canWalk(point)); +} + +void Actor::realLocation(Location &location, uint16 objectId, uint16 walkFlags) { + int angle; + int distance; + ActorData *actor; + ObjectData *obj; + debug (8, "Actor::realLocation objectId=%i", objectId); + if (walkFlags & kWalkUseAngle) { + if (_vm->_scene->getFlags() & kSceneFlagISO) { + angle = (location.x + 2) & 15; + distance = location.y; + + location.u() = (angleLUT[angle][0] * distance) >> 8; + location.v() = -(angleLUT[angle][1] * distance) >> 8; + } else { + angle = location.x & 15; + distance = location.y; + + location.x = (angleLUT[angle][0] * distance) >> 6; + location.y = (angleLUT[angle][1] * distance) >> 6; + } + } + + if (objectId != ID_NOTHING) { + if (validActorId(objectId)) { + actor = getActor(objectId); + location.addXY(actor->_location); + } else if (validObjId(objectId)) { + obj = getObj(objectId); + location.addXY(obj->_location); + } + } +} + +void Actor::actorFaceTowardsObject(uint16 actorId, uint16 objectId) { + ActorData *actor; + ObjectData *obj; + + if (validActorId(objectId)) { + actor = getActor(objectId); + actorFaceTowardsPoint(actorId, actor->_location); + } else if (validObjId(objectId)) { + obj = getObj(objectId); + actorFaceTowardsPoint(actorId, obj->_location); + } +} + +void Actor::actorFaceTowardsPoint(uint16 actorId, const Location &toLocation) { + ActorData *actor; + Location delta; + //debug (8, "Actor::actorFaceTowardsPoint actorId=%i", actorId); + actor = getActor(actorId); + + toLocation.delta(actor->_location, delta); + + if (_vm->_scene->getFlags() & kSceneFlagISO) { + if (delta.u() > 0) { + actor->_facingDirection = (delta.v() > 0) ? kDirUp : kDirRight; + } else { + actor->_facingDirection = (delta.v() > 0) ? kDirLeft : kDirDown; + } + } else { + if (ABS(delta.y) > ABS(delta.x * 2)) { + actor->_facingDirection = (delta.y > 0) ? kDirDown : kDirUp; + } else { + actor->_facingDirection = (delta.x > 0) ? kDirRight : kDirLeft; + } + } +} + +void Actor::updateActorsScene(int actorsEntrance) { + int i, j; + int followerDirection; + ActorData *actor; + Location tempLocation; + Location possibleLocation; + Point delta; + const SceneEntry *sceneEntry; + + if (_vm->_scene->currentSceneNumber() == 0) { + error("Actor::updateActorsScene _vm->_scene->currentSceneNumber() == 0"); + } + + _vm->_sound->stopVoice(); + _activeSpeech.stringsCount = 0; + _activeSpeech.playing = false; + _protagonist = NULL; + + for (i = 0; i < _actorsCount; i++) { + actor = _actors[i]; + actor->_inScene = false; + actor->_spriteList.freeMem(); + if (actor->_disabled) { + continue; + } + if ((actor->_flags & (kProtagonist | kFollower)) || (i == 0)) { + if (actor->_flags & kProtagonist) { + actor->_finalTarget = actor->_location; + _centerActor = _protagonist = actor; + } else if (_vm->getGameType() == GType_ITE && + _vm->_scene->currentSceneResourceId() == RID_ITE_OVERMAP_SCENE) { + continue; + } + + actor->_sceneNumber = _vm->_scene->currentSceneNumber(); + } + if (actor->_sceneNumber == _vm->_scene->currentSceneNumber()) { + actor->_inScene = true; + actor->_actionCycle = (_vm->_rnd.getRandomNumber(7) & 0x7) * 4; // 1/8th chance + } + } + + // _protagonist can be null while loading a game from the command line + if (_protagonist == NULL) + return; + + if ((actorsEntrance >= 0) && (_vm->_scene->_entryList.entryListCount > 0)) { + if (_vm->_scene->_entryList.entryListCount <= actorsEntrance) { + actorsEntrance = 0; //OCEAN bug + } + + sceneEntry = _vm->_scene->_entryList.getEntry(actorsEntrance); + if (_vm->_scene->getFlags() & kSceneFlagISO) { + _protagonist->_location = sceneEntry->location; + } else { + _protagonist->_location.x = sceneEntry->location.x * ACTOR_LMULT; + _protagonist->_location.y = sceneEntry->location.y * ACTOR_LMULT; + _protagonist->_location.z = sceneEntry->location.z * ACTOR_LMULT; + } + // Workaround for bug #1328045: + // "When entering any of the houses at the start of the + // game if you click on anything inside the building you + // start walking through the door, turn around and leave." + // + // After stepping on an action zone, Rif is trying to exit. + // Shift Rif's entry position to a non action zone area. + if (_vm->getGameType() == GType_ITE) { + if ((_vm->_scene->currentSceneNumber() >= 53) && (_vm->_scene->currentSceneNumber() <= 66)) + _protagonist->_location.y += 10; + } + + _protagonist->_facingDirection = _protagonist->_actionDirection = sceneEntry->facing; + } + + _protagonist->_currentAction = kActionWait; + + if (_vm->_scene->getFlags() & kSceneFlagISO) { + //nothing? + } else { + _vm->_scene->initDoorsState(); //TODO: move to _scene + } + + followerDirection = _protagonist->_facingDirection + 3; + calcScreenPosition(_protagonist); + + for (i = 0; i < _actorsCount; i++) { + actor = _actors[i]; + if (actor->_flags & (kFollower)) { + actor->_facingDirection = actor->_actionDirection = _protagonist->_facingDirection; + actor->_currentAction = kActionWait; + actor->_walkStepsCount = actor->_walkStepIndex = 0; + actor->_location.z = _protagonist->_location.z; + + + if (_vm->_scene->getFlags() & kSceneFlagISO) { + _vm->_isoMap->placeOnTileMap(_protagonist->_location, actor->_location, 3, followerDirection & 0x07); + } else { + followerDirection &= 0x07; + + possibleLocation = _protagonist->_location; + + delta.x = directionLUT[followerDirection][0]; + delta.y = directionLUT[followerDirection][1]; + + for (j = 0; j < 30; j++) { + tempLocation = possibleLocation; + tempLocation.x += delta.x; + tempLocation.y += delta.y; + + if (validFollowerLocation(tempLocation)) { + possibleLocation = tempLocation; + } else { + tempLocation = possibleLocation; + tempLocation.x += delta.x; + if (validFollowerLocation(tempLocation)) { + possibleLocation = tempLocation; + } else { + tempLocation = possibleLocation; + tempLocation.y += delta.y; + if (validFollowerLocation(tempLocation)) { + possibleLocation = tempLocation; + } else { + break; + } + } + } + } + + actor->_location = possibleLocation; + } + followerDirection += 2; + } + + } + + handleActions(0, true); + if (_vm->_scene->getFlags() & kSceneFlagISO) { + _vm->_isoMap->adjustScroll(true); + } +} + +void Actor::handleActions(int msec, bool setup) { + int i; + ActorData *actor; + ActorFrameRange *frameRange; + int state; + int speed; + int32 framesLeft; + Location delta; + Location addDelta; + int hitZoneIndex; + const HitZone *hitZone; + Point hitPoint; + Location pickLocation; + + for (i = 0; i < _actorsCount; i++) { + actor = _actors[i]; + if (!actor->_inScene) + continue; + + if ((_vm->getGameType() == GType_ITE) && (i == ACTOR_DRAGON_INDEX)) { + moveDragon(actor); + continue; + } + + switch (actor->_currentAction) { + case kActionWait: + if (!setup && (actor->_flags & kFollower)) { + followProtagonist(actor); + if (actor->_currentAction != kActionWait) + break; + } + + if (actor->_targetObject != ID_NOTHING) { + actorFaceTowardsObject(actor->_id, actor->_targetObject); + } + + if (actor->_flags & kCycle) { + frameRange = getActorFrameRange(actor->_id, getFrameType(kFrameStand)); + if (frameRange->frameCount > 0) { + actor->_actionCycle++; + actor->_actionCycle = (actor->_actionCycle) % frameRange->frameCount; + } else { + actor->_actionCycle = 0; + } + actor->_frameNumber = frameRange->frameIndex + actor->_actionCycle; + break; + } + + if ((actor->_actionCycle & 3) == 0) { + actor->cycleWrap(100); + + frameRange = getActorFrameRange(actor->_id, getFrameType(kFrameWait)); + if ((frameRange->frameCount < 1 || actor->_actionCycle > 33)) + frameRange = getActorFrameRange(actor->_id, getFrameType(kFrameStand)); + + if (frameRange->frameCount) { + actor->_frameNumber = frameRange->frameIndex + (uint16)_vm->_rnd.getRandomNumber(frameRange->frameCount - 1); + } else { + actor->_frameNumber = frameRange->frameIndex; + } + } + actor->_actionCycle++; + break; + + case kActionWalkToPoint: + case kActionWalkToLink: + if (_vm->_scene->getFlags() & kSceneFlagISO) { + actor->_partialTarget.delta(actor->_location, delta); + + while ((delta.u() == 0) && (delta.v() == 0)) { + + if ((actor == _protagonist) && (_vm->mouseButtonPressed())) { + _vm->_isoMap->screenPointToTileCoords(_vm->mousePos(), pickLocation); + + if (!actorWalkTo(_protagonist->_id, pickLocation)) { + break; + } + } else if (!_vm->_isoMap->nextTileTarget(actor) && !actorEndWalk(actor->_id, true)) { + break; + } + + actor->_partialTarget.delta(actor->_location, delta); + actor->_partialTarget.z = 0; + } + + if (actor->_flags & kFastest) { + speed = 8; + } else if (actor->_flags & kFaster) { + speed = 6; + } else { + speed = 4; + } + + if (_vm->_scene->currentSceneResourceId() == RID_ITE_OVERMAP_SCENE) { + speed = 2; + } + + if ((actor->_actionDirection == 2) || (actor->_actionDirection == 6)) { + speed = speed / 2; + } + + if (ABS(delta.v()) > ABS(delta.u())) { + addDelta.v() = clamp(-speed, delta.v(), speed); + if (addDelta.v() == delta.v()) { + addDelta.u() = delta.u(); + } else { + addDelta.u() = delta.u() * addDelta.v(); + addDelta.u() += (addDelta.u() > 0) ? (delta.v() / 2) : (-delta.v() / 2); + addDelta.u() /= delta.v(); + } + } else { + addDelta.u() = clamp(-speed, delta.u(), speed); + if (addDelta.u() == delta.u()) { + addDelta.v() = delta.v(); + } else { + addDelta.v() = delta.v() * addDelta.u(); + addDelta.v() += (addDelta.v() > 0) ? (delta.u() / 2) : (-delta.u() / 2); + addDelta.v() /= delta.u(); + } + } + + actor->_location.add(addDelta); + } else { + actor->_partialTarget.delta(actor->_location, delta); + + while ((delta.x == 0) && (delta.y == 0)) { + + if (actor->_walkStepIndex >= actor->_walkStepsCount) { + actorEndWalk(actor->_id, true); + break; + } + + actor->_partialTarget.fromScreenPoint(actor->_walkStepsPoints[actor->_walkStepIndex++]); + if (_vm->getGameType() == GType_ITE) { + if (actor->_partialTarget.x > 224 * 2 * ACTOR_LMULT) { + actor->_partialTarget.x -= 256 * 2 * ACTOR_LMULT; + } + } else { + if (actor->_partialTarget.x > 224 * 4 * ACTOR_LMULT) { + actor->_partialTarget.x -= 256 * 4 * ACTOR_LMULT; + } + } + + actor->_partialTarget.delta(actor->_location, delta); + + if (ABS(delta.y) > ABS(delta.x)) { + actor->_actionDirection = delta.y > 0 ? kDirDown : kDirUp; + } else { + actor->_actionDirection = delta.x > 0 ? kDirRight : kDirLeft; + } + } + + if(_vm->getGameType() == GType_ITE) + speed = (ACTOR_LMULT * 2 * actor->_screenScale + 63) / 256; + else + speed = (ACTOR_SPEED * actor->_screenScale + 128) >> 8; + + if (speed < 1) + speed = 1; + + if(_vm->getGameType() == GType_IHNM) + speed = speed / 2; + + if ((actor->_actionDirection == kDirUp) || (actor->_actionDirection == kDirDown)) { + addDelta.y = clamp(-speed, delta.y, speed); + if (addDelta.y == delta.y) { + addDelta.x = delta.x; + } else { + addDelta.x = delta.x * addDelta.y; + addDelta.x += (addDelta.x > 0) ? (delta.y / 2) : (-delta.y / 2); + addDelta.x /= delta.y; + actor->_facingDirection = actor->_actionDirection; + } + } else { + addDelta.x = clamp(-2 * speed, delta.x, 2 * speed); + if (addDelta.x == delta.x) { + addDelta.y = delta.y; + } else { + addDelta.y = delta.y * addDelta.x; + addDelta.y += (addDelta.y > 0) ? (delta.x / 2) : (-delta.x / 2); + addDelta.y /= delta.x; + actor->_facingDirection = actor->_actionDirection; + } + } + + actor->_location.add(addDelta); + } + + if (actor->_actorFlags & kActorBackwards) { + actor->_facingDirection = (actor->_actionDirection + 4) & 7; + actor->_actionCycle--; + } else { + actor->_actionCycle++; + } + + frameRange = getActorFrameRange(actor->_id, actor->_walkFrameSequence); + + if (actor->_actionCycle < 0) { + actor->_actionCycle = frameRange->frameCount - 1; + } else if (actor->_actionCycle >= frameRange->frameCount) { + actor->_actionCycle = 0; + } + + actor->_frameNumber = frameRange->frameIndex + actor->_actionCycle; + break; + + case kActionWalkDir: + if (_vm->_scene->getFlags() & kSceneFlagISO) { + actor->_location.u() += tileDirectionLUT[actor->_actionDirection][0]; + actor->_location.v() += tileDirectionLUT[actor->_actionDirection][1]; + + frameRange = getActorFrameRange(actor->_id, actor->_walkFrameSequence); + + actor->_actionCycle++; + actor->cycleWrap(frameRange->frameCount); + actor->_frameNumber = frameRange->frameIndex + actor->_actionCycle; + } else { + if (_vm->getGameType() == GType_ITE) { + actor->_location.x += directionLUT[actor->_actionDirection][0] * 2; + actor->_location.y += directionLUT[actor->_actionDirection][1] * 2; + } else { + // FIXME: The original does not multiply by 8 here, but we do + actor->_location.x += (directionLUT[actor->_actionDirection][0] * 8 * actor->_screenScale + 128) >> 8; + actor->_location.y += (directionLUT[actor->_actionDirection][1] * 8 * actor->_screenScale + 128) >> 8; + } + + frameRange = getActorFrameRange(actor->_id, actor->_walkFrameSequence); + actor->_actionCycle++; + actor->cycleWrap(frameRange->frameCount); + actor->_frameNumber = frameRange->frameIndex + actor->_actionCycle; + } + break; + + case kActionSpeak: + actor->_actionCycle++; + actor->cycleWrap(64); + + frameRange = getActorFrameRange(actor->_id, getFrameType(kFrameGesture)); + if (actor->_actionCycle >= frameRange->frameCount) { + if (actor->_actionCycle & 1) + break; + frameRange = getActorFrameRange(actor->_id, getFrameType(kFrameSpeak)); + + state = (uint16)_vm->_rnd.getRandomNumber(frameRange->frameCount); + + if (state == 0) { + frameRange = getActorFrameRange(actor->_id, getFrameType(kFrameStand)); + } else { + state--; + } + } else { + state = actor->_actionCycle; + } + + actor->_frameNumber = frameRange->frameIndex + state; + break; + + case kActionAccept: + case kActionStoop: + break; + + case kActionCycleFrames: + case kActionPongFrames: + if (actor->_cycleTimeCount > 0) { + actor->_cycleTimeCount--; + break; + } + + actor->_cycleTimeCount = actor->_cycleDelay; + actor->_actionCycle++; + + frameRange = getActorFrameRange(actor->_id, actor->_cycleFrameSequence); + + if (actor->_currentAction == kActionPongFrames) { + if (actor->_actionCycle >= frameRange->frameCount * 2 - 2) { + if (actor->_actorFlags & kActorContinuous) { + actor->_actionCycle = 0; + } else { + actor->_currentAction = kActionFreeze; + break; + } + } + + state = actor->_actionCycle; + if (state >= frameRange->frameCount) { + state = frameRange->frameCount * 2 - 2 - state; + } + } else { + if (actor->_actionCycle >= frameRange->frameCount) { + if (actor->_actorFlags & kActorContinuous) { + actor->_actionCycle = 0; + } else { + actor->_currentAction = kActionFreeze; + break; + } + } + state = actor->_actionCycle; + } + + if (frameRange->frameCount && (actor->_actorFlags & kActorRandom)) { + state = _vm->_rnd.getRandomNumber(frameRange->frameCount - 1); + } + + if (actor->_actorFlags & kActorBackwards) { + actor->_frameNumber = frameRange->frameIndex + frameRange->frameCount - 1 - state; + } else { + actor->_frameNumber = frameRange->frameIndex + state; + } + break; + + case kActionFall: + if (actor->_actionCycle > 0) { + framesLeft = actor->_actionCycle--; + actor->_finalTarget.delta(actor->_location, delta); + delta.x /= framesLeft; + delta.y /= framesLeft; + actor->_location.addXY(delta); + actor->_fallVelocity += actor->_fallAcceleration; + actor->_fallPosition += actor->_fallVelocity; + actor->_location.z = actor->_fallPosition >> 4; + } else { + actor->_location = actor->_finalTarget; + actor->_currentAction = kActionFreeze; + _vm->_script->wakeUpActorThread(kWaitTypeWalk, actor); + } + break; + + case kActionClimb: + actor->_cycleDelay++; + if (actor->_cycleDelay & 3) { + break; + } + + if (actor->_location.z >= actor->_finalTarget.z + ACTOR_CLIMB_SPEED) { + actor->_location.z -= ACTOR_CLIMB_SPEED; + actor->_actionCycle--; + } else if (actor->_location.z <= actor->_finalTarget.z - ACTOR_CLIMB_SPEED) { + actor->_location.z += ACTOR_CLIMB_SPEED; + actor->_actionCycle++; + } else { + actor->_location.z = actor->_finalTarget.z; + actor->_currentAction = kActionFreeze; + _vm->_script->wakeUpActorThread(kWaitTypeWalk, actor); + } + + frameRange = getActorFrameRange(actor->_id, actor->_cycleFrameSequence); + + if (actor->_actionCycle < 0) { + actor->_actionCycle = frameRange->frameCount - 1; + } + actor->cycleWrap(frameRange->frameCount); + actor->_frameNumber = frameRange->frameIndex + actor->_actionCycle; + break; + } + + if ((actor->_currentAction >= kActionWalkToPoint) && (actor->_currentAction <= kActionWalkDir)) { + hitZone = NULL; + + if (_vm->_scene->getFlags() & kSceneFlagISO) { + actor->_location.toScreenPointUV(hitPoint); + } else { + actor->_location.toScreenPointXY(hitPoint); + } + hitZoneIndex = _vm->_scene->_actionMap->hitTest(hitPoint); + if (hitZoneIndex != -1) { + hitZone = _vm->_scene->_actionMap->getHitZone(hitZoneIndex); + } + + if (hitZone != actor->_lastZone) { + if (actor->_lastZone) + stepZoneAction(actor, actor->_lastZone, true, false); + actor->_lastZone = hitZone; + // WORKAROUND for graphics glitch in the rat caves. Don't do this step zone action in the rat caves + // (room 51) for hitzone 24577 (the door with the copy protection) to avoid the glitch. This glitch + // happens because the copy protection is supposed to kick in at this point, but it's bypassed + // (with permission from Wyrmkeep Entertainment) + if (hitZone && + !(_vm->getGameType() == GType_ITE && _vm->_scene->currentSceneNumber() == 51 && hitZone->getHitZoneId() == 24577)) + stepZoneAction(actor, hitZone, false, false); + } + } + } + // Update frameCount for sfWaitFrames in IHNM + _vm->_frameCount++; +} + +void Actor::direct(int msec) { + + if (_vm->_scene->_entryList.entryListCount == 0) { + return; + } + + if (_vm->_interface->_statusTextInput) { + return; + } + + // FIXME: HACK. This should be turned into cycle event. + _lastTickMsec += msec; + + if (_lastTickMsec > 1000 / _handleActionDiv) { + _lastTickMsec = 0; + //process actions + handleActions(msec, false); + } + +//process speech + handleSpeech(msec); +} + +bool Actor::followProtagonist(ActorData *actor) { + Location protagonistLocation; + Location newLocation; + Location delta; + int protagonistBGMaskType; + Point prefer1; + Point prefer2; + Point prefer3; + int16 prefU; + int16 prefV; + int16 newU; + int16 newV; + + assert(_protagonist); + + actor->_flags &= ~(kFaster | kFastest); + protagonistLocation = _protagonist->_location; + calcScreenPosition(_protagonist); + + if (_vm->_scene->getFlags() & kSceneFlagISO) { + prefU = 60; + prefV = 60; + + + actor->_location.delta(protagonistLocation, delta); + + if (actor->_id == actorIndexToId(2)) { + prefU = prefV = 48; + } + + if ((delta.u() > prefU) || (delta.u() < -prefU) || (delta.v() > prefV) || (delta.v() < -prefV)) { + + if ((delta.u() > prefU * 2) || (delta.u() < -prefU * 2) || (delta.v() > prefV * 2) || (delta.v() < -prefV * 2)) { + actor->_flags |= kFaster; + + if ((delta.u() > prefU * 3) || (delta.u() < -prefU*3) || (delta.v() > prefV * 3) || (delta.v() < -prefV * 3)) { + actor->_flags |= kFastest; + } + } + + prefU /= 2; + prefV /= 2; + + newU = clamp(-prefU, delta.u(), prefU) + protagonistLocation.u(); + newV = clamp(-prefV, delta.v(), prefV) + protagonistLocation.v(); + + newLocation.u() = newU + _vm->_rnd.getRandomNumber(prefU - 1) - prefU / 2; + newLocation.v() = newV + _vm->_rnd.getRandomNumber(prefV - 1) - prefV / 2; + newLocation.z = 0; + + return actorWalkTo(actor->_id, newLocation); + } + + } else { + prefer1.x = (100 * _protagonist->_screenScale) >> 8; + prefer1.y = (50 * _protagonist->_screenScale) >> 8; + + if (_protagonist->_currentAction == kActionWalkDir) { + prefer1.x /= 2; + } + + if (prefer1.x < 8) { + prefer1.x = 8; + } + + if (prefer1.y < 8) { + prefer1.y = 8; + } + + prefer2.x = prefer1.x * 2; + prefer2.y = prefer1.y * 2; + prefer3.x = prefer1.x + prefer1.x / 2; + prefer3.y = prefer1.y + prefer1.y / 2; + + actor->_location.delta(protagonistLocation, delta); + + protagonistBGMaskType = 0; + if (_vm->_scene->isBGMaskPresent() && _vm->_scene->validBGMaskPoint(_protagonist->_screenPosition)) { + protagonistBGMaskType = _vm->_scene->getBGMaskType(_protagonist->_screenPosition); + } + + if ((_vm->_rnd.getRandomNumber(7) & 0x7) == 0) // 1/8th chance + actor->_actorFlags &= ~kActorNoFollow; + + if (actor->_actorFlags & kActorNoFollow) { + return false; + } + + if ((delta.x > prefer2.x) || (delta.x < -prefer2.x) || + (delta.y > prefer2.y) || (delta.y < -prefer2.y) || + ((_protagonist->_currentAction == kActionWait) && + (delta.x * 2 < prefer1.x) && (delta.x * 2 > -prefer1.x) && + (delta.y < prefer1.y) && (delta.y > -prefer1.y))) { + + if (ABS(delta.x) > ABS(delta.y)) { + + delta.x = (delta.x > 0) ? prefer3.x : -prefer3.x; + + newLocation.x = delta.x + protagonistLocation.x; + newLocation.y = clamp(-prefer2.y, delta.y, prefer2.y) + protagonistLocation.y; + } else { + delta.y = (delta.y > 0) ? prefer3.y : -prefer3.y; + + newLocation.x = clamp(-prefer2.x, delta.x, prefer2.x) + protagonistLocation.x; + newLocation.y = delta.y + protagonistLocation.y; + } + newLocation.z = 0; + + if (protagonistBGMaskType != 3) { + newLocation.x += _vm->_rnd.getRandomNumber(prefer1.x - 1) - prefer1.x / 2; + newLocation.y += _vm->_rnd.getRandomNumber(prefer1.y - 1) - prefer1.y / 2; + } + + newLocation.x = clamp(-31 * 4, newLocation.x, (_vm->getDisplayWidth() + 31) * 4); + + return actorWalkTo(actor->_id, newLocation); + } + } + return false; +} + +bool Actor::actorWalkTo(uint16 actorId, const Location &toLocation) { + ActorData *actor; + ActorData *anotherActor; + int i; + + Rect testBox; + Rect testBox2; + Point anotherActorScreenPosition; + Point collision; + Point pointFrom, pointTo, pointBest, pointAdd; + Point delta, bestDelta; + Point tempPoint; + bool extraStartNode; + bool extraEndNode; + + actor = getActor(actorId); + + if (actor == _protagonist) { + _vm->_scene->setDoorState(2, 0xff); + _vm->_scene->setDoorState(3, 0); + } else { + _vm->_scene->setDoorState(2, 0); + _vm->_scene->setDoorState(3, 0xff); + } + + if (_vm->_scene->getFlags() & kSceneFlagISO) { + + if ((_vm->getGameType() == GType_ITE) && (actor->_index == ACTOR_DRAGON_INDEX)) { + return false; + } + + actor->_finalTarget = toLocation; + actor->_walkStepsCount = 0; + _vm->_isoMap->findTilePath(actor, actor->_location, toLocation); + + + if ((actor->_walkStepsCount == 0) && (actor->_flags & kProtagonist)) { + actor->_actorFlags |= kActorNoCollide; + _vm->_isoMap->findTilePath(actor, actor->_location, toLocation); + } + + actor->_walkStepIndex = 0; + if (_vm->_isoMap->nextTileTarget(actor)) { + actor->_currentAction = kActionWalkToPoint; + actor->_walkFrameSequence = getFrameType(kFrameWalk); + } else { + actorEndWalk(actorId, false); + return false; + } + } else { + + actor->_location.toScreenPointXY(pointFrom); + pointFrom.x &= ~1; + + extraStartNode = _vm->_scene->offscreenPath(pointFrom); + + toLocation.toScreenPointXY(pointTo); + pointTo.x &= ~1; + + extraEndNode = _vm->_scene->offscreenPath(pointTo); + + if (_vm->_scene->isBGMaskPresent()) { + + if ((((actor->_currentAction >= kActionWalkToPoint) && + (actor->_currentAction <= kActionWalkDir)) || (actor == _protagonist)) && + !_vm->_scene->canWalk(pointFrom)) { + + int max = _vm->getGameType() == GType_ITE ? 8 : 4; + + for (i = 1; i < max; i++) { + pointAdd = pointFrom; + pointAdd.y += i; + if (_vm->_scene->canWalk(pointAdd)) { + pointFrom = pointAdd; + break; + } + pointAdd = pointFrom; + pointAdd.y -= i; + if (_vm->_scene->canWalk(pointAdd)) { + pointFrom = pointAdd; + break; + } + if (_vm->getGameType() == GType_ITE) { + pointAdd = pointFrom; + pointAdd.x += i; + if (_vm->_scene->canWalk(pointAdd)) { + pointFrom = pointAdd; + break; + } + pointAdd = pointFrom; + pointAdd.x -= i; + if (_vm->_scene->canWalk(pointAdd)) { + pointFrom = pointAdd; + break; + } + } + } + } + + _barrierCount = 0; + if (!(actor->_actorFlags & kActorNoCollide)) { + collision.x = ACTOR_COLLISION_WIDTH * actor->_screenScale / (256 * 2); + collision.y = ACTOR_COLLISION_HEIGHT * actor->_screenScale / (256 * 2); + + + for (i = 0; (i < _actorsCount) && (_barrierCount < ACTOR_BARRIERS_MAX); i++) { + anotherActor = _actors[i]; + if (!anotherActor->_inScene) + continue; + if (anotherActor == actor) + continue; + + anotherActorScreenPosition = anotherActor->_screenPosition; + testBox.left = (anotherActorScreenPosition.x - collision.x) & ~1; + testBox.right = (anotherActorScreenPosition.x + collision.x) & ~1 + 1; + testBox.top = anotherActorScreenPosition.y - collision.y; + testBox.bottom = anotherActorScreenPosition.y + collision.y + 1; + testBox2 = testBox; + testBox2.right += 2; + testBox2.left -= 2; + testBox2.top -= 1; + testBox2.bottom += 1; + + if (testBox2.contains(pointFrom)) { + if (pointFrom.x > anotherActorScreenPosition.x + 4) { + testBox.right = pointFrom.x - 1; + } else if (pointFrom.x < anotherActorScreenPosition.x - 4) { + testBox.left = pointFrom.x + 2; + } else if (pointFrom.y > anotherActorScreenPosition.y) { + testBox.bottom = pointFrom.y; + } else { + testBox.top = pointFrom.y + 1 ; + } + } + + if ((testBox.width() > 0) && (testBox.height() > 0)) { + _barrierList[_barrierCount++] = testBox; + } + } + } + + + pointBest = pointTo; + actor->_walkStepsCount = 0; + findActorPath(actor, pointFrom, pointTo); + + if (actor->_walkStepsCount == 0) { + error("actor->_walkStepsCount == 0"); + } + + if (extraStartNode) { + actor->_walkStepIndex = 0; + } else { + actor->_walkStepIndex = 1; + } + + if (extraEndNode) { + toLocation.toScreenPointXY(tempPoint); + actor->_walkStepsCount--; + actor->addWalkStepPoint(tempPoint); + } + + + pointBest = actor->_walkStepsPoints[actor->_walkStepsCount - 1]; + + pointBest.x &= ~1; + delta.x = ABS(pointFrom.x - pointTo.x); + delta.y = ABS(pointFrom.y - pointTo.y); + + bestDelta.x = ABS(pointBest.x - pointTo.x); + bestDelta.y = ABS(pointBest.y - pointTo.y); + + if ((delta.x + delta.y <= bestDelta.x + bestDelta.y) && (actor->_flags & kFollower)) { + actor->_actorFlags |= kActorNoFollow; + } + + if (pointBest == pointFrom) { + actor->_walkStepsCount = 0; + } + } else { + actor->_walkStepsCount = 0; + actor->addWalkStepPoint(pointTo); + actor->_walkStepIndex = 0; + } + + actor->_partialTarget = actor->_location; + actor->_finalTarget = toLocation; + if (actor->_walkStepsCount == 0) { + actorEndWalk(actorId, false); + return false; + } else { + if (actor->_flags & kProtagonist) { + _actors[1]->_actorFlags &= ~kActorNoFollow; // TODO: mark all actors with kFollower flag, not only 1 and 2 + _actors[2]->_actorFlags &= ~kActorNoFollow; + } + actor->_currentAction = (actor->_walkStepsCount >= ACTOR_MAX_STEPS_COUNT) ? kActionWalkToLink : kActionWalkToPoint; + actor->_walkFrameSequence = getFrameType(kFrameWalk); + } + } + return true; +} + +bool Actor::actorEndWalk(uint16 actorId, bool recurse) { + bool walkMore = false; + ActorData *actor; + const HitZone *hitZone; + int hitZoneIndex; + Point testPoint; + + actor = getActor(actorId); + actor->_actorFlags &= ~kActorBackwards; + + if (_vm->getGameType() == GType_ITE) { + + if (actor->_location.distance(actor->_finalTarget) > 8 && (actor->_flags & kProtagonist) && recurse && !(actor->_actorFlags & kActorNoCollide)) { + actor->_actorFlags |= kActorNoCollide; + return actorWalkTo(actorId, actor->_finalTarget); + } + } + + actor->_currentAction = kActionWait; + if (actor->_actorFlags & kActorFinalFace) { + actor->_facingDirection = actor->_actionDirection = (actor->_actorFlags >> 6) & 0x07; //? + } + + actor->_actorFlags &= ~(kActorNoCollide | kActorCollided | kActorFinalFace | kActorFacingMask); + actor->_flags &= ~(kFaster | kFastest); + + if (actor == _protagonist) { + _vm->_script->wakeUpActorThread(kWaitTypeWalk, actor); + if (_vm->_script->_pendingVerb == _vm->_script->getVerbType(kVerbWalkTo)) { + if (_vm->getGameType() == GType_ITE) + actor->_location.toScreenPointUV(testPoint); // it's wrong calculation, but it is used in ITE + else + actor->_location.toScreenPointXY(testPoint); + + hitZoneIndex = _vm->_scene->_actionMap->hitTest(testPoint); + if (hitZoneIndex != -1) { + hitZone = _vm->_scene->_actionMap->getHitZone(hitZoneIndex); + stepZoneAction(actor, hitZone, false, true); + } else { + _vm->_script->setNoPendingVerb(); + } + } else if (_vm->_script->_pendingVerb != _vm->_script->getVerbType(kVerbNone)) { + _vm->_script->doVerb(); + } + } else { + if (recurse && (actor->_flags & kFollower)) + walkMore = followProtagonist(actor); + + _vm->_script->wakeUpActorThread(kWaitTypeWalk, actor); + } + return walkMore; +} + +void Actor::moveDragon(ActorData *actor) { + int16 dir0, dir1, dir2, dir3; + int16 moveType; + Event event; + const DragonMove *dragonMove; + + if ((actor->_actionCycle < 0) || + ((actor->_actionCycle == 0) && (actor->_dragonMoveType >= ACTOR_DRAGON_TURN_MOVES))) { + + moveType = kDragonMoveInvalid; + if (actor->_location.distance(_protagonist->_location) < 24) { + if (_dragonHunt && (_protagonist->_currentAction != kActionFall)) { + event.type = kEvTOneshot; + event.code = kScriptEvent; + event.op = kEventExecNonBlocking; + event.time = 0; + event.param = _vm->_scene->getScriptModuleNumber(); // module number + event.param2 = ACTOR_EXP_KNOCK_RIF; // script entry point number + event.param3 = -1; // Action + event.param4 = -1; // Object + event.param5 = -1; // With Object + event.param6 = -1; // Actor + _vm->_events->queue(&event); + + _dragonHunt = false; + } + } else { + _dragonHunt = true; + } + + if (actor->_walkStepIndex + 2 > actor->_walkStepsCount) { + + _vm->_isoMap->findDragonTilePath(actor, actor->_location, _protagonist->_location, actor->_actionDirection); + + if (actor->_walkStepsCount == 0) { + _vm->_isoMap->findDragonTilePath(actor, actor->_location, _protagonist->_location, 0); + } + + if (actor->_walkStepsCount < 2) { + return; + } + + actor->_partialTarget = actor->_location; + actor->_finalTarget = _protagonist->_location; + actor->_walkStepIndex = 0; + } + + dir0 = actor->_actionDirection; + dir1 = actor->_tileDirections[actor->_walkStepIndex++]; + dir2 = actor->_tileDirections[actor->_walkStepIndex]; + dir3 = actor->_tileDirections[actor->_walkStepIndex + 1]; + + if (dir0 != dir1){ + actor->_actionDirection = dir0 = dir1; + } + + actor->_location = actor->_partialTarget; + + if ((dir1 != dir2) && (dir1 == dir3)) { + switch (dir1) { + case kDirUpLeft: + actor->_partialTarget.v() += 16; + moveType = kDragonMoveUpLeft; + break; + case kDirDownLeft: + actor->_partialTarget.u() -= 16; + moveType = kDragonMoveDownLeft; + break; + case kDirDownRight: + actor->_partialTarget.v() -= 16; + moveType = kDragonMoveDownRight; + break; + case kDirUpRight: + actor->_partialTarget.u() += 16; + moveType = kDragonMoveUpRight; + break; + } + + switch (dir2) { + case kDirUpLeft: + actor->_partialTarget.v() += 16; + break; + case kDirDownLeft: + actor->_partialTarget.u() -= 16; + break; + case kDirDownRight: + actor->_partialTarget.v() -= 16; + break; + case kDirUpRight: + actor->_partialTarget.u() += 16; + break; + } + + actor->_walkStepIndex++; + } else { + switch (dir1) { + case kDirUpLeft: + actor->_partialTarget.v() += 16; + switch (dir2) { + case kDirDownLeft: + moveType = kDragonMoveUpLeft_Left; + actor->_partialTarget.u() -= 16; + break; + case kDirUpLeft: + moveType = kDragonMoveUpLeft; + break; + case kDirUpRight: + actor->_partialTarget.u() += 16; + moveType = kDragonMoveUpLeft_Right; + break; + default: + actor->_actionDirection = dir1; + actor->_walkStepsCount = 0; + break; + } + break; + case kDirDownLeft: + actor->_partialTarget.u() -= 16; + switch (dir2) { + case kDirDownRight: + moveType = kDragonMoveDownLeft_Left; + actor->_partialTarget.v() -= 16; + break; + case kDirDownLeft: + moveType = kDragonMoveDownLeft; + break; + case kDirUpLeft: + moveType = kDragonMoveDownLeft_Right; + actor->_partialTarget.v() += 16; + break; + default: + actor->_actionDirection = dir1; + actor->_walkStepsCount = 0; + break; + } + break; + case kDirDownRight: + actor->_partialTarget.v() -= 16; + switch (dir2) { + case kDirUpRight: + moveType = kDragonMoveDownRight_Left; + actor->_partialTarget.u() += 16; + break; + case kDirDownRight: + moveType = kDragonMoveDownRight; + break; + case kDirDownLeft: + moveType = kDragonMoveDownRight_Right; + actor->_partialTarget.u() -= 16; + break; + default: + actor->_actionDirection = dir1; + actor->_walkStepsCount = 0; + break; + } + break; + case kDirUpRight: + actor->_partialTarget.u() += 16; + switch (dir2) { + case kDirUpLeft: + moveType = kDragonMoveUpRight_Left; + actor->_partialTarget.v() += 16; + break; + case kDirUpRight: + moveType = kDragonMoveUpRight; + break; + case kDirDownRight: + moveType = kDragonMoveUpRight_Right; + actor->_partialTarget.v() -= 16; + break; + default: + actor->_actionDirection = dir1; + actor->_walkStepsCount = 0; + break; + } + break; + + default: + actor->_actionDirection = dir1; + actor->_walkStepsCount = 0; + break; + } + } + + actor->_dragonMoveType = moveType; + + if (moveType >= ACTOR_DRAGON_TURN_MOVES) { + actor->_dragonStepCycle = 0; + actor->_actionCycle = 4; + actor->_walkStepIndex++; + } else { + actor->_actionCycle = 4; + } + } + + actor->_actionCycle--; + + if ((actor->_walkStepsCount < 1) || (actor->_actionCycle < 0)) { + return; + } + + if (actor->_dragonMoveType < ACTOR_DRAGON_TURN_MOVES) { + + actor->_dragonStepCycle++; + if (actor->_dragonStepCycle >= 7) { + actor->_dragonStepCycle = 0; + } + + actor->_dragonBaseFrame = actor->_dragonMoveType * 7; + + if (actor->_location.u() > actor->_partialTarget.u() + 3) { + actor->_location.u() -= 4; + } else if (actor->_location.u() < actor->_partialTarget.u() - 3) { + actor->_location.u() += 4; + } else { + actor->_location.u() = actor->_partialTarget.u(); + } + + if (actor->_location.v() > actor->_partialTarget.v() + 3) { + actor->_location.v() -= 4; + } else if (actor->_location.v() < actor->_partialTarget.v() - 3) { + actor->_location.v() += 4; + } else { + actor->_location.v() = actor->_partialTarget.v(); + } + } else { + dragonMove = &dragonMoveTable[actor->_dragonMoveType]; + actor->_dragonBaseFrame = dragonMove->baseFrame; + + + actor->_location.u() = actor->_partialTarget.u() - dragonMove->offset[actor->_actionCycle][0]; + actor->_location.v() = actor->_partialTarget.v() - dragonMove->offset[actor->_actionCycle][1]; + + actor->_dragonStepCycle++; + if (actor->_dragonStepCycle >= 3) { + actor->_dragonStepCycle = 3; + } + } + + actor->_frameNumber = actor->_dragonBaseFrame + actor->_dragonStepCycle; +} + +void Actor::findActorPath(ActorData *actor, const Point &fromPoint, const Point &toPoint) { + Point iteratorPoint; + Point bestPoint; + int maskType; + int i; + Rect intersect; + +#ifdef ACTOR_DEBUG + _debugPointsCount = 0; +#endif + + actor->_walkStepsCount = 0; + if (fromPoint == toPoint) { + actor->addWalkStepPoint(toPoint); + return; + } + + for (iteratorPoint.y = 0; iteratorPoint.y < _yCellCount; iteratorPoint.y++) { + for (iteratorPoint.x = 0; iteratorPoint.x < _xCellCount; iteratorPoint.x++) { + if (_vm->_scene->validBGMaskPoint(iteratorPoint)) { + maskType = _vm->_scene->getBGMaskType(iteratorPoint); + setPathCell(iteratorPoint, _vm->_scene->getDoorState(maskType) ? kPathCellBarrier : kPathCellEmpty); + } else { + setPathCell(iteratorPoint, kPathCellBarrier); + } + } + } + + for (i = 0; i < _barrierCount; i++) { + intersect.left = MAX(_pathRect.left, _barrierList[i].left); + intersect.top = MAX(_pathRect.top, _barrierList[i].top); + intersect.right = MIN(_pathRect.right, _barrierList[i].right); + intersect.bottom = MIN(_pathRect.bottom, _barrierList[i].bottom); + + for (iteratorPoint.y = intersect.top; iteratorPoint.y < intersect.bottom; iteratorPoint.y++) { + for (iteratorPoint.x = intersect.left; iteratorPoint.x < intersect.right; iteratorPoint.x++) { + setPathCell(iteratorPoint, kPathCellBarrier); + } + } + } + +#ifdef ACTOR_DEBUG + for (iteratorPoint.y = 0; iteratorPoint.y < _yCellCount; iteratorPoint.y++) { + for (iteratorPoint.x = 0; iteratorPoint.x < _xCellCount; iteratorPoint.x++) { + if (getPathCell(iteratorPoint) == kPathCellBarrier) { + addDebugPoint(iteratorPoint, 24); + } + } + } +#endif + + if (scanPathLine(fromPoint, toPoint)) { + actor->addWalkStepPoint(fromPoint); + actor->addWalkStepPoint(toPoint); + return; + } + + i = fillPathArray(fromPoint, toPoint, bestPoint); + + if (fromPoint == bestPoint) { + actor->addWalkStepPoint(bestPoint); + return; + } + + if (i == 0) { + error("fillPathArray returns zero"); + } + + setActorPath(actor, fromPoint, bestPoint); +} + +bool Actor::scanPathLine(const Point &point1, const Point &point2) { + Point point; + Point delta; + Point s; + Point fDelta; + int16 errterm; + + calcDeltaS(point1, point2, delta, s); + point = point1; + + fDelta.x = delta.x * 2; + fDelta.y = delta.y * 2; + + if (delta.y > delta.x) { + + errterm = fDelta.x - delta.y; + + while (delta.y > 0) { + while (errterm >= 0) { + point.x += s.x; + errterm -= fDelta.y; + } + + point.y += s.y; + errterm += fDelta.x; + + if (!validPathCellPoint(point)) { + return false; + } + if (getPathCell(point) == kPathCellBarrier) { + return false; + } + delta.y--; + } + } else { + + errterm = fDelta.y - delta.x; + + while (delta.x > 0) { + while (errterm >= 0) { + point.y += s.y; + errterm -= fDelta.x; + } + + point.x += s.x; + errterm += fDelta.y; + + if (!validPathCellPoint(point)) { + return false; + } + if (getPathCell(point) == kPathCellBarrier) { + return false; + } + delta.x--; + } + } + return true; +} + +int Actor::fillPathArray(const Point &fromPoint, const Point &toPoint, Point &bestPoint) { + int bestRating; + int currentRating; + int i; + Point bestPath; + int pointCounter; + int startDirection; + PathDirectionData *pathDirection; + PathDirectionData *newPathDirection; + const PathDirectionData *samplePathDirection; + Point nextPoint; + int directionCount; + int16 compressX = (_vm->getGameType() == GType_ITE) ? 2 : 1; + + _pathDirectionListCount = 0; + pointCounter = 0; + bestRating = quickDistance(fromPoint, toPoint, compressX); + bestPath = fromPoint; + + for (startDirection = 0; startDirection < 4; startDirection++) { + newPathDirection = addPathDirectionListData(); + newPathDirection->coord = fromPoint; + newPathDirection->direction = startDirection; + } + + if (validPathCellPoint(fromPoint)) { + setPathCell(fromPoint, kDirUp); + +#ifdef ACTOR_DEBUG + addDebugPoint(fromPoint, 24+36); +#endif + } + + i = 0; + + do { + pathDirection = &_pathDirectionList[i]; + for (directionCount = 0; directionCount < 3; directionCount++) { + samplePathDirection = &pathDirectionLUT[pathDirection->direction][directionCount]; + nextPoint = pathDirection->coord; + nextPoint.x += samplePathDirection->coord.x; + nextPoint.y += samplePathDirection->coord.y; + + if (!validPathCellPoint(nextPoint)) { + continue; + } + + if (getPathCell(nextPoint) != kPathCellEmpty) { + continue; + } + + setPathCell(nextPoint, samplePathDirection->direction); + +#ifdef ACTOR_DEBUG + addDebugPoint(nextPoint, samplePathDirection->direction + 96); +#endif + newPathDirection = addPathDirectionListData(); + newPathDirection->coord = nextPoint; + newPathDirection->direction = samplePathDirection->direction; + ++pointCounter; + if (nextPoint == toPoint) { + bestPoint = toPoint; + return pointCounter; + } + currentRating = quickDistance(nextPoint, toPoint, compressX); + if (currentRating < bestRating) { + bestRating = currentRating; + bestPath = nextPoint; + } + pathDirection = &_pathDirectionList[i]; + } + ++i; + } while (i < _pathDirectionListCount); + + bestPoint = bestPath; + return pointCounter; +} + +void Actor::setActorPath(ActorData *actor, const Point &fromPoint, const Point &toPoint) { + Point nextPoint; + int8 direction; + int i; + + _pathListIndex = -1; + addPathListPoint(toPoint); + nextPoint = toPoint; + + while (!(nextPoint == fromPoint)) { + direction = getPathCell(nextPoint); + if ((direction < 0) || (direction >= 8)) { + error("Actor::setActorPath error direction 0x%X", direction); + } + nextPoint.x -= pathDirectionLUT2[direction][0]; + nextPoint.y -= pathDirectionLUT2[direction][1]; + addPathListPoint(nextPoint); + +#ifdef ACTOR_DEBUG + addDebugPoint(nextPoint, 0x8a); +#endif + } + + pathToNode(); + removeNodes(); + nodeToPath(); + removePathPoints(); + + for (i = 0; i <= _pathNodeListIndex; i++) { + actor->addWalkStepPoint(_pathNodeList[i].point); + } +} + +void Actor::pathToNode() { + Point point1, point2, delta; + int direction; + int i; + Point *point; + + point= &_pathList[_pathListIndex]; + direction = 0; + + _pathNodeListIndex = -1; + addPathNodeListPoint(*point); + + for (i = _pathListIndex; i > 0; i--) { + point1 = *point; + --point; + point2 = *point; + if (direction == 0) { + delta.x = int16Compare(point2.x, point1.x); + delta.y = int16Compare(point2.y, point1.y); + direction++; + } + if ((point1.x + delta.x != point2.x) || (point1.y + delta.y != point2.y)) { + addPathNodeListPoint(point1); + direction--; + i++; + point++; + } + } + addPathNodeListPoint(*_pathList); +} + +int pathLine(Point *pointList, const Point &point1, const Point &point2) { + Point point; + Point delta; + Point tempPoint; + Point s; + int16 errterm; + int16 res; + + calcDeltaS(point1, point2, delta, s); + + point = point1; + + tempPoint.x = delta.x * 2; + tempPoint.y = delta.y * 2; + + if (delta.y > delta.x) { + + errterm = tempPoint.x - delta.y; + res = delta.y; + + while (delta.y > 0) { + while (errterm >= 0) { + point.x += s.x; + errterm -= tempPoint.y; + } + + point.y += s.y; + errterm += tempPoint.x; + + *pointList = point; + pointList++; + delta.y--; + } + } else { + + errterm = tempPoint.y - delta.x; + res = delta.x; + + while (delta.x > 0) { + while (errterm >= 0) { + point.y += s.y; + errterm -= tempPoint.x; + } + + point.x += s.x; + errterm += tempPoint.y; + + *pointList = point; + pointList++; + delta.x--; + } + } + return res; +} + +void Actor::nodeToPath() { + int i; + Point point1, point2; + PathNode *node; + Point *point; + + for (i = 0, point = _pathList; i < _pathListAlloced; i++, point++) { + point->x = point->y = PATH_NODE_EMPTY; + } + + _pathListIndex = 1; + _pathList[0] = _pathNodeList[0].point; + _pathNodeList[0].link = 0; + for (i = 0, node = _pathNodeList; i < _pathNodeListIndex; i++) { + point1 = node->point; + node++; + point2 = node->point; + _pathListIndex += pathLine(&_pathList[_pathListIndex], point1, point2); + node->link = _pathListIndex - 1; + } + _pathListIndex--; + _pathNodeList[_pathNodeListIndex].link = _pathListIndex; + +} + +void Actor::removeNodes() { + int i, j, k; + PathNode *iNode, *jNode, *kNode, *fNode; + fNode = &_pathNodeList[_pathNodeListIndex]; + + if (scanPathLine(_pathNodeList[0].point, fNode->point)) { + _pathNodeList[1] = *fNode; + _pathNodeListIndex = 1; + } + + if (_pathNodeListIndex < 4) { + return; + } + + for (i = _pathNodeListIndex - 1, iNode = fNode-1; i > 1 ; i--, iNode--) { + if (iNode->point.x == PATH_NODE_EMPTY) { + continue; + } + + if (scanPathLine(_pathNodeList[0].point, iNode->point)) { + for (j = 1, jNode = _pathNodeList + 1; j < i; j++, jNode++) { + jNode->point.x = PATH_NODE_EMPTY; + } + } + } + + for (i = 1, iNode = _pathNodeList + 1; i < _pathNodeListIndex - 1; i++, iNode++) { + if (iNode->point.x == PATH_NODE_EMPTY) { + continue; + } + + if (scanPathLine(fNode->point, iNode->point)) { + for (j = i + 1, jNode = iNode + 1; j < _pathNodeListIndex; j++, jNode++) { + jNode->point.x = PATH_NODE_EMPTY; + } + } + } + condenseNodeList(); + + for (i = 1, iNode = _pathNodeList + 1; i < _pathNodeListIndex - 1; i++, iNode++) { + if (iNode->point.x == PATH_NODE_EMPTY) { + continue; + } + for (j = i + 2, jNode = iNode + 2; j < _pathNodeListIndex; j++, jNode++) { + if (jNode->point.x == PATH_NODE_EMPTY) { + continue; + } + + if (scanPathLine(iNode->point, jNode->point)) { + for (k = i + 1,kNode = iNode + 1; k < j; k++, kNode++) { + kNode->point.x = PATH_NODE_EMPTY; + } + } + } + } + condenseNodeList(); +} + +void Actor::condenseNodeList() { + int i, j, count; + PathNode *iNode, *jNode; + + count = _pathNodeListIndex; + + for (i = 1, iNode = _pathNodeList + 1; i < _pathNodeListIndex; i++, iNode++) { + if (iNode->point.x == PATH_NODE_EMPTY) { + j = i + 1; + jNode = iNode + 1; + while (jNode->point.x == PATH_NODE_EMPTY) { + j++; + jNode++; + } + *iNode = *jNode; + count = i; + jNode->point.x = PATH_NODE_EMPTY; + if (j == _pathNodeListIndex) { + break; + } + } + } + _pathNodeListIndex = count; +} + +void Actor::removePathPoints() { + int i, j, k, l; + PathNode *node; + int start; + int end; + Point point1, point2; + + if (_pathNodeListIndex < 2) + return; + + _newPathNodeListIndex = -1; + addNewPathNodeListPoint(_pathNodeList[0]); + + for (i = 1, node = _pathNodeList + 1; i < _pathNodeListIndex; i++, node++) { + addNewPathNodeListPoint(*node); + + for (j = 5; j > 0; j--) { + start = node->link - j; + end = node->link + j; + + if (start < 0 || end > _pathListIndex) { + continue; + } + + point1 = _pathList[start]; + point2 = _pathList[end]; + if ((point1.x == PATH_NODE_EMPTY) || (point2.x == PATH_NODE_EMPTY)) { + continue; + } + + if (scanPathLine(point1, point2)) { + for (l = 1; l <= _newPathNodeListIndex; l++) { + if (start <= _newPathNodeList[l].link) { + _newPathNodeListIndex = l; + _newPathNodeList[_newPathNodeListIndex].point = point1; + _newPathNodeList[_newPathNodeListIndex].link = start; + incrementNewPathNodeListIndex(); + break; + } + } + _newPathNodeList[_newPathNodeListIndex].point = point2; + _newPathNodeList[_newPathNodeListIndex].link = end; + + for (k = start + 1; k < end; k++) { + _pathList[k].x = PATH_NODE_EMPTY; + } + break; + } + } + } + + addNewPathNodeListPoint(_pathNodeList[_pathNodeListIndex]); + + for (i = 0, j = 0; i <= _newPathNodeListIndex; i++) { + if (_newPathNodeListIndex == i || (_newPathNodeList[i].point != _newPathNodeList[i+1].point)) { + _pathNodeList[j++] = _newPathNodeList[i]; + } + } + _pathNodeListIndex = j - 1; +} + +void Actor::drawPathTest() { +#ifdef ACTOR_DEBUG + int i; + Surface *surface; + surface = _vm->_gfx->getBackBuffer(); + if (_debugPoints == NULL) { + return; + } + + for (i = 0; i < _debugPointsCount; i++) { + *((byte *)surface->pixels + (_debugPoints[i].point.y * surface->pitch) + _debugPoints[i].point.x) = _debugPoints[i].color; + } +#endif +} + +// Console wrappers - must be safe to run + +void Actor::cmdActorWalkTo(int argc, const char **argv) { + uint16 actorId = (uint16) atoi(argv[1]); + Location location; + Point movePoint; + + movePoint.x = atoi(argv[2]); + movePoint.y = atoi(argv[3]); + + location.fromScreenPoint(movePoint); + + if (!validActorId(actorId)) { + _vm->_console->DebugPrintf("Actor::cmActorWalkTo Invalid actorId 0x%X.\n", actorId); + return; + } + + actorWalkTo(actorId, location); +} + +} // End of namespace Saga diff --git a/engines/saga/animation.cpp b/engines/saga/animation.cpp index 7b3bdcd665..09b2ba412d 100644 --- a/engines/saga/animation.cpp +++ b/engines/saga/animation.cpp @@ -78,92 +78,75 @@ void Anim::freeCutawayList(void) { _cutawayListLength = 0; } -void Anim::playCutaway(int cut, bool fade) { +int Anim::playCutaway(int cut, bool fade) { debug(0, "playCutaway(%d, %d)", cut, fade); + Event event; + Event *q_event = NULL; bool startImmediately = false; + byte *resourceData; + size_t resourceDataLength; + ResourceContext *context = _vm->_resource->getContext(GAME_RESOURCEFILE); _cutAwayFade = fade; - // Chained cutaway, clean up the previous cutaway - if (_cutawayActive) { - clearCutaway(); - - // This is used because when AM is zapping the child's mother in Benny's chapter, - // there is a cutaway followed by a video. The video needs to start immediately after - // the cutaway so that it looks like the original - startImmediately = true; - } - - // WORKAROUND: The IHNM demo deals with chained cutaways in a different manner. Don't save - // the palette of cutaway 11 (the woman looking at the marble) - if (!(_vm->getGameId() == GID_IHNM_DEMO && cut == 11)) - _vm->_gfx->savePalette(); + _vm->_gfx->savePalette(); + _vm->_gfx->getCurrentPal(saved_pal); if (fade) { - _vm->_gfx->getCurrentPal(saved_pal); - // TODO - /* - Event event; static PalEntry cur_pal[PAL_ENTRIES]; - _vm->_gfx->getCurrentPal(cur_pal); + _vm->_interface->setFadeMode(kFadeOut); + // Fade to black out + _vm->_gfx->getCurrentPal(cur_pal); event.type = kEvTImmediate; event.code = kPalEvent; event.op = kEventPalToBlack; event.time = 0; event.duration = kNormalFadeDuration; event.data = cur_pal; + q_event = _vm->_events->queue(&event); - _vm->_events->queue(&event); - */ + // set fade mode + event.type = kEvTImmediate; + event.code = kInterfaceEvent; + event.op = kEventSetFadeMode; + event.param = kNoFade; + event.time = 0; + event.duration = 0; + q_event = _vm->_events->chain(q_event, &event); } // Prepare cutaway - _vm->_gfx->showCursor(false); - _vm->_interface->setStatusText(""); - _vm->_interface->setSaveReminderState(0); - _vm->_interface->rememberMode(); + if (!_cutawayActive) { + _vm->_gfx->showCursor(false); + _vm->_interface->setStatusText(""); + _vm->_interface->setSaveReminderState(0); + _vm->_interface->rememberMode(); + _cutawayActive = true; + } else { + // If another cutaway is up, start the next cutaway immediately + startImmediately = true; + } + if (_cutAwayMode == kPanelVideo) _vm->_interface->setMode(kPanelVideo); else _vm->_interface->setMode(kPanelCutaway); - _cutawayActive = true; - - // Set the initial background and palette for the cutaway - ResourceContext *context = _vm->_resource->getContext(GAME_RESOURCEFILE); - - byte *resourceData; - size_t resourceDataLength; - - _vm->_resource->loadResource(context, _cutawayList[cut].backgroundResourceId, resourceData, resourceDataLength); - - byte *buf; - size_t buflen; - int width; - int height; - - _vm->decodeBGImage(resourceData, resourceDataLength, &buf, &buflen, &width, &height); - - const PalEntry *palette = (const PalEntry *)_vm->getImagePal(resourceData, resourceDataLength); - - Surface *bgSurface = _vm->_render->getBackGroundSurface(); - const Rect rect(width, height); - - bgSurface->blit(rect, buf); - _vm->_frameCount++; - - _vm->_gfx->setPalette(palette); - // WORKAROUND for a bug found in the original IHNM demo. The palette of cutaway 12 is incorrect (the incorrect - // palette can be seen in the original demo too, for a split second). Therefore, use the saved palette for this - // cutaway - if (_vm->getGameId() == GID_IHNM_DEMO && cut == 12) - _vm->_gfx->restorePalette(); - - free(buf); - free(resourceData); + if (fade) { + // Set the initial background and palette for the cutaway + event.type = kEvTImmediate; + event.code = kCutawayEvent; + event.op = kEventShowCutawayBg; + event.time = 0; + event.duration = 0; + event.param = _cutawayList[cut].backgroundResourceId; + q_event = _vm->_events->chain(q_event, &event); + } else { + showCutawayBg(_cutawayList[cut].backgroundResourceId); + } // Play the animation @@ -183,7 +166,7 @@ void Anim::playCutaway(int cut, bool fade) { if (cutawaySlot == -1) { warning("Could not allocate cutaway animation slot"); - return; + return 0; } // Some cutaways in IHNM have animResourceId equal to 0, which means that they only have @@ -191,48 +174,47 @@ void Anim::playCutaway(int cut, bool fade) { // An example is the "nightfall" animation in Ben's chapter (fadein-fadeout), the animation // for the second from the left monitor in Ellen's chapter etc // Therefore, skip the animation bit if animResourceId is 0 and only show the background - if (_cutawayList[cut].animResourceId == 0) - return; - - _vm->_resource->loadResource(context, _cutawayList[cut].animResourceId, resourceData, resourceDataLength); - - load(MAX_ANIMATIONS + cutawaySlot, resourceData, resourceDataLength); - - free(resourceData); + if (_cutawayList[cut].animResourceId != 0) { + _vm->_resource->loadResource(context, _cutawayList[cut].animResourceId, resourceData, resourceDataLength); + load(MAX_ANIMATIONS + cutawaySlot, resourceData, resourceDataLength); + free(resourceData); - setCycles(MAX_ANIMATIONS + cutawaySlot, _cutawayList[cut].cycles); - setFrameTime(MAX_ANIMATIONS + cutawaySlot, 1000 / _cutawayList[cut].frameRate); + setCycles(MAX_ANIMATIONS + cutawaySlot, _cutawayList[cut].cycles); + setFrameTime(MAX_ANIMATIONS + cutawaySlot, 1000 / _cutawayList[cut].frameRate); + } if (_cutAwayMode != kPanelVideo || startImmediately) play(MAX_ANIMATIONS + cutawaySlot, 0); else { - Event event; event.type = kEvTOneshot; event.code = kAnimEvent; event.op = kEventPlay; event.param = MAX_ANIMATIONS + cutawaySlot; event.time = (40 / 3) * 1000 / _cutawayList[cut].frameRate; - _vm->_events->queue(&event); + if (fade) + q_event = _vm->_events->chain(q_event, &event); + else + _vm->_events->queue(&event); } + + return MAX_ANIMATIONS + cutawaySlot; } void Anim::endCutaway(void) { - // I believe this is called by scripts after running one cutaway. At - // this time, nothing needs to be done here. + // This is called by scripts after a cutaway is finished. At this time, + // nothing needs to be done here. debug(0, "endCutaway()"); } void Anim::returnFromCutaway(void) { - // I believe this is called by scripts after running a cutaway to - // ensure that we return to the scene as if nothing had happened. It's - // not called by the IHNM intro, presumably because there is no old - // scene to return to. + // This is called by scripts after a cutaway is finished, to return back + // to the scene that the cutaway was called from. It's not called by the + // IHNM intro, as there is no old scene to return to. debug(0, "returnFromCutaway()"); - if (_cutawayActive) { Event event; Event *q_event = NULL; @@ -240,16 +222,26 @@ void Anim::returnFromCutaway(void) { if (_cutAwayFade) { static PalEntry cur_pal[PAL_ENTRIES]; - _vm->_gfx->getCurrentPal(cur_pal); + _vm->_interface->setFadeMode(kFadeOut); + // Fade to black out + _vm->_gfx->getCurrentPal(cur_pal); event.type = kEvTImmediate; event.code = kPalEvent; event.op = kEventPalToBlack; event.time = 0; event.duration = kNormalFadeDuration; event.data = cur_pal; - q_event = _vm->_events->queue(&event); + + // set fade mode + event.type = kEvTImmediate; + event.code = kInterfaceEvent; + event.op = kEventSetFadeMode; + event.param = kNoFade; + event.time = 0; + event.duration = 0; + q_event = _vm->_events->chain(q_event, &event); } // Clear the cutaway. Note that this sets _cutawayActive to false @@ -272,7 +264,6 @@ void Anim::returnFromCutaway(void) { event.op = kEventResumeAll; event.time = 0; event.duration = 0; - q_event = _vm->_events->chain(q_event, &event); // chain with the other events // Draw the scene @@ -281,7 +272,6 @@ void Anim::returnFromCutaway(void) { event.op = kEventDraw; event.time = 0; event.duration = 0; - q_event = _vm->_events->chain(q_event, &event); // chain with the other events // Handle fade up, if we previously faded down @@ -292,22 +282,22 @@ void Anim::returnFromCutaway(void) { event.time = 0; event.duration = kNormalFadeDuration; event.data = saved_pal; - q_event = _vm->_events->chain(q_event, &event); - } event.type = kEvTOneshot; event.code = kScriptEvent; event.op = kEventThreadWake; event.param = kWaitTypeWakeUp; - q_event = _vm->_events->chain(q_event, &event); } } void Anim::clearCutaway(void) { + PalEntry *pal; + debug(1, "clearCutaway()"); + if (_cutawayActive) { _cutawayActive = false; @@ -317,18 +307,56 @@ void Anim::clearCutaway(void) { } _vm->_interface->restoreMode(); - - if (_vm->getGameId() != GID_IHNM_DEMO) { - if (_vm->_scene->currentSceneNumber() >= 144 && _vm->_scene->currentSceneNumber() <= 149) { - // Don't show the mouse cursor in the non-interactive part of the IHNM demo - } else { - _vm->_gfx->showCursor(true); - } - } else { + _vm->_gfx->showCursor(true); + + if (_vm->getGameId() == GID_IHNM_DEMO) { // Enable the save reminder state after each cutaway for the IHNM demo _vm->_interface->setSaveReminderState(true); } + + // Set the scene's palette + _vm->_scene->getBGPal(pal); + _vm->_gfx->setPalette(pal); + } +} + +void Anim::showCutawayBg(int bg) { + ResourceContext *context = _vm->_resource->getContext(GAME_RESOURCEFILE); + + byte *resourceData; + size_t resourceDataLength; + byte *buf; + size_t buflen; + int width; + int height; + Event event; + static PalEntry pal[PAL_ENTRIES]; + + _vm->_resource->loadResource(context, bg, resourceData, resourceDataLength); + _vm->decodeBGImage(resourceData, resourceDataLength, &buf, &buflen, &width, &height); + + const byte *palPointer = _vm->getImagePal(resourceData, resourceDataLength); + memcpy(pal, palPointer, sizeof(pal)); + Surface *bgSurface = _vm->_render->getBackGroundSurface(); + const Rect rect(width, height); + bgSurface->blit(rect, buf); + _vm->_frameCount++; + + if (_cutAwayFade) { + // Handle fade up, if we previously faded down + event.type = kEvTImmediate; + event.code = kPalEvent; + event.op = kEventBlackToPal; + event.time = 0; + event.duration = kNormalFadeDuration; + event.data = pal; + _vm->_events->queue(&event); + } else { + _vm->_gfx->setPalette(pal); } + + free(buf); + free(resourceData); } void Anim::startVideo(int vid, bool fade) { @@ -380,6 +408,12 @@ void Anim::load(uint16 animId, const byte *animResourceData, size_t animResource anim->start += temp; // Cache frame offsets + + // WORKAROUND: Cutaway with background resource ID 37 (loaded as cutaway #4) is ending credits. + // For some reason it has wrong number of frames specified in its header. So we calculate it here: + if (animId > MAX_ANIMATIONS && _cutawayListLength > 4 && _cutawayList[4].backgroundResourceId == 37 && anim->maxFrame == 143) + anim->maxFrame = fillFrameOffsets(anim, false); + anim->frameOffsets = (size_t *)malloc((anim->maxFrame + 1) * sizeof(*anim->frameOffsets)); if (anim->frameOffsets == NULL) { memoryError("Anim::load"); @@ -388,7 +422,9 @@ void Anim::load(uint16 animId, const byte *animResourceData, size_t animResource fillFrameOffsets(anim); // Set animation data - anim->currentFrame = 0; + // HACK: We set currentFrame to -1, as the first frame of the animation is never drawn otherwise + // (check Anim::play) + anim->currentFrame = -1; anim->completed = 0; anim->cycles = anim->maxFrame; @@ -422,6 +458,13 @@ void Anim::setCycles(uint16 animId, int cycles) { anim->cycles = cycles; } +int Anim::getCycles(uint16 animId) { + if (animId >= MAX_ANIMATIONS && _cutawayAnimations[animId - MAX_ANIMATIONS] == NULL) + return 0; + + return getAnimation(animId)->cycles; +} + void Anim::play(uint16 animId, int vectorTime, bool playing) { Event event; Surface *backGroundSurface; @@ -440,6 +483,23 @@ void Anim::play(uint16 animId, int vectorTime, bool playing) { if (animId < MAX_ANIMATIONS && _cutawayActive) return; + if (animId >= MAX_ANIMATIONS && _cutawayAnimations[animId - MAX_ANIMATIONS] == NULL) { + // In IHNM, cutaways without an animation bit are not rendered, but the framecount + // needs to be updated + _vm->_frameCount++; + + event.type = kEvTOneshot; + event.code = kAnimEvent; + event.op = kEventFrame; + event.param = animId; + event.time = 10; + _vm->_events->queue(&event); + + // Nothing to render here (apart from the background, which is already rendered), + // so return + return; + } + anim = getAnimation(animId); backGroundSurface = _vm->_render->getBackGroundSurface(); @@ -453,19 +513,28 @@ void Anim::play(uint16 animId, int vectorTime, bool playing) { return; } + // HACK: The first frame of the animation is never shown when entering a scene + // For now, we initialize currentFrame to be -1 instead of 0 and we draw the + // first frame of the animation on the next iteration of Anim::play + // FIXME: find out why this occurs and remove this hack. Note that when this + // hack is removed, currentFrame should be initialized to 0 again in Anim::load + if (anim->currentFrame < 0) { + anim->currentFrame = 0; + event.type = kEvTOneshot; + event.code = kAnimEvent; + event.op = kEventFrame; + event.param = animId; + event.time = 0; + _vm->_events->queue(&event); + + return; + } + if (anim->completed < anim->cycles) { - frame = anim->currentFrame; + if (anim->currentFrame < 0) + anim->currentFrame = 0; - // WORKAROUND for a buggy animation in IHNM. Animation 0 in scene 67 (the mob of angry prisoners) should - // start from frame 0, not frame 1. Frame 0 is the background of the animation (the mob of prisoners), whereas - // the rest of the frames are their animated arms. Therefore, in order for the prisoners to appear correctly, - // frame 0 should be displayed as the first frame, but anim->currentframe is set to 1, which means that the - // prisoners will never be shown. In the original, the prisoners (first frame in the animation) are shown a - // bit after the animation is started (which is wrong again, but not that apparent), whereas in ScummVM the - // first frame is never shown. Therefore, make sure that for this animation, frame 0 is shown first - if (_vm->getGameType() == GType_IHNM && _vm->_scene->currentChapterNumber() == 4 && - _vm->_scene->currentSceneNumber() == 67 && animId == 0 && anim->completed == 1) - frame = 0; + frame = anim->currentFrame; // FIXME: if start > 0, then this works incorrectly decodeFrame(anim, anim->frameOffsets[frame], displayBuffer, _vm->getDisplayWidth() * _vm->getDisplayHeight()); @@ -488,6 +557,9 @@ void Anim::play(uint16 animId, int vectorTime, bool playing) { _vm->_frameCount += 100; // make sure the waiting thread stops waiting // Animation done playing anim->state = ANIM_PAUSE; + anim->currentFrame = 0; + anim->completed = 0; + if (anim->linkId == -1) { if (anim->flags & ANIM_FLAG_ENDSCENE) { // This animation ends the scene @@ -498,9 +570,6 @@ void Anim::play(uint16 animId, int vectorTime, bool playing) { _vm->_events->queue(&event); } return; - } else { - anim->currentFrame = 0; - anim->completed = 0; } } @@ -521,7 +590,6 @@ void Anim::play(uint16 animId, int vectorTime, bool playing) { event.op = kEventFrame; event.param = animId; event.time = frameTime; - _vm->_events->queue(&event); } @@ -592,6 +660,22 @@ void Anim::setFrameTime(uint16 animId, int time) { anim->frameTime = time; } +int Anim::getFrameTime(uint16 animId) { + AnimationData *anim; + + anim = getAnimation(animId); + + return anim->frameTime; +} + +bool Anim::isPlaying(uint16 animId) { + AnimationData *anim; + + anim = getAnimation(animId); + + return (anim->state == ANIM_PLAYING); +} + int16 Anim::getCurrentFrame(uint16 animId) { AnimationData *anim; @@ -631,11 +715,12 @@ void Anim::decodeFrame(AnimationData *anim, size_t frameOffset, byte *buf, size_ MemoryReadStream readS(anim->resourceData + frameOffset, anim->resourceLength - frameOffset); - +// FIXME: This is thrown when the first video of the IHNM end sequence is shown (the "turn off screen" +// video), however the video is played correctly and the rest of the end sequence continues normally #if 1 #define VALIDATE_WRITE_POINTER \ if ((writePointer < buf) || (writePointer >= (buf + screenWidth * screenHeight))) { \ - error("VALIDATE_WRITE_POINTER: writePointer=%p buf=%p", (void *)writePointer, (void *)buf); \ + warning("VALIDATE_WRITE_POINTER: writePointer=%p buf=%p", (void *)writePointer, (void *)buf); \ } #else #define VALIDATE_WRITE_POINTER @@ -758,8 +843,8 @@ void Anim::decodeFrame(AnimationData *anim, size_t frameOffset, byte *buf, size_ } while (1); } -void Anim::fillFrameOffsets(AnimationData *anim) { - uint16 currentFrame; +int Anim::fillFrameOffsets(AnimationData *anim, bool reallyFill) { + uint16 currentFrame = 0; byte markByte; uint16 control; uint16 runcount; @@ -772,12 +857,18 @@ void Anim::fillFrameOffsets(AnimationData *anim) { readS._bigEndian = !_vm->isBigEndian(); // RLE has inversion BE<>LE - for (currentFrame = 0; currentFrame <= anim->maxFrame; currentFrame++) { - anim->frameOffsets[currentFrame] = readS.pos(); + while (!readS.eos()) { + if (reallyFill) { + anim->frameOffsets[currentFrame] = readS.pos(); + + if (currentFrame == anim->maxFrame) + break; + } + currentFrame++; // For some strange reason, the animation header is in little // endian format, but the actual RLE encoded frame data, - // including the frame header, is in big endian format. */ + // including the frame header, is in big endian format do { markByte = readS.readByte(); // debug(7, "_pos=%x currentFrame=%i markByte=%x", readS.pos(), currentFrame, markByte); @@ -816,8 +907,7 @@ void Anim::fillFrameOffsets(AnimationData *anim) { case SAGA_FRAME_LONG_UNCOMPRESSED_RUN: // (16) 0001 0000 // Long Uncompressed Run runcount = readS.readSint16BE(); - for (i = 0; i < runcount; i++) - readS.readByte(); + readS.seek(runcount, SEEK_CUR); continue; break; case SAGA_FRAME_NOOP: // Does nothing @@ -855,6 +945,8 @@ void Anim::fillFrameOffsets(AnimationData *anim) { } } while (markByte != SAGA_FRAME_END); } + + return currentFrame; } void Anim::animInfo() { diff --git a/engines/saga/animation.h b/engines/saga/animation.h index f8cf90425f..4306d8e00d 100644 --- a/engines/saga/animation.h +++ b/engines/saga/animation.h @@ -115,10 +115,11 @@ public: void loadCutawayList(const byte *resourcePointer, size_t resourceLength); void freeCutawayList(void); - void playCutaway(int cut, bool fade); + int playCutaway(int cut, bool fade); void endCutaway(void); void returnFromCutaway(void); void clearCutaway(void); + void showCutawayBg(int bg); void startVideo(int vid, bool fade); void endVideo(void); @@ -140,12 +141,10 @@ public: void resume(uint16 animId, int cycles); void resumeAll(); int16 getCurrentFrame(uint16 animId); - bool hasCutaway(void) { - return _cutawayActive; - } - void setCutAwayMode(int mode) { - _cutAwayMode = mode; - } + int getFrameTime(uint16 animId); + int getCycles(uint16 animId); + bool isPlaying(uint16 animId); + bool hasAnimation(uint16 animId) { if (animId >= MAX_ANIMATIONS) { if (animId < MAX_ANIMATIONS + ARRAYSIZE(_cutawayAnimations)) @@ -154,10 +153,16 @@ public: } return (_animations[animId] != NULL); } - int cutawayResourceID(int cutaway) { return _cutawayList[cutaway].animResourceId; } + + bool hasCutaway(void) { return _cutawayActive; } + void setCutAwayMode(int mode) { _cutAwayMode = mode; } + int cutawayListLength() { return _cutawayListLength; } + int cutawayBgResourceID(int cutaway) { return _cutawayList[cutaway].backgroundResourceId; } + int cutawayAnimResourceID(int cutaway) { return _cutawayList[cutaway].animResourceId; } + private: void decodeFrame(AnimationData *anim, size_t frameOffset, byte *buf, size_t bufLength); - void fillFrameOffsets(AnimationData *anim); + int fillFrameOffsets(AnimationData *anim, bool reallyFill = true); void validateAnimationId(uint16 animId) { if (animId >= MAX_ANIMATIONS) { @@ -168,7 +173,7 @@ private: } } if (_animations[animId] == NULL) { - error("validateAnimationId: animId=%i unassigned", animId); + error("validateAnimationId: animId=%i unassigned.", animId); } } diff --git a/engines/saga/console.cpp b/engines/saga/console.cpp index 421245ab30..0a6b733e00 100644 --- a/engines/saga/console.cpp +++ b/engines/saga/console.cpp @@ -75,6 +75,14 @@ Console::Console(SagaEngine *vm) : GUI::Debugger() { // Panel commands DCmd_Register("current_panel_mode", WRAP_METHOD(Console, cmdCurrentPanelMode)); DCmd_Register("set_panel_mode", WRAP_METHOD(Console, cmdSetPanelMode)); + + // Font commands + DCmd_Register("set_font_mapping", WRAP_METHOD(Console, cmdSetFontMapping)); + + // Global flags commands + DCmd_Register("global_flags_info", WRAP_METHOD(Console, cmdGlobalFlagsInfo)); + DCmd_Register("set_global_flag", WRAP_METHOD(Console, cmdSetGlobalFlag)); + DCmd_Register("clear_global_flag", WRAP_METHOD(Console, cmdClearGlobalFlag)); } Console::~Console() { @@ -158,4 +166,92 @@ bool Console::cmdSetPanelMode(int argc, const char **argv) { return true; } +bool Console::cmdSetFontMapping(int argc, const char **argv) { + if (argc != 2) { + DebugPrintf("Sets font mapping\nUsage: %s <Font mapping flag>\n", argv[0]); + DebugPrintf("Mapping flags:\n0 - default game behavior\n1 - force font mapping\n2 - ignore font mapping\n"); + } else { + _vm->_font->setFontMapping(atoi(argv[1])); + } + return true; +} + +bool Console::cmdGlobalFlagsInfo(int argc, const char **argv) { + DebugPrintf("Global flags status for IHNM:\n"); + + // Global flags in IHNM: + // 00: Unknown + // 01: Unknown + // 02: Unknown + // 03: Unknown + // 04: Unknown + // 05: Unknown + // 06: Unknown + // 07: Unknown + // 08: Unknown + // 09: Unknown + // 10: Unknown + // 11: Unknown + // 12: Unknown + // 13: Unknown + // 14: Unknown + // 15: Unknown + // 16: Used in the final chapter. If it's 0 when a character dies, the "bad" ending for that character is shown + // 17: Unknown + // 18: Unknown + // 19: Unknown, used in the final chapter + // 20: Unknown + // 21: Unknown + // 22: Unknown + // 23: Unknown + // 24: Unknown + // 25: Unknown + // 26: Unknown + // 27: Unknown + // 28: Unknown + // 29: Unknown + // 30: Unknown + // 31: Unknown + + int i = 0, k = 0, flagStatus = 0; + + for (i = 0; i < 32; i += 8) { + for (k = i; k < i + 8; k ++) { + flagStatus = _vm->_globalFlags & (1 << k) ? 1 : 0; + _vm->_console->DebugPrintf("%02d: %u |", k, flagStatus); + } + _vm->_console->DebugPrintf("\n"); + } + + return true; +} + +bool Console::cmdSetGlobalFlag(int argc, const char **argv) { + if (argc != 2) { + DebugPrintf("Usage: %s <Global flag number>\nValid flag numbers are 0 - 31\n", argv[0]); + } else { + int flagNumber = atoi(argv[1]); + if (flagNumber >= 0 && flagNumber <= 31) { + _vm->_globalFlags |= (1 << flagNumber); + } else { + DebugPrintf("Valid flag numbers are 0 - 31\n"); + } + } + return true; +} + +bool Console::cmdClearGlobalFlag(int argc, const char **argv) { + if (argc != 2) { + DebugPrintf("Usage: %s <Global flag number>\nValid flag numbers are 0 - 31\n", argv[0]); + } else { + int flagNumber = atoi(argv[1]); + if (flagNumber >= 0 && flagNumber <= 31) { + _vm->_globalFlags &= ~(1 << flagNumber); + } else { + DebugPrintf("Valid flag numbers are 0 - 31\n"); + } + } + return true; +} + } // End of namespace Saga diff --git a/engines/saga/console.h b/engines/saga/console.h index 3db9833f22..7936d3a959 100644 --- a/engines/saga/console.h +++ b/engines/saga/console.h @@ -55,6 +55,12 @@ private: bool cmdCurrentPanelMode(int argc, const char **argv); bool cmdSetPanelMode(int argc, const char **argv); + bool cmdSetFontMapping(int argc, const char **argv); + + bool cmdGlobalFlagsInfo(int argc, const char **argv); + bool cmdSetGlobalFlag(int argc, const char **argv); + bool cmdClearGlobalFlag(int argc, const char **argv); + private: SagaEngine *_vm; }; diff --git a/engines/saga/detection.cpp b/engines/saga/detection.cpp index c8918998f1..29ca0e8bbe 100644 --- a/engines/saga/detection.cpp +++ b/engines/saga/detection.cpp @@ -18,8 +18,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL:https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/branches/gsoc2007-fsnode/engines/saga/detection.cpp $ - * $Id:detection.cpp 26949 2007-05-26 20:23:24Z david_corrales $ + * $URL$ + * $Id$ * */ @@ -49,7 +49,6 @@ struct SAGAGameDescription { const GameFontDescription *fontDescriptions; const GameSoundInfo *voiceInfo; const GameSoundInfo *sfxInfo; - const GameSoundInfo *musicInfo; int patchesCount; const GamePatchDescription *patchDescriptions; }; @@ -59,7 +58,18 @@ const bool SagaEngine::isMacResources() const { return (getPlatform() == Common: const GameResourceDescription *SagaEngine::getResourceDescription() { return _gameDescription->resourceDescription; } const GameSoundInfo *SagaEngine::getVoiceInfo() const { return _gameDescription->voiceInfo; } const GameSoundInfo *SagaEngine::getSfxInfo() const { return _gameDescription->sfxInfo; } -const GameSoundInfo *SagaEngine::getMusicInfo() const { return _gameDescription->musicInfo; } +const GameSoundInfo *SagaEngine::getMusicInfo() const { + static GameSoundInfo musicInfo; + musicInfo.resourceType = kSoundPCM; + musicInfo.frequency = 11025; + musicInfo.sampleBits = 16; + // The digital music in the ITE Mac demo version is not stereo + musicInfo.stereo = _gameDescription->gameType == GID_ITE_MACDEMO2 ? false : true; + musicInfo.isBigEndian = false; + musicInfo.isSigned = true; + + return &musicInfo; +} const GameFontDescription *SagaEngine::getFontDescription(int index) { assert(index < _gameDescription->fontsCount); diff --git a/engines/saga/detection_tables.h b/engines/saga/detection_tables.h index 0d57adb87d..5bb408e947 100644 --- a/engines/saga/detection_tables.h +++ b/engines/saga/detection_tables.h @@ -18,8 +18,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL:https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/branches/gsoc2007-fsnode/engines/saga/detection_tables.h $ - * $Id:detection_tables.h 26949 2007-05-26 20:23:24Z david_corrales $ + * $URL$ + * $Id$ * */ @@ -34,6 +34,7 @@ static const GameResourceDescription ITE_Resources = { RID_ITE_CONVERSE_PANEL, RID_ITE_OPTION_PANEL, 0, // Warning panel (IHNM only) + 0, // Warning panel sprites (IHNM only) RID_ITE_MAIN_SPRITES, RID_ITE_MAIN_PANEL_SPRITES, 0, // Option panel sprites (IHNM only) @@ -50,6 +51,7 @@ static const GameResourceDescription ITEDemo_Resources = { RID_ITEDEMO_CONVERSE_PANEL, RID_ITEDEMO_OPTION_PANEL, 0, // Warning panel (IHNM only) + 0, // Warning panel sprites (IHNM only) RID_ITEDEMO_MAIN_SPRITES, RID_ITEDEMO_MAIN_PANEL_SPRITES, 0, // Option panel sprites (IHNM only) @@ -59,188 +61,6 @@ static const GameResourceDescription ITEDemo_Resources = { RID_ITEDEMO_ACTOR_NAMES }; -// Inherit the Earth - DOS Demo version -static const GameFontDescription ITEDEMO_GameFonts[] = { - {0}, - {1} -}; - -// Inherit the Earth - Wyrmkeep Win32 Demo version - -static const GameFontDescription ITEWINDEMO_GameFonts[] = { - {2}, - {0} -}; - -static const GameSoundInfo ITEWINDEMO1_GameSound = { - kSoundPCM, - 22050, - 8, - false, - false, - false -}; - -static const GameSoundInfo ITEWINDEMO2_GameVoice = { - kSoundVOX, - 22050, - 16, - false, - false, - true -}; - -static const GameSoundInfo ITEWINDEMO2_GameSound = { - kSoundPCM, - 22050, - 16, - false, - false, - true -}; - -// Inherit the Earth - Wyrmkeep Mac Demo version -static const GameSoundInfo ITEMACDEMO_GameVoice = { - kSoundVOX, - 22050, - 16, - false, - false, - true -}; - -static const GameSoundInfo ITEMACDEMO_GameSound = { - kSoundPCM, - 22050, - 16, - false, - true, - true -}; - -static const GameSoundInfo ITEMACDEMO_GameMusic = { - kSoundPCM, - 11025, - 16, - false, - false, - true -}; - -static const GameSoundInfo ITEMACCD_G_GameSound = { - kSoundMacPCM, - 22050, - 8, - false, - false, - false -}; - -// Inherit the Earth - Mac Wyrmkeep version -static const GameSoundInfo ITEMACCD_GameSound = { - kSoundPCM, - 22050, - 16, - false, - true, - true -}; - -static const GameSoundInfo ITEMACCD_GameMusic = { - kSoundPCM, - 11025, - 16, - true, - false, - true -}; - -// Inherit the Earth - Diskette version -static const GameFontDescription ITEDISK_GameFonts[] = { - {2}, - {0}, - {1} -}; - -static const GameSoundInfo ITEDISK_GameSound = { - kSoundVOC, - -1, - -1, - false, - false, - true -}; - -static const GameFontDescription ITECD_GameFonts[] = { - {2}, - {0}, - {1} -}; - -static const GameSoundInfo ITECD_GameSound = { - kSoundPCM, - 22050, - 16, - false, - false, - true -}; - -// Patch files. Files not found will be ignored -static const GamePatchDescription ITEPatch_Files[] = { - { "cave.mid", GAME_RESOURCEFILE, 9, NULL}, - { "intro.mid", GAME_RESOURCEFILE, 10, NULL}, - { "fvillage.mid", GAME_RESOURCEFILE, 11, NULL}, - { "elkhall.mid", GAME_RESOURCEFILE, 12, NULL}, - { "mouse.mid", GAME_RESOURCEFILE, 13, NULL}, - { "darkclaw.mid", GAME_RESOURCEFILE, 14, NULL}, - { "birdchrp.mid", GAME_RESOURCEFILE, 15, NULL}, - { "orbtempl.mid", GAME_RESOURCEFILE, 16, NULL}, - { "spooky.mid", GAME_RESOURCEFILE, 17, NULL}, - { "catfest.mid", GAME_RESOURCEFILE, 18, NULL}, - { "elkfanfare.mid", GAME_RESOURCEFILE, 19, NULL}, - { "bcexpl.mid", GAME_RESOURCEFILE, 20, NULL}, - { "boargtnt.mid", GAME_RESOURCEFILE, 21, NULL}, - { "boarking.mid", GAME_RESOURCEFILE, 22, NULL}, - { "explorea.mid", GAME_RESOURCEFILE, 23, NULL}, - { "exploreb.mid", GAME_RESOURCEFILE, 24, NULL}, - { "explorec.mid", GAME_RESOURCEFILE, 25, NULL}, - { "sunstatm.mid", GAME_RESOURCEFILE, 26, NULL}, - { "nitstrlm.mid", GAME_RESOURCEFILE, 27, NULL}, - { "humruinm.mid", GAME_RESOURCEFILE, 28, NULL}, - { "damexplm.mid", GAME_RESOURCEFILE, 29, NULL}, - { "tychom.mid", GAME_RESOURCEFILE, 30, NULL}, - { "kitten.mid", GAME_RESOURCEFILE, 31, NULL}, - { "sweet.mid", GAME_RESOURCEFILE, 32, NULL}, - { "brutalmt.mid", GAME_RESOURCEFILE, 33, NULL}, - { "shiala.mid", GAME_RESOURCEFILE, 34, NULL}, - - { "wyrm.pak", GAME_RESOURCEFILE, 1529, NULL}, - { "wyrm1.dlt", GAME_RESOURCEFILE, 1530, NULL}, - { "wyrm2.dlt", GAME_RESOURCEFILE, 1531, NULL}, - { "wyrm3.dlt", GAME_RESOURCEFILE, 1532, NULL}, - { "wyrm4.dlt", GAME_RESOURCEFILE, 1533, NULL}, - { "credit3n.dlt", GAME_RESOURCEFILE, 1796, NULL}, - { "credit3m.dlt", GAME_RESOURCEFILE, 1796, NULL}, // Macintosh - { "credit4n.dlt", GAME_RESOURCEFILE, 1797, NULL}, - { "credit4m.dlt", GAME_RESOURCEFILE, 1797, NULL}, // Macintosh - { "p2_a.voc", GAME_VOICEFILE, 4, NULL}, - { "p2_a.iaf", GAME_VOICEFILE, 4, &ITECD_GameSound} -}; - -static const GamePatchDescription ITEMacPatch_Files[] = { - { "wyrm.pak", GAME_RESOURCEFILE, 1529, NULL}, - { "wyrm1.dlt", GAME_RESOURCEFILE, 1530, NULL}, - { "wyrm2.dlt", GAME_RESOURCEFILE, 1531, NULL}, - { "wyrm3.dlt", GAME_RESOURCEFILE, 1532, NULL}, - { "wyrm4.dlt", GAME_RESOURCEFILE, 1533, NULL}, - { "credit3m.dlt", GAME_RESOURCEFILE, 1796, NULL}, - { "credit4m.dlt", GAME_RESOURCEFILE, 1797, NULL}, - { "p2_a.iaf", GAME_VOICEFILE, 4, &ITEMACCD_GameSound} -}; - -// IHNM section - static const GameResourceDescription IHNM_Resources = { RID_IHNM_SCENE_LUT, // Scene lookup table RN RID_IHNM_SCRIPT_LUT, // Script lookup table RN @@ -248,6 +68,7 @@ static const GameResourceDescription IHNM_Resources = { RID_IHNM_CONVERSE_PANEL, RID_IHNM_OPTION_PANEL, RID_IHNM_WARNING_PANEL, + RID_IHNM_WARNING_PANEL_SPRITES, RID_IHNM_MAIN_SPRITES, RID_IHNM_MAIN_PANEL_SPRITES, RID_IHNM_OPTION_PANEL_SPRITES, @@ -264,6 +85,7 @@ static const GameResourceDescription IHNMDEMO_Resources = { RID_IHNMDEMO_CONVERSE_PANEL, RID_IHNMDEMO_OPTION_PANEL, RID_IHNMDEMO_WARNING_PANEL, + RID_IHNMDEMO_WARNING_PANEL_SPRITES, RID_IHNMDEMO_MAIN_SPRITES, RID_IHNMDEMO_MAIN_PANEL_SPRITES, RID_IHNMDEMO_OPTION_PANEL_SPRITES, @@ -273,29 +95,73 @@ static const GameResourceDescription IHNMDEMO_Resources = { 0 // Actors strings (ITE only) }; -static const GameFontDescription IHNMDEMO_GameFonts[] = { - {2}, - {3}, - {4} -}; +static const GameFontDescription ITEDEMO_GameFonts[] = { {0}, {1} }; +static const GameFontDescription ITEWINDEMO_GameFonts[] = { {2}, {0} }; +static const GameFontDescription ITE_GameFonts[] = { {2}, {0}, {1} }; +static const GameFontDescription IHNMDEMO_GameFonts[] = { {2}, {3}, {4} }; +// Font 6 is kIHNMFont8, font 8 is kIHNMMainFont +static const GameFontDescription IHNMCD_GameFonts[] = { {2}, {3}, {4}, {5}, {6}, {7}, {8} }; + +// frequency, sampleBits, stereo, isBigEndian, isSigned +static const GameSoundInfo ITEPC_GameSound = { kSoundPCM, 22050, 16, false, false, true }; +static const GameSoundInfo ITEMAC_GameSound = { kSoundPCM, 22050, 16, false, true, true }; +static const GameSoundInfo ITEWINDEMO1_GameSound = { kSoundPCM, 22050, 8, false, false, false }; +static const GameSoundInfo ITEMACCD_G_GameSound = { kSoundMacPCM, 22050, 8, false, false, false }; +static const GameSoundInfo ITEDISK_GameSound = { kSoundVOC, -1, -1, false, false, true }; +static const GameSoundInfo ITEDEMO_GameVoice = { kSoundVOX, 22050, 16, false, false, true }; +static const GameSoundInfo IHNM_GameSound = { kSoundWAV, -1, -1, false, false, true }; -static const GameFontDescription IHNMCD_GameFonts[] = { - {2}, - {3}, - {4}, - {5}, - {6}, // kIHNMFont8 - {7}, - {8} // kIHNMMainFont +// Patch files. Files not found will be ignored +static const GamePatchDescription ITEPatch_Files[] = { + { "cave.mid", GAME_RESOURCEFILE, 9, NULL}, + { "intro.mid", GAME_RESOURCEFILE, 10, NULL}, + { "fvillage.mid", GAME_RESOURCEFILE, 11, NULL}, + { "elkhall.mid", GAME_RESOURCEFILE, 12, NULL}, + { "mouse.mid", GAME_RESOURCEFILE, 13, NULL}, + { "darkclaw.mid", GAME_RESOURCEFILE, 14, NULL}, + { "birdchrp.mid", GAME_RESOURCEFILE, 15, NULL}, + { "orbtempl.mid", GAME_RESOURCEFILE, 16, NULL}, + { "spooky.mid", GAME_RESOURCEFILE, 17, NULL}, + { "catfest.mid", GAME_RESOURCEFILE, 18, NULL}, + { "elkfanfare.mid", GAME_RESOURCEFILE, 19, NULL}, + { "bcexpl.mid", GAME_RESOURCEFILE, 20, NULL}, + { "boargtnt.mid", GAME_RESOURCEFILE, 21, NULL}, + { "boarking.mid", GAME_RESOURCEFILE, 22, NULL}, + { "explorea.mid", GAME_RESOURCEFILE, 23, NULL}, + { "exploreb.mid", GAME_RESOURCEFILE, 24, NULL}, + { "explorec.mid", GAME_RESOURCEFILE, 25, NULL}, + { "sunstatm.mid", GAME_RESOURCEFILE, 26, NULL}, + { "nitstrlm.mid", GAME_RESOURCEFILE, 27, NULL}, + { "humruinm.mid", GAME_RESOURCEFILE, 28, NULL}, + { "damexplm.mid", GAME_RESOURCEFILE, 29, NULL}, + { "tychom.mid", GAME_RESOURCEFILE, 30, NULL}, + { "kitten.mid", GAME_RESOURCEFILE, 31, NULL}, + { "sweet.mid", GAME_RESOURCEFILE, 32, NULL}, + { "brutalmt.mid", GAME_RESOURCEFILE, 33, NULL}, + { "shiala.mid", GAME_RESOURCEFILE, 34, NULL}, + + { "wyrm.pak", GAME_RESOURCEFILE, 1529, NULL}, + { "wyrm1.dlt", GAME_RESOURCEFILE, 1530, NULL}, + { "wyrm2.dlt", GAME_RESOURCEFILE, 1531, NULL}, + { "wyrm3.dlt", GAME_RESOURCEFILE, 1532, NULL}, + { "wyrm4.dlt", GAME_RESOURCEFILE, 1533, NULL}, + { "credit3n.dlt", GAME_RESOURCEFILE, 1796, NULL}, // PC + { "credit3m.dlt", GAME_RESOURCEFILE, 1796, NULL}, // Macintosh + { "credit4n.dlt", GAME_RESOURCEFILE, 1797, NULL}, // PC + { "credit4m.dlt", GAME_RESOURCEFILE, 1797, NULL}, // Macintosh + { "p2_a.voc", GAME_VOICEFILE, 4, NULL}, + { "p2_a.iaf", GAME_VOICEFILE, 4, &ITEPC_GameSound} }; -static const GameSoundInfo IHNM_GameSound = { - kSoundWAV, - -1, - -1, - false, - false, - true +static const GamePatchDescription ITEMacPatch_Files[] = { + { "wyrm.pak", GAME_RESOURCEFILE, 1529, NULL}, + { "wyrm1.dlt", GAME_RESOURCEFILE, 1530, NULL}, + { "wyrm2.dlt", GAME_RESOURCEFILE, 1531, NULL}, + { "wyrm3.dlt", GAME_RESOURCEFILE, 1532, NULL}, + { "wyrm4.dlt", GAME_RESOURCEFILE, 1533, NULL}, + { "credit3m.dlt", GAME_RESOURCEFILE, 1796, NULL}, + { "credit4m.dlt", GAME_RESOURCEFILE, 1797, NULL}, + { "p2_a.iaf", GAME_VOICEFILE, 4, &ITEMAC_GameSound} }; static const SAGAGameDescription gameDescriptions[] = { @@ -333,7 +199,6 @@ static const SAGAGameDescription gameDescriptions[] = { ITEDEMO_GameFonts, &ITEDISK_GameSound, &ITEDISK_GameSound, - &ITEMACCD_GameMusic, // note: this version did not originally have digital music 0, NULL, }, @@ -363,18 +228,15 @@ static const SAGAGameDescription gameDescriptions[] = { &ITE_Resources, ARRAYSIZE(ITEWINDEMO_GameFonts), ITEWINDEMO_GameFonts, - &ITEMACDEMO_GameVoice, - &ITEMACDEMO_GameSound, - &ITEMACDEMO_GameMusic, + &ITEDEMO_GameVoice, + &ITEMAC_GameSound, ARRAYSIZE(ITEMacPatch_Files), ITEMacPatch_Files, }, - // Note: This version is NOT supported yet - // Exiting the faire leads to a crash - // Inherit the earth - MAC Demo version 1 + // Non-interactive demo { { "ite", @@ -393,14 +255,13 @@ static const SAGAGameDescription gameDescriptions[] = { }, GType_ITE, GID_ITE_MACDEMO1, - GF_BIG_ENDIAN_DATA | GF_WYRMKEEP | GF_CD_FX, + GF_BIG_ENDIAN_DATA | GF_WYRMKEEP | GF_CD_FX | GF_NON_INTERACTIVE, ITE_DEFAULT_SCENE, &ITE_Resources, ARRAYSIZE(ITEWINDEMO_GameFonts), ITEWINDEMO_GameFonts, - &ITEMACDEMO_GameVoice, - &ITEMACDEMO_GameSound, - &ITEMACCD_GameMusic, + &ITEDEMO_GameVoice, + &ITEMAC_GameSound, ARRAYSIZE(ITEMacPatch_Files), ITEMacPatch_Files, }, @@ -431,18 +292,15 @@ static const SAGAGameDescription gameDescriptions[] = { &ITE_Resources, ARRAYSIZE(ITEWINDEMO_GameFonts), ITEWINDEMO_GameFonts, - &ITEWINDEMO2_GameVoice, - &ITEWINDEMO2_GameSound, - &ITEMACCD_GameMusic, + &ITEDEMO_GameVoice, + &ITEPC_GameSound, ARRAYSIZE(ITEPatch_Files), ITEPatch_Files, }, - // Note: This version is NOT supported yet - // Exiting the faire leads to a crash - // Inherit the earth - Win32 Demo version 1 + // Non-interactive demo { { "ite", @@ -460,14 +318,13 @@ static const SAGAGameDescription gameDescriptions[] = { }, GType_ITE, GID_ITE_WINDEMO1, - GF_WYRMKEEP | GF_CD_FX, + GF_WYRMKEEP | GF_CD_FX | GF_NON_INTERACTIVE, ITE_DEFAULT_SCENE, &ITE_Resources, ARRAYSIZE(ITEWINDEMO_GameFonts), ITEWINDEMO_GameFonts, &ITEWINDEMO1_GameSound, &ITEWINDEMO1_GameSound, - &ITEMACCD_GameMusic, // note: this version did not originally have digital music ARRAYSIZE(ITEPatch_Files), ITEPatch_Files, }, @@ -504,7 +361,6 @@ static const SAGAGameDescription gameDescriptions[] = { ITEWINDEMO_GameFonts, &ITEMACCD_G_GameSound, &ITEMACCD_G_GameSound, - &ITEMACCD_GameMusic, // note: this version did not originally have digital music 0, NULL, }, @@ -533,9 +389,8 @@ static const SAGAGameDescription gameDescriptions[] = { &ITE_Resources, ARRAYSIZE(ITEWINDEMO_GameFonts), ITEWINDEMO_GameFonts, - &ITEMACCD_GameSound, - &ITEMACCD_GameSound, - &ITEMACCD_GameMusic, + &ITEMAC_GameSound, + &ITEMAC_GameSound, ARRAYSIZE(ITEMacPatch_Files), ITEMacPatch_Files, }, @@ -570,11 +425,10 @@ static const SAGAGameDescription gameDescriptions[] = { GF_WYRMKEEP | GF_CD_FX, ITE_DEFAULT_SCENE, &ITE_Resources, - ARRAYSIZE(ITECD_GameFonts), - ITECD_GameFonts, - &ITEMACCD_GameSound, - &ITECD_GameSound, - &ITEMACCD_GameMusic, + ARRAYSIZE(ITE_GameFonts), + ITE_GameFonts, + &ITEMAC_GameSound, + &ITEPC_GameSound, 0, NULL, }, @@ -601,11 +455,10 @@ static const SAGAGameDescription gameDescriptions[] = { GF_CD_FX, ITE_DEFAULT_SCENE, &ITE_Resources, - ARRAYSIZE(ITECD_GameFonts), - ITECD_GameFonts, - &ITECD_GameSound, - &ITECD_GameSound, - &ITEMACCD_GameMusic, + ARRAYSIZE(ITE_GameFonts), + ITE_GameFonts, + &ITEPC_GameSound, + &ITEPC_GameSound, ARRAYSIZE(ITEPatch_Files), ITEPatch_Files, }, @@ -631,11 +484,10 @@ static const SAGAGameDescription gameDescriptions[] = { GF_CD_FX, ITE_DEFAULT_SCENE, &ITE_Resources, - ARRAYSIZE(ITECD_GameFonts), - ITECD_GameFonts, - &ITECD_GameSound, - &ITECD_GameSound, - &ITEMACCD_GameMusic, // note: this version did not originally have digital music + ARRAYSIZE(ITE_GameFonts), + ITE_GameFonts, + &ITEPC_GameSound, + &ITEPC_GameSound, ARRAYSIZE(ITEPatch_Files), ITEPatch_Files, }, @@ -662,11 +514,10 @@ static const SAGAGameDescription gameDescriptions[] = { GF_CD_FX, ITE_DEFAULT_SCENE, &ITE_Resources, - ARRAYSIZE(ITECD_GameFonts), - ITECD_GameFonts, - &ITECD_GameSound, - &ITECD_GameSound, - &ITEMACCD_GameMusic, // note: this version did not originally have digital music + ARRAYSIZE(ITE_GameFonts), + ITE_GameFonts, + &ITEPC_GameSound, + &ITEPC_GameSound, 0, NULL, }, @@ -694,11 +545,10 @@ static const SAGAGameDescription gameDescriptions[] = { 0, ITE_DEFAULT_SCENE, &ITE_Resources, - ARRAYSIZE(ITEDISK_GameFonts), - ITEDISK_GameFonts, + ARRAYSIZE(ITE_GameFonts), + ITE_GameFonts, &ITEDISK_GameSound, &ITEDISK_GameSound, - &ITEMACCD_GameMusic, // note: this version did not originally have digital music 0, NULL, }, @@ -723,11 +573,10 @@ static const SAGAGameDescription gameDescriptions[] = { 0, ITE_DEFAULT_SCENE, &ITE_Resources, - ARRAYSIZE(ITEDISK_GameFonts), - ITEDISK_GameFonts, + ARRAYSIZE(ITE_GameFonts), + ITE_GameFonts, &ITEDISK_GameSound, &ITEDISK_GameSound, - &ITEMACCD_GameMusic, // note: this version did not originally have digital music ARRAYSIZE(ITEPatch_Files), ITEPatch_Files, }, @@ -766,7 +615,6 @@ static const SAGAGameDescription gameDescriptions[] = { IHNMDEMO_GameFonts, &IHNM_GameSound, &IHNM_GameSound, - NULL, 0, NULL, }, @@ -805,7 +653,6 @@ static const SAGAGameDescription gameDescriptions[] = { IHNMCD_GameFonts, &IHNM_GameSound, &IHNM_GameSound, - NULL, 0, NULL, }, @@ -845,7 +692,6 @@ static const SAGAGameDescription gameDescriptions[] = { IHNMCD_GameFonts, &IHNM_GameSound, &IHNM_GameSound, - NULL, 0, NULL, }, @@ -884,7 +730,6 @@ static const SAGAGameDescription gameDescriptions[] = { IHNMCD_GameFonts, &IHNM_GameSound, &IHNM_GameSound, - NULL, 0, NULL, }, @@ -923,12 +768,12 @@ static const SAGAGameDescription gameDescriptions[] = { IHNMCD_GameFonts, &IHNM_GameSound, &IHNM_GameSound, - NULL, 0, NULL, }, // I Have No Mouth And I Must Scream - Fr CD version + // Censored CD version (without Nimdok) { { "ihnm", @@ -961,11 +806,10 @@ static const SAGAGameDescription gameDescriptions[] = { IHNMCD_GameFonts, &IHNM_GameSound, &IHNM_GameSound, - NULL, 0, NULL, }, - { AD_TABLE_END_MARKER, 0, 0, 0, 0, NULL, 0, NULL, NULL, NULL, NULL, 0, NULL } + { AD_TABLE_END_MARKER, 0, 0, 0, 0, NULL, 0, NULL, NULL, NULL, 0, NULL } }; } // End of namespace Saga diff --git a/engines/saga/displayinfo.h b/engines/saga/displayinfo.h index 74bbcc4343..d7d51a1e9f 100644 --- a/engines/saga/displayinfo.h +++ b/engines/saga/displayinfo.h @@ -18,8 +18,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL:https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/branches/gsoc2007-fsnode/engines/saga/displayinfo.h $ - * $Id:displayinfo.h 26949 2007-05-26 20:23:24Z david_corrales $ + * $URL$ + * $Id$ * */ @@ -280,7 +280,7 @@ static const GameDisplayInfo ITE_DisplayInfo = { }; -//TODO: ihnm +// IHNM #define IHNM_CONVERSE_MAX_TEXT_WIDTH (485 - 8) #define IHNM_CONVERSE_TEXT_HEIGHT 10 #define IHNM_CONVERSE_TEXT_LINES 11 @@ -330,20 +330,20 @@ static PanelButton IHNM_OptionPanelButtons[] = { {kPanelButtonOptionText,60,61, 0,0, kTextMusic,'-',0, 0,0,0}, // text: music {kPanelButtonOptionText,60,86, 0,0, kTextSound,'-',0, 0,0,0}, // text: noise {kPanelButtonOptionText,56,111, 0,0, kTextVoices,'-',0, 0,0,0}, // text: voices - {kPanelButtonOption, 153,29, 79,23, kTextReadingSpeed,'r',0, 0,0,0}, //read speed - {kPanelButtonOption, 153,54, 79,23, kTextMusic,'m',0, 0,0,0}, //music - {kPanelButtonOption, 153,79, 79,23, kTextSound,'n',0, 0,0,0}, //sound-noise - {kPanelButtonOption, 153,104,79,23, kTextVoices,'v',0, 0,0,0}, //voices - {kPanelButtonOption, 19,149, 200,25, kTextQuitGame,'q',0, 0,0,0}, //quit - {kPanelButtonOption, 19,177, 200,25, kTextContinuePlaying,'c',0, 0,0,0}, //continue + {kPanelButtonOption, 154,30, 79,23, kTextReadingSpeed,'r',0, 0,0,0}, //read speed + {kPanelButtonOption, 154,55, 79,23, kTextMusic,'m',0, 0,0,0}, //music + {kPanelButtonOption, 154,80, 79,23, kTextSound,'n',0, 0,0,0}, //sound-noise + {kPanelButtonOption, 154,105,79,23, kTextVoices,'v',0, 0,0,0}, //voices + {kPanelButtonOption, 20,150, 200,25, kTextQuitGame,'q',0, 0,0,0}, //quit + {kPanelButtonOption, 20,178, 200,25, kTextContinuePlaying,'c',0, 0,0,0}, //continue {kPanelButtonOptionSaveFiles, 244,18, 170,138, 0,'-',0, 0,0,0}, //savefiles - {kPanelButtonOption, 242,162, 79,23, kTextLoad,'l',0, 0,0,0}, //load - {kPanelButtonOption, 333,162, 79,23, kTextSave,'s',0, 0,0,0}, //save + {kPanelButtonOption, 243,163, 79,23, kTextLoad,'l',0, 0,0,0}, //load + {kPanelButtonOption, 334,163, 79,23, kTextSave,'s',0, 0,0,0}, //save }; static PanelButton IHNM_QuitPanelButtons[] = { - {kPanelButtonQuit, 25,79, 80,25, kTextQuit,'q',0, 0,0,0}, - {kPanelButtonQuit, 155,79, 80,25, kTextCancel,'c',0, 0,0,0}, + {kPanelButtonQuit, 26,80, 80,25, kTextQuit,'q',0, 0,0,0}, + {kPanelButtonQuit, 156,80, 80,25, kTextCancel,'c',0, 0,0,0}, {kPanelButtonQuitText, 75,30, 0,0, kTextQuitTheGameQuestion,'-',0, 0,0,0}, }; @@ -354,11 +354,10 @@ static PanelButton IHNM_LoadPanelButtons[] = { }; static PanelButton IHNM_SavePanelButtons[] = { - // TODO {kPanelButtonSave, 25,79, 80,25, kTextSave,'s',0, 0,0,0}, {kPanelButtonSave, 155,79, 80,25, kTextCancel,'c',0, 0,0,0}, - {kPanelButtonSaveEdit, 26,57, 209,17, 0,'-',0, 0,0,0}, - {kPanelButtonSaveText, 75,30, 0,0, kTextEnterSaveGameName,'-',0, 0,0,0}, + {kPanelButtonSaveEdit, 22,56, 216,17, 0,'-',0, 0,0,0}, + {kPanelButtonSaveText, 74,30, 0,0, kTextEnterSaveGameName,'-',0, 0,0,0}, }; diff --git a/engines/saga/events.cpp b/engines/saga/events.cpp index 80e6b58595..50297b7ef0 100644 --- a/engines/saga/events.cpp +++ b/engines/saga/events.cpp @@ -154,10 +154,12 @@ int Events::handleContinuous(Event *event) { case kEventBlackToPal: _vm->_gfx->blackToPal((PalEntry *)event->data, event_pc); break; - case kEventPalToBlack: _vm->_gfx->palToBlack((PalEntry *)event->data, event_pc); break; + case kEventPalFade: + _vm->_gfx->palFade((PalEntry *)event->data, event->param, event->param2, event->param3, event->param4, event_pc); + break; default: break; } @@ -237,10 +239,12 @@ int Events::handleImmediate(Event *event) { case kEventBlackToPal: _vm->_gfx->blackToPal((PalEntry *)event->data, event_pc); break; - case kEventPalToBlack: _vm->_gfx->palToBlack((PalEntry *)event->data, event_pc); break; + case kEventPalFade: + _vm->_gfx->palFade((PalEntry *)event->data, event->param, event->param2, event->param3, event->param4, event_pc); + break; default: break; } @@ -251,6 +255,7 @@ int Events::handleImmediate(Event *event) { case kSceneEvent: case kAnimEvent: case kCutawayEvent: + case kActorEvent: handleOneShot(event); event_done = true; break; @@ -338,11 +343,22 @@ int Events::handleOneShot(Event *event) { if (event->param == kEvPSetPalette) { PalEntry *palPointer; + + if (_vm->getGameType() == GType_IHNM) { + if (_vm->_spiritualBarometer > 255) + _vm->_gfx->setPaletteColor(kIHNMColorPortrait, 0xff, 0xff, 0xff); + else + _vm->_gfx->setPaletteColor(kIHNMColorPortrait, + _vm->_spiritualBarometer * _vm->_interface->_portraitBgColor.red / 256, + _vm->_spiritualBarometer * _vm->_interface->_portraitBgColor.green / 256, + _vm->_spiritualBarometer * _vm->_interface->_portraitBgColor.blue / 256); + } + _vm->_scene->getBGPal(palPointer); _vm->_gfx->setPalette(palPointer); } } - _vm->_actor->showActors(true); + _vm->_render->clearFlag(RF_DISABLE_ACTORS); } break; case kPsychicProfileBgEvent: @@ -374,7 +390,7 @@ int Events::handleOneShot(Event *event) { free(buf); free(resourceData); - // Draw the scene. It won't be drawn by Render::drawScene(), as the RF_PLACARD is set + // Draw the scene. It won't be drawn by Render::drawScene(), as a placard is up _vm->_scene->draw(); } break; @@ -455,6 +471,9 @@ int Events::handleOneShot(Event *event) { case kEventSetFadeMode: _vm->_interface->setFadeMode(event->param); break; + case kEventRestoreMode: + _vm->_interface->restoreMode(); + break; default: break; } @@ -530,6 +549,17 @@ int Events::handleOneShot(Event *event) { case kEventClear: _vm->_anim->clearCutaway(); break; + case kEventShowCutawayBg: + _vm->_anim->showCutawayBg(event->param); + break; + default: + break; + } + case kActorEvent: + switch (event->op) { + case kEventMove: + // TODO (check Actor::direct) + break; default: break; } diff --git a/engines/saga/events.h b/engines/saga/events.h index 2486525751..de4d296eab 100644 --- a/engines/saga/events.h +++ b/engines/saga/events.h @@ -69,21 +69,20 @@ enum EventOps { // BG events kEventDisplay = 1, // ANIM events - // kEventPlay = 1, // reused - // kEventStop = 2, // reused + kEventPlay = 1, // used in music and sound events too + kEventStop = 2, // used in music and sound events too kEventFrame = 3, - kEventSetFlag = 4, - kEventClearFlag = 5, + kEventSetFlag = 4, // used in graphics events too + kEventClearFlag = 5, // used in graphics events too kEventResumeAll = 6, - // MUISC & SOUND events - kEventPlay = 1, - kEventStop = 2, + // MUSIC and SOUND events + // Reused: kEventPlay, kEventStop // SCENE events kEventDraw = 1, kEventEnd = 2, // TEXT events - kEventHide = 2, kEventRemove = 3, + // Reused: kEventHide // PALANIM events kEventCycleStart = 1, kEventCycleStep = 2, @@ -93,6 +92,7 @@ enum EventOps { kEventSetStatus = 3, kEventClearStatus = 4, kEventSetFadeMode = 5, + kEventRestoreMode = 6, // ACTOR events kEventMove = 1, // SCRIPT events @@ -101,23 +101,24 @@ enum EventOps { kEventThreadWake = 3, // CURSOR events kEventShow = 1, - // kEventHide = 2, // reused + kEventHide = 2, // used in text events too kEventSetNormalCursor = 3, kEventSetBusyCursor = 4, // GRAPHICS events kEventFillRect = 1, - // kEventSetFlag = 4, // reused - // kEventClearFlag = 5, // reused - + // Reused: kEventSetFlag, kEventClearFlag // CONTINUOUS events + // // PALETTE events kEventPalToBlack = 1, kEventBlackToPal = 2, + kEventPalFade = 3, // TRANSITION events kEventDissolve = 1, kEventDissolveBGMask = 2, // CUTAWAY events - kEventClear = 1 + kEventClear = 1, + kEventShowCutawayBg = 2 }; enum EventParams { diff --git a/engines/saga/font.cpp b/engines/saga/font.cpp index 71cd6b0eef..06e51a78e4 100644 --- a/engines/saga/font.cpp +++ b/engines/saga/font.cpp @@ -49,6 +49,7 @@ Font::Font(SagaEngine *vm) : _vm(vm), _initialized(false) { } _initialized = true; + _fontMapping = 0; } Font::~Font(void) { @@ -325,14 +326,29 @@ void Font::outFont(const FontStyle &drawFont, Surface *ds, const char *text, siz c_code = *textPointer & 0xFFU; // Translate character - if (!(flags & kFontDontmap)) + if (_fontMapping == 0) { // Check font mapping debug flag + // Default game behavior + + // It seems that this font mapping causes problems with non-english + // versions of IHNM, so it has been changed to apply for ITE only. + // It doesn't make any difference for the English version of IHNM. + // Fixes bug #1796045: "IHNM: Spanish font wrong". + if (!(flags & kFontDontmap) && _vm->getGameType() == GType_ITE) + c_code = _charMap[c_code]; + } else if (_fontMapping == 1) { + // Force font mapping c_code = _charMap[c_code]; + } else { + // In all other cases, ignore font mapping + } assert(c_code < FONT_CHARCOUNT); // Check if character is defined if ((drawFont.fontCharEntry[c_code].index == 0) && (c_code != FONT_FIRSTCHAR)) { #if FONT_SHOWUNDEFINED - if (c_code == FONT_CH_SPACE || c_code == 9) { + // A tab character appears in the IHNM demo instructions screen, so filter + // it out here + if (c_code == FONT_CH_SPACE || c_code == FONT_CH_TAB) { textPoint.x += drawFont.fontCharEntry[c_code].tracking; continue; } @@ -632,8 +648,7 @@ Font::FontId Font::knownFont2FontIdx(KnownFont font) { // The demo version of IHNM has 3 font types (like ITE), not 6 (like the full version of IHNM) if (_vm->getGameType() == GType_ITE || _vm->getGameId() == GID_IHNM_DEMO) { - switch (font) - { + switch (font) { case (kKnownFontSmall): fontId = kSmallFont; break; @@ -655,8 +670,7 @@ Font::FontId Font::knownFont2FontIdx(KnownFont font) { break; } } else if (_vm->getGameType() == GType_IHNM && _vm->getGameId() != GID_IHNM_DEMO) { - switch (font) - { + switch (font) { case (kKnownFontSmall): fontId = kSmallFont; break; diff --git a/engines/saga/font.h b/engines/saga/font.h index 5823513e0f..16fdfc22b9 100644 --- a/engines/saga/font.h +++ b/engines/saga/font.h @@ -39,6 +39,7 @@ namespace Saga { // have a valid offset of '0' #define FONT_FIRSTCHAR 33 +#define FONT_CH_TAB 9 #define FONT_CH_SPACE 32 #define FONT_CH_QMARK 63 @@ -140,8 +141,11 @@ class Font { } void textDrawRect(KnownFont font, Surface *ds, const char *text, const Common::Rect &rect, int color, int effectColor, FontEffectFlags flags) { textDrawRect(knownFont2FontIdx(font), ds, text, rect, color, effectColor, flags); + } + void setFontMapping(int mapping) { + _fontMapping = mapping; } - + private: enum FontId { kSmallFont, @@ -196,6 +200,7 @@ class Font { SagaEngine *_vm; bool _initialized; + int _fontMapping; int _loadedFonts; FontData **_fonts; diff --git a/engines/saga/gfx.cpp b/engines/saga/gfx.cpp index 56ffe04c96..8509da62ed 100644 --- a/engines/saga/gfx.cpp +++ b/engines/saga/gfx.cpp @@ -356,8 +356,6 @@ void Gfx::blackToPal(PalEntry *srcPal, double percent) { // Exponential fade fpercent = percent * percent; - fpercent = 1.0 - fpercent; - // Use the correct percentage change per frame for each palette entry for (i = 0, ppal = _currentPal; i < PAL_ENTRIES; i++, ppal += 4) { if (i < from || i >= from + numcolors) @@ -365,7 +363,7 @@ void Gfx::blackToPal(PalEntry *srcPal, double percent) { else palE = &srcPal[i]; - new_entry = (int)(palE->red - palE->red * fpercent); + new_entry = (int)(palE->red * fpercent); if (new_entry < 0) { ppal[0] = 0; @@ -373,7 +371,7 @@ void Gfx::blackToPal(PalEntry *srcPal, double percent) { ppal[0] = (byte)new_entry; } - new_entry = (int)(palE->green - palE->green * fpercent); + new_entry = (int)(palE->green * fpercent); if (new_entry < 0) { ppal[1] = 0; @@ -381,7 +379,7 @@ void Gfx::blackToPal(PalEntry *srcPal, double percent) { ppal[1] = (byte) new_entry; } - new_entry = (int)(palE->blue - palE->blue * fpercent); + new_entry = (int)(palE->blue * fpercent); if (new_entry < 0) { ppal[2] = 0; @@ -402,7 +400,79 @@ void Gfx::blackToPal(PalEntry *srcPal, double percent) { _system->setPalette(_currentPal, 0, PAL_ENTRIES); } +// Used in IHNM only +void Gfx::palFade(PalEntry *srcPal, int16 from, int16 to, int16 start, int16 numColors, double percent) { + int i; + int new_entry; + byte *ppal; + PalEntry *palE; + double fpercent; + + from = from > 256 ? 256 : from; + from = from < 0 ? 0 : from; + to = to > 256 ? 256 : to; + to = to < 0 ? 0 : to; + + if (from == 0 || to == 0) { + // This case works like palToBlack or blackToPal, so no changes are needed + } else { + double x = from > to ? from / to : to / from; + percent /= x; + if (from < to) + percent += 1 / x; + } + + // Exponential fade + percent = percent > 1.0 ? 1.0 : percent; + fpercent = percent * percent; + + if (from > to) + fpercent = 1.0 - fpercent; + + // Use the correct percentage change per frame for each palette entry + for (i = 0, ppal = _currentPal; i < PAL_ENTRIES; i++, ppal += 4) { + if (i < start || i >= start + numColors) + palE = &_globalPalette[i]; + else + palE = &srcPal[i]; + + new_entry = (int)(palE->red * fpercent); + + if (new_entry < 0) { + ppal[0] = 0; + } else { + ppal[0] = (byte) new_entry; + } + + new_entry = (int)(palE->green * fpercent); + + if (new_entry < 0) { + ppal[1] = 0; + } else { + ppal[1] = (byte) new_entry; + } + + new_entry = (int)(palE->blue * fpercent); + + if (new_entry < 0) { + ppal[2] = 0; + } else { + ppal[2] = (byte) new_entry; + } + ppal[3] = 0; + } + + // Color 0 should always be black in IHNM + memset(&_currentPal[0 * 4], 0, 4); + + _system->setPalette(_currentPal, 0, PAL_ENTRIES); +} + void Gfx::showCursor(bool state) { + // Don't show the mouse cursor in the non-interactive part of the IHNM demo + if (_vm->_scene->isNonInteractiveIHNMDemoPart()) + state = false; + CursorMan.showMouse(state); } diff --git a/engines/saga/gfx.h b/engines/saga/gfx.h index 0fa7aab742..ea1370c79d 100644 --- a/engines/saga/gfx.h +++ b/engines/saga/gfx.h @@ -150,6 +150,7 @@ public: void restorePalette() { setPalette(_savedPalette, true); } void palToBlack(PalEntry *src_pal, double percent); void blackToPal(PalEntry *src_pal, double percent); + void palFade(PalEntry *srcPal, int16 from, int16 to, int16 start, int16 numColors, double percent); void showCursor(bool state); void setCursor(CursorType cursorType = kCursorNormal); diff --git a/engines/saga/ihnm_introproc.cpp b/engines/saga/ihnm_introproc.cpp index 631da37e82..fcf69d1bd1 100644 --- a/engines/saga/ihnm_introproc.cpp +++ b/engines/saga/ihnm_introproc.cpp @@ -31,154 +31,52 @@ #include "saga/animation.h" #include "saga/events.h" #include "saga/interface.h" +#include "saga/render.h" #include "saga/rscfile.h" #include "saga/sndres.h" #include "saga/music.h" #include "saga/scene.h" -namespace Saga { +#include "common/events.h" -SceneResourceData IHNM_IntroMovie1RL[] = { - {30, 2, 0, 0, false}, - {31, 14, 0, 0, false} -}; - -SceneDescription IHNM_IntroMovie1Desc = { - 0, 0, 0, 0, 0, 0, 0, 0, - IHNM_IntroMovie1RL, - ARRAYSIZE(IHNM_IntroMovie1RL) -}; - -SceneResourceData IHNM_IntroMovie2RL[] = { - {32, 2, 0, 0, false}, - {33, 14, 0, 0, false} -}; - -SceneDescription IHNM_IntroMovie2Desc = { - 0, 0, 0, 0, 0, 0, 0, 0, - IHNM_IntroMovie2RL, - ARRAYSIZE(IHNM_IntroMovie2RL) -}; - -SceneResourceData IHNM_IntroMovie3RL[] = { - {34, 2, 0, 0, false}, - {35, 14, 0, 0, false} -}; - -SceneDescription IHNM_IntroMovie3Desc = { - 0, 0, 0, 0, 0, 0, 0, 0, - IHNM_IntroMovie3RL, - ARRAYSIZE(IHNM_IntroMovie3RL) -}; - -SceneResourceData IHNM_IntroMovie4RL[] = { - {1227, 2, 0, 0, false}, - {1226, 14, 0, 0, false} -}; - -SceneDescription IHNM_IntroMovie4Desc = { - 0, 0, 0, 0, 0, 0, 0, 0, - IHNM_IntroMovie4RL, - ARRAYSIZE(IHNM_IntroMovie4RL) -}; - -// Demo -SceneResourceData IHNMDEMO_IntroMovie1RL[] = { - {19, 2, 0, 0, false} // this scene doesn't have an animation -}; - -SceneDescription IHNMDEMO_IntroMovie1Desc = { - 0, 0, 0, 0, 0, 0, 0, 0, - IHNMDEMO_IntroMovie1RL, - ARRAYSIZE(IHNMDEMO_IntroMovie1RL) -}; - -SceneResourceData IHNMDEMO_IntroMovie2RL[] = { - {22, 2, 0, 0, false}, - {23, 14, 0, 0, false} -}; - -SceneDescription IHNMDEMO_IntroMovie2Desc = { - 0, 0, 0, 0, 0, 0, 0, 0, - IHNMDEMO_IntroMovie2RL, - ARRAYSIZE(IHNMDEMO_IntroMovie2RL) -}; - -LoadSceneParams IHNM_IntroList[] = { - {0, kLoadByDescription, &IHNM_IntroMovie1Desc, Scene::SC_IHNMIntroMovieProc1, false, kTransitionNoFade, 0, NO_CHAPTER_CHANGE}, - {0, kLoadByDescription, &IHNM_IntroMovie2Desc, Scene::SC_IHNMIntroMovieProc2, false, kTransitionNoFade, 0, NO_CHAPTER_CHANGE}, - {0, kLoadByDescription, &IHNM_IntroMovie3Desc, Scene::SC_IHNMIntroMovieProc3, false, kTransitionNoFade, 0, NO_CHAPTER_CHANGE}, -}; - -LoadSceneParams IHNMDEMO_IntroList[] = { - {0, kLoadByDescription, &IHNMDEMO_IntroMovie1Desc, Scene::SC_IHNMIntroMovieProc1, false, kTransitionNoFade, 0, NO_CHAPTER_CHANGE}, - {0, kLoadByDescription, &IHNMDEMO_IntroMovie2Desc, Scene::SC_IHNMIntroMovieProc3, false, kTransitionNoFade, 0, NO_CHAPTER_CHANGE}, -}; +namespace Saga { // IHNM cutaway intro resource IDs #define RID_IHNM_INTRO_CUTAWAYS 39 #define RID_IHNMDEMO_INTRO_CUTAWAYS 25 int Scene::IHNMStartProc() { - size_t n_introscenes; - size_t i; - LoadSceneParams firstScene; - /* - // Test code - uses loadCutawayList to load the intro cutaways, like the original + IHNMLoadCutaways(); - ResourceContext *resourceContext; - //ResourceContext *soundContext; - byte *resourcePointer; - size_t resourceLength; - - resourceContext = _vm->_resource->getContext(GAME_RESOURCEFILE); - if (resourceContext == NULL) { - error("Scene::IHNMStartProc() resource context not found"); - } - - if (_vm->getGameId() != GID_IHNM_DEMO) - _vm->_resource->loadResource(resourceContext, RID_IHNM_INTRO_CUTAWAYS, resourcePointer, resourceLength); - else - _vm->_resource->loadResource(resourceContext, RID_IHNMDEMO_INTRO_CUTAWAYS, resourcePointer, resourceLength); - - if (resourceLength == 0) { - error("Scene::IHNMStartProc() Can't load cutaway list"); - } - - // Load the cutaways for the title screens - _vm->_anim->loadCutawayList(resourcePointer, resourceLength); - - // Note that the resource ID needed is the returned ID minus one - printf("%i\n", _vm->_anim->cutawayResourceID(0)); - printf("%i\n", _vm->_anim->cutawayResourceID(1)); - printf("%i\n", _vm->_anim->cutawayResourceID(2)); - */ - - // The original used the "play video" mechanism for the first part of - // the intro. We just use that panel mode. - - _vm->_anim->setCutAwayMode(kPanelVideo); - _vm->_interface->setMode(kPanelVideo); - - if (_vm->getGameId() != GID_IHNM_DEMO) - n_introscenes = ARRAYSIZE(IHNM_IntroList); - else - n_introscenes = ARRAYSIZE(IHNMDEMO_IntroList); - - // Queue the company and title videos if (_vm->getGameId() != GID_IHNM_DEMO) { - for (i = 0; i < n_introscenes; i++) { - _vm->_scene->queueScene(&IHNM_IntroList[i]); + int logoLength = -168; + + if (_vm->getLanguage() == Common::DE_DEU || _vm->getLanguage() == Common::ES_ESP) + logoLength = -128; + + // Play Cyberdreams logo for 168 frames + if (!playTitle(0, logoLength, true)) { + // Play Dreamers Guild logo for 10 seconds + if (!playLoopingTitle(1, 10)) { + // Play the title music + _vm->_music->play(1, MUSIC_NORMAL); + // Play title screen + playTitle(2, 17); + } } } else { - for (i = 0; i < n_introscenes; i++) { - _vm->_scene->queueScene(&IHNMDEMO_IntroList[i]); - } + _vm->_music->play(1, MUSIC_NORMAL); + playTitle(0, 10); + playTitle(2, 12); } + _vm->_music->setVolume(0, 1000); + _vm->_anim->freeCutawayList(); + + // Queue first scene firstScene.loadFlag = kLoadBySceneNumber; firstScene.sceneDescriptor = -1; firstScene.sceneDescription = NULL; @@ -193,241 +91,189 @@ int Scene::IHNMStartProc() { return SUCCESS; } -int Scene::SC_IHNMIntroMovieProc1(int param, void *refCon) { - return ((Scene *)refCon)->IHNMIntroMovieProc1(param); -} +int Scene::IHNMCreditsProc() { + IHNMLoadCutaways(); -int Scene::IHNMIntroMovieProc1(int param) { - Event event; - Event *q_event; - - switch (param) { - case SCENE_BEGIN: - // Background for intro scene is the first frame of the - // intro animation; display it and set the palette - event.type = kEvTOneshot; - event.code = kBgEvent; - event.op = kEventDisplay; - event.param = kEvPSetPalette; - event.time = 0; - - q_event = _vm->_events->queue(&event); - - if (_vm->getGameId() != GID_IHNM_DEMO) { - _vm->_anim->setFrameTime(0, IHNM_INTRO_FRAMETIME); - _vm->_anim->setFlag(0, ANIM_FLAG_ENDSCENE); - - event.type = kEvTOneshot; - event.code = kAnimEvent; - event.op = kEventPlay; - event.param = 0; - event.time = 0; - - q_event = _vm->_events->chain(q_event, &event); - } else { - // Start playing the intro music for the demo version - event.type = kEvTOneshot; - event.code = kMusicEvent; - event.param = 1; - event.param2 = MUSIC_NORMAL; - event.op = kEventPlay; - event.time = 0; - - q_event = _vm->_events->chain(q_event, &event); - - // The IHNM demo doesn't have an animation at the - // Cyberdreans logo screen - - // Queue end of scene after a while - event.type = kEvTOneshot; - event.code = kSceneEvent; - event.op = kEventEnd; - event.time = 8000; - - q_event = _vm->_events->chain(q_event, &event); - } + _vm->_music->play(0, MUSIC_NORMAL); - break; - default: - break; + if (_vm->getGameId() != GID_IHNM_DEMO) { + // Display the credits for 400 frames + playTitle(4, -400, true); + } else { + // Display sales info for 60 seconds + playTitle(3, 60, true); } - return 0; -} + _vm->_music->setVolume(0, 1000); + _vm->_anim->freeCutawayList(); -int Scene::SC_IHNMIntroMovieProc2(int param, void *refCon) { - return ((Scene *)refCon)->IHNMIntroMovieProc2(param); + return SUCCESS; } -int Scene::IHNMIntroMovieProc2(int param) { - Event event; - Event *q_event; - PalEntry *pal; - - static PalEntry current_pal[PAL_ENTRIES]; - - switch (param) { - case SCENE_BEGIN: - // Fade to black out of the intro CyberDreams logo anim - _vm->_gfx->getCurrentPal(current_pal); - - event.type = kEvTContinuous; - event.code = kPalEvent; - event.op = kEventPalToBlack; - event.time = 0; - event.duration = IHNM_PALFADE_TIME; - event.data = current_pal; - - q_event = _vm->_events->queue(&event); - - // Background for intro scene is the first frame of the - // intro animation; display it but don't set palette - event.type = kEvTOneshot; - event.code = kBgEvent; - event.op = kEventDisplay; - event.param = kEvPNoSetPalette; - event.time = 0; - - q_event = _vm->_events->chain(q_event, &event); - - _vm->_anim->setCycles(0, -1); - - // Unlike the original, we keep the logo spinning during the - // palette fades. We don't have to, but I think it looks better - // that way. - - event.type = kEvTOneshot; - event.code = kAnimEvent; - event.op = kEventPlay; - event.param = 0; - event.time = 0; - - q_event = _vm->_events->chain(q_event, &event); - - // Fade in from black to the scene background palette - _vm->_scene->getBGPal(pal); - - event.type = kEvTContinuous; - event.code = kPalEvent; - event.op = kEventBlackToPal; - event.time = 0; - event.duration = IHNM_PALFADE_TIME; - event.data = pal; - - q_event = _vm->_events->chain(q_event, &event); - - // Fade to black after looping animation for a while - event.type = kEvTContinuous; - event.code = kPalEvent; - event.op = kEventPalToBlack; - event.time = IHNM_DGLOGO_TIME; - event.duration = IHNM_PALFADE_TIME; - event.data = pal; - - q_event = _vm->_events->chain(q_event, &event); - - // Queue end of scene - event.type = kEvTOneshot; - event.code = kSceneEvent; - event.op = kEventEnd; - event.time = 0; - - q_event = _vm->_events->chain(q_event, &event); - break; - default: - break; +void Scene::IHNMLoadCutaways() { + ResourceContext *resourceContext; + //ResourceContext *soundContext; + byte *resourcePointer; + size_t resourceLength; + + resourceContext = _vm->_resource->getContext(GAME_RESOURCEFILE); + if (resourceContext == NULL) { + error("Scene::IHNMStartProc() resource context not found"); } - return 0; -} + if (_vm->getGameId() != GID_IHNM_DEMO) + _vm->_resource->loadResource(resourceContext, RID_IHNM_INTRO_CUTAWAYS, resourcePointer, resourceLength); + else + _vm->_resource->loadResource(resourceContext, RID_IHNMDEMO_INTRO_CUTAWAYS, resourcePointer, resourceLength); -int Scene::SC_IHNMIntroMovieProc3(int param, void *refCon) { - return ((Scene *)refCon)->IHNMIntroMovieProc3(param); -} + if (resourceLength == 0) { + error("Scene::IHNMStartProc() Can't load cutaway list"); + } -int Scene::IHNMIntroMovieProc3(int param) { - Event event; - Event *q_event; - PalEntry *pal; - static PalEntry current_pal[PAL_ENTRIES]; + // Load the cutaways for the title screens + _vm->_anim->loadCutawayList(resourcePointer, resourceLength); +} - switch (param) { - case SCENE_BEGIN: - // Fade to black out of the intro DG logo anim - _vm->_gfx->getCurrentPal(current_pal); +bool Scene::checkKey() { + Common::Event event; + bool res = false; + + while (_vm->_eventMan->pollEvent(event)) { + switch (event.type) { + case Common::EVENT_QUIT: + _vm->shutDown(); + // fallthrough + case Common::EVENT_KEYDOWN: + res = true; + break; + default: + break; + } + } - event.type = kEvTContinuous; - event.code = kPalEvent; - event.op = kEventPalToBlack; - event.time = 0; - event.duration = IHNM_PALFADE_TIME; - event.data = current_pal; + return res; +} - q_event = _vm->_events->queue(&event); +bool Scene::playTitle(int title, int time, int mode) { + bool interrupted = false; + Surface *backBufferSurface; + int startTime = _vm->_system->getMillis(); + int frameTime = 0; + int curTime; + int assignedId; + int phase = 0; + bool done = false; + bool playParameter = true; + static PalEntry cur_pal[PAL_ENTRIES]; + static PalEntry pal_cut[PAL_ENTRIES]; + + backBufferSurface = _vm->_render->getBackGroundSurface(); + + // Load the cutaway + + _vm->_anim->setCutAwayMode(mode); + _vm->_frameCount = 0; + + _vm->_gfx->getCurrentPal(cur_pal); + + assignedId = _vm->_anim->playCutaway(title, false); + + _vm->_gfx->getCurrentPal(pal_cut); + + while (!done) { + curTime = _vm->_system->getMillis(); + + switch (phase) { + case 0: // fadeout + case 1: // fadeout 100% + case 7: // fadeout + case 8: // fadeout 100% + _vm->_gfx->palToBlack(cur_pal, (double)(curTime - startTime) / kNormalFadeDuration); + // fall through + + case 3: // fadein + case 4: // fadein 100% + if (phase == 3 || phase == 4) + _vm->_gfx->blackToPal(pal_cut, (double)(curTime - startTime) / kNormalFadeDuration); + + if (curTime - startTime > kNormalFadeDuration) { + phase++; + if (phase == 2 || phase == 5 || phase == 9) + startTime = curTime; + break; + } + break; + + case 2: // display background + _vm->_system->copyRectToScreen((byte *)backBufferSurface->pixels, backBufferSurface->w, 0, 0, + backBufferSurface->w, backBufferSurface->h); + phase++; + startTime = curTime; + break; + + case 5: // playback + if (time < 0) { + if (_vm->_frameCount >= -time) { + phase++; + break; + } + } else { + if (curTime - startTime >= time * 1000) { + phase++; + break; + } + } + + if (checkKey()) { + interrupted = true; + done = true; + break; + } + + if (_vm->_anim->getCycles(assignedId)) { // IHNM demo has 0 frames logo + if (curTime - frameTime > _vm->_anim->getFrameTime(assignedId)) { + _vm->_anim->play(assignedId, 0, playParameter); + + if (playParameter == true) // Do not loop animations + playParameter = false; + + frameTime = curTime; + + _vm->_system->copyRectToScreen((byte *)backBufferSurface->pixels, backBufferSurface->w, 0, 0, + backBufferSurface->w, backBufferSurface->h); + } + + } + break; + + case 6: // playback end + startTime = curTime; + _vm->_gfx->getCurrentPal(cur_pal); + phase++; + break; + + case 9: // end + done = true; + break; + } - // Music, maestro + _vm->_system->updateScreen(); + _vm->_system->delayMillis(10); + } - // In the GM file, this music also appears as tracks 7, 13, 19, - // 25 and 31, but only track 1 sounds right with the FM music. + // Clean up - if (_vm->getGameId() != GID_IHNM_DEMO) { - event.type = kEvTOneshot; - event.code = kMusicEvent; - event.param = 1; - event.param2 = MUSIC_NORMAL; - event.op = kEventPlay; - event.time = 0; + _vm->_anim->endVideo(); - q_event = _vm->_events->chain(q_event, &event); - } + memset((byte *)backBufferSurface->pixels, 0, backBufferSurface->w * backBufferSurface->h); + _vm->_system->copyRectToScreen((byte *)backBufferSurface->pixels, backBufferSurface->w, 0, 0, + backBufferSurface->w, backBufferSurface->h); - // Background for intro scene is the first frame of the intro - // animation; display it but don't set palette - event.type = kEvTOneshot; - event.code = kBgEvent; - event.op = kEventDisplay; - event.param = kEvPNoSetPalette; - event.time = 0; - - q_event = _vm->_events->chain(q_event, &event); - - // Fade in from black to the scene background palette - _vm->_scene->getBGPal(pal); - - event.type = kEvTContinuous; - event.code = kPalEvent; - event.op = kEventBlackToPal; - event.time = 0; - event.duration = IHNM_PALFADE_TIME; - event.data = pal; - - q_event = _vm->_events->chain(q_event, &event); - - event.type = kEvTOneshot; - event.code = kAnimEvent; - event.op = kEventPlay; - event.param = 0; - event.time = 0; - - q_event = _vm->_events->chain(q_event, &event); - - // Queue end of scene after a while - // The delay has been increased so the speech won't start until the music has ended - event.type = kEvTOneshot; - event.code = kSceneEvent; - event.op = kEventEnd; - if (_vm->getGameId() != GID_IHNM_DEMO) - event.time = _vm->_music->hasAdlib() ? IHNM_TITLE_TIME_FM : IHNM_TITLE_TIME_GM; - else - event.time = 12000; - - q_event = _vm->_events->chain(q_event, &event); - break; - default: - break; - } + return interrupted; +} - return 0; +bool Scene::playLoopingTitle(int title, int seconds) { + return playTitle(title, seconds, kPanelCutaway); } } // End of namespace Saga diff --git a/engines/saga/input.cpp b/engines/saga/input.cpp index 358a225efa..5082ec7aca 100644 --- a/engines/saga/input.cpp +++ b/engines/saga/input.cpp @@ -49,7 +49,7 @@ int SagaEngine::processInput() { _console->attach(); } if (_interface->_textInput || _interface->_statusTextInput) { - _interface->processAscii(event.kbd.ascii); + _interface->processAscii(event.kbd); return SUCCESS; } @@ -115,7 +115,7 @@ int SagaEngine::processInput() { _render->toggleFlag(RF_RENDERPAUSE); break; default: - _interface->processAscii(event.kbd.ascii); + _interface->processAscii(event.kbd); break; } break; diff --git a/engines/saga/interface.cpp b/engines/saga/interface.cpp index 8cfd993391..e6854b1c05 100644 --- a/engines/saga/interface.cpp +++ b/engines/saga/interface.cpp @@ -229,6 +229,12 @@ Interface::Interface(SagaEngine *vm) : _vm(vm) { _vm->_sprite->loadList(_vm->getResourceDescription()->mainPanelSpritesResourceId, _mainPanel.sprites); // Option panel sprites _vm->_sprite->loadList(_vm->getResourceDescription()->optionPanelSpritesResourceId, _optionPanel.sprites); + // Save panel sprites + _vm->_sprite->loadList(_vm->getResourceDescription()->warningPanelSpritesResourceId, _savePanel.sprites); + // Load panel sprites + _vm->_sprite->loadList(_vm->getResourceDescription()->warningPanelSpritesResourceId, _loadPanel.sprites); + // Quit panel sprites + _vm->_sprite->loadList(_vm->getResourceDescription()->warningPanelSpritesResourceId, _quitPanel.sprites); if (_vm->getGameType() == GType_ITE) { _vm->_sprite->loadList(_vm->getResourceDescription()->defaultPortraitsResourceId, _defPortraits); @@ -342,18 +348,10 @@ int Interface::activate() { } else if (_panelMode == kPanelNull && _vm->getGameId() == GID_IHNM_DEMO) { _saveReminderState = 1; } + _vm->_gfx->showCursor(true); draw(); } - if (_vm->getGameId() != GID_IHNM_DEMO) { - _vm->_gfx->showCursor(true); - } else { - if (_vm->_scene->currentSceneNumber() >= 144 && _vm->_scene->currentSceneNumber() <= 149) { - // Don't show the mouse cursor in the non-interactive part of the IHNM demo - } else { - _vm->_gfx->showCursor(true); - } - } return SUCCESS; } @@ -369,7 +367,7 @@ int Interface::deactivate() { } void Interface::rememberMode() { - debug(1, "rememberMode(%d)", _savedMode); + debug(1, "rememberMode(%d)", _panelMode); _savedMode = _panelMode; } @@ -400,9 +398,6 @@ void Interface::setMode(int mode) { if (_vm->getGameId() == GID_IHNM_DEMO) { _inMainMode = true; _saveReminderState = 1; - if ((_vm->_scene->currentSceneNumber() >= 144 && _vm->_scene->currentSceneNumber() <= 149) || - _vm->_scene->currentSceneNumber() == 0 || _vm->_scene->currentSceneNumber() == -1) - _vm->_gfx->showCursor(false); } } else if (mode == kPanelOption) { // Show the cursor in the IHNM demo @@ -420,8 +415,8 @@ void Interface::setMode(int mode) { switch (_panelMode) { case kPanelMain: - if (_vm->getGameType() == GType_IHNM) - warning("FIXME: Implement IHNM differences from ExecuteInventoryPanel"); + // FIXME: Implement IHNM differences from ExecuteInventoryPanel for IHNM (though I believe they're already + // implemented) _mainPanel.currentButton = NULL; break; @@ -481,22 +476,22 @@ void Interface::setMode(int mode) { draw(); } -bool Interface::processAscii(uint16 ascii) { +bool Interface::processAscii(Common::KeyState keystate) { // TODO: Checking for Esc and Enter below is a bit hackish, and // and probably only works with the English version. Maybe we should // add a flag to the button so it can indicate if it's the default or // cancel button? - + uint16 ascii = keystate.ascii; int i; PanelButton *panelButton; if (_statusTextInput) { - processStatusTextInput(ascii); + processStatusTextInput(keystate); return true; } switch (_panelMode) { case kPanelNull: - if (ascii == 27) { // Esc + if (keystate.keycode == Common::KEYCODE_ESCAPE) { if (_vm->_scene->isInIntro()) { _vm->_scene->skipScene(); } else { @@ -506,26 +501,22 @@ bool Interface::processAscii(uint16 ascii) { return true; } - if (_vm->getGameId() == GID_IHNM_DEMO) { - if (_vm->_scene->currentSceneNumber() >= 144 && _vm->_scene->currentSceneNumber() <= 149) - _vm->_scene->showIHNMDemoSpecialScreen(); - } + if (_vm->_scene->isNonInteractiveIHNMDemoPart()) + _vm->_scene->showIHNMDemoSpecialScreen(); break; case kPanelCutaway: - if (ascii == 27) { // Esc + if (keystate.keycode == Common::KEYCODE_ESCAPE) { if (!_disableAbortSpeeches) _vm->_actor->abortAllSpeeches(); _vm->_scene->cutawaySkip(); return true; } - if (_vm->getGameId() == GID_IHNM_DEMO) { - if (_vm->_scene->currentSceneNumber() >= 144 && _vm->_scene->currentSceneNumber() <= 149) - _vm->_scene->showIHNMDemoSpecialScreen(); - } + if (_vm->_scene->isNonInteractiveIHNMDemoPart()) + _vm->_scene->showIHNMDemoSpecialScreen(); break; case kPanelVideo: - if (ascii == 27) { // Esc + if (keystate.keycode == Common::KEYCODE_ESCAPE) { if (_vm->_scene->isInIntro()) { _vm->_scene->skipScene(); } else { @@ -536,14 +527,12 @@ bool Interface::processAscii(uint16 ascii) { return true; } - if (_vm->getGameId() == GID_IHNM_DEMO) { - if (_vm->_scene->currentSceneNumber() >= 144 && _vm->_scene->currentSceneNumber() <= 149) - _vm->_scene->showIHNMDemoSpecialScreen(); - } + if (_vm->_scene->isNonInteractiveIHNMDemoPart()) + _vm->_scene->showIHNMDemoSpecialScreen(); break; case kPanelOption: // TODO: check input dialog keys - if (ascii == 27 || ascii == 13) { // Esc or Enter + if (keystate.keycode == Common::KEYCODE_ESCAPE || keystate.keycode == Common::KEYCODE_RETURN) { // Esc or Enter ascii = 'c'; //continue } @@ -558,13 +547,13 @@ bool Interface::processAscii(uint16 ascii) { } break; case kPanelSave: - if (_textInput && processTextInput(ascii)) { + if (_textInput && processTextInput(keystate)) { return true; } - if (ascii == 27) { // Esc + if (keystate.keycode == Common::KEYCODE_ESCAPE) { ascii = 'c'; // cancel - } else if (ascii == 13) { // Enter + } else if (keystate.keycode == Common::KEYCODE_RETURN) { // Enter ascii = 's'; // save } @@ -579,9 +568,9 @@ bool Interface::processAscii(uint16 ascii) { } break; case kPanelQuit: - if (ascii == 27) { // Esc + if (keystate.keycode == Common::KEYCODE_ESCAPE) { ascii = 'c'; // cancel - } else if (ascii == 13) { // Enter + } else if (keystate.keycode == Common::KEYCODE_RETURN) { // Enter ascii = 'q'; // quit } @@ -619,8 +608,7 @@ bool Interface::processAscii(uint16 ascii) { return true; } } - if (ascii == 15) // ctrl-o - { + if (keystate.keycode == Common::KEYCODE_o && keystate.flags == Common::KBD_CTRL) { // ctrl-o if (_saveReminderState > 0) { setMode(kPanelOption); return true; @@ -663,7 +651,7 @@ bool Interface::processAscii(uint16 ascii) { mapPanelClean(); break; case kPanelSceneSubstitute: - if (ascii == 13) { + if (keystate.keycode == Common::KEYCODE_RETURN) { _vm->_render->clearFlag(RF_DEMO_SUBST); _vm->_gfx->setPalette(_mapSavedPal); setMode(kPanelMain); @@ -678,11 +666,11 @@ bool Interface::processAscii(uint16 ascii) { break; case kPanelProtect: if (_vm->getGameType() == GType_ITE) { - if (_textInput && processTextInput(ascii)) { + if (_textInput && processTextInput(keystate)) { return true; } - if (ascii == 27 || ascii == 13) { // Esc or Enter + if (keystate.keycode == Common::KEYCODE_ESCAPE || keystate.keycode == Common::KEYCODE_RETURN) { _vm->_script->wakeUpThreads(kWaitTypeRequest); _vm->_interface->setMode(kPanelMain); @@ -725,7 +713,7 @@ void Interface::setStatusText(const char *text, int statusColor) { assert(text != NULL); assert(strlen(text) < STATUS_TEXT_LEN); - if (_vm->_render->getFlags() & (RF_PLACARD | RF_MAP)) + if (_vm->_render->getFlags() & RF_MAP || _vm->_interface->getMode() == kPanelPlacard) return; strncpy(_statusText, text, STATUS_TEXT_LEN); @@ -801,16 +789,6 @@ void Interface::draw() { converseDisplayTextLines(backBuffer); } - if (_vm->getGameType() == GType_IHNM) { - if (_vm->_spiritualBarometer > 255) - _vm->_gfx->setPaletteColor(kIHNMColorPortrait, 0xff, 0xff, 0xff); - else - _vm->_gfx->setPaletteColor(kIHNMColorPortrait, - _vm->_spiritualBarometer * _portraitBgColor.red / 256, - _vm->_spiritualBarometer * _portraitBgColor.green / 256, - _vm->_spiritualBarometer * _portraitBgColor.blue / 256); - } - if (_panelMode == kPanelMain || _panelMode == kPanelConverse || _lockedMode == kPanelMain || _lockedMode == kPanelConverse || (_panelMode == kPanelNull && _vm->getGameId() == GID_IHNM_DEMO)) { @@ -841,14 +819,19 @@ void Interface::calcOptionSaveSlider() { int totalFiles = _vm->getSaveFilesCount(); int visibleFiles = _vm->getDisplayInfo().optionSaveFileVisible; int height = _optionSaveFileSlider->height; - int sliderHeight; + int sliderHeight = 13; // IHNM's save file list slider has a fixed height int pos; if (totalFiles < visibleFiles) { totalFiles = visibleFiles; } - sliderHeight = visibleFiles * height / totalFiles; + if (_vm->getGameType() == GType_ITE) { + // ITE's save file list slider has a dynamically computed height, depending on + // the number of save games + sliderHeight = visibleFiles * height / totalFiles; + } + if (sliderHeight < 7) { sliderHeight = 7; } @@ -931,6 +914,7 @@ void Interface::drawOption() { PanelButton *panelButton; Point textPoint; Point point; + Point sliderPoint; int spritenum = 0; backBuffer = _vm->_gfx->getBackBuffer(); @@ -959,7 +943,15 @@ void Interface::drawOption() { backBuffer->drawRect(_optionSaveRectTop, kITEColorDarkGrey); } - drawButtonBox(backBuffer, _optionSaveRectSlider, kSlider, _optionSaveFileSlider->state > 0); + if (_vm->getGameType() == GType_ITE) { + drawButtonBox(backBuffer, _optionSaveRectSlider, kSlider, _optionSaveFileSlider->state > 0); + } else { + panelButton = &_optionPanel.buttons[0]; + sliderPoint.x = _optionPanel.x + panelButton->xOffset; + sliderPoint.y = _optionSaveRectSlider.top; + _vm->_sprite->draw(backBuffer, _vm->getDisplayClip(), _optionPanel.sprites, 0 + _optionSaveFileSlider->state, sliderPoint, 256); + + } if (_optionSaveRectBottom.height() > 0) { backBuffer->drawRect(_optionSaveRectBottom, kITEColorDarkGrey); @@ -970,7 +962,10 @@ void Interface::drawOption() { rect2 = rect; fontHeight = _vm->_font->getHeight(kKnownFontSmall); for (j = 0; j < _vm->getDisplayInfo().optionSaveFileVisible; j++) { - bgColor = kITEColorDarkGrey0C; + if (_vm->getGameType() == GType_ITE) + bgColor = kITEColorDarkGrey0C; + else + bgColor = kIHNMColorBlack; fgColor = kITEColorBrightWhite; idx = j + _optionSaveFileTop; @@ -1052,7 +1047,10 @@ void Interface::setQuit(PanelButton *panelButton) { setMode(kPanelOption); break; case kTextQuit: - _vm->shutDown(); + if (_vm->getGameId() == GID_IHNM_DEMO) + _vm->_scene->creditsScene(); // display sales info for IHNM demo + else + _vm->shutDown(); break; } } @@ -1118,20 +1116,20 @@ void Interface::setLoad(PanelButton *panelButton) { } } -void Interface::processStatusTextInput(uint16 ascii) { +void Interface::processStatusTextInput(Common::KeyState keystate) { - switch (ascii) { - case 27: // esc + switch (keystate.keycode) { + case Common::KEYCODE_ESCAPE: _statusTextInputState = kStatusTextInputAborted; _statusTextInput = false; _vm->_script->wakeUpThreads(kWaitTypeStatusTextInput); break; - case 13: // return + case Common::KEYCODE_RETURN: _statusTextInputState = kStatusTextInputEntered; _statusTextInput = false; _vm->_script->wakeUpThreads(kWaitTypeStatusTextInput); break; - case 8: // backspace + case Common::KEYCODE_BACKSPACE: if (_statusTextInputPos == 0) { break; } @@ -1141,36 +1139,36 @@ void Interface::processStatusTextInput(uint16 ascii) { if (_statusTextInputPos >= STATUS_TEXT_INPUT_MAX) { break; } - if (((ascii >= 'a') && (ascii <='z')) || - ((ascii >= '0') && (ascii <='9')) || - ((ascii >= 'A') && (ascii <='Z')) || - (ascii == ' ')) { - _statusTextInputString[_statusTextInputPos++] = ascii; + if (isalnum(keystate.ascii) || (keystate.ascii == ' ')) { + _statusTextInputString[_statusTextInputPos++] = keystate.ascii; _statusTextInputString[_statusTextInputPos] = 0; } } setStatusText(_statusTextInputString); } -bool Interface::processTextInput(uint16 ascii) { +bool Interface::processTextInput(Common::KeyState keystate) { char ch[2]; char tempString[SAVE_TITLE_SIZE]; uint tempWidth; memset(tempString, 0, SAVE_TITLE_SIZE); ch[1] = 0; + // IHNM has a smaller save title size than ITE. We only limit the save title size during text input + // in IHNM, to preserve backwards compatibility with older save games + uint save_title_size = _vm->getGameType() == GType_ITE ? SAVE_TITLE_SIZE : IHNM_SAVE_TITLE_SIZE; - switch (ascii) { - case 13: + switch (keystate.keycode) { + case Common::KEYCODE_RETURN: return false; - case 27: // esc + case Common::KEYCODE_ESCAPE: _textInput = false; break; - case 8: // backspace + case Common::KEYCODE_BACKSPACE: if (_textInputPos <= 1) { break; } _textInputPos--; - case 127: // del + case Common::KEYCODE_DELETE: if (_textInputPos <= _textInputStringLength) { if (_textInputPos != 1) { strncpy(tempString, _textInputString, _textInputPos - 1); @@ -1182,27 +1180,25 @@ bool Interface::processTextInput(uint16 ascii) { _textInputStringLength = strlen(_textInputString); } break; - case 276: // left + case Common::KEYCODE_LEFT: if (_textInputPos > 1) { _textInputPos--; } break; - case 275: // right + case Common::KEYCODE_RIGHT: if (_textInputPos <= _textInputStringLength) { _textInputPos++; } break; default: - if (((ascii >= 'a') && (ascii <='z')) || - ((ascii >= '0') && (ascii <='9')) || - ((ascii >= 'A') && (ascii <='Z')) || - (ascii == ' ')) { - if (_textInputStringLength < SAVE_TITLE_SIZE - 1) { - ch[0] = ascii; + if (isalnum(keystate.ascii) || (keystate.ascii == ' ') || + (keystate.ascii == '-') || (keystate.ascii == '_')) { + if (_textInputStringLength < save_title_size - 1) { + ch[0] = keystate.ascii; tempWidth = _vm->_font->getStringWidth(kKnownFontSmall, ch, 0, kFontNormal); tempWidth += _vm->_font->getStringWidth(kKnownFontSmall, _textInputString, 0, kFontNormal); if (tempWidth > _textInputMaxWidth) { - break; + break; } if (_textInputPos != 1) { strncpy(tempString, _textInputString, _textInputPos - 1); @@ -1243,10 +1239,10 @@ void Interface::drawTextInput(Surface *ds, InterfacePanel *panel, PanelButton *p while ((ch[0] = _textInputString[i++]) != 0) { rect.setWidth(_vm->_font->getStringWidth(kKnownFontSmall, ch, 0, kFontNormal)); if ((i == _textInputPos) && _textInput) { - fgColor = kITEColorBlack; - ds->fillRect(rect, kITEColorWhite); + fgColor = _vm->KnownColor2ColorId(kKnownColorBlack); + ds->fillRect(rect, _vm->KnownColor2ColorId(kKnownColorWhite)); } else { - fgColor = kITEColorWhite; + fgColor = _vm->KnownColor2ColorId(kKnownColorWhite); } textPoint.x = rect.left; textPoint.y = rect.top + 1; @@ -1257,7 +1253,7 @@ void Interface::drawTextInput(Surface *ds, InterfacePanel *panel, PanelButton *p if (_textInput && (_textInputPos >= i)) { ch[0] = ' '; rect.setWidth(_vm->_font->getStringWidth(kKnownFontSmall, ch, 0, kFontNormal)); - ds->fillRect(rect, kITEColorWhite); + ds->fillRect(rect, _vm->KnownColor2ColorId(kKnownColorWhite)); } } @@ -1468,11 +1464,22 @@ void Interface::handleOptionClick(const Point& mousePoint) { void Interface::handleChapterSelectionUpdate(const Point& mousePoint) { uint16 objectId; + int hitZoneIndex; + const HitZone * hitZone; // FIXME: Original handled more object types here. objectId = _vm->_actor->hitTest(mousePoint, true); + if (objectId == ID_NOTHING) { + hitZoneIndex = _vm->_scene->_objectMap->hitTest(mousePoint); + + if ((hitZoneIndex != -1)) { + hitZone = _vm->_scene->_objectMap->getHitZone(hitZoneIndex); + objectId = hitZone->getHitZoneId(); + } + } + if (objectId != _vm->_script->_pointerObject) { _vm->_script->_pointerObject = objectId; } @@ -1492,12 +1499,12 @@ void Interface::handleChapterSelectionClick(const Point& mousePoint) { switch (objectTypeId(obj)) { case kGameObjectHitZone: - hitZone = _vm->_scene->_actionMap->getHitZone(objectIdToIndex(obj)); + hitZone = _vm->_scene->_objectMap->getHitZone(objectIdToIndex(obj)); if (hitZone == NULL) return; - if (hitZone->getFlags() & kHitZoneExit) + if (hitZone->getFlags() & kHitZoneEnabled) script = hitZone->getScriptNumber(); break; @@ -1523,7 +1530,6 @@ void Interface::handleChapterSelectionClick(const Point& mousePoint) { event.param4 = obj; // Object event.param5 = 0; // With Object event.param6 = obj; // Actor - _vm->_events->queue(&event); } } @@ -1540,11 +1546,8 @@ void Interface::setOption(PanelButton *panelButton) { } else { if (_vm->_scene->currentChapterNumber() == 8) { setMode(kPanelChapterSelection); - } else if (_vm->getGameId() == GID_IHNM_DEMO) { - if (_vm->_scene->currentSceneNumber() >= 144 && _vm->_scene->currentSceneNumber() <= 149) - setMode(kPanelNull); - else - setMode(kPanelMain); + } else if (_vm->_scene->isNonInteractiveIHNMDemoPart()) { + setMode(kPanelNull); } else { setMode(kPanelMain); } @@ -1564,11 +1567,9 @@ void Interface::setOption(PanelButton *panelButton) { } break; case kTextSave: - // Disallow saving in the non-interactive part of the IHNM demo - if (_vm->getGameId() == GID_IHNM_DEMO) { - if (_vm->_scene->currentSceneNumber() >= 144 && _vm->_scene->currentSceneNumber() <= 149) - return; - } + // Disallow saving in the non-interactive part of the IHNM demo (original demo didn't support saving at all) + if (_vm->_scene->isNonInteractiveIHNMDemoPart()) + return; if (!_vm->isSaveListFull() && (_optionSaveFileTitleNumber == 0)) { _textInputString[0] = 0; @@ -1787,10 +1788,8 @@ void Interface::update(const Point& mousePoint, int updateFlag) { break; case kPanelNull: - if (_vm->getGameId() == GID_IHNM_DEMO && (updateFlag & UPDATE_MOUSECLICK)) { - if (_vm->_scene->currentSceneNumber() >= 144 && _vm->_scene->currentSceneNumber() <= 149) - _vm->_scene->showIHNMDemoSpecialScreen(); - } + if (_vm->_scene->isNonInteractiveIHNMDemoPart() && (updateFlag & UPDATE_MOUSECLICK)) + _vm->_scene->showIHNMDemoSpecialScreen(); break; } @@ -1808,6 +1807,10 @@ void Interface::drawStatusBar() { if (_vm->getGameType() == GType_IHNM && _vm->_scene->currentChapterNumber() == 8) return; + // Don't draw the status bar while fading out + if (_fadeMode == kFadeOut) + return; + backBuffer = _vm->_gfx->getBackBuffer(); // Erase background of status bar @@ -1921,7 +1924,6 @@ void Interface::handleMainUpdate(const Point& mousePoint) { if ((panelButton != NULL) && (panelButton->type == kPanelButtonArrow)) { if (panelButton->state == 1) { - //TODO: insert timeout catchup inventoryChangePos(panelButton->id); } changed = true; @@ -1938,11 +1940,14 @@ void Interface::handleMainUpdate(const Point& mousePoint) { //inventory stuff void Interface::inventoryChangePos(int chg) { - if ((chg < 0 && _inventoryStart + chg >= 0) || - (chg > 0 && _inventoryStart < _inventoryEnd)) { - _inventoryStart += chg; - draw(); + // Arrows will scroll the inventory up or down up to 4 items + for (int i = 1; i <= 4; i++) { + if ((chg < 0 && _inventoryStart + chg >= 0) || + (chg > 0 && _inventoryStart < _inventoryEnd)) { + _inventoryStart += chg; } + } + draw(); } void Interface::inventorySetPos(int key) { @@ -2087,18 +2092,19 @@ void Interface::drawButtonBox(Surface *ds, const Rect& rect, ButtonKind kind, bo solidColor = down ? kITEColorLightBlue94 : kITEColorLightBlue96; break; case kEdit: - cornerColor = kITEColorLightBlue96; - frameColor = kITEColorLightBlue96; - fillColor = kITEColorLightBlue96; - our = kITEColorDarkBlue8a; - odl = kITEColorLightBlue94; - iur = 0x97; - idl = 0x95; - if (down) { - solidColor = kITEColorBlue; + if (_vm->getGameType() == GType_ITE) { + cornerColor = frameColor = fillColor = kITEColorLightBlue96; + our = kITEColorDarkBlue8a; + odl = kITEColorLightBlue94; + solidColor = down ? kITEColorBlue : kITEColorDarkGrey0C; } else { - solidColor = kITEColorDarkGrey0C; + cornerColor = frameColor = fillColor = kIHNMColorBlack; + our = kIHNMColorBlack; + odl = kIHNMColorBlack; + solidColor = kIHNMColorBlack; } + iur = 0x97; + idl = 0x95; break; default: cornerColor = 0x8b; @@ -2248,21 +2254,25 @@ void Interface::drawPanelButtonText(Surface *ds, InterfacePanel *panel, PanelBut litButton = panelButton->state > 0; if (panel == &_optionPanel) { - texturePoint.x = _optionPanel.x + panelButton->xOffset; - texturePoint.y = _optionPanel.y + panelButton->yOffset; + texturePoint.x = _optionPanel.x + panelButton->xOffset - 1; + texturePoint.y = _optionPanel.y + panelButton->yOffset - 1; _vm->_sprite->draw(ds, _vm->getDisplayClip(), _optionPanel.sprites, spritenum + 2 + litButton, texturePoint, 256); } else if (panel == &_quitPanel) { - texturePoint.x = _quitPanel.x + panelButton->xOffset; - texturePoint.y = _quitPanel.y + panelButton->yOffset; - _vm->_sprite->draw(ds, _vm->getDisplayClip(), _optionPanel.sprites, 14 + litButton, texturePoint, 256); + texturePoint.x = _quitPanel.x + panelButton->xOffset - 3; + texturePoint.y = _quitPanel.y + panelButton->yOffset - 3; + _vm->_sprite->draw(ds, _vm->getDisplayClip(), _quitPanel.sprites, litButton, texturePoint, 256); } else if (panel == &_savePanel) { - texturePoint.x = _savePanel.x + panelButton->xOffset; - texturePoint.y = _savePanel.y + panelButton->yOffset; - _vm->_sprite->draw(ds, _vm->getDisplayClip(), _optionPanel.sprites, 14 + litButton, texturePoint, 256); + texturePoint.x = _savePanel.x + panelButton->xOffset - 3; + texturePoint.y = _savePanel.y + panelButton->yOffset - 3; + _vm->_sprite->draw(ds, _vm->getDisplayClip(), _savePanel.sprites, litButton, texturePoint, 256); + // Input text box sprite + texturePoint.x = _savePanel.x + _saveEdit->xOffset - 2; + texturePoint.y = _savePanel.y + _saveEdit->yOffset - 2; + _vm->_sprite->draw(ds, _vm->getDisplayClip(), _savePanel.sprites, 2, texturePoint, 256); } else if (panel == &_loadPanel) { - texturePoint.x = _loadPanel.x + panelButton->xOffset; - texturePoint.y = _loadPanel.y + panelButton->yOffset; - _vm->_sprite->draw(ds, _vm->getDisplayClip(), _optionPanel.sprites, 14 + litButton, texturePoint, 256); + texturePoint.x = _loadPanel.x + panelButton->xOffset - 3; + texturePoint.y = _loadPanel.y + panelButton->yOffset - 3; + _vm->_sprite->draw(ds, _vm->getDisplayClip(), _loadPanel.sprites, litButton, texturePoint, 256); } else { // revert to default behavior drawButtonBox(ds, rect, kButton, panelButton->state > 0); @@ -2523,11 +2533,14 @@ void Interface::converseDisplayTextLines(Surface *ds) { } void Interface::converseChangePos(int chg) { - if ((chg < 0 && _converseStartPos + chg >= 0) || - (chg > 0 && _converseStartPos < _converseEndPos)) { - _converseStartPos += chg; - draw(); + // Arrows will scroll the converse panel or down up to 4 conversation options + for (int i = 1; i <= 4; i++) { + if ((chg < 0 && _converseStartPos + chg >= 0) || + (chg > 0 && _converseStartPos < _converseEndPos)) { + _converseStartPos += chg; + } } + draw(); } void Interface::converseSetPos(int key) { @@ -2580,7 +2593,6 @@ void Interface::handleConverseUpdate(const Point& mousePoint) { if (_conversePanel.currentButton->type == kPanelButtonArrow) { if (_conversePanel.currentButton->state == 1) { - //TODO: insert timeout catchup converseChangePos(_conversePanel.currentButton->id); } draw(); diff --git a/engines/saga/interface.h b/engines/saga/interface.h index 7ae225219a..a8e2d5a647 100644 --- a/engines/saga/interface.h +++ b/engines/saga/interface.h @@ -28,6 +28,7 @@ #ifndef SAGA_INTERFACE_H #define SAGA_INTERFACE_H +#include "common/keyboard.h" #include "common/savefile.h" #include "saga/displayinfo.h" @@ -225,7 +226,7 @@ public: void drawStatusBar(); void setVerbState(int verb, int state); - bool processAscii(uint16 ascii); + bool processAscii(Common::KeyState keystate); void keyBoss(); void keyBossExit(); @@ -341,8 +342,8 @@ private: void drawVerbPanelText(Surface *ds, PanelButton *panelButton, KnownColor textKnownColor, KnownColor textShadowKnownColor); void drawVerbPanel(Surface *backBuffer, PanelButton* panelButton); void calcOptionSaveSlider(); - bool processTextInput(uint16 ascii); - void processStatusTextInput(uint16 ascii); + bool processTextInput(Common::KeyState keystate); + void processStatusTextInput(Common::KeyState keystate); public: void converseInit(void); @@ -379,6 +380,7 @@ private: public: SpriteList _defPortraits; + PalEntry _portraitBgColor; private: SagaEngine *_vm; @@ -416,7 +418,6 @@ private: int _statusOnceColor; int _leftPortrait; int _rightPortrait; - PalEntry _portraitBgColor; Point _lastMousePoint; diff --git a/engines/saga/ite_introproc.cpp b/engines/saga/ite_introproc.cpp index 1664969644..1b74d41cb7 100644 --- a/engines/saga/ite_introproc.cpp +++ b/engines/saga/ite_introproc.cpp @@ -115,7 +115,6 @@ Event *Scene::ITEQueueDialogue(Event *q_event, int n_dialogues, const IntroDialo event.op = kEventDisplay; event.data = entry; event.time = (i == 0) ? 0 : VOICE_PAD; - q_event = _vm->_events->chain(q_event, &event); // Play voice @@ -124,7 +123,6 @@ Event *Scene::ITEQueueDialogue(Event *q_event, int n_dialogues, const IntroDialo event.op = kEventPlay; event.param = dialogue[i].i_voice_rn; event.time = 0; - q_event = _vm->_events->chain(q_event, &event); voice_len = _vm->_sndRes->getVoiceLength(dialogue[i].i_voice_rn); @@ -138,7 +136,6 @@ Event *Scene::ITEQueueDialogue(Event *q_event, int n_dialogues, const IntroDialo event.op = kEventRemove; event.data = entry; event.time = voice_len; - q_event = _vm->_events->chain(q_event, &event); } @@ -265,7 +262,6 @@ Event *Scene::ITEQueueCredits(int delta_time, int duration, int n_credits, const event.op = kEventDisplay; event.data = entry; event.time = delta_time; - q_event = _vm->_events->queue(&event); // Remove text @@ -274,7 +270,6 @@ Event *Scene::ITEQueueCredits(int delta_time, int duration, int n_credits, const event.op = kEventRemove; event.data = entry; event.time = duration; - q_event = _vm->_events->chain(q_event, &event); y += (_vm->_font->getHeight(font) + line_spacing); @@ -301,7 +296,6 @@ int Scene::ITEIntroAnimProc(int param) { event.op = kEventDisplay; event.param = kEvPSetPalette; event.time = 0; - q_event = _vm->_events->queue(&event); debug(3, "Intro animation procedure started."); @@ -340,7 +334,6 @@ int Scene::ITEIntroAnimProc(int param) { event.op = kEventPlay; event.param = 0; event.time = 0; - q_event = _vm->_events->chain(q_event, &event); // Queue intro music playback @@ -350,7 +343,6 @@ int Scene::ITEIntroAnimProc(int param) { event.param2 = MUSIC_LOOP; event.op = kEventPlay; event.time = 0; - q_event = _vm->_events->chain(q_event, &event); } break; @@ -427,7 +419,6 @@ int Scene::ITEIntroCave1Proc(int param) { event.code = kPalAnimEvent; event.op = kEventCycleStart; event.time = 0; - q_event = _vm->_events->queue(&event); // Queue narrator dialogue list @@ -438,8 +429,8 @@ int Scene::ITEIntroCave1Proc(int param) { event.code = kSceneEvent; event.op = kEventEnd; event.time = VOICE_PAD; - q_event = _vm->_events->chain(q_event, &event); + break; case SCENE_END: break; @@ -504,7 +495,6 @@ int Scene::ITEIntroCave2Proc(int param) { event.op = kEventDissolve; event.time = 0; event.duration = DISSOLVE_DURATION; - q_event = _vm->_events->queue(&event); // Begin palette cycling animation for candles @@ -512,7 +502,6 @@ int Scene::ITEIntroCave2Proc(int param) { event.code = kPalAnimEvent; event.op = kEventCycleStart; event.time = 0; - q_event = _vm->_events->chain(q_event, &event); // Queue narrator dialogue list @@ -523,8 +512,8 @@ int Scene::ITEIntroCave2Proc(int param) { event.code = kSceneEvent; event.op = kEventEnd; event.time = VOICE_PAD; - q_event = _vm->_events->chain(q_event, &event); + break; case SCENE_END: break; @@ -588,7 +577,6 @@ int Scene::ITEIntroCave3Proc(int param) { event.op = kEventDissolve; event.time = 0; event.duration = DISSOLVE_DURATION; - q_event = _vm->_events->queue(&event); // Begin palette cycling animation for candles @@ -596,7 +584,6 @@ int Scene::ITEIntroCave3Proc(int param) { event.code = kPalAnimEvent; event.op = kEventCycleStart; event.time = 0; - q_event = _vm->_events->chain(q_event, &event); // Queue narrator dialogue list @@ -607,8 +594,8 @@ int Scene::ITEIntroCave3Proc(int param) { event.code = kSceneEvent; event.op = kEventEnd; event.time = VOICE_PAD; - q_event = _vm->_events->chain(q_event, &event); + break; case SCENE_END: break; @@ -681,7 +668,6 @@ int Scene::ITEIntroCave4Proc(int param) { event.op = kEventDissolve; event.time = 0; event.duration = DISSOLVE_DURATION; - q_event = _vm->_events->queue(&event); // Begin palette cycling animation for candles @@ -689,7 +675,6 @@ int Scene::ITEIntroCave4Proc(int param) { event.code = kPalAnimEvent; event.op = kEventCycleStart; event.time = 0; - q_event = _vm->_events->chain(q_event, &event); // Queue narrator dialogue list @@ -700,8 +685,8 @@ int Scene::ITEIntroCave4Proc(int param) { event.code = kSceneEvent; event.op = kEventEnd; event.time = VOICE_PAD; - q_event = _vm->_events->chain(q_event, &event); + break; case SCENE_END: break; @@ -747,7 +732,6 @@ int Scene::ITEIntroValleyProc(int param) { event.op = kEventPlay; event.param = 0; event.time = 0; - q_event = _vm->_events->queue(&event); // Begin ITE title theme music @@ -759,7 +743,6 @@ int Scene::ITEIntroValleyProc(int param) { event.param2 = MUSIC_NORMAL; event.op = kEventPlay; event.time = 0; - q_event = _vm->_events->chain(q_event, &event); // Pause animation before logo @@ -768,7 +751,6 @@ int Scene::ITEIntroValleyProc(int param) { event.op = kEventStop; event.param = 0; event.time = 3000; - q_event = _vm->_events->chain(q_event, &event); // Display logo @@ -777,7 +759,6 @@ int Scene::ITEIntroValleyProc(int param) { event.op = kEventDissolveBGMask; event.time = 0; event.duration = LOGO_DISSOLVE_DURATION; - q_event = _vm->_events->chain(q_event, &event); // Remove logo @@ -786,7 +767,6 @@ int Scene::ITEIntroValleyProc(int param) { event.op = kEventDissolve; event.time = 3000; event.duration = LOGO_DISSOLVE_DURATION; - q_event = _vm->_events->chain(q_event, &event); // Unpause animation before logo @@ -795,7 +775,6 @@ int Scene::ITEIntroValleyProc(int param) { event.op = kEventPlay; event.time = 0; event.param = 0; - q_event = _vm->_events->chain(q_event, &event); // Queue game credits list @@ -806,8 +785,8 @@ int Scene::ITEIntroValleyProc(int param) { event.code = kSceneEvent; event.op = kEventEnd; event.time = 1000; - q_event = _vm->_events->chain(q_event, &event); + break; case SCENE_END: break; @@ -870,7 +849,6 @@ int Scene::ITEIntroTreeHouseProc(int param) { event.op = kEventDissolve; event.time = 0; event.duration = DISSOLVE_DURATION; - q_event = _vm->_events->queue(&event); if (_vm->_anim->hasAnimation(0)) { @@ -882,7 +860,6 @@ int Scene::ITEIntroTreeHouseProc(int param) { event.op = kEventPlay; event.param = 0; event.time = 0; - q_event = _vm->_events->chain(q_event, &event); } @@ -895,8 +872,8 @@ int Scene::ITEIntroTreeHouseProc(int param) { event.code = kSceneEvent; event.op = kEventEnd; event.time = 1000; - q_event = _vm->_events->chain(q_event, &event); + break; case SCENE_END: break; @@ -950,7 +927,6 @@ int Scene::ITEIntroFairePathProc(int param) { event.op = kEventDissolve; event.time = 0; event.duration = DISSOLVE_DURATION; - q_event = _vm->_events->queue(&event); // Begin title screen background animation @@ -961,7 +937,6 @@ int Scene::ITEIntroFairePathProc(int param) { event.op = kEventPlay; event.param = 0; event.time = 0; - q_event = _vm->_events->chain(q_event, &event); // Queue game credits list @@ -973,8 +948,8 @@ int Scene::ITEIntroFairePathProc(int param) { event.code = kSceneEvent; event.op = kEventEnd; event.time = 1000; - q_event = _vm->_events->chain(q_event, &event); + break; case SCENE_END: break; @@ -1005,7 +980,6 @@ int Scene::ITEIntroFaireTentProc(int param) { event.op = kEventDissolve; event.time = 0; event.duration = DISSOLVE_DURATION; - q_event_start = _vm->_events->queue(&event); // End scene after momentary pause @@ -1014,6 +988,7 @@ int Scene::ITEIntroFaireTentProc(int param) { event.op = kEventEnd; event.time = 5000; q_event = _vm->_events->chain(q_event_start, &event); + break; case SCENE_END: break; diff --git a/engines/saga/itedata.h b/engines/saga/itedata.h index d9bd59adc4..3c594b5fec 100644 --- a/engines/saga/itedata.h +++ b/engines/saga/itedata.h @@ -41,9 +41,6 @@ enum ActorFlags { kNoScale = 0x80 // (1<<7) Actor is not scaled }; -// TODO: This doesn't quite correspond to the original Actor struct, so I'm not -// sure if I got it right. - struct ActorTableData { byte flags; byte nameIndex; diff --git a/engines/saga/module.mk b/engines/saga/module.mk index 6c1812ad23..68cf91be32 100644 --- a/engines/saga/module.mk +++ b/engines/saga/module.mk @@ -2,6 +2,7 @@ MODULE := engines/saga MODULE_OBJS := \ actor.o \ + actor_walk.o \ animation.o \ console.o \ detection.o \ diff --git a/engines/saga/music.cpp b/engines/saga/music.cpp index 04e79c174d..6b233e0256 100644 --- a/engines/saga/music.cpp +++ b/engines/saga/music.cpp @@ -92,7 +92,7 @@ DigitalMusicInputStream::DigitalMusicInputStream(SagaEngine *vm, ResourceContext _compressedStream = NULL; - if (Common::File::exists("music.cmp")) { + if (Common::File::exists("music.cmp") || Common::File::exists("musicd.cmp")) { // Read compressed header to determine compression type _file->seek((long)resourceData->offset, SEEK_SET); _file->read(compressedHeader, 9); @@ -320,6 +320,8 @@ void MusicPlayer::metaEvent(byte type, byte *data, uint16 length) { void MusicPlayer::onTimer(void *refCon) { MusicPlayer *music = (MusicPlayer *)refCon; + Common::StackLock lock(music->_mutex); + if (music->_isPlaying) music->_parser->onTimer(); } @@ -329,6 +331,8 @@ void MusicPlayer::playMusic() { } void MusicPlayer::stopMusic() { + Common::StackLock lock(_mutex); + _isPlaying = false; if (_parser) { _parser->unloadMusic(); @@ -352,6 +356,7 @@ Music::Music(SagaEngine *vm, Audio::Mixer *mixer, MidiDriver *driver, int enable } Music::~Music() { + _vm->_timer->removeTimerProc(&musicVolumeGaugeCallback); _mixer->stopHandle(_musicHandle); delete _player; xmidiParser->setMidiDriver(NULL); @@ -561,7 +566,7 @@ void Music::play(uint32 resourceId, MusicFlags flags) { parser->property(MidiParser::mpCenterPitchWheelOnUnload, 1); _player->_parser = parser; - _player->setVolume(_vm->_musicVolume == 10 ? 255 : _vm->_musicVolume * 25); + setVolume(_vm->_musicVolume == 10 ? 255 : _vm->_musicVolume * 25); if (flags & MUSIC_LOOP) _player->setLoop(true); @@ -574,15 +579,17 @@ void Music::play(uint32 resourceId, MusicFlags flags) { } void Music::pause(void) { - //TODO: do it + _player->setVolume(-1); + _player->setPlaying(false); } void Music::resume(void) { - //TODO: do it} + _player->setVolume(_vm->_musicVolume == 10 ? 255 : _vm->_musicVolume * 25); + _player->setPlaying(true); } void Music::stop(void) { - //TODO: do it + _player->stopMusic(); } } // End of namespace Saga diff --git a/engines/saga/music.h b/engines/saga/music.h index b038a25a11..1fbdda53f2 100644 --- a/engines/saga/music.h +++ b/engines/saga/music.h @@ -34,6 +34,7 @@ #include "sound/mp3.h" #include "sound/vorbis.h" #include "sound/flac.h" +#include "common/mutex.h" namespace Saga { @@ -49,6 +50,7 @@ public: ~MusicPlayer(); bool isPlaying() { return _isPlaying; } + void setPlaying(bool playing) { _isPlaying = playing; } void setVolume(int volume); int getVolume() { return _masterVolume; } @@ -77,6 +79,7 @@ public: MidiChannel *getPercussionChannel() { return 0; } MidiParser *_parser; + Common::Mutex _mutex; protected: diff --git a/engines/saga/palanim.cpp b/engines/saga/palanim.cpp index 19c2fc4d40..f318b815cc 100644 --- a/engines/saga/palanim.cpp +++ b/engines/saga/palanim.cpp @@ -131,7 +131,6 @@ int PalAnim::cycleStart() { event.code = kPalAnimEvent; event.op = kEventCycleStep; event.time = PALANIM_CYCLETIME; - _vm->_events->queue(&event); return SUCCESS; @@ -178,7 +177,6 @@ int PalAnim::cycleStep(int vectortime) { event.code = kPalAnimEvent; event.op = kEventCycleStep; event.time = vectortime + PALANIM_CYCLETIME; - _vm->_events->queue(&event); return SUCCESS; diff --git a/engines/saga/render.cpp b/engines/saga/render.cpp index 930476b4e2..e006b4a627 100644 --- a/engines/saga/render.cpp +++ b/engines/saga/render.cpp @@ -85,11 +85,12 @@ void Render::drawScene() { // Get mouse coordinates mousePoint = _vm->mousePos(); - if (!(_flags & (RF_DEMO_SUBST | RF_PLACARD | RF_MAP))) { - // Display scene background - _vm->_scene->draw(); - + if (!(_flags & (RF_DEMO_SUBST | RF_MAP) || _vm->_interface->getMode() == kPanelPlacard)) { if (_vm->_interface->getFadeMode() != kFadeOut) { + // Display scene background + if (!(_flags & RF_DISABLE_ACTORS)) + _vm->_scene->draw(); + if (_vm->_puzzle->isActive()) { _vm->_puzzle->movePiece(mousePoint); _vm->_actor->drawSpeech(); diff --git a/engines/saga/render.h b/engines/saga/render.h index 4c6e3ee5b1..95abc2e4df 100644 --- a/engines/saga/render.h +++ b/engines/saga/render.h @@ -39,11 +39,10 @@ enum RENDER_FLAGS { RF_OBJECTMAP_TEST = (1 << 3), RF_RENDERPAUSE = (1 << 4), RF_GAMEPAUSE = (1 << 5), - RF_PLACARD = (1 << 6), - RF_ACTOR_PATH_TEST = (1 << 7), - RF_MAP = (1 << 8), - RF_DISABLE_ACTORS = (1 << 9), - RF_DEMO_SUBST = (1 << 10) + RF_ACTOR_PATH_TEST = (1 << 6), + RF_MAP = (1 << 7), + RF_DISABLE_ACTORS = (1 << 8), + RF_DEMO_SUBST = (1 << 9) }; class Render { diff --git a/engines/saga/rscfile.cpp b/engines/saga/rscfile.cpp index 4d3ff1e47c..ba56e838b7 100644 --- a/engines/saga/rscfile.cpp +++ b/engines/saga/rscfile.cpp @@ -330,7 +330,11 @@ bool Resource::loadContext(ResourceContext *context) { if (resourceData->patchData->_patchFile->open(patchDescription->fileName)) { resourceData->offset = 0; resourceData->size = resourceData->patchData->_patchFile->size(); - resourceData->patchData->_patchFile->close(); + // ITE uses several patch files which are loaded and then not needed + // anymore (as they're in memory), so close them here. IHNM uses only + // 1 patch file, which is reused, so don't close it + if (_vm->getGameType() == GType_ITE) + resourceData->patchData->_patchFile->close(); } else { delete resourceData->patchData; resourceData->patchData = NULL; @@ -606,7 +610,11 @@ void Resource::loadResource(ResourceContext *context, uint32 resourceId, byte*&r if (file->read(resourceBuffer, resourceSize) != resourceSize) { error("Resource::loadResource() failed to read"); } - if (resourceData->patchData != NULL) + + // ITE uses several patch files which are loaded and then not needed + // anymore (as they're in memory), so close them here. IHNM uses only + // 1 patch file, which is reused, so don't close it + if (resourceData->patchData != NULL && _vm->getGameType() == GType_ITE) file->close(); } @@ -742,6 +750,12 @@ void Resource::loadGlobalResources(int chapter, int actorsEntrance) { if (_metaResource.songTableID > 0) { _vm->_resource->loadResource(resourceContext, _metaResource.songTableID, resourcePointer, resourceLength); + if (chapter == 6) { + int32 id = READ_LE_UINT32(&resourcePointer[actorsEntrance * 4]); + free(resourcePointer); + _vm->_resource->loadResource(resourceContext, id, resourcePointer, resourceLength); + } + if (resourceLength == 0) { error("Resource::loadGlobalResources Can't load songs list for current track"); } @@ -758,6 +772,7 @@ void Resource::loadGlobalResources(int chapter, int actorsEntrance) { free(resourcePointer); } else { // The IHNM demo has a fixed music track and doesn't load a song table + _vm->_music->setVolume(_vm->_musicVolume == 10 ? -1 : _vm->_musicVolume * 25, 1); _vm->_music->play(3, MUSIC_LOOP); } diff --git a/engines/saga/saga.cpp b/engines/saga/saga.cpp index 76731c201a..01a75f4af1 100644 --- a/engines/saga/saga.cpp +++ b/engines/saga/saga.cpp @@ -259,10 +259,10 @@ int SagaEngine::go() { _scene->changeScene(getStartSceneNumber(), 0, kTransitionNoFade); _events->handleEvents(0); // Process immediate events + _interface->setMode(kPanelMain); char *fileName; fileName = calcSaveFileName(ConfMan.getInt("save_slot")); load(fileName); - _interface->setMode(kPanelMain); } else { _framesEsc = 0; _scene->startScene(); @@ -428,6 +428,9 @@ ColorId SagaEngine::KnownColor2ColorId(KnownColor knownColor) { case (kKnownColorBrightWhite): colorId = kITEColorBrightWhite; break; + case (kKnownColorWhite): + colorId = kITEColorWhite; + break; case (kKnownColorBlack): colorId = kITEColorBlack; break; @@ -449,8 +452,7 @@ ColorId SagaEngine::KnownColor2ColorId(KnownColor knownColor) { error("SagaEngine::KnownColor2ColorId unknown color %i", knownColor); } } else if (getGameType() == GType_IHNM) { - switch (knownColor) - { + switch (knownColor) { case(kKnownColorTransparent): colorId = kITEColorTransBlack; break; @@ -458,6 +460,9 @@ ColorId SagaEngine::KnownColor2ColorId(KnownColor knownColor) { case (kKnownColorBrightWhite): colorId = kITEColorBrightWhite; break; + case (kKnownColorWhite): + colorId = kITEColorBrightWhite; + break; case (kKnownColorBlack): colorId = kIHNMColorBlack; break; diff --git a/engines/saga/saga.h b/engines/saga/saga.h index 43952fe564..8016fb9e65 100644 --- a/engines/saga/saga.h +++ b/engines/saga/saga.h @@ -69,7 +69,12 @@ struct StringList; #define MAXPATH 512 //TODO: remove +// Note that IHNM has a smaller save title size than ITE +// We allocate the ITE save title size in savegames, to +// preserve savegame backwards compatibility. We only check +// for IHNM's save title during text input #define SAVE_TITLE_SIZE 28 +#define IHNM_SAVE_TITLE_SIZE 22 #define MAX_SAVES 96 #define MAX_FILE_NAME 256 @@ -153,7 +158,8 @@ enum GameFeatures { GF_WYRMKEEP = 1 << 1, GF_CD_FX = 1 << 2, GF_SCENE_SUBSTITUTES = 1 << 3, - GF_COMPRESSED_SOUNDS = 1 << 4 + GF_COMPRESSED_SOUNDS = 1 << 4, + GF_NON_INTERACTIVE = 1 << 5 }; enum VerbTypeIds { @@ -297,6 +303,7 @@ struct GameResourceDescription { uint32 conversePanelResourceId; uint32 optionPanelResourceId; uint32 warningPanelResourceId; + uint32 warningPanelSpritesResourceId; uint32 mainSpritesResourceId; uint32 mainPanelSpritesResourceId; uint32 optionPanelSpritesResourceId; @@ -441,6 +448,7 @@ enum ColorId { enum KnownColor { kKnownColorTransparent, kKnownColorBrightWhite, + kKnownColorWhite, kKnownColorBlack, kKnownColorSubtitleTextColor, diff --git a/engines/saga/sagaresnames.h b/engines/saga/sagaresnames.h index 761ac1ab68..b416d85fd8 100644 --- a/engines/saga/sagaresnames.h +++ b/engines/saga/sagaresnames.h @@ -108,6 +108,7 @@ namespace Saga { #define RID_IHNM_OPTION_PANEL 15 #define RID_IHNM_OPTION_PANEL_SPRITES 16 #define RID_IHNM_WARNING_PANEL 17 +#define RID_IHNM_WARNING_PANEL_SPRITES 18 #define RID_IHNM_BOSS_SCREEN 19 #define RID_IHNM_PROFILE_BG 20 #define RID_IHNM_MAIN_STRINGS 21 @@ -122,7 +123,8 @@ namespace Saga { #define RID_IHNMDEMO_OPTION_PANEL 10 #define RID_IHNMDEMO_OPTION_PANEL_SPRITES 11 #define RID_IHNMDEMO_WARNING_PANEL 12 -#define RID_IHNMDEMO_BOSS_SCREEN 13 // Does not exist in the demo +#define RID_IHNMDEMO_WARNING_PANEL_SPRITES 13 +#define RID_IHNMDEMO_BOSS_SCREEN 14 // Does not exist in the demo #define RID_IHNMDEMO_PROFILE_BG 15 #define RID_IHNMDEMO_MAIN_STRINGS 16 diff --git a/engines/saga/saveload.cpp b/engines/saga/saveload.cpp index 77d7816963..6e731de44e 100644 --- a/engines/saga/saveload.cpp +++ b/engines/saga/saveload.cpp @@ -187,6 +187,9 @@ void SagaEngine::save(const char *fileName, const char *saveName) { _saveHeader.type = MKID_BE('SAGA'); _saveHeader.size = 0; _saveHeader.version = CURRENT_SAGA_VER; + // Note that IHNM has a smaller save title size than ITE + // We allocate the ITE save title size here, to preserve + // savegame backwards compatibility strncpy(_saveHeader.name, saveName, SAVE_TITLE_SIZE); out->writeUint32BE(_saveHeader.type); @@ -255,8 +258,8 @@ void SagaEngine::load(const char *fileName) { // Some older saves were not written in an endian safe fashion. // We try to detect this here by checking for extremly high version values. // If found, we retry with the data swapped. - // FIXME: Maybe display a warning/error message instead? if (_saveHeader.version > 0xFFFFFF) { + warning("This savegame is not endian safe, retrying with the data swapped"); _saveHeader.version = SWAP_BYTES_32(_saveHeader.version); } @@ -276,7 +279,6 @@ void SagaEngine::load(const char *fileName) { // Surrounding scene sceneNumber = in->readSint32LE(); - // Protagonist if (getGameType() != GType_ITE) { int currentChapter = _scene->currentChapterNumber(); _scene->setChapterNumber(in->readSint32LE()); @@ -286,10 +288,13 @@ void SagaEngine::load(const char *fileName) { _scene->setCurrentMusicTrack(in->readSint32LE()); _scene->setCurrentMusicRepeat(in->readSint32LE()); _music->stop(); - if (getGameId() != GID_IHNM_DEMO) + if (_scene->currentChapterNumber() == 8) + _interface->setMode(kPanelChapterSelection); + if (getGameId() != GID_IHNM_DEMO) { _music->play(_music->_songTable[_scene->getCurrentMusicTrack()], _scene->getCurrentMusicRepeat() ? MUSIC_LOOP : MUSIC_NORMAL); - else + } else { _music->play(3, MUSIC_LOOP); + } } // Inset scene @@ -323,11 +328,14 @@ void SagaEngine::load(const char *fileName) { if (getGameType() != GType_ITE) { if (_scene->currentProtag() != 0 && _scene->currentChapterNumber() != 6) { ActorData *actor1 = _actor->getFirstActor(); - // Original stores the current protagonist ID from sfSwapActors: - //ActorData *actor2 = _actor->getActor(_scene->currentProtag()); - // However, we already store the protagonist, so merely getting the saved - // protagonist is easier and safer, and works without glitches - ActorData *actor2 = _actor->_protagonist; + ActorData *actor2; + // The original gets actor2 from the current protagonist ID, but this is sometimes wrong + // If the current protagonist ID is not correct, use the stored protagonist + if (!_actor->validActorId(_scene->currentProtag())) { + actor2 = _actor->_protagonist; + } else { + actor2 = _actor->getActor(_scene->currentProtag()); + } SWAP(actor1->_location, actor2->_location); @@ -345,6 +353,7 @@ void SagaEngine::load(const char *fileName) { if (insetSceneNumber != sceneNumber) { _render->setFlag(RF_DISABLE_ACTORS); + _scene->draw(); _render->drawScene(); _render->clearFlag(RF_DISABLE_ACTORS); _scene->changeScene(insetSceneNumber, ACTOR_NO_ENTRANCE, kTransitionNoFade); diff --git a/engines/saga/scene.cpp b/engines/saga/scene.cpp index c49fe546ee..a80b482e47 100644 --- a/engines/saga/scene.cpp +++ b/engines/saga/scene.cpp @@ -205,6 +205,7 @@ Scene::Scene(SagaEngine *vm) : _vm(vm) { _sceneLoaded = false; _sceneNumber = 0; + _chapterNumber = 0; _sceneResourceId = 0; _inGame = false; _loadDescription = false; @@ -281,6 +282,9 @@ void Scene::startScene() { break; } + // Stop the intro music + _vm->_music->stop(); + // Load the head in scene queue queueIterator = _sceneQueue.begin(); if (queueIterator == _sceneQueue.end()) { @@ -292,6 +296,31 @@ void Scene::startScene() { loadScene(sceneQueue); } +void Scene::creditsScene() { + // End the last game ending scene + _vm->_scene->endScene(); + // We're not in the game anymore + _inGame = false; + + // Hide cursor during credits + _vm->_gfx->showCursor(false); + + switch (_vm->getGameType()) { + case GType_ITE: + // Not called by ITE + break; + case GType_IHNM: + IHNMCreditsProc(); + break; + default: + error("Scene::creditsScene(): Error: Can't start credits scene... gametype not supported"); + break; + } + + _vm->shutDown(); + return; +} + void Scene::nextScene() { SceneQueueList::iterator queueIterator; LoadSceneParams *sceneQueue; @@ -561,6 +590,9 @@ void Scene::loadScene(LoadSceneParams *loadSceneParams) { Event *q_event; static PalEntry current_pal[PAL_ENTRIES]; + if (loadSceneParams->transitionType == kTransitionFade) + _vm->_interface->setFadeMode(kFadeOut); + // Change the cursor to an hourglass in IHNM event.type = kEvTOneshot; event.code = kCursorEvent; @@ -575,19 +607,11 @@ void Scene::loadScene(LoadSceneParams *loadSceneParams) { error("loadScene wrong usage"); } - if (loadSceneParams->chapter == 6) + if (loadSceneParams->chapter == 6 || loadSceneParams->chapter == 8) _vm->_interface->setLeftPortrait(0); _vm->_anim->freeCutawayList(); - // FIXME: Freed script modules are not reloaded correctly when changing chapters. - // This is apparent when returning back to the character selection screen, - // where the scene script module is loaded incorrectly - // Don't free them for now, but free them on game exit, like ITE. - // This has no impact on the game itself (other than increased memory usage), - // as each chapter uses a different module slot - // TODO: Find out why the script modules are not loaded correctly when - // changing chapters and uncomment this again - //_vm->_script->freeModules(); + _vm->_script->freeModules(); // deleteAllScenes(); @@ -612,6 +636,7 @@ void Scene::loadScene(LoadSceneParams *loadSceneParams) { _vm->_script->setVerb(_vm->_script->getVerbType(kVerbWalkTo)); if (loadSceneParams->sceneDescriptor == -2) { + _vm->_interface->setFadeMode(kNoFade); return; } } @@ -651,11 +676,11 @@ void Scene::loadScene(LoadSceneParams *loadSceneParams) { debug(3, "Loading scene number %d:", _sceneNumber); - if (_vm->getGameId() == GID_IHNM_DEMO && _sceneNumber == 144) { + if (isNonInteractiveIHNMDemoPart()) { // WORKAROUND for the non-interactive part of the IHNM demo: When restarting the - // non-interactive demo, opcode sfMainMode is incorrectly called. Therefore, if the - // starting scene of the non-interactive demo is loaded (scene 144), set panel to null - // and lock the user interface + // non-interactive demo, opcode sfMainMode is incorrectly called. Therefore, if any + // of the scenes of the non-interactive demo are loaded (scenes 144-149), set panel + // to null and lock the user interface _vm->_interface->deactivate(); _vm->_interface->setMode(kPanelNull); } @@ -709,15 +734,6 @@ void Scene::loadScene(LoadSceneParams *loadSceneParams) { q_event = NULL; - //fix placard bug - //i guess we should remove RF_PLACARD flag - and use _interface->getMode() - event.type = kEvTOneshot; - event.code = kGraphicsEvent; - event.op = kEventClearFlag; - event.param = RF_PLACARD; - - q_event = _vm->_events->chain(q_event, &event); - if (loadSceneParams->transitionType == kTransitionFade) { _vm->_interface->setFadeMode(kFadeOut); @@ -764,7 +780,6 @@ void Scene::loadScene(LoadSceneParams *loadSceneParams) { event.param4 = _sceneNumber; // Object event.param5 = loadSceneParams->actorsEntrance; // With Object event.param6 = 0; // Actor - q_event = _vm->_events->chain(q_event, &event); } @@ -786,7 +801,6 @@ void Scene::loadScene(LoadSceneParams *loadSceneParams) { event.time = 0; event.duration = kNormalFadeDuration; event.data = _bg.pal; - q_event = _vm->_events->chain(q_event, &event); // set fade mode @@ -807,11 +821,6 @@ void Scene::loadScene(LoadSceneParams *loadSceneParams) { _vm->_sound->stopAll(); - // FIXME: Does IHNM use scene background music, or is all the - // music scripted? At the very least, it shouldn't try - // to start song 0 at the beginning of the game, since - // it's the end credits music. - if (_vm->getGameType() == GType_ITE) { if (_sceneDescription.musicResourceId >= 0) { event.type = kEvTOneshot; @@ -820,14 +829,12 @@ void Scene::loadScene(LoadSceneParams *loadSceneParams) { event.param2 = MUSIC_DEFAULT; event.op = kEventPlay; event.time = 0; - _vm->_events->queue(&event); } else { event.type = kEvTOneshot; event.code = kMusicEvent; event.op = kEventStop; event.time = 0; - _vm->_events->queue(&event); } } @@ -838,7 +845,6 @@ void Scene::loadScene(LoadSceneParams *loadSceneParams) { event.op = kEventDisplay; event.param = kEvPSetPalette; event.time = 0; - _vm->_events->queue(&event); // Begin palette cycle animation if present @@ -846,7 +852,6 @@ void Scene::loadScene(LoadSceneParams *loadSceneParams) { event.code = kPalAnimEvent; event.op = kEventCycleStart; event.time = 0; - q_event = _vm->_events->queue(&event); // Start the scene main script @@ -861,7 +866,6 @@ void Scene::loadScene(LoadSceneParams *loadSceneParams) { event.param4 = _sceneNumber; // Object event.param5 = loadSceneParams->actorsEntrance; // With Object event.param6 = 0; // Actor - _vm->_events->queue(&event); } @@ -1178,7 +1182,9 @@ void Scene::endScene() { _sceneProc(SCENE_END, this); } - // + // Stop showing actors till the next scene's background is drawn from loadScene + _vm->_render->setFlag(RF_DISABLE_ACTORS); + _vm->_script->abortAllThreads(); _vm->_script->_skipSpeeches = false; @@ -1308,31 +1314,38 @@ void Scene::clearPlacard() { Event event; Event *q_event; - _vm->_interface->restoreMode(); + _vm->_interface->setFadeMode(kFadeOut); + // Fade to black out _vm->_gfx->getCurrentPal(cur_pal); - event.type = kEvTImmediate; event.code = kPalEvent; event.op = kEventPalToBlack; event.time = 0; event.duration = kNormalFadeDuration; event.data = cur_pal; - q_event = _vm->_events->queue(&event); - event.type = kEvTOneshot; - event.code = kGraphicsEvent; - event.op = kEventClearFlag; - event.param = RF_PLACARD; - + // set fade mode + event.type = kEvTImmediate; + event.code = kInterfaceEvent; + event.op = kEventSetFadeMode; + event.param = kNoFade; + event.time = 0; + event.duration = 0; q_event = _vm->_events->chain(q_event, &event); event.type = kEvTOneshot; event.code = kTextEvent; event.op = kEventRemove; event.data = _vm->_script->getPlacardTextEntry(); + q_event = _vm->_events->chain(q_event, &event); + event.type = kEvTImmediate; + event.code = kInterfaceEvent; + event.op = kEventRestoreMode; + event.time = 0; + event.duration = 0; q_event = _vm->_events->chain(q_event, &event); _vm->_scene->getBGPal(pal); @@ -1343,20 +1356,17 @@ void Scene::clearPlacard() { event.time = 0; event.duration = kNormalFadeDuration; event.data = pal; - q_event = _vm->_events->chain(q_event, &event); event.type = kEvTOneshot; event.code = kCursorEvent; event.op = kEventShow; - q_event = _vm->_events->chain(q_event, &event); event.type = kEvTOneshot; event.code = kScriptEvent; event.op = kEventThreadWake; event.param = kWaitTypePlacard; - q_event = _vm->_events->chain(q_event, &event); } @@ -1378,37 +1388,37 @@ void Scene::showPsychicProfile(const char *text) { event.type = kEvTOneshot; event.code = kCursorEvent; event.op = kEventHide; - q_event = _vm->_events->queue(&event); - _vm->_gfx->getCurrentPal(cur_pal); + _vm->_interface->setFadeMode(kFadeOut); + // Fade to black out + _vm->_gfx->getCurrentPal(cur_pal); event.type = kEvTImmediate; event.code = kPalEvent; event.op = kEventPalToBlack; event.time = 0; event.duration = kNormalFadeDuration; event.data = cur_pal; - q_event = _vm->_events->chain(q_event, &event); - event.type = kEvTOneshot; + // set fade mode + event.type = kEvTImmediate; event.code = kInterfaceEvent; - event.op = kEventClearStatus; - + event.op = kEventSetFadeMode; + event.param = kNoFade; + event.time = 0; + event.duration = 0; q_event = _vm->_events->chain(q_event, &event); event.type = kEvTOneshot; - event.code = kGraphicsEvent; - event.op = kEventSetFlag; - event.param = RF_PLACARD; - + event.code = kInterfaceEvent; + event.op = kEventClearStatus; q_event = _vm->_events->chain(q_event, &event); // Set the background and palette for the psychic profile event.type = kEvTOneshot; event.code = kPsychicProfileBgEvent; - q_event = _vm->_events->chain(q_event, &event); _vm->_scene->_textList.clear(); @@ -1432,7 +1442,6 @@ void Scene::showPsychicProfile(const char *text) { event.code = kTextEvent; event.op = kEventDisplay; event.data = _psychicProfileTextEntry; - q_event = _vm->_events->chain(q_event, &event); } @@ -1444,22 +1453,21 @@ void Scene::showPsychicProfile(const char *text) { event.time = 0; event.duration = kNormalFadeDuration; event.data = pal; - q_event = _vm->_events->chain(q_event, &event); event.type = kEvTOneshot; event.code = kScriptEvent; event.op = kEventThreadWake; event.param = kWaitTypePlacard; - q_event = _vm->_events->chain(q_event, &event); } void Scene::clearPsychicProfile() { if (_vm->_interface->getMode() == kPanelPlacard || _vm->getGameId() == GID_IHNM_DEMO) { + _vm->_interface->restoreMode(); _vm->_scene->clearPlacard(); _vm->_scene->_textList.clear(); - _vm->_actor->showActors(false); + _vm->_render->setFlag(RF_DISABLE_ACTORS); _vm->_gfx->restorePalette(); _vm->_scene->restoreScene(); _vm->_interface->activate(); diff --git a/engines/saga/scene.h b/engines/saga/scene.h index da97bddff5..aca3f910e0 100644 --- a/engines/saga/scene.h +++ b/engines/saga/scene.h @@ -221,6 +221,7 @@ class Scene { void cmdSceneChange(int argc, const char **argv); void startScene(); + void creditsScene(); void nextScene(); void skipScene(); void endScene(); @@ -345,6 +346,10 @@ class Scene { void clearPsychicProfile(); void showIHNMDemoSpecialScreen(); + bool isNonInteractiveIHNMDemoPart() { + return _vm->getGameId() == GID_IHNM_DEMO && (_sceneNumber >= 144 && _sceneNumber <= 149); + } + private: void loadScene(LoadSceneParams *loadSceneParams); void loadSceneDescriptor(uint32 resourceId); @@ -391,17 +396,26 @@ class Scene { private: int IHNMStartProc(); + int IHNMCreditsProc(); int ITEStartProc(); + void IHNMLoadCutaways(); + bool checkKey(); + + bool playTitle(int title, int time, int mode = kPanelVideo); + bool playLoopingTitle(int title, int seconds); + public: static int SC_IHNMIntroMovieProc1(int param, void *refCon); static int SC_IHNMIntroMovieProc2(int param, void *refCon); static int SC_IHNMIntroMovieProc3(int param, void *refCon); + static int SC_IHNMCreditsMovieProc(int param, void *refCon); private: int IHNMIntroMovieProc1(int param); int IHNMIntroMovieProc2(int param); int IHNMIntroMovieProc3(int param); + int IHNMCreditsMovieProc(int param); public: static int SC_ITEIntroAnimProc(int param, void *refCon); diff --git a/engines/saga/script.cpp b/engines/saga/script.cpp index 82fcb352c0..611975f471 100644 --- a/engines/saga/script.cpp +++ b/engines/saga/script.cpp @@ -204,6 +204,7 @@ void Script::freeModules() { for (i = 0; i < _modulesCount; i++) { if (_modules[i].loaded) { _modules[i].freeMem(); + _modules[i].loaded = false; } } _staticSize = 0; @@ -359,8 +360,6 @@ int Script::getVerbType(VerbTypes verbType) { } } else { - // TODO: This is ugly and needs rewriting, but - // it works for now switch (verbType) { case kVerbNone: return kVerbIHNMNone; @@ -507,7 +506,6 @@ void Script::doVerb() { event.param4 = _pendingObject[0]; // Object event.param5 = _pendingObject[1]; // With Object event.param6 = (objectType == kGameObjectActor) ? _pendingObject[0] : ID_PROTAG; // Actor - _vm->_events->queue(&event); } else { @@ -773,7 +771,13 @@ void Script::whichObject(const Point& mousePoint) { objectId = newObjectId; if (_vm->getGameType() == GType_ITE) objectFlags = kObjUseWith; + // Note: for IHNM, the default right button action is "Look at" for actors, + // but "Talk to" makes much more sense newRightButtonVerb = getVerbType(kVerbTalkTo); + // Slight hack because of the above change: the jukebox in Gorrister's chapter + // is an actor, so change the right button action to "Look at" + if (_vm->getGameType() == GType_IHNM && objectId == 8199) + newRightButtonVerb = getVerbType(kVerbLookAt); if ((_currentVerb == getVerbType(kVerbPickUp)) || (_currentVerb == getVerbType(kVerbOpen)) || @@ -827,6 +831,10 @@ void Script::whichObject(const Point& mousePoint) { if (newRightButtonVerb >= getVerbType(kVerbOptions)) { newRightButtonVerb = getVerbType(kVerbNone); } + } else { + if (newRightButtonVerb >= getVerbType(kVerbOptions)) { + newRightButtonVerb = getVerbType(kVerbWalkTo); + } } if ((_currentVerb == getVerbType(kVerbTalkTo)) || ((_currentVerb == getVerbType(kVerbGive)) && _firstObjectSet)) { diff --git a/engines/saga/script.h b/engines/saga/script.h index 5e5e702132..37e35cf241 100644 --- a/engines/saga/script.h +++ b/engines/saga/script.h @@ -237,7 +237,6 @@ struct ModuleData { voiceLUT.freeMem(); free(moduleBase); free(entryPoints); - memset(this, 0x0, sizeof(*this)); } }; @@ -597,7 +596,7 @@ private: void sfShowIHNMDemoHelpPage(SCRIPTFUNC_PARAMS); void sfGetPoints(SCRIPTFUNC_PARAMS); void sfSetGlobalFlag(SCRIPTFUNC_PARAMS); - void sf92(SCRIPTFUNC_PARAMS); + void sfDemoSetInteractive(SCRIPTFUNC_PARAMS); void sfClearGlobalFlag(SCRIPTFUNC_PARAMS); void sfTestGlobalFlag(SCRIPTFUNC_PARAMS); void sfSetPoints(SCRIPTFUNC_PARAMS); diff --git a/engines/saga/sfuncs.cpp b/engines/saga/sfuncs.cpp index c0e44584df..74f192c7f7 100644 --- a/engines/saga/sfuncs.cpp +++ b/engines/saga/sfuncs.cpp @@ -230,7 +230,7 @@ static const ScriptFunctionDescription IHNMscriptFunctionsList[IHNM_SCRIPT_FUNCT OPCODE(sfShowIHNMDemoHelpPage), OPCODE(sfVstopFX), OPCODE(sfVstopLoopedFX), - OPCODE(sf92), // only used in the demo version of IHNM + OPCODE(sfDemoSetInteractive), // only used in the demo version of IHNM OPCODE(sfDemoIsInteractive), OPCODE(sfVsetTrack), OPCODE(sfGetPoints), @@ -253,8 +253,7 @@ static const ScriptFunctionDescription IHNMscriptFunctionsList[IHNM_SCRIPT_FUNCT // Script function #0 (0x00) // Print a debugging message void Script::sfPutString(SCRIPTFUNC_PARAMS) { - const char *str; - str = thread->_strings->getString(thread->pop()); + const char *str = thread->_strings->getString(thread->pop()); _vm->_console->DebugPrintf("sfPutString: %s\n",str); debug(0, "sfPutString: %s", str); @@ -263,8 +262,7 @@ void Script::sfPutString(SCRIPTFUNC_PARAMS) { // Script function #1 (0x01) blocking // Param1: time in ticks void Script::sfWait(SCRIPTFUNC_PARAMS) { - int16 time; - time = thread->pop(); + int16 time = thread->pop(); if (!_skipSpeeches) { thread->waitDelay(_vm->ticksToMSec(time)); // put thread to sleep @@ -274,17 +272,17 @@ void Script::sfWait(SCRIPTFUNC_PARAMS) { // Script function #2 (0x02) void Script::sfTakeObject(SCRIPTFUNC_PARAMS) { uint16 objectId = thread->pop(); - ObjectData *obj; - obj = _vm->_actor->getObj(objectId); + ObjectData *obj = _vm->_actor->getObj(objectId); + if (obj->_sceneNumber != ITE_SCENE_INV) { obj->_sceneNumber = ITE_SCENE_INV; // WORKAROUND for two incorrect object sprites in the IHNM demo // (the mirror and the icon in Ted's part). Set them correctly here if (_vm->getGameId() == GID_IHNM_DEMO) { - if (obj->_spriteListResourceId == 4 && objectId == 16408) + if (objectId == 16408) obj->_spriteListResourceId = 24; - if (obj->_spriteListResourceId == 3 && objectId == 16409) + if (objectId == 16409) obj->_spriteListResourceId = 25; } @@ -297,23 +295,20 @@ void Script::sfTakeObject(SCRIPTFUNC_PARAMS) { void Script::sfIsCarried(SCRIPTFUNC_PARAMS) { uint16 objectId = thread->pop(); CommonObjectData *object; + if (_vm->_actor->validObjId(objectId)) { object = _vm->_actor->getObj(objectId); thread->_returnValue = (object->_sceneNumber == ITE_SCENE_INV) ? 1 : 0; } else { thread->_returnValue = 0; } - - } // Script function #4 (0x04) nonblocking // Set the command display to the specified text string // Param1: dialogue index of string void Script::sfStatusBar(SCRIPTFUNC_PARAMS) { - int16 stringIndex = thread->pop(); - - _vm->_interface->setStatusText(thread->_strings->getString(stringIndex)); + _vm->_interface->setStatusText(thread->_strings->getString(thread->pop())); } // Script function #5 (0x05) @@ -323,9 +318,29 @@ void Script::sfMainMode(SCRIPTFUNC_PARAMS) { showVerb(); _vm->_interface->activate(); _vm->_interface->setMode(kPanelMain); + // Sometimes, the active cutaway is cleared after this opcode is called, + // resulting in an incorrect mode being set. An example is Ellen's chapter + // in IHNM, when using the computer with the chaos trebler CD. Make sure + // that the saved mode is kPanelMain, so that it won't get overwritten + // by an incorrect stored mode + _vm->_interface->rememberMode(); if (_vm->getGameType() == GType_ITE) setPointerVerb(); + + // The early Windows and Mac demos of ITE were non-interactive. In those demos, + // the intro is shown and then when the first scene is shown, there's a dialog + // thanking the user for playing the demo and asking him to buy the full game, + // without allowing him to continue any further. The game data itself for these + // demos does not contain any scripts for the first scene (i.e. there's no text + // in the game data to look at Rif's silver medallion). Also, there are no more + // scenes apart from the Grand Tournament scene. This opcode is called in those + // demos, and I assume that its use there is to just show the popup window and + // exit the game. Therefore, once this opcode is called in the older ITE demos, + // exit the game. Known non-interactive demos are GID_ITE_MACDEMO1 and + // GID_ITE_WINDEMO1 + if (_vm->getFeatures() & GF_NON_INTERACTIVE) + _vm->shutDown(); } // Script function #6 (0x06) blocking @@ -333,15 +348,11 @@ void Script::sfMainMode(SCRIPTFUNC_PARAMS) { // Param2: actor x // Param3: actor y void Script::sfScriptWalkTo(SCRIPTFUNC_PARAMS) { - uint16 actorId; + uint16 actorId = thread->pop(); + ActorData *actor = _vm->_actor->getActor(actorId); Location actorLocation; - ActorData *actor; - - actorId = thread->pop(); actorLocation.x = thread->pop(); actorLocation.y = thread->pop(); - - actor = _vm->_actor->getActor(actorId); actorLocation.z = actor->_location.z; actor->_flags &= ~kFollower; @@ -357,10 +368,10 @@ void Script::sfScriptWalkTo(SCRIPTFUNC_PARAMS) { // Param3: theObject // Param4: withObject void Script::sfScriptDoAction(SCRIPTFUNC_PARAMS) { - uint16 objectId; - uint16 action; - uint16 theObject; - uint16 withObject; + uint16 objectId = thread->pop(); + uint16 action = thread->pop(); + uint16 theObject = thread->pop(); + uint16 withObject = thread->pop(); int16 scriptEntryPointNumber; int16 moduleNumber; ActorData *actor; @@ -368,11 +379,6 @@ void Script::sfScriptDoAction(SCRIPTFUNC_PARAMS) { const HitZone *hitZone; Event event; - objectId = thread->pop(); - action = thread->pop(); - theObject = thread->pop(); - withObject = thread->pop(); - switch (objectTypeId(objectId)) { case kGameObjectObject: obj = _vm->_actor->getObj(objectId); @@ -381,6 +387,8 @@ void Script::sfScriptDoAction(SCRIPTFUNC_PARAMS) { return; } moduleNumber = 0; + if (_vm->getGameType() == GType_IHNM) + moduleNumber = _vm->_scene->getScriptModuleNumber(); break; case kGameObjectActor: actor = _vm->_actor->getActor(objectId); @@ -393,6 +401,8 @@ void Script::sfScriptDoAction(SCRIPTFUNC_PARAMS) { } else { moduleNumber = _vm->_scene->getScriptModuleNumber(); } + if (_vm->getGameType() == GType_IHNM) + moduleNumber = _vm->_scene->getScriptModuleNumber(); break; case kGameObjectHitZone: case kGameObjectStepZone: @@ -421,7 +431,6 @@ void Script::sfScriptDoAction(SCRIPTFUNC_PARAMS) { event.param4 = theObject; // Object event.param5 = withObject; // With Object event.param6 = objectId; - _vm->_events->queue(&event); } @@ -429,14 +438,9 @@ void Script::sfScriptDoAction(SCRIPTFUNC_PARAMS) { // Param1: actor id // Param2: actor orientation void Script::sfSetActorFacing(SCRIPTFUNC_PARAMS) { - int16 actorId; - int actorDirection; - ActorData *actor; + ActorData *actor = _vm->_actor->getActor(thread->pop()); + int actorDirection = thread->pop(); - actorId = thread->pop(); - actorDirection = thread->pop(); - - actor = _vm->_actor->getActor(actorId); actor->_facingDirection = actor->_actionDirection = actorDirection; actor->_targetObject = ID_NOTHING; } @@ -448,7 +452,9 @@ void Script::sfStartBgdAnim(SCRIPTFUNC_PARAMS) { _vm->_anim->setCycles(animId, cycles); _vm->_anim->setFrameTime(animId, _vm->ticksToMSec(kRepeatSpeedTicks)); - _vm->_anim->play(animId, 0); + + if (!_vm->_anim->isPlaying(animId)) + _vm->_anim->play(animId, 0); debug(1, "sfStartBgdAnim(%d, %d)", animId, cycles); } @@ -468,11 +474,7 @@ void Script::sfStopBgdAnim(SCRIPTFUNC_PARAMS) { // reenabled. // Param1: boolean void Script::sfLockUser(SCRIPTFUNC_PARAMS) { - int16 lock; - - lock = thread->pop(); - - if (lock) { + if (thread->pop()) { _vm->_interface->deactivate(); } else { _vm->_interface->activate(); @@ -485,6 +487,7 @@ void Script::sfLockUser(SCRIPTFUNC_PARAMS) { void Script::sfPreDialog(SCRIPTFUNC_PARAMS) { _vm->_interface->deactivate(); _vm->_interface->converseClear(); + if (_vm->_interface->isInMainMode()) _vm->_interface->setMode(kPanelConverse); else @@ -497,10 +500,7 @@ void Script::sfPreDialog(SCRIPTFUNC_PARAMS) { void Script::sfKillActorThreads(SCRIPTFUNC_PARAMS) { ScriptThread *anotherThread; ScriptThreadList::iterator threadIterator; - int16 actorId; - - actorId = thread->pop(); - + int16 actorId = thread->pop(); for (threadIterator = _threadList.begin(); threadIterator != _threadList.end(); ++threadIterator) { anotherThread = threadIterator.operator->(); @@ -515,34 +515,21 @@ void Script::sfKillActorThreads(SCRIPTFUNC_PARAMS) { // Param1: actor id // Param2: object id void Script::sfFaceTowards(SCRIPTFUNC_PARAMS) { - int16 actorId; - int16 targetObject; - ActorData *actor; - - actorId = thread->pop(); - targetObject = thread->pop(); - - actor = _vm->_actor->getActor(actorId); - actor->_targetObject = targetObject; + ActorData *actor = _vm->_actor->getActor(thread->pop()); + actor->_targetObject = thread->pop(); } // Script function #15 (0x0F) // Param1: actor id // Param2: target object void Script::sfSetFollower(SCRIPTFUNC_PARAMS) { - int16 actorId; - int16 targetObject; - - ActorData *actor; + int16 actorId = thread->pop(); + ActorData *actor = _vm->_actor->getActor(actorId); + actor->_targetObject = thread->pop(); - actorId = thread->pop(); - targetObject = thread->pop(); + debug(1, "sfSetFollower(%d, %d) [%d]", actorId, actor->_targetObject, _vm->_actor->actorIdToIndex(actorId)); - debug(1, "sfSetFollower(%d, %d) [%d]", actorId, targetObject, _vm->_actor->actorIdToIndex(actorId)); - - actor = _vm->_actor->getActor(actorId); - actor->_targetObject = targetObject; - if (targetObject != ID_NOTHING) { + if (actor->_targetObject != ID_NOTHING) { actor->_flags |= kFollower; actor->_actorFlags &= ~kActorNoFollow; } else { @@ -552,53 +539,33 @@ void Script::sfSetFollower(SCRIPTFUNC_PARAMS) { // Script function #16 (0x10) void Script::sfScriptGotoScene(SCRIPTFUNC_PARAMS) { - int16 sceneNumber; - int16 entrance; - int16 transition = 0; // IHNM + int16 sceneNumber = thread->pop(); + int16 entrance = thread->pop(); - sceneNumber = thread->pop(); - entrance = thread->pop(); if (_vm->getGameType() == GType_IHNM) { - transition = thread->pop(); - _vm->_gfx->setCursor(kCursorBusy); } - if ((_vm->getGameType() == GType_ITE && sceneNumber < 0) || - (_vm->getGameType() == GType_IHNM && sceneNumber == 0)) { - // TODO: set creditsFlag to true for IHNM + if (_vm->getGameType() == GType_ITE && sceneNumber < 0) { _vm->shutDown(); return; } - if (_vm->getGameType() == GType_IHNM) { - // WORKAROUND for the briefly appearing actors at the beginning of each chapter - // This will stop the actors being drawn in those specific scenes until the scene background has been drawn - if ((_vm->_scene->currentChapterNumber() == 1 && _vm->_scene->currentSceneNumber() == 6) || - (_vm->_scene->currentChapterNumber() == 2 && _vm->_scene->currentSceneNumber() == 31) || - (_vm->_scene->currentChapterNumber() == 3 && _vm->_scene->currentSceneNumber() == 58) || - (_vm->_scene->currentChapterNumber() == 4 && _vm->_scene->currentSceneNumber() == 68) || - (_vm->_scene->currentChapterNumber() == 5 && _vm->_scene->currentSceneNumber() == 91) || - (_vm->_scene->currentChapterNumber() == 7 && _vm->_scene->currentSceneNumber() == 145)) - _vm->_actor->showActors(false); // Stop showing actors before the background is drawn - - // Since it doesn't look like the IHNM scripts remove the - // cutaway after the intro, this is probably the best place to do it - _vm->_anim->clearCutaway(); + if (_vm->getGameType() == GType_IHNM && sceneNumber == 0) { + _vm->_scene->creditsScene(); + return; } // It is possible to leave scene when converse panel is on, // particulalrly it may happen at Moneychanger tent. This - // prevent this from happening. + // prevents this from happening. if (_vm->_interface->getMode() == kPanelConverse) { _vm->_interface->setMode(kPanelMain); } // changeScene calls loadScene which calls setVerb. setVerb resets all pending objects and object flags if (sceneNumber == -1 && _vm->getGameType() == GType_IHNM) { - // TODO: This is used to return back to the character selection screen in IHNM. - // However, it seems more than this is needed, AM's speech is wrong and no actors - // are shown + // Return back to the character selection screen in IHNM _vm->_scene->changeScene(154, entrance, kTransitionFade, 8); } else { _vm->_scene->changeScene(sceneNumber, entrance, (sceneNumber == ITE_SCENE_ENDCREDIT1) ? kTransitionFade : kTransitionNoFade); @@ -615,23 +582,27 @@ void Script::sfScriptGotoScene(SCRIPTFUNC_PARAMS) { _currentObject[0] = _currentObject[1] = ID_NOTHING; showVerb(); // calls setStatusText("") - if (_vm->getGameType() == GType_IHNM) + if (_vm->getGameType() == GType_IHNM) { + // There are some cutaways which are not removed by game scripts, like the cutaway + // after the intro of IHNM or the cutaway at the end of Ellen's part in the IHNM demo. + // Clear any remaining cutaways here + _vm->_anim->clearCutaway(); _vm->_gfx->setCursor(kCursorNormal); + } } // Script function #17 (0x11) // Param1: object id // Param2: sprite index void Script::sfSetObjImage(SCRIPTFUNC_PARAMS) { - uint16 objectId; - uint16 spriteId; - ObjectData *obj; - - objectId = thread->pop(); - spriteId = thread->pop(); + uint16 objectId = thread->pop(); + uint16 spriteId = thread->pop(); + ObjectData *obj = _vm->_actor->getObj(objectId); - obj = _vm->_actor->getObj(objectId); - obj->_spriteListResourceId = OBJ_SPRITE_BASE + spriteId; + if (_vm->getGameType() == GType_IHNM) + obj->_spriteListResourceId = spriteId; + else + obj->_spriteListResourceId = OBJ_SPRITE_BASE + spriteId; _vm->_interface->refreshInventory(); } @@ -639,26 +610,18 @@ void Script::sfSetObjImage(SCRIPTFUNC_PARAMS) { // Param1: object id // Param2: name index void Script::sfSetObjName(SCRIPTFUNC_PARAMS) { - uint16 objectId; - uint16 nameIdx; - ObjectData *obj; - - objectId = thread->pop(); - nameIdx = thread->pop(); + uint16 objectId = thread->pop(); + uint16 nameIdx = thread->pop(); + ObjectData *obj = _vm->_actor->getObj(objectId); - obj = _vm->_actor->getObj(objectId); obj->_nameIndex = nameIdx; } // Script function #19 (0x13) // Param1: object id void Script::sfGetObjImage(SCRIPTFUNC_PARAMS) { - uint16 objectId; - ObjectData *obj; - - objectId = thread->pop(); - - obj = _vm->_actor->getObj(objectId); + uint16 objectId = thread->pop(); + ObjectData *obj = _vm->_actor->getObj(objectId); if (_vm->getGameType() == GType_IHNM) thread->_returnValue = obj->_spriteListResourceId; @@ -686,8 +649,7 @@ void Script::sfGetNumber(SCRIPTFUNC_PARAMS) { // Script function #21 (0x15) // Param1: door # void Script::sfScriptOpenDoor(SCRIPTFUNC_PARAMS) { - int16 doorNumber; - doorNumber = thread->pop(); + int16 doorNumber = thread->pop(); if (_vm->_scene->getFlags() & kSceneFlagISO) { _vm->_isoMap->setTileDoorState(doorNumber, 1); @@ -699,8 +661,7 @@ void Script::sfScriptOpenDoor(SCRIPTFUNC_PARAMS) { // Script function #22 (0x16) // Param1: door # void Script::sfScriptCloseDoor(SCRIPTFUNC_PARAMS) { - int16 doorNumber; - doorNumber = thread->pop(); + int16 doorNumber = thread->pop(); if (_vm->_scene->getFlags() & kSceneFlagISO) { _vm->_isoMap->setTileDoorState(doorNumber, 0); @@ -728,10 +689,7 @@ void Script::SF_cycleColors(SCRIPTFUNC_PARAMS) { // Script function #25 (0x19) // Param1: actor id void Script::sfDoCenterActor(SCRIPTFUNC_PARAMS) { - int16 actorId; - actorId = thread->pop(); - - _vm->_actor->_centerActor = _vm->_actor->getActor(actorId); + _vm->_actor->_centerActor = _vm->_actor->getActor(thread->pop()); } // Script function #26 (0x1A) nonblocking @@ -743,7 +701,9 @@ void Script::sfStartBgdAnimSpeed(SCRIPTFUNC_PARAMS) { _vm->_anim->setCycles(animId, cycles); _vm->_anim->setFrameTime(animId, _vm->ticksToMSec(speed)); - _vm->_anim->play(animId, 0); + + if (!_vm->_anim->isPlaying(animId)) + _vm->_anim->play(animId, 0); debug(1, "sfStartBgdAnimSpeed(%d, %d, %d)", animId, cycles, speed); } @@ -753,19 +713,14 @@ void Script::sfStartBgdAnimSpeed(SCRIPTFUNC_PARAMS) { // Param2: actor x // Param3: actor y void Script::sfScriptWalkToAsync(SCRIPTFUNC_PARAMS) { - int16 actorId; + int16 actorId = thread->pop(); + ActorData *actor = _vm->_actor->getActor(actorId); Location actorLocation; - ActorData *actor; - - actorId = thread->pop(); actorLocation.x = thread->pop(); actorLocation.y = thread->pop(); - - actor = _vm->_actor->getActor(actorId); actorLocation.z = actor->_location.z; actor->_flags &= ~kFollower; - _vm->_actor->actorWalkTo(actorId, actorLocation); } @@ -797,14 +752,8 @@ void Script::sfEnableZone(SCRIPTFUNC_PARAMS) { // Param1: actor id // Param2: current action void Script::sfSetActorState(SCRIPTFUNC_PARAMS) { - int16 actorId; - int currentAction; - ActorData *actor; - - actorId = thread->pop(); - currentAction = thread->pop(); - - actor = _vm->_actor->getActor(actorId); + ActorData *actor = _vm->_actor->getActor(thread->pop()); + int currentAction = thread->pop(); if ((currentAction >= kActionWalkToPoint) && (currentAction <= kActionWalkToPoint)) { wakeUpActorThread(kWaitTypeWalk, actor); @@ -818,14 +767,12 @@ void Script::sfSetActorState(SCRIPTFUNC_PARAMS) { // Param2: actor pos x // Param3: actor pos y void Script::sfScriptMoveTo(SCRIPTFUNC_PARAMS) { - int16 objectId; + int16 objectId = thread->pop(); Location location; - ActorData *actor; - ObjectData *obj; - - objectId = thread->pop(); location.x = thread->pop(); location.y = thread->pop(); + ActorData *actor; + ObjectData *obj; if (_vm->_actor->validActorId(objectId)) { actor = _vm->_actor->getActor(objectId); @@ -854,18 +801,11 @@ void Script::sfSceneEq(SCRIPTFUNC_PARAMS) { // Script function #32 (0x20) void Script::sfDropObject(SCRIPTFUNC_PARAMS) { - uint16 objectId; - uint16 spriteId; - int16 x; - int16 y; - ObjectData *obj; - - objectId = thread->pop(); - spriteId = thread->pop(); - x = thread->pop(); - y = thread->pop(); - - obj = _vm->_actor->getObj(objectId); + uint16 objectId = thread->pop(); + ObjectData *obj = _vm->_actor->getObj(objectId); + uint16 spriteId = thread->pop(); + obj->_location.x = thread->pop(); + obj->_location.y = thread->pop(); if (obj->_sceneNumber == ITE_SCENE_INV) { _vm->_interface->removeFromInventory(objectId); @@ -873,10 +813,10 @@ void Script::sfDropObject(SCRIPTFUNC_PARAMS) { obj->_sceneNumber = _vm->_scene->currentSceneNumber(); - // WORKAROUND for the compact disk in Ellen's chapter + // HACK for the compact disk in Ellen's chapter // Change the scene number of the compact disk so that it's not shown. It will be shown // once Ellen says that there's something different (i.e. after speaking with AM) - // See Actor::actorSpeech for the other part of this workaround + // See Actor::actorSpeech for the other part of this hack if (_vm->getGameType() == GType_IHNM && _vm->_scene->currentChapterNumber() == 3 && _vm->_scene->currentSceneNumber() == 59 && obj->_id == 16385) obj->_sceneNumber = -1; @@ -891,9 +831,6 @@ void Script::sfDropObject(SCRIPTFUNC_PARAMS) { } else { obj->_spriteListResourceId = OBJ_SPRITE_BASE + spriteId; } - - obj->_location.x = x; - obj->_location.y = y; } // Script function #33 (0x21) @@ -909,16 +846,10 @@ void Script::sfFinishBgdAnim(SCRIPTFUNC_PARAMS) { // Param1: actor id 1 // Param2: actor id 2 void Script::sfSwapActors(SCRIPTFUNC_PARAMS) { - int16 actorId1; - int16 actorId2; - ActorData *actor1; - ActorData *actor2; - - actorId1 = thread->pop(); - actorId2 = thread->pop(); - - actor1 = _vm->_actor->getActor(actorId1); - actor2 = _vm->_actor->getActor(actorId2); + int16 actorId1 = thread->pop(); + int16 actorId2 = thread->pop(); + ActorData *actor1 = _vm->_actor->getActor(actorId1); + ActorData *actor2 = _vm->_actor->getActor(actorId2); SWAP(actor1->_location, actor2->_location); @@ -944,24 +875,19 @@ void Script::sfSwapActors(SCRIPTFUNC_PARAMS) { ///.... // Param3: actor idN void Script::sfSimulSpeech(SCRIPTFUNC_PARAMS) { - int16 stringId; - int16 actorsCount; + int16 stringId = thread->pop(); + int16 actorsCount = thread->pop(); int i; uint16 actorsIds[ACTOR_SPEECH_ACTORS_MAX]; - const char *string; + const char *string = thread->_strings->getString(stringId); int16 sampleResourceId = -1; - stringId = thread->pop(); - actorsCount = thread->pop(); - if (actorsCount > ACTOR_SPEECH_ACTORS_MAX) error("sfSimulSpeech actorsCount=0x%X exceed ACTOR_SPEECH_ACTORS_MAX", actorsCount); for (i = 0; i < actorsCount; i++) actorsIds[i] = thread->pop(); - string = thread->_strings->getString(stringId); - if (thread->_voiceLUT->voices) { if (_vm->getGameType() == GType_IHNM && stringId >= 338) { sampleResourceId = -1; @@ -982,22 +908,16 @@ void Script::sfSimulSpeech(SCRIPTFUNC_PARAMS) { // Param3: actor y // Param4: actor walk flag void Script::sfScriptWalk(SCRIPTFUNC_PARAMS) { - int16 actorId; + int16 actorId = thread->pop(); + ActorData *actor = _vm->_actor->getActor(actorId); Location actorLocation; - ActorData *actor; - uint16 walkFlags; - - actorId = thread->pop(); actorLocation.x = thread->pop(); actorLocation.y = thread->pop(); - walkFlags = thread->pop(); - - actor = _vm->_actor->getActor(actorId); actorLocation.z = actor->_location.z; - - _vm->_actor->realLocation(actorLocation, ID_NOTHING, walkFlags); + uint16 walkFlags = thread->pop(); actor->_flags &= ~kFollower; + _vm->_actor->realLocation(actorLocation, ID_NOTHING, walkFlags); if (_vm->_actor->actorWalkTo(actorId, actorLocation) && !(walkFlags & kWalkAsync)) { thread->waitWalk(actor); @@ -1016,18 +936,10 @@ void Script::sfScriptWalk(SCRIPTFUNC_PARAMS) { // Param3: cycle frame number // Param4: cycle delay void Script::sfCycleFrames(SCRIPTFUNC_PARAMS) { - int16 actorId; - int16 flags; - int cycleFrameSequence; - int cycleDelay; - ActorData *actor; - - actorId = thread->pop(); - flags = thread->pop(); - cycleFrameSequence = thread->pop(); - cycleDelay = thread->pop(); - - actor = _vm->_actor->getActor(actorId); + ActorData *actor = _vm->_actor->getActor(thread->pop()); + int16 flags = thread->pop(); + int cycleFrameSequence = thread->pop(); + int cycleDelay = thread->pop(); if (flags & kCyclePong) { actor->_currentAction = kActionPongFrames; @@ -1046,8 +958,8 @@ void Script::sfCycleFrames(SCRIPTFUNC_PARAMS) { if (flags & kCycleReverse) { if (_vm->getGameType() == GType_IHNM && _vm->_scene->currentChapterNumber() == 2 && _vm->_scene->currentSceneNumber() == 41) { - // Prevent Benny from walking backwards after talking to the child via the monitor. This occurs in the - // original as well, and is fixed by not setting the kActorBackwards flag at this point + // WORKAROUND: Prevent Benny from walking backwards after talking to the child via the monitor. This + // occurs in the original as well, and is fixed by not setting the kActorBackwards flag at this point } else { actor->_actorFlags |= kActorBackwards; } @@ -1064,19 +976,11 @@ void Script::sfCycleFrames(SCRIPTFUNC_PARAMS) { // Param2: frame type // Param3: frame offset void Script::sfSetFrame(SCRIPTFUNC_PARAMS) { - int16 actorId; - int frameType; - int frameOffset; - ActorData *actor; - ActorFrameRange *frameRange; - - actorId = thread->pop(); - frameType = thread->pop(); - frameOffset = thread->pop(); - - actor = _vm->_actor->getActor(actorId); - - frameRange = _vm->_actor->getActorFrameRange(actorId, frameType); + int16 actorId = thread->pop(); + ActorData *actor = _vm->_actor->getActor(actorId); + int frameType = thread->pop(); + int frameOffset = thread->pop(); + ActorFrameRange *frameRange = _vm->_actor->getActorFrameRange(actorId, frameType); actor->_frameNumber = frameRange->frameIndex + frameOffset; @@ -1088,17 +992,13 @@ void Script::sfSetFrame(SCRIPTFUNC_PARAMS) { // Script function #39 (0x27) // Sets the right-hand portrait void Script::sfSetPortrait(SCRIPTFUNC_PARAMS) { - int16 param = thread->pop(); - - _vm->_interface->setRightPortrait(param); + _vm->_interface->setRightPortrait(thread->pop()); } // Script function #40 (0x28) // Sets the left-hand portrait void Script::sfSetProtagPortrait(SCRIPTFUNC_PARAMS) { - int16 param = thread->pop(); - - _vm->_interface->setLeftPortrait(param); + _vm->_interface->setLeftPortrait(thread->pop()); } // Script function #41 (0x29) nonblocking @@ -1130,21 +1030,15 @@ void Script::sfChainBgdAnim(SCRIPTFUNC_PARAMS) { // Param3: actor y // Param4: frame seq void Script::sfScriptSpecialWalk(SCRIPTFUNC_PARAMS) { - int16 actorId; - int16 walkFrameSequence; + int16 actorId = thread->pop(); + ActorData *actor = _vm->_actor->getActor(actorId); Location actorLocation; - ActorData *actor; - - actorId = thread->pop(); actorLocation.x = thread->pop(); actorLocation.y = thread->pop(); - walkFrameSequence = thread->pop(); - - actor = _vm->_actor->getActor(actorId); actorLocation.z = actor->_location.z; + int16 walkFrameSequence = thread->pop(); _vm->_actor->actorWalkTo(actorId, actorLocation); - actor->_walkFrameSequence = walkFrameSequence; } @@ -1156,39 +1050,20 @@ void Script::sfScriptSpecialWalk(SCRIPTFUNC_PARAMS) { // Param5: actor action // Param6: actor frame number void Script::sfPlaceActor(SCRIPTFUNC_PARAMS) { - int16 actorId; - Location actorLocation; - int actorDirection; - int frameType; - int frameOffset; - ActorData *actor; + int16 actorId = thread->pop(); + ActorData *actor = _vm->_actor->getActor(actorId); + actor->_location.x = thread->pop(); + actor->_location.y = thread->pop(); + actor->_facingDirection = actor->_actionDirection = thread->pop(); + int frameType = thread->pop(); + int frameOffset = thread->pop(); ActorFrameRange *frameRange; - actorId = thread->pop(); - actorLocation.x = thread->pop(); - actorLocation.y = thread->pop(); - actorDirection = thread->pop(); - frameType = thread->pop(); - frameOffset = thread->pop(); - - debug(1, "sfPlaceActor(id = 0x%x, x=%d, y=%d, dir=%d, frameType=%d, frameOffset=%d)", actorId, actorLocation.x, - actorLocation.y, actorDirection, frameType, frameOffset); - - actor = _vm->_actor->getActor(actorId); - actor->_location.x = actorLocation.x; - actor->_location.y = actorLocation.y; - actor->_facingDirection = actor->_actionDirection = actorDirection; - - if (!actor->_frames) - _vm->_actor->loadActorResources(actor); //? is not it already loaded ? + debug(1, "sfPlaceActor(id = 0x%x, x=%d, y=%d, dir=%d, frameType=%d, frameOffset=%d)", actorId, actor->_location.x, + actor->_location.y, actor->_facingDirection, frameType, frameOffset); if (frameType >= 0) { frameRange = _vm->_actor->getActorFrameRange(actorId, frameType); - - if (frameRange->frameCount <= frameOffset) { - warning("Wrong frameOffset 0x%X", frameOffset); - } - actor->_frameNumber = frameRange->frameIndex + frameOffset; actor->_currentAction = kActionFreeze; } else { @@ -1213,24 +1088,17 @@ void Script::sfCheckUserInterrupt(SCRIPTFUNC_PARAMS) { // Param4: actor y // Param5: actor walk flag void Script::sfScriptWalkRelative(SCRIPTFUNC_PARAMS) { - int16 actorId; - int16 objectId; - uint16 walkFlags; + int16 actorId = thread->pop(); + ActorData *actor = _vm->_actor->getActor(actorId); + int16 objectId = thread->pop(); Location actorLocation; - ActorData *actor; - - actorId = thread->pop(); - objectId = thread->pop(); actorLocation.x = thread->pop(); actorLocation.y = thread->pop(); - walkFlags = thread->pop(); - - actor = _vm->_actor->getActor(actorId); actorLocation.z = actor->_location.z; - - _vm->_actor->realLocation(actorLocation, objectId, walkFlags); + uint16 walkFlags = thread->pop(); actor->_flags &= ~kFollower; + _vm->_actor->realLocation(actorLocation, objectId, walkFlags); if (_vm->_actor->actorWalkTo(actorId, actorLocation) && !(walkFlags & kWalkAsync)) { thread->waitWalk(actor); @@ -1250,50 +1118,36 @@ void Script::sfScriptWalkRelative(SCRIPTFUNC_PARAMS) { // Param4: actor y // Param5: actor walk flag void Script::sfScriptMoveRelative(SCRIPTFUNC_PARAMS) { - int16 actorId; - int16 objectId; - uint16 walkFlags; + ActorData *actor = _vm->_actor->getActor(thread->pop()); + int16 objectId = thread->pop(); Location actorLocation; - ActorData *actor; - - actorId = thread->pop(); - objectId = thread->pop(); actorLocation.x = thread->pop(); actorLocation.y = thread->pop(); - walkFlags = thread->pop(); - - actor = _vm->_actor->getActor(actorId); actorLocation.z = actor->_location.z; + uint16 walkFlags = thread->pop(); _vm->_actor->realLocation(actorLocation, objectId, walkFlags); - actor->_location = actorLocation; actor->_actorFlags = (actor->_actorFlags & ~kActorFacingMask) | (walkFlags & kActorFacingMask); } // Script function #47 (0x2F) void Script::sfSimulSpeech2(SCRIPTFUNC_PARAMS) { - int16 stringId; - int16 actorsCount; - int16 speechFlags; + int16 stringId = thread->pop(); + const char *string = thread->_strings->getString(stringId); + int16 actorsCount = thread->pop(); + int16 speechFlags = thread->pop(); int i; uint16 actorsIds[ACTOR_SPEECH_ACTORS_MAX]; - const char *string; int16 sampleResourceId = -1; - stringId = thread->pop(); - actorsCount = thread->pop(); - speechFlags = thread->pop(); - if (actorsCount > ACTOR_SPEECH_ACTORS_MAX) error("sfSimulSpeech2 actorsCount=0x%X exceed ACTOR_SPEECH_ACTORS_MAX", actorsCount); for (i = 0; i < actorsCount; i++) actorsIds[i] = thread->pop(); - string = thread->_strings->getString(stringId); - if (thread->_voiceLUT->voices) { sampleResourceId = thread->_voiceLUT->voices[stringId]; if (sampleResourceId <= 0 || sampleResourceId > 4000) @@ -1308,7 +1162,7 @@ void Script::sfSimulSpeech2(SCRIPTFUNC_PARAMS) { // Script function #48 (0x30) // Param1: string rid void Script::sfPlacard(SCRIPTFUNC_PARAMS) { - int stringId; + int stringId = thread->pop(); Surface *backBuffer = _vm->_gfx->getBackBuffer(); static PalEntry cur_pal[PAL_ENTRIES]; PalEntry *pal; @@ -1320,36 +1174,35 @@ void Script::sfPlacard(SCRIPTFUNC_PARAMS) { _vm->_interface->rememberMode(); _vm->_interface->setMode(kPanelPlacard); - stringId = thread->pop(); - event.type = kEvTOneshot; event.code = kCursorEvent; event.op = kEventHide; - q_event = _vm->_events->queue(&event); - _vm->_gfx->getCurrentPal(cur_pal); + _vm->_interface->setFadeMode(kFadeOut); + // Fade to black out + _vm->_gfx->getCurrentPal(cur_pal); event.type = kEvTImmediate; event.code = kPalEvent; event.op = kEventPalToBlack; event.time = 0; event.duration = kNormalFadeDuration; event.data = cur_pal; - q_event = _vm->_events->chain(q_event, &event); - event.type = kEvTOneshot; + // set fade mode + event.type = kEvTImmediate; event.code = kInterfaceEvent; - event.op = kEventClearStatus; - + event.op = kEventSetFadeMode; + event.param = kNoFade; + event.time = 0; + event.duration = 0; q_event = _vm->_events->chain(q_event, &event); event.type = kEvTOneshot; - event.code = kGraphicsEvent; - event.op = kEventSetFlag; - event.param = RF_PLACARD; - + event.code = kInterfaceEvent; + event.op = kEventClearStatus; q_event = _vm->_events->chain(q_event, &event); event.type = kEvTOneshot; @@ -1361,7 +1214,6 @@ void Script::sfPlacard(SCRIPTFUNC_PARAMS) { event.param3 = _vm->_scene->getHeight(); event.param4 = 0; event.param5 = _vm->getDisplayWidth(); - q_event = _vm->_events->chain(q_event, &event); // Put the text in the center of the viewport, assuming it will fit on @@ -1386,25 +1238,21 @@ void Script::sfPlacard(SCRIPTFUNC_PARAMS) { event.code = kTextEvent; event.op = kEventDisplay; event.data = _placardTextEntry; - q_event = _vm->_events->chain(q_event, &event); _vm->_scene->getBGPal(pal); - event.type = kEvTImmediate; event.code = kPalEvent; event.op = kEventBlackToPal; event.time = 0; event.duration = kNormalFadeDuration; event.data = pal; - q_event = _vm->_events->chain(q_event, &event); event.type = kEvTOneshot; event.code = kScriptEvent; event.op = kEventThreadWake; event.param = kWaitTypePlacard; - q_event = _vm->_events->chain(q_event, &event); } @@ -1419,8 +1267,7 @@ void Script::sfPlacardOff(SCRIPTFUNC_PARAMS) { void Script::sfPsychicProfile(SCRIPTFUNC_PARAMS) { thread->wait(kWaitTypePlacard); - int stringId = thread->pop(); - _vm->_scene->showPsychicProfile(thread->_strings->getString(stringId)); + _vm->_scene->showPsychicProfile(thread->_strings->getString(thread->pop())); } void Script::sfPsychicProfileOff(SCRIPTFUNC_PARAMS) { @@ -1433,9 +1280,7 @@ void Script::sfPsychicProfileOff(SCRIPTFUNC_PARAMS) { // Script function #50 (0x32) void Script::sfSetProtagState(SCRIPTFUNC_PARAMS) { - int protagState = thread->pop(); - - _vm->_actor->setProtagState(protagState); + _vm->_actor->setProtagState(thread->pop()); } // Script function #51 (0x33) @@ -1456,28 +1301,20 @@ void Script::sfResumeBgdAnim(SCRIPTFUNC_PARAMS) { // Param5: actionCycle // Param6: flags void Script::sfThrowActor(SCRIPTFUNC_PARAMS) { - int16 actorId; - ActorData *actor; - int16 flags; - int32 actionCycle; - Location location; + ActorData *actor = _vm->_actor->getActor(thread->pop()); + actor->_finalTarget.x = thread->pop(); + actor->_finalTarget.y = thread->pop(); + actor->_finalTarget.z = actor->_location.z; + thread->pop(); // not used + int32 actionCycle = thread->pop(); + int16 flags = thread->pop(); - actorId = thread->pop(); - location.x = thread->pop(); - location.y = thread->pop(); - thread->pop(); - actionCycle = thread->pop(); - flags = thread->pop(); - - actor = _vm->_actor->getActor(actorId); - location.z = actor->_location.z; actor->_currentAction = kActionFall; actor->_actionCycle = actionCycle; actor->_fallAcceleration = -20; actor->_fallVelocity = - (actor->_fallAcceleration * actor->_actionCycle) / 2; - actor->_fallPosition = actor->_location.z << 4; + actor->_fallPosition = actor->_location.z << 4; - actor->_finalTarget = location; actor->_actionCycle--; if (!(flags & kWalkAsync)) { thread->waitWalk(actor); @@ -1488,11 +1325,7 @@ void Script::sfThrowActor(SCRIPTFUNC_PARAMS) { // Param1: actor id // Param2: target object void Script::sfWaitWalk(SCRIPTFUNC_PARAMS) { - int16 actorId; - ActorData *actor; - - actorId = thread->pop(); - actor = _vm->_actor->getActor(actorId); + ActorData *actor = _vm->_actor->getActor(thread->pop()); if ((actor->_currentAction == kActionWalkToPoint) || (actor->_currentAction == kActionWalkToLink) || @@ -1510,14 +1343,8 @@ void Script::sfScriptSceneID(SCRIPTFUNC_PARAMS) { // Param1: actor id // Param2: scene number void Script::sfChangeActorScene(SCRIPTFUNC_PARAMS) { - int16 actorId; - int32 sceneNumber; - ActorData *actor; - - actorId = thread->pop(); - sceneNumber = thread->pop(); - actor = _vm->_actor->getActor(actorId); - actor->_sceneNumber = sceneNumber; + ActorData *actor = _vm->_actor->getActor(thread->pop()); + actor->_sceneNumber = thread->pop(); } // Script function #56 (0x38) @@ -1526,19 +1353,11 @@ void Script::sfChangeActorScene(SCRIPTFUNC_PARAMS) { // Param3: frame seq // Param4: flags void Script::sfScriptClimb(SCRIPTFUNC_PARAMS) { - int16 actorId; - int16 z; - ActorData *actor; - uint16 flags; - int cycleFrameSequence; - - actorId = thread->pop(); - z = thread->pop(); - cycleFrameSequence = thread->pop(); - flags = thread->pop(); + ActorData *actor = _vm->_actor->getActor(thread->pop()); + actor->_finalTarget.z = thread->pop(); + int cycleFrameSequence = thread->pop(); + uint16 flags = thread->pop(); - actor = _vm->_actor->getActor(actorId); - actor->_finalTarget.z = z; actor->_flags &= ~kFollower; actor->_actionCycle = 1; actor->_cycleFrameSequence = cycleFrameSequence; @@ -1552,10 +1371,8 @@ void Script::sfScriptClimb(SCRIPTFUNC_PARAMS) { // Param1: door # // Param2: door state void Script::sfSetDoorState(SCRIPTFUNC_PARAMS) { - int16 doorNumber; - int16 doorState; - doorNumber = thread->pop(); - doorState = thread->pop(); + int16 doorNumber = thread->pop(); + int16 doorState = thread->pop(); if (_vm->_scene->getFlags() & kSceneFlagISO) { _vm->_isoMap->setTileDoorState(doorNumber, doorState); @@ -1568,14 +1385,10 @@ void Script::sfSetDoorState(SCRIPTFUNC_PARAMS) { // Param1: actor id // Param2: z void Script::sfSetActorZ(SCRIPTFUNC_PARAMS) { - int16 objectId; + int16 objectId = thread->pop(); + int16 z = thread->pop(); ActorData *actor; ObjectData *obj; - int16 z; - - objectId = thread->pop(); - z = thread->pop(); - if (_vm->_actor->validActorId(objectId)) { actor = _vm->_actor->getActor(objectId); @@ -1595,22 +1408,15 @@ void Script::sfSetActorZ(SCRIPTFUNC_PARAMS) { // Param4: x // Param5: y void Script::sfScriptText(SCRIPTFUNC_PARAMS) { - int16 stringId; - int16 flags; - Rect rect; - int color; + const char *text = thread->_strings->getString(thread->pop()); + int16 flags = thread->pop(); + int color = thread->pop(); Point point; - int width; - const char*text; - stringId = thread->pop(); - flags = thread->pop(); - color = thread->pop(); point.x = thread->pop(); point.y = thread->pop(); + Rect rect; + int width = _vm->_font->getStringWidth(kKnownFontScript, text, 0, kFontOutline); - text = thread->_strings->getString(stringId); - - width = _vm->_font->getStringWidth(kKnownFontScript, text, 0, kFontOutline); rect.top = point.y - 6; rect.setHeight(12); rect.left = point.x - width / 2; @@ -1623,11 +1429,7 @@ void Script::sfScriptText(SCRIPTFUNC_PARAMS) { // Script function #60 (0x3C) // Param1: actor id void Script::sfGetActorX(SCRIPTFUNC_PARAMS) { - int16 actorId; - ActorData *actor; - - actorId = thread->pop(); - actor = _vm->_actor->getActor(actorId); + ActorData *actor = _vm->_actor->getActor(thread->pop()); thread->_returnValue = actor->_location.x >> 2; } @@ -1635,23 +1437,17 @@ void Script::sfGetActorX(SCRIPTFUNC_PARAMS) { // Script function #61 (0x3D) // Param1: actor id void Script::sfGetActorY(SCRIPTFUNC_PARAMS) { - int16 actorId; - ActorData *actor; - - actorId = thread->pop(); - actor = _vm->_actor->getActor(actorId); + ActorData *actor = _vm->_actor->getActor(thread->pop()); thread->_returnValue = actor->_location.y >> 2; } // Script function #62 (0x3E) void Script::sfEraseDelta(SCRIPTFUNC_PARAMS) { - Surface *backGroundSurface; + Surface *backGroundSurface = _vm->_render->getBackGroundSurface(); BGInfo backGroundInfo; - backGroundSurface = _vm->_render->getBackGroundSurface(); _vm->_scene->getBGInfo(backGroundInfo); - backGroundSurface->blit(backGroundInfo.bounds, backGroundInfo.buffer); } @@ -1712,12 +1508,11 @@ void Script::sfPickClimbOutPos(SCRIPTFUNC_PARAMS) { // Script function #65 (0x41) void Script::sfTossRif(SCRIPTFUNC_PARAMS) { - int16 uc , vc; uint16 direction; ActorData *protagonist = _vm->_actor->_protagonist; + int16 uc = protagonist->_location.u() >> 4; + int16 vc = protagonist->_location.v() >> 4; - uc = protagonist->_location.u() >> 4; - vc = protagonist->_location.v() >> 4; if (_vm->_isoMap->findNearestChasm(uc, vc, direction)) { uc <<= 4; vc <<= 4; @@ -1793,10 +1588,9 @@ void Script::sfPlayLoopedSound(SCRIPTFUNC_PARAMS) { } // Script function #72 (0x48) +// Param1: animation id void Script::sfGetDeltaFrame(SCRIPTFUNC_PARAMS) { - uint16 animId = (uint16)thread->pop(); - - thread->_returnValue = _vm->_anim->getCurrentFrame(animId); + thread->_returnValue = _vm->_anim->getCurrentFrame((uint16)thread->pop()); } // Script function #73 (0x49) @@ -1813,10 +1607,8 @@ void Script::sfProtectResult(SCRIPTFUNC_PARAMS) { if (_vm->_copyProtection) { thread->_returnValue = _vm->_interface->getProtectHash(); } else { - int protectHash; - //cheating - protectHash = thread->pop(); + int protectHash = thread->pop(); thread->push(protectHash); thread->_returnValue = protectHash; } @@ -1824,10 +1616,7 @@ void Script::sfProtectResult(SCRIPTFUNC_PARAMS) { // Script function #75 (0x4b) void Script::sfRand(SCRIPTFUNC_PARAMS) { - int16 param; - - param = thread->pop(); - thread->_returnValue = _vm->_rnd.getRandomNumber(param - 1); + thread->_returnValue = _vm->_rnd.getRandomNumber(thread->pop() - 1); } // Script function #76 (0x4c) @@ -1839,7 +1628,6 @@ void Script::sfFadeMusic(SCRIPTFUNC_PARAMS) { void Script::sfPlayVoice(SCRIPTFUNC_PARAMS) { int16 param = thread->pop(); - warning("sfPlayVoice(%d)", param); if (param > 0) { _vm->_sndRes->playVoice(param + 3712); } else { @@ -1881,13 +1669,24 @@ void Script::finishDialog(int strID, int replyID, int flags, int bitOffset) { } void Script::sfSetChapterPoints(SCRIPTFUNC_PARAMS) { - int16 ethics = thread->pop(); - int16 barometer = thread->pop(); int chapter = _vm->_scene->currentChapterNumber(); + _vm->_ethicsPoints[chapter] = thread->pop(); + int16 barometer = thread->pop(); + static PalEntry cur_pal[PAL_ENTRIES]; - _vm->_ethicsPoints[chapter] = ethics; - _vm->_spiritualBarometer = ethics * 256 / barometer; + _vm->_spiritualBarometer = _vm->_ethicsPoints[chapter] * 256 / barometer; _vm->_scene->setChapterPointsChanged(true); // don't save this music when saving in IHNM + + if (_vm->_spiritualBarometer > 255) + _vm->_gfx->setPaletteColor(kIHNMColorPortrait, 0xff, 0xff, 0xff); + else + _vm->_gfx->setPaletteColor(kIHNMColorPortrait, + _vm->_spiritualBarometer * _vm->_interface->_portraitBgColor.red / 256, + _vm->_spiritualBarometer * _vm->_interface->_portraitBgColor.green / 256, + _vm->_spiritualBarometer * _vm->_interface->_portraitBgColor.blue / 256); + + _vm->_gfx->getCurrentPal(cur_pal); + _vm->_gfx->setPalette(cur_pal); } void Script::sfSetPortraitBgColor(SCRIPTFUNC_PARAMS) { @@ -1899,12 +1698,9 @@ void Script::sfSetPortraitBgColor(SCRIPTFUNC_PARAMS) { } void Script::sfScriptStartCutAway(SCRIPTFUNC_PARAMS) { - int16 cut; - int16 fade; - - cut = thread->pop(); + int16 cut = thread->pop(); thread->pop(); // Not used - fade = thread->pop(); + int16 fade = thread->pop(); _vm->_anim->setCutAwayMode(kPanelCutaway); _vm->_anim->playCutaway(cut, fade != 0); @@ -1930,61 +1726,37 @@ void Script::sfResetMouseClicks(SCRIPTFUNC_PARAMS) { // Used in IHNM only // Param1: frames void Script::sfWaitFrames(SCRIPTFUNC_PARAMS) { - int16 frames; - frames = thread->pop(); - - // HACK for the nightfall scene in Benny's chapter - // sfWaitFrames is supposed to wait for fadein and fadeout during that cutaway, but we - // don't support it yet (function sfScriptFade). This is a temporary hack to avoid - // having ScummVM wait for ever in that cutaway - // FIXME: Remove this hack once the palette fading is properly handled - if (_vm->_scene->currentChapterNumber() == 2 && _vm->_scene->currentSceneNumber() == 41 && _vm->_anim->hasCutaway()) - return; + int16 frames = thread->pop(); if (!_skipSpeeches) thread->waitFrames(_vm->_frameCount + frames); } void Script::sfScriptFade(SCRIPTFUNC_PARAMS) { - thread->pop(); // first pal entry, ignored (already handled by Gfx::palToBlack) - thread->pop(); // last pal entry, ignored (already handled by Gfx::palToBlack) + int16 firstPalEntry = thread->pop(); + int16 lastPalEntry = thread->pop(); int16 startingBrightness = thread->pop(); int16 endingBrightness = thread->pop(); - // delay between pal changes is always 10 (not used) - static PalEntry cur_pal[PAL_ENTRIES]; Event event; - short delta = (startingBrightness < endingBrightness) ? +1 : -1; + static PalEntry cur_pal[PAL_ENTRIES]; _vm->_gfx->getCurrentPal(cur_pal); - - // TODO: This is still wrong, probably a new event type needs to be added (kEventPalFade) - warning("TODO: sfScriptFade"); - return; - - if (startingBrightness > 255) - startingBrightness = 255; - if (startingBrightness < 0 ) - startingBrightness = 0; - if (endingBrightness > 255) - endingBrightness = 255; - if (endingBrightness < 0) - endingBrightness = 0; - event.type = kEvTImmediate; event.code = kPalEvent; - event.op = kEventPalToBlack; + event.op = kEventPalFade; event.time = 0; - event.duration = kNormalFadeDuration - ((endingBrightness - startingBrightness) * delta); + event.duration = kNormalFadeDuration; event.data = cur_pal; - - _vm->_events->queue(&event); + event.param = startingBrightness; + event.param2 = endingBrightness; + event.param3 = firstPalEntry; + event.param4 = lastPalEntry - firstPalEntry + 1; + _vm->_events->queue(&event); } void Script::sfScriptStartVideo(SCRIPTFUNC_PARAMS) { - int16 vid; - int16 fade; - vid = thread->pop(); - fade = thread->pop(); + int16 vid = thread->pop(); + int16 fade = thread->pop(); _vm->_anim->setCutAwayMode(kPanelVideo); _vm->_anim->startVideo(vid, fade != 0); @@ -2006,14 +1778,10 @@ void Script::sfShowIHNMDemoHelpBg(SCRIPTFUNC_PARAMS) { } void Script::sfAddIHNMDemoHelpTextLine(SCRIPTFUNC_PARAMS) { - int stringId, textHeight; + int stringId = thread->pop(); TextListEntry textEntry; Event event; - stringId = thread->pop(); - - textHeight = _vm->_font->getHeight(kKnownFontVerb, thread->_strings->getString(stringId), 226, kFontCentered); - textEntry.knownColor = kKnownColorBlack; textEntry.useRect = true; textEntry.rect.left = 245; @@ -2030,10 +1798,9 @@ void Script::sfAddIHNMDemoHelpTextLine(SCRIPTFUNC_PARAMS) { event.code = kTextEvent; event.op = kEventDisplay; event.data = _psychicProfileTextEntry; - _vm->_events->queue(&event); - _ihnmDemoCurrentY += 10; + _ihnmDemoCurrentY += _vm->_font->getHeight(kKnownFontVerb, thread->_strings->getString(stringId), 226, kFontCentered); } void Script::sfShowIHNMDemoHelpPage(SCRIPTFUNC_PARAMS) { @@ -2051,9 +1818,14 @@ void Script::sfVstopLoopedFX(SCRIPTFUNC_PARAMS) { _vm->_sound->stopSound(); } -void Script::sf92(SCRIPTFUNC_PARAMS) { - SF_stub("sf92", thread, nArgs); - // This opcode is empty in the full version of IHNM, but it's not empty in the demo +void Script::sfDemoSetInteractive(SCRIPTFUNC_PARAMS) { + if (thread->pop() == 0) { + _vm->_interface->deactivate(); + _vm->_interface->setMode(kPanelNull); + } + + // Note: the original also sets an appropriate flag here, but we don't, + // as we don't use it } void Script::sfDemoIsInteractive(SCRIPTFUNC_PARAMS) { @@ -2159,7 +1931,6 @@ void Script::sfQueueMusic(SCRIPTFUNC_PARAMS) { // change // FIXME: If this is too short for other cases apart from chapter // point change, set it back to 1000 - _vm->_events->queue(&event); if (!_vm->_scene->haveChapterPointsChanged()) { @@ -2173,9 +1944,7 @@ void Script::sfQueueMusic(SCRIPTFUNC_PARAMS) { } void Script::sfDisableAbortSpeeches(SCRIPTFUNC_PARAMS) { - int value = thread->pop(); - - _vm->_interface->disableAbortSpeeches(value != 0); + _vm->_interface->disableAbortSpeeches(thread->pop() != 0); } void Script::sfNull(SCRIPTFUNC_PARAMS) { diff --git a/engines/saga/sndres.cpp b/engines/saga/sndres.cpp index edbdebabab..ac21656dfa 100644 --- a/engines/saga/sndres.cpp +++ b/engines/saga/sndres.cpp @@ -101,8 +101,7 @@ SndRes::~SndRes() { } } -void SndRes::setVoiceBank(int serial) -{ +void SndRes::setVoiceBank(int serial) { if (_voiceSerial == serial) return; _voiceSerial = serial; @@ -183,9 +182,9 @@ bool SndRes::load(ResourceContext *context, uint32 resourceId, SoundBuffer &buff } bool uncompressedSound = false; - // If a patch file exists for sound resource 4 (used in ITE intro), don't treat this sound as compressed - if (_vm->getGameType() == GType_ITE && resourceId == 4 && - (Common::File::exists("sound/p2_a.iaf") || Common::File::exists("sound/p2_a.voc"))) + // If patch data exists for sound resource 4 (used in ITE intro), don't treat this sound as compressed + // Patch data for this resource is in file p2_a.iaf or p2_a.voc + if (_vm->getGameType() == GType_ITE && resourceId == 4 && context->table[resourceId].patchData != NULL) uncompressedSound = true; // FIXME: Currently, the SFX.RES file in IHNM cannot be compressed diff --git a/engines/scumm/actor.cpp b/engines/scumm/actor.cpp index 187a45b836..38517c1d69 100644 --- a/engines/scumm/actor.cpp +++ b/engines/scumm/actor.cpp @@ -523,7 +523,7 @@ void Actor_v2::walkActor() { if (_moving & MF_TURN) { new_dir = updateActorDirection(false); - // FIXME -- is this correct? + // FIXME: is this correct? if (_facing != new_dir) setDirection(new_dir); else @@ -670,7 +670,7 @@ int Actor::remapDirection(int dir, bool is_walking) { bool flipX; bool flipY; - // FIXME - It seems that at least in The Dig the original code does + // FIXME: It seems that at least in The Dig the original code does // check _ignoreBoxes here. However, it breaks some animations in Loom, // causing Bobbin to face towards the camera instead of away from it // in some places: After the tree has been destroyed by lightning, and @@ -1446,7 +1446,7 @@ void Actor::drawActorCostume(bool hitTestMode) { bcr->_actorX *= V12_X_MULTIPLIER; bcr->_actorY *= V12_Y_MULTIPLIER; } - bcr->_actorX -= _vm->virtscr[0].xstart; + bcr->_actorX -= _vm->_virtscr[kMainVirtScreen].xstart; if (_vm->_game.platform == Common::kPlatformNES) { // In the NES version, when the actor is facing right, @@ -1532,7 +1532,7 @@ void Actor::drawActorCostume(bool hitTestMode) { _heNoTalkAnimation = 0; // If the actor is partially hidden, redraw it next frame. - if (bcr->drawCostume(_vm->virtscr[0], _vm->_gdi->_numStrips, this, _drawToBackBuf) & 1) { + if (bcr->drawCostume(_vm->_virtscr[kMainVirtScreen], _vm->_gdi->_numStrips, this, _drawToBackBuf) & 1) { _needRedraw = (_vm->_game.version <= 6); } @@ -1902,7 +1902,7 @@ void ScummEngine::actorTalk(const byte *msg) { convertMessageToString(msg, _charsetBuffer, sizeof(_charsetBuffer)); - // FIXME: Workaround for bugs #770039 and #770049 + // WORKAROUND for bugs #770039 and #770049 if (_game.id == GID_LOOM) { if (!*_charsetBuffer) return; @@ -2325,7 +2325,7 @@ void ScummEngine_v71he::postProcessAuxQueue() { int y = (int16)READ_LE_UINT16(axfd + 4) + dy; int w = (int16)READ_LE_UINT16(axfd + 6); int h = (int16)READ_LE_UINT16(axfd + 8); - VirtScreen *pvs = &virtscr[kMainVirtScreen]; + VirtScreen *pvs = &_virtscr[kMainVirtScreen]; uint8 *dst1 = pvs->getPixels(0, pvs->topline); uint8 *dst2 = pvs->getBackPixels(0, pvs->topline); switch (comp) { diff --git a/engines/scumm/akos.cpp b/engines/scumm/akos.cpp index c8667d7ab2..86a19540d6 100644 --- a/engines/scumm/akos.cpp +++ b/engines/scumm/akos.cpp @@ -546,7 +546,7 @@ void AkosRenderer::codec1_genericDecode(Codec1 &v1) { scaleytab = &v1.scaletable[v1.scaleYindex]; maskbit = revBitMask(v1.x & 7); - mask = _vm->getMaskBuffer(v1.x - (_vm->virtscr[0].xstart & 7), v1.y, _zbuf); + mask = _vm->getMaskBuffer(v1.x - (_vm->_virtscr[kMainVirtScreen].xstart & 7), v1.y, _zbuf); if (len) goto StartPos; @@ -610,17 +610,13 @@ void AkosRenderer::codec1_genericDecode(Codec1 &v1) { skip_column = true; v1.scaleXindex += v1.scaleXstep; dst = v1.destptr; - mask = _vm->getMaskBuffer(v1.x - (_vm->virtscr[0].xstart & 7), v1.y, _zbuf); + mask = _vm->getMaskBuffer(v1.x - (_vm->_virtscr[kMainVirtScreen].xstart & 7), v1.y, _zbuf); } StartPos:; } while (--len); } while (1); } -#ifdef PALMOS_68K -const byte *bigCostumeScaleTable; -const byte *smallCostumeScaleTableAKOS; -#else // This is exact duplicate of smallCostumeScaleTable[] in costume.cpp // See FIXME below for explanation const byte smallCostumeScaleTableAKOS[256] = { @@ -757,7 +753,6 @@ const byte bigCostumeScaleTable[768] = { 0x0F, 0x8F, 0x4F, 0xCF, 0x2F, 0xAF, 0x6F, 0xEF, 0x1F, 0x9F, 0x5F, 0xDF, 0x3F, 0xBF, 0x7F, 0xFF, }; -#endif byte AkosRenderer::codec1(int xmoveCur, int ymoveCur) { int num_colors; @@ -987,8 +982,8 @@ byte AkosRenderer::codec1(int xmoveCur, int ymoveCur) { } void AkosRenderer::markRectAsDirty(Common::Rect rect) { - rect.left -= _vm->virtscr[0].xstart & 7; - rect.right -= _vm->virtscr[0].xstart & 7; + rect.left -= _vm->_virtscr[kMainVirtScreen].xstart & 7; + rect.right -= _vm->_virtscr[kMainVirtScreen].xstart & 7; _vm->markRectAsDirty(kMainVirtScreen, rect, _actorID); } @@ -1862,18 +1857,3 @@ void ScummEngine_v7::akos_processQueue() { #endif } // End of namespace Scumm - -#ifdef PALMOS_68K -#include "scumm_globals.h" - -_GINIT(Akos) -_GSETPTR(Scumm::bigCostumeScaleTable, GBVARS_BIGSCALETABLE_INDEX, byte, GBVARS_SCUMM) -//_GSETPTR(Scumm::smallCostumeScaleTableAKOS, GBVARS_SMALLSCALETABLEAKOS_INDEX, byte, GBVARS_SCUMM) -_GEND - -_GRELEASE(Akos) -_GRELEASEPTR(GBVARS_BIGSCALETABLE_INDEX, GBVARS_SCUMM) -//_GRELEASEPTR(GBVARS_SMALLSCALETABLEAKOS_INDEX, GBVARS_SCUMM) -_GEND - -#endif diff --git a/engines/scumm/base-costume.cpp b/engines/scumm/base-costume.cpp index 8886dbfcd4..fe87dc65ec 100644 --- a/engines/scumm/base-costume.cpp +++ b/engines/scumm/base-costume.cpp @@ -39,9 +39,9 @@ byte BaseCostumeRenderer::drawCostume(const VirtScreen &vs, int numStrips, const else _out.pixels = vs.getPixels(0, 0); - _actorX += _vm->virtscr[0].xstart & 7; + _actorX += _vm->_virtscr[kMainVirtScreen].xstart & 7; _out.w = _out.pitch; - _out.pixels = (byte *)_out.pixels - (_vm->virtscr[0].xstart & 7); + _out.pixels = (byte *)_out.pixels - (_vm->_virtscr[kMainVirtScreen].xstart & 7); _numStrips = numStrips; diff --git a/engines/scumm/base-costume.h b/engines/scumm/base-costume.h index 155bbff97f..7acaff2679 100644 --- a/engines/scumm/base-costume.h +++ b/engines/scumm/base-costume.h @@ -42,15 +42,8 @@ struct CostumeInfo { #include "common/pack-end.h" // END STRUCT PACKING - -#ifdef PALMOS_68K -extern const byte *smallCostumeScaleTable; -extern const byte *bigCostumeScaleTable; -#else extern const byte smallCostumeScaleTable[256]; extern const byte bigCostumeScaleTable[768]; -#endif - class Actor; diff --git a/engines/scumm/camera.cpp b/engines/scumm/camera.cpp index d6ecc715ea..ea6ac9b528 100644 --- a/engines/scumm/camera.cpp +++ b/engines/scumm/camera.cpp @@ -199,7 +199,7 @@ void ScummEngine::cameraMoved() { screenLeft = _screenStartStrip * 8; } - virtscr[0].xstart = screenLeft; + _virtscr[kMainVirtScreen].xstart = screenLeft; } void ScummEngine::panCameraTo(int x, int y) { diff --git a/engines/scumm/charset.cpp b/engines/scumm/charset.cpp index 2271bf53a1..6eb6cfd7c6 100644 --- a/engines/scumm/charset.cpp +++ b/engines/scumm/charset.cpp @@ -50,10 +50,7 @@ void ScummEngine::loadCJKFont() { _useCJKMode = false; _textSurfaceMultiplier = 1; - if (_game.platform == Common::kPlatformSegaCD) - return; - - if (_language == Common::JA_JPN && _game.version <= 5) { // FM-TOWNS v3 / v5 Kanji + if (_game.version <= 5 && _game.platform == Common::kPlatformFMTowns && _language == Common::JA_JPN) { // FM-TOWNS v3 / v5 Kanji int numChar = 256 * 32; _2byteWidth = 16; _2byteHeight = 16; @@ -66,7 +63,7 @@ void ScummEngine::loadCJKFont() { fp.close(); } _textSurfaceMultiplier = 2; - } else if (_language == Common::KO_KOR || _language == Common::JA_JPN || _language == Common::ZH_TWN) { + } else if (_game.version >= 7 && (_language == Common::KO_KOR || _language == Common::JA_JPN || _language == Common::ZH_TWN)) { int numChar = 0; const char *fontFile = NULL; @@ -77,7 +74,7 @@ void ScummEngine::loadCJKFont() { break; case Common::JA_JPN: fontFile = (_game.id == GID_DIG) ? "kanji16.fnt" : "japanese.fnt"; - numChar = 1024; //FIXME + numChar = 1024; //FIXME: sev needs japanese font files to clarify font size break; case Common::ZH_TWN: if (_game.id == GID_CMI) { @@ -501,13 +498,6 @@ void CharsetRenderer::addLinebreaks(int a, byte *str, int pos, int maxwidth) { setCurID(oldID); } -#ifdef PALMOS_68K -static const byte *englishCharsetDataV2; -static const byte *germanCharsetDataV2; -static const byte *frenchCharsetDataV2; -static const byte *italianCharsetDataV2; -static const byte *spanishCharsetDataV2; -#else // English Zak font static const byte englishCharsetDataV2[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -1168,7 +1158,6 @@ static const byte spanishCharsetDataV2[] = { 0x1c, 0x36, 0x36, 0x7c, 0x66, 0x66, 0x7c, 0x40, 0x08, 0x0c, 0x0e, 0xff, 0xff, 0x0e, 0x0c, 0x08, }; -#endif CharsetRendererV2::CharsetRendererV2(ScummEngine *vm, Common::Language language) : CharsetRendererV3(vm) { @@ -1237,8 +1226,7 @@ int CharsetRendererV3::getCharWidth(byte chr) { return spacing; } -void CharsetRendererV3::setColor(byte color) -{ +void CharsetRendererV3::setColor(byte color) { bool useShadow = false; _color = color; @@ -1769,7 +1757,7 @@ void CharsetRendererNut::printChar(int chr, bool ignoreCharsetMask) { int drawTop = _top; if (ignoreCharsetMask) { - VirtScreen *vs = &_vm->virtscr[kMainVirtScreen]; + VirtScreen *vs = &_vm->_virtscr[kMainVirtScreen]; s = *vs; s.pixels = vs->getPixels(0, 0); } else { @@ -1893,24 +1881,3 @@ void CharsetRendererNES::drawBits1(const Graphics::Surface &s, byte *dst, const } } // End of namespace Scumm - -#ifdef PALMOS_68K -#include "scumm_globals.h" - -_GINIT(Charset) -_GSETPTR(Scumm::germanCharsetDataV2, GBVARS_GERMANCHARSETDATAV2_INDEX, byte, GBVARS_SCUMM) -_GSETPTR(Scumm::frenchCharsetDataV2, GBVARS_FRENCHCHARSETDATAV2_INDEX, byte, GBVARS_SCUMM) -_GSETPTR(Scumm::englishCharsetDataV2, GBVARS_ENGLISHCHARSETDATAV2_INDEX, byte, GBVARS_SCUMM) -_GSETPTR(Scumm::italianCharsetDataV2, GBVARS_ITALIANCHARSETDATAV2_INDEX, byte, GBVARS_SCUMM) -_GSETPTR(Scumm::spanishCharsetDataV2, GBVARS_SPANISHCHARSETDATAV2_INDEX, byte, GBVARS_SCUMM) -_GEND - -_GRELEASE(Charset) -_GRELEASEPTR(GBVARS_GERMANCHARSETDATAV2_INDEX, GBVARS_SCUMM) -_GRELEASEPTR(GBVARS_FRENCHCHARSETDATAV2_INDEX, GBVARS_SCUMM) -_GRELEASEPTR(GBVARS_ENGLISHCHARSETDATAV2_INDEX, GBVARS_SCUMM) -_GRELEASEPTR(GBVARS_ITALIANCHARSETDATAV2_INDEX, GBVARS_SCUMM) -_GRELEASEPTR(GBVARS_SPANISHCHARSETDATAV2_INDEX, GBVARS_SCUMM) -_GEND - -#endif diff --git a/engines/scumm/costume.cpp b/engines/scumm/costume.cpp index 2c5be5bf21..ac61d39d25 100644 --- a/engines/scumm/costume.cpp +++ b/engines/scumm/costume.cpp @@ -32,9 +32,6 @@ namespace Scumm { -#ifdef PALMOS_68K -const byte *smallCostumeScaleTable; -#else const byte smallCostumeScaleTable[256] = { 0xFF, 0xFD, 0x7D, 0xBD, 0x3D, 0xDD, 0x5D, 0x9D, 0x1D, 0xED, 0x6D, 0xAD, 0x2D, 0xCD, 0x4D, 0x8D, @@ -69,7 +66,6 @@ const byte smallCostumeScaleTable[256] = { 0x0E, 0x8E, 0x4E, 0xCE, 0x2E, 0xAE, 0x6E, 0xEE, 0x1E, 0x9E, 0x5E, 0xDE, 0x3E, 0xBE, 0x7E, 0xFE }; -#endif static const int v1MMNESLookup[25] = { 0x00, 0x03, 0x01, 0x06, 0x08, @@ -1165,16 +1161,3 @@ byte C64CostumeLoader::increaseAnim(Actor *a, int slot) { } // End of namespace Scumm - -#ifdef PALMOS_68K -#include "scumm_globals.h" - -_GINIT(Costume) -_GSETPTR(Scumm::smallCostumeScaleTable, GBVARS_SMALLSCALETABLE_INDEX, byte, GBVARS_SCUMM) -_GEND - -_GRELEASE(Costume) -_GRELEASEPTR(GBVARS_SMALLSCALETABLE_INDEX, GBVARS_SCUMM) -_GEND - -#endif diff --git a/engines/scumm/cursor.cpp b/engines/scumm/cursor.cpp index 23657946c6..b8b2cbcb6d 100644 --- a/engines/scumm/cursor.cpp +++ b/engines/scumm/cursor.cpp @@ -236,7 +236,7 @@ void ScummEngine_v6::setCursorFromImg(uint img, uint room, uint imgindex) { } void ScummEngine_v6::useIm01Cursor(const byte *im, int w, int h) { - VirtScreen *vs = &virtscr[0]; + VirtScreen *vs = &_virtscr[kMainVirtScreen]; byte *buf, *dst; const byte *src; int i; diff --git a/engines/scumm/debugger.cpp b/engines/scumm/debugger.cpp index 83ba9e24c1..68a001c983 100644 --- a/engines/scumm/debugger.cpp +++ b/engines/scumm/debugger.cpp @@ -652,7 +652,7 @@ static int gfxPrimitivesCompareInt(const void *a, const void *b); static void hlineColor(ScummEngine *scumm, int x1, int x2, int y, byte color) { - VirtScreen *vs = &scumm->virtscr[0]; + VirtScreen *vs = &scumm->_virtscr[kMainVirtScreen]; byte *ptr; // Clip y diff --git a/engines/scumm/detection.cpp b/engines/scumm/detection.cpp index be830cab64..90c6e40aa7 100644 --- a/engines/scumm/detection.cpp +++ b/engines/scumm/detection.cpp @@ -18,8 +18,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL:https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/branches/gsoc2007-fsnode/engines/scumm/detection.cpp $ - * $Id:detection.cpp 26949 2007-05-26 20:23:24Z david_corrales $ + * $URL$ + * $Id$ * */ @@ -56,11 +56,7 @@ static int compareMD5Table(const void *a, const void *b) { } static const MD5Table *findInMD5Table(const char *md5) { -#ifdef PALMOS_68K - uint32 arraySize = MemPtrSize((void *)md5table) / sizeof(MD5Table) - 1; -#else uint32 arraySize = ARRAYSIZE(md5table) - 1; -#endif return (const MD5Table *)bsearch(md5, md5table, arraySize, sizeof(MD5Table), compareMD5Table); } @@ -886,11 +882,9 @@ PluginError Engine_SCUMM_create(OSystem *syst, Engine **engine) { *engine = new ScummEngine_v70he(syst, res); break; #endif -#ifndef PALMOS_68K case 61: *engine = new ScummEngine_v60he(syst, res); break; -#endif default: *engine = new ScummEngine_v6(syst, res); } @@ -913,16 +907,3 @@ PluginError Engine_SCUMM_create(OSystem *syst, Engine **engine) { REGISTER_PLUGIN(SCUMM, "Scumm Engine", "LucasArts SCUMM Games (C) LucasArts\n" "Humongous SCUMM Games (C) Humongous" ); - -#ifdef PALMOS_68K -#include "scumm_globals.h" - -_GINIT(Scumm_md5table) -_GSETPTR(md5table, GBVARS_MD5TABLE_INDEX, MD5Table, GBVARS_SCUMM) -_GEND - -_GRELEASE(Scumm_md5table) -_GRELEASEPTR(GBVARS_MD5TABLE_INDEX, GBVARS_SCUMM) -_GEND - -#endif diff --git a/engines/scumm/detection.h b/engines/scumm/detection.h index d0fefe3a29..bc67aafb7e 100644 --- a/engines/scumm/detection.h +++ b/engines/scumm/detection.h @@ -18,8 +18,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL:https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/branches/gsoc2007-fsnode/engines/scumm/detection.h $ - * $Id:detection.h 26949 2007-05-26 20:23:24Z david_corrales $ + * $URL$ + * $Id$ * */ diff --git a/engines/scumm/detection_tables.h b/engines/scumm/detection_tables.h index acde4e5ad0..70118b9baf 100644 --- a/engines/scumm/detection_tables.h +++ b/engines/scumm/detection_tables.h @@ -18,8 +18,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL:https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/branches/gsoc2007-fsnode/engines/scumm/detection_tables.h $ - * $Id:detection_tables.h 26949 2007-05-26 20:23:24Z david_corrales $ + * $URL$ + * $Id$ * */ @@ -37,11 +37,7 @@ //#include "scumm/intern.h" //#include "scumm/he/intern_he.h" -#ifdef PALMOS_68K -#include "extras/palm-scumm-md5.h" -#else #include "scumm/scumm-md5.h" -#endif namespace Scumm { @@ -399,6 +395,7 @@ static const GameFilenamePattern gameFilenamesTable[] = { { "maniac", "Maniac Mansion (SW).prg", kGenUnchanged, Common::SE_SWE, Common::kPlatformNES, "NES" }, { "maniac", "Maniac Mansion (U).prg", kGenUnchanged, Common::EN_USA, Common::kPlatformNES, "NES" }, { "maniac", "Maniac Mansion (G).prg", kGenUnchanged, Common::DE_DEU, Common::kPlatformNES, "NES" }, + { "maniac", "Maniac Mansion (Sp).prg", kGenUnchanged, Common::ES_ESP, Common::kPlatformNES, "NES" }, { "zak", "%02d.LFL", kGenRoomNum, UNK_LANG, UNK, 0 }, { "zak", "zak1.d64", kGenUnchanged, UNK_LANG, Common::kPlatformC64, 0 }, // ... and zak2.d64 diff --git a/engines/scumm/dialogs.cpp b/engines/scumm/dialogs.cpp index 85a72cb090..1666578c4c 100644 --- a/engines/scumm/dialogs.cpp +++ b/engines/scumm/dialogs.cpp @@ -81,11 +81,6 @@ struct ResString { char string[80]; }; -#ifdef PALMOS_68K -static const ResString *string_map_table_v7; -static const ResString *string_map_table_v6; -static const ResString *string_map_table_v5; -#else static const ResString string_map_table_v8[] = { {0, "/BT_100/Please insert disk %d. Press ENTER"}, {0, "/BT__003/Unable to Find %s, (%s %d) Press Button."}, @@ -216,7 +211,6 @@ static const ResString string_map_table_v345[] = { {20, "Select a game to LOAD"}, {28, "Game title"} }; -#endif #pragma mark - @@ -967,20 +961,3 @@ void Indy3IQPointsDialog::handleKeyDown(Common::KeyState state) { } } // End of namespace Scumm - -#ifdef PALMOS_68K -#include "scumm_globals.h" - -_GINIT(Dialogs) -_GSETPTR(Scumm::string_map_table_v7, GBVARS_STRINGMAPTABLEV7_INDEX, Scumm::ResString, GBVARS_SCUMM) -_GSETPTR(Scumm::string_map_table_v6, GBVARS_STRINGMAPTABLEV6_INDEX, Scumm::ResString, GBVARS_SCUMM) -_GSETPTR(Scumm::string_map_table_v5, GBVARS_STRINGMAPTABLEV5_INDEX, Scumm::ResString, GBVARS_SCUMM) -_GEND - -_GRELEASE(Dialogs) -_GRELEASEPTR(GBVARS_STRINGMAPTABLEV7_INDEX, GBVARS_SCUMM) -_GRELEASEPTR(GBVARS_STRINGMAPTABLEV6_INDEX, GBVARS_SCUMM) -_GRELEASEPTR(GBVARS_STRINGMAPTABLEV5_INDEX, GBVARS_SCUMM) -_GEND - -#endif diff --git a/engines/scumm/file.cpp b/engines/scumm/file.cpp index 2c7f9ead5b..b80be63d32 100644 --- a/engines/scumm/file.cpp +++ b/engines/scumm/file.cpp @@ -24,9 +24,6 @@ */ #include "scumm/file.h" -#include "common/endian.h" -#include "common/util.h" -#include "common/md5.h" #include "scumm/scumm.h" @@ -196,1275 +193,6 @@ uint32 ScummFile::write(const void *, uint32) { } #pragma mark - -#pragma mark --- ScummNESFile --- -#pragma mark - - -enum ResType { - NES_UNKNOWN, - NES_GLOBDATA, - NES_ROOM, - NES_SCRIPT, - NES_SOUND, - NES_COSTUME, - NES_ROOMGFX, - NES_COSTUMEGFX, - NES_SPRPALS, - NES_SPRDESC, - NES_SPRLENS, - NES_SPROFFS, - NES_SPRDATA, - NES_CHARSET, - NES_PREPLIST -}; - -struct ScummNESFile::Resource { - uint32 offset; - uint16 length; - ResType type; -}; - -ScummNESFile::ScummNESFile() : _stream(0), _buf(0), _ROMset(kROMsetNum) { -} - -uint32 ScummNESFile::write(const void *, uint32) { - error("ScummNESFile does not support writing!"); - return 0; -} - -void ScummNESFile::setEnc(byte enc) { - _stream->setEnc(enc); -} - -#ifdef PALMOS_68K -static const ScummNESFile::Resource *res_roomgfx_usa; -static const ScummNESFile::Resource *res_roomgfx_eur; -static const ScummNESFile::Resource *res_roomgfx_swe; -static const ScummNESFile::Resource *res_roomgfx_fra; -static const ScummNESFile::Resource *res_roomgfx_ger; -#else -static const ScummNESFile::Resource res_roomgfx_usa[40] = { - { 0x04001, 0x03C9, NES_ROOMGFX }, { 0x043CA, 0x069E, NES_ROOMGFX }, { 0x04A68, 0x0327, NES_ROOMGFX }, { 0x04D8F, 0x053B, NES_ROOMGFX }, { 0x052CA, 0x06BE, NES_ROOMGFX }, - { 0x05988, 0x0682, NES_ROOMGFX }, { 0x0600A, 0x0778, NES_ROOMGFX }, { 0x06782, 0x0517, NES_ROOMGFX }, { 0x06C99, 0x07FB, NES_ROOMGFX }, { 0x07494, 0x07BE, NES_ROOMGFX }, - { 0x08001, 0x07A5, NES_ROOMGFX }, { 0x087A6, 0x06DD, NES_ROOMGFX }, { 0x08E83, 0x04EA, NES_ROOMGFX }, { 0x0936D, 0x0846, NES_ROOMGFX }, { 0x09BB3, 0x08C8, NES_ROOMGFX }, - { 0x0A47B, 0x0844, NES_ROOMGFX }, { 0x0ACBF, 0x0515, NES_ROOMGFX }, { 0x0B1D4, 0x0799, NES_ROOMGFX }, { 0x0B96D, 0x04BB, NES_ROOMGFX }, { 0x07C52, 0x0319, NES_ROOMGFX }, - { 0x0C001, 0x0464, NES_ROOMGFX }, { 0x0C465, 0x076D, NES_ROOMGFX }, { 0x0CBD2, 0x0827, NES_ROOMGFX }, { 0x0D3F9, 0x0515, NES_ROOMGFX }, { 0x0D90E, 0x064E, NES_ROOMGFX }, - { 0x0DF5C, 0x0775, NES_ROOMGFX }, { 0x0E6D1, 0x06DD, NES_ROOMGFX }, { 0x0EDAE, 0x0376, NES_ROOMGFX }, { 0x0F124, 0x05F7, NES_ROOMGFX }, { 0x0F71B, 0x0787, NES_ROOMGFX }, - { 0x10001, 0x02D6, NES_ROOMGFX }, { 0x102D7, 0x06A3, NES_ROOMGFX }, { 0x1097A, 0x099F, NES_ROOMGFX }, { 0x11319, 0x0361, NES_ROOMGFX }, { 0x1167A, 0x0489, NES_ROOMGFX }, - { 0x11B03, 0x0437, NES_ROOMGFX }, { 0x11F3A, 0x084D, NES_ROOMGFX }, { 0x0BE28, 0x0199, NES_ROOMGFX }, { 0x12787, 0x09A7, NES_ROOMGFX }, { 0x1312E, 0x037A, NES_ROOMGFX } -}; -static const ScummNESFile::Resource res_roomgfx_eur[40] = { - { 0x04001, 0x03B9, NES_ROOMGFX }, { 0x043BA, 0x069E, NES_ROOMGFX }, { 0x04A58, 0x0327, NES_ROOMGFX }, { 0x04D7F, 0x053B, NES_ROOMGFX }, { 0x052BA, 0x06BE, NES_ROOMGFX }, - { 0x05978, 0x0682, NES_ROOMGFX }, { 0x05FFA, 0x0778, NES_ROOMGFX }, { 0x06772, 0x0517, NES_ROOMGFX }, { 0x06C89, 0x07FB, NES_ROOMGFX }, { 0x07484, 0x07BE, NES_ROOMGFX }, - { 0x08001, 0x07A5, NES_ROOMGFX }, { 0x087A6, 0x06DD, NES_ROOMGFX }, { 0x08E83, 0x04EA, NES_ROOMGFX }, { 0x0936D, 0x0846, NES_ROOMGFX }, { 0x09BB3, 0x08C8, NES_ROOMGFX }, - { 0x0A47B, 0x0844, NES_ROOMGFX }, { 0x0ACBF, 0x0515, NES_ROOMGFX }, { 0x0B1D4, 0x0799, NES_ROOMGFX }, { 0x0B96D, 0x04BB, NES_ROOMGFX }, { 0x07C42, 0x0319, NES_ROOMGFX }, - { 0x0C001, 0x0464, NES_ROOMGFX }, { 0x0C465, 0x076D, NES_ROOMGFX }, { 0x0CBD2, 0x0827, NES_ROOMGFX }, { 0x0D3F9, 0x0515, NES_ROOMGFX }, { 0x0D90E, 0x064E, NES_ROOMGFX }, - { 0x0DF5C, 0x0775, NES_ROOMGFX }, { 0x0E6D1, 0x06DD, NES_ROOMGFX }, { 0x0EDAE, 0x0376, NES_ROOMGFX }, { 0x0F124, 0x05F7, NES_ROOMGFX }, { 0x0F71B, 0x0787, NES_ROOMGFX }, - { 0x10001, 0x02D6, NES_ROOMGFX }, { 0x102D7, 0x06A3, NES_ROOMGFX }, { 0x1097A, 0x099F, NES_ROOMGFX }, { 0x11319, 0x0361, NES_ROOMGFX }, { 0x1167A, 0x0489, NES_ROOMGFX }, - { 0x11B03, 0x0437, NES_ROOMGFX }, { 0x11F3A, 0x084D, NES_ROOMGFX }, { 0x12787, 0x0199, NES_ROOMGFX }, { 0x12920, 0x09A7, NES_ROOMGFX }, { 0x132C7, 0x037A, NES_ROOMGFX } -}; -static const ScummNESFile::Resource res_roomgfx_swe[40] = { - { 0x04001, 0x03F0, NES_ROOMGFX }, { 0x043F1, 0x069E, NES_ROOMGFX }, { 0x04A8F, 0x0327, NES_ROOMGFX }, { 0x04DB6, 0x053B, NES_ROOMGFX }, { 0x052F1, 0x06BE, NES_ROOMGFX }, - { 0x059AF, 0x0682, NES_ROOMGFX }, { 0x06031, 0x0778, NES_ROOMGFX }, { 0x067A9, 0x0517, NES_ROOMGFX }, { 0x06CC0, 0x07FB, NES_ROOMGFX }, { 0x074BB, 0x07BE, NES_ROOMGFX }, - { 0x08001, 0x07A5, NES_ROOMGFX }, { 0x087A6, 0x06DD, NES_ROOMGFX }, { 0x08E83, 0x04EA, NES_ROOMGFX }, { 0x0936D, 0x07E2, NES_ROOMGFX }, { 0x09B4F, 0x0791, NES_ROOMGFX }, - { 0x0A2E0, 0x07B5, NES_ROOMGFX }, { 0x0AA95, 0x0515, NES_ROOMGFX }, { 0x0AFAA, 0x0799, NES_ROOMGFX }, { 0x0B743, 0x04BF, NES_ROOMGFX }, { 0x0BC02, 0x0319, NES_ROOMGFX }, - { 0x0C001, 0x0464, NES_ROOMGFX }, { 0x0C465, 0x072C, NES_ROOMGFX }, { 0x0CB91, 0x0827, NES_ROOMGFX }, { 0x0D3B8, 0x0515, NES_ROOMGFX }, { 0x0D8CD, 0x064E, NES_ROOMGFX }, - { 0x0DF1B, 0x0775, NES_ROOMGFX }, { 0x0E690, 0x06DD, NES_ROOMGFX }, { 0x0ED6D, 0x0376, NES_ROOMGFX }, { 0x0F0E3, 0x05F7, NES_ROOMGFX }, { 0x0F6DA, 0x0791, NES_ROOMGFX }, - { 0x07C79, 0x02D6, NES_ROOMGFX }, { 0x10001, 0x06A3, NES_ROOMGFX }, { 0x106A4, 0x0921, NES_ROOMGFX }, { 0x10FC5, 0x0361, NES_ROOMGFX }, { 0x11326, 0x0489, NES_ROOMGFX }, - { 0x117AF, 0x0437, NES_ROOMGFX }, { 0x11BE6, 0x084F, NES_ROOMGFX }, { 0x12435, 0x0199, NES_ROOMGFX }, { 0x125CE, 0x0947, NES_ROOMGFX }, { 0x12F15, 0x037A, NES_ROOMGFX } -}; -static const ScummNESFile::Resource res_roomgfx_fra[40] = { - { 0x04001, 0x0426, NES_ROOMGFX }, { 0x04427, 0x069E, NES_ROOMGFX }, { 0x04AC5, 0x0327, NES_ROOMGFX }, { 0x04DEC, 0x053B, NES_ROOMGFX }, { 0x05327, 0x06BE, NES_ROOMGFX }, - { 0x059E5, 0x0682, NES_ROOMGFX }, { 0x06067, 0x0778, NES_ROOMGFX }, { 0x067DF, 0x0517, NES_ROOMGFX }, { 0x06CF6, 0x07FB, NES_ROOMGFX }, { 0x074F1, 0x07BE, NES_ROOMGFX }, - { 0x08001, 0x07A5, NES_ROOMGFX }, { 0x087A6, 0x06DD, NES_ROOMGFX }, { 0x08E83, 0x04EA, NES_ROOMGFX }, { 0x0936D, 0x07E2, NES_ROOMGFX }, { 0x09B4F, 0x0791, NES_ROOMGFX }, - { 0x0A2E0, 0x07B5, NES_ROOMGFX }, { 0x0AA95, 0x0515, NES_ROOMGFX }, { 0x0AFAA, 0x0799, NES_ROOMGFX }, { 0x0B743, 0x04BB, NES_ROOMGFX }, { 0x0BBFE, 0x0319, NES_ROOMGFX }, - { 0x0C001, 0x0464, NES_ROOMGFX }, { 0x0C465, 0x072C, NES_ROOMGFX }, { 0x0CB91, 0x0827, NES_ROOMGFX }, { 0x0D3B8, 0x0515, NES_ROOMGFX }, { 0x0D8CD, 0x064E, NES_ROOMGFX }, - { 0x0DF1B, 0x0775, NES_ROOMGFX }, { 0x0E690, 0x06DD, NES_ROOMGFX }, { 0x0ED6D, 0x0376, NES_ROOMGFX }, { 0x0F0E3, 0x05F7, NES_ROOMGFX }, { 0x0F6DA, 0x0787, NES_ROOMGFX }, - { 0x10001, 0x02D6, NES_ROOMGFX }, { 0x102D7, 0x06A3, NES_ROOMGFX }, { 0x1097A, 0x0921, NES_ROOMGFX }, { 0x1129B, 0x0361, NES_ROOMGFX }, { 0x115FC, 0x0489, NES_ROOMGFX }, - { 0x11A85, 0x0437, NES_ROOMGFX }, { 0x11EBC, 0x070D, NES_ROOMGFX }, { 0x07CAF, 0x0199, NES_ROOMGFX }, { 0x125C9, 0x0947, NES_ROOMGFX }, { 0x12F10, 0x037A, NES_ROOMGFX } -}; -static const ScummNESFile::Resource res_roomgfx_ger[40] = { - { 0x04001, 0x0406, NES_ROOMGFX }, { 0x04407, 0x069E, NES_ROOMGFX }, { 0x04AA5, 0x0327, NES_ROOMGFX }, { 0x04DCC, 0x053B, NES_ROOMGFX }, { 0x05307, 0x06BE, NES_ROOMGFX }, - { 0x059C5, 0x0682, NES_ROOMGFX }, { 0x06047, 0x0778, NES_ROOMGFX }, { 0x067BF, 0x0517, NES_ROOMGFX }, { 0x06CD6, 0x07FB, NES_ROOMGFX }, { 0x074D1, 0x07BE, NES_ROOMGFX }, - { 0x08001, 0x07A5, NES_ROOMGFX }, { 0x087A6, 0x06DD, NES_ROOMGFX }, { 0x08E83, 0x04EA, NES_ROOMGFX }, { 0x0936D, 0x07E2, NES_ROOMGFX }, { 0x09B4F, 0x0791, NES_ROOMGFX }, - { 0x0A2E0, 0x07B5, NES_ROOMGFX }, { 0x0AA95, 0x0515, NES_ROOMGFX }, { 0x0AFAA, 0x0799, NES_ROOMGFX }, { 0x0B743, 0x04BB, NES_ROOMGFX }, { 0x0BBFE, 0x0319, NES_ROOMGFX }, - { 0x0C001, 0x0464, NES_ROOMGFX }, { 0x0C465, 0x072C, NES_ROOMGFX }, { 0x0CB91, 0x0827, NES_ROOMGFX }, { 0x0D3B8, 0x0515, NES_ROOMGFX }, { 0x0D8CD, 0x064E, NES_ROOMGFX }, - { 0x0DF1B, 0x0775, NES_ROOMGFX }, { 0x0E690, 0x06DD, NES_ROOMGFX }, { 0x0ED6D, 0x0376, NES_ROOMGFX }, { 0x0F0E3, 0x05F7, NES_ROOMGFX }, { 0x0F6DA, 0x0787, NES_ROOMGFX }, - { 0x07C8F, 0x02D6, NES_ROOMGFX }, { 0x10001, 0x06A3, NES_ROOMGFX }, { 0x106A4, 0x0921, NES_ROOMGFX }, { 0x10FC5, 0x0361, NES_ROOMGFX }, { 0x11326, 0x0489, NES_ROOMGFX }, - { 0x117AF, 0x0437, NES_ROOMGFX }, { 0x11BE6, 0x07A0, NES_ROOMGFX }, { 0x12386, 0x0199, NES_ROOMGFX }, { 0x1251F, 0x0947, NES_ROOMGFX }, { 0x12E66, 0x037A, NES_ROOMGFX } -}; -#endif -static const ScummNESFile::Resource *res_roomgfx[ScummNESFile::kROMsetNum] = { - res_roomgfx_usa, - res_roomgfx_eur, - res_roomgfx_swe, - res_roomgfx_fra, - res_roomgfx_ger, -}; - -#ifdef PALMOS_68K -static const ScummNESFile::Resource *res_costumegfx_usa; -static const ScummNESFile::Resource *res_costumegfx_eur; -static const ScummNESFile::Resource *res_costumegfx_swe; -static const ScummNESFile::Resource *res_costumegfx_fra; -static const ScummNESFile::Resource *res_costumegfx_ger; -#else -static const ScummNESFile::Resource res_costumegfx_usa[2] = { { 0x30001, 0x0EB8, NES_COSTUMEGFX }, { 0x2F9F1, 0x0340, NES_COSTUMEGFX } }; -static const ScummNESFile::Resource res_costumegfx_eur[2] = { { 0x30001, 0x0EB8, NES_COSTUMEGFX }, { 0x2F9F1, 0x0340, NES_COSTUMEGFX } }; -static const ScummNESFile::Resource res_costumegfx_swe[2] = { { 0x2EFE1, 0x0EB8, NES_COSTUMEGFX }, { 0x30001, 0x0340, NES_COSTUMEGFX } }; -static const ScummNESFile::Resource res_costumegfx_fra[2] = { { 0x30001, 0x0EB8, NES_COSTUMEGFX }, { 0x2F608, 0x0340, NES_COSTUMEGFX } }; -static const ScummNESFile::Resource res_costumegfx_ger[2] = { { 0x30001, 0x0EB8, NES_COSTUMEGFX }, { 0x2F4CE, 0x0340, NES_COSTUMEGFX } }; -#endif -static const ScummNESFile::Resource *res_costumegfx[ScummNESFile::kROMsetNum] = { - res_costumegfx_usa, - res_costumegfx_eur, - res_costumegfx_swe, - res_costumegfx_fra, - res_costumegfx_ger, -}; - -#ifdef PALMOS_68K -static const ScummNESFile::Resource *res_rooms_usa; -static const ScummNESFile::Resource *res_rooms_eur; -static const ScummNESFile::Resource *res_rooms_swe; -static const ScummNESFile::Resource *res_rooms_fra; -static const ScummNESFile::Resource *res_rooms_ger; -#else -static const ScummNESFile::Resource res_rooms_usa[55] = { - { 0x00000, 0x0000, NES_ROOM }, { 0x14001, 0x0D0C, NES_ROOM }, { 0x134A8, 0x04B3, NES_ROOM }, { 0x15397, 0x0849, NES_ROOM }, { 0x15C68, 0x0685, NES_ROOM }, - { 0x16381, 0x0715, NES_ROOM }, { 0x1395B, 0x04E7, NES_ROOM }, { 0x16CE8, 0x0AC0, NES_ROOM }, { 0x18001, 0x06BA, NES_ROOM }, { 0x17AED, 0x03CB, NES_ROOM }, - { 0x18BE7, 0x0663, NES_ROOM }, { 0x192A6, 0x0580, NES_ROOM }, { 0x19A44, 0x0443, NES_ROOM }, { 0x1A106, 0x0563, NES_ROOM }, { 0x1A669, 0x0446, NES_ROOM }, - { 0x1AAAF, 0x03A7, NES_ROOM }, { 0x1AE56, 0x07E3, NES_ROOM }, { 0x1B699, 0x0692, NES_ROOM }, { 0x1C001, 0x0B49, NES_ROOM }, { 0x1CD09, 0x04C6, NES_ROOM }, - { 0x1D4C2, 0x0568, NES_ROOM }, { 0x1DF6C, 0x0514, NES_ROOM }, { 0x1E8FA, 0x05CC, NES_ROOM }, { 0x1EF83, 0x0389, NES_ROOM }, { 0x1F5E4, 0x0723, NES_ROOM }, - { 0x20001, 0x049A, NES_ROOM }, { 0x20511, 0x04F8, NES_ROOM }, { 0x21666, 0x05CB, NES_ROOM }, { 0x21DD6, 0x046B, NES_ROOM }, { 0x222F0, 0x0460, NES_ROOM }, - { 0x227B6, 0x0909, NES_ROOM }, { 0x24001, 0x0366, NES_ROOM }, { 0x23BDF, 0x03CA, NES_ROOM }, { 0x247DB, 0x050D, NES_ROOM }, { 0x25ACF, 0x0346, NES_ROOM }, - { 0x1BDBD, 0x01CA, NES_ROOM }, { 0x25E15, 0x0457, NES_ROOM }, { 0x2626C, 0x0547, NES_ROOM }, { 0x267B3, 0x064A, NES_ROOM }, { 0x1FD72, 0x024B, NES_ROOM }, - { 0x2739A, 0x01FA, NES_ROOM }, { 0x2766D, 0x0219, NES_ROOM }, { 0x28001, 0x02F4, NES_ROOM }, { 0x284D6, 0x045C, NES_ROOM }, { 0x289A3, 0x09CF, NES_ROOM }, - { 0x293C6, 0x05A0, NES_ROOM }, { 0x27B65, 0x0201, NES_ROOM }, { 0x2ADD1, 0x0325, NES_ROOM }, { 0x2B339, 0x01FC, NES_ROOM }, { 0x2B535, 0x02A9, NES_ROOM }, - { 0x2B7DE, 0x02DE, NES_ROOM }, { 0x2C001, 0x03CE, NES_ROOM }, { 0x2BBC0, 0x0205, NES_ROOM }, { 0x2C53A, 0x0170, NES_ROOM }, { 0x13E42, 0x0169, NES_ROOM } -}; -static const ScummNESFile::Resource res_rooms_eur[55] = { - { 0x00000, 0x0000, NES_ROOM }, { 0x14001, 0x0D0C, NES_ROOM }, { 0x13641, 0x04B3, NES_ROOM }, { 0x15397, 0x0849, NES_ROOM }, { 0x15C68, 0x0685, NES_ROOM }, - { 0x16381, 0x0715, NES_ROOM }, { 0x16CE8, 0x04E7, NES_ROOM }, { 0x18001, 0x0ABF, NES_ROOM }, { 0x171CF, 0x06BA, NES_ROOM }, { 0x13AF4, 0x03D2, NES_ROOM }, - { 0x18E1A, 0x0663, NES_ROOM }, { 0x194D9, 0x04A9, NES_ROOM }, { 0x19BA0, 0x0443, NES_ROOM }, { 0x1A262, 0x047C, NES_ROOM }, { 0x1A6DE, 0x0446, NES_ROOM }, - { 0x1AB24, 0x03A7, NES_ROOM }, { 0x1AECB, 0x07E3, NES_ROOM }, { 0x1B70E, 0x0692, NES_ROOM }, { 0x1C001, 0x0ACA, NES_ROOM }, { 0x1CC8A, 0x04C6, NES_ROOM }, - { 0x1D443, 0x0568, NES_ROOM }, { 0x1DEED, 0x0514, NES_ROOM }, { 0x1E87B, 0x05CC, NES_ROOM }, { 0x1EF04, 0x0389, NES_ROOM }, { 0x1F565, 0x0723, NES_ROOM }, - { 0x20001, 0x049A, NES_ROOM }, { 0x20511, 0x04F8, NES_ROOM }, { 0x21666, 0x05D5, NES_ROOM }, { 0x21DE0, 0x046B, NES_ROOM }, { 0x222FA, 0x0460, NES_ROOM }, - { 0x227C0, 0x0909, NES_ROOM }, { 0x24001, 0x0366, NES_ROOM }, { 0x247DB, 0x03CA, NES_ROOM }, { 0x24BA5, 0x050D, NES_ROOM }, { 0x23BE9, 0x0346, NES_ROOM }, - { 0x17DB5, 0x01CA, NES_ROOM }, { 0x25E99, 0x0457, NES_ROOM }, { 0x262F0, 0x0547, NES_ROOM }, { 0x26837, 0x064A, NES_ROOM }, { 0x1FCF3, 0x024B, NES_ROOM }, - { 0x2741E, 0x01FA, NES_ROOM }, { 0x276F1, 0x0219, NES_ROOM }, { 0x28001, 0x02F4, NES_ROOM }, { 0x284D6, 0x045C, NES_ROOM }, { 0x289A3, 0x09CF, NES_ROOM }, - { 0x293C6, 0x05A0, NES_ROOM }, { 0x27BE9, 0x0201, NES_ROOM }, { 0x2ADE3, 0x0325, NES_ROOM }, { 0x2B34B, 0x01FC, NES_ROOM }, { 0x2B547, 0x02A9, NES_ROOM }, - { 0x2B7F0, 0x02DE, NES_ROOM }, { 0x2C001, 0x03CE, NES_ROOM }, { 0x2BBD2, 0x0205, NES_ROOM }, { 0x2C53A, 0x0170, NES_ROOM }, { 0x2BDD7, 0x0169, NES_ROOM } -}; -static const ScummNESFile::Resource res_rooms_swe[55] = { - { 0x00000, 0x0000, NES_ROOM }, { 0x14001, 0x0D12, NES_ROOM }, { 0x1328F, 0x04B3, NES_ROOM }, { 0x15367, 0x0859, NES_ROOM }, { 0x13742, 0x0694, NES_ROOM }, - { 0x15C45, 0x0707, NES_ROOM }, { 0x1658F, 0x04E0, NES_ROOM }, { 0x16A6F, 0x0AC8, NES_ROOM }, { 0x18001, 0x06C7, NES_ROOM }, { 0x1789C, 0x03EA, NES_ROOM }, - { 0x18C09, 0x0649, NES_ROOM }, { 0x192AE, 0x04AB, NES_ROOM }, { 0x19982, 0x0447, NES_ROOM }, { 0x1A04D, 0x047E, NES_ROOM }, { 0x1A4CB, 0x0444, NES_ROOM }, - { 0x1A90F, 0x03B9, NES_ROOM }, { 0x1ACC8, 0x07E9, NES_ROOM }, { 0x1B511, 0x06A4, NES_ROOM }, { 0x1C001, 0x0B1A, NES_ROOM }, { 0x1CCFD, 0x0486, NES_ROOM }, - { 0x1D482, 0x0579, NES_ROOM }, { 0x1DF61, 0x051E, NES_ROOM }, { 0x1E8EC, 0x05CF, NES_ROOM }, { 0x1EF73, 0x0398, NES_ROOM }, { 0x1F5F0, 0x071A, NES_ROOM }, - { 0x20001, 0x049C, NES_ROOM }, { 0x2051E, 0x051E, NES_ROOM }, { 0x21725, 0x05D5, NES_ROOM }, { 0x21EA5, 0x047F, NES_ROOM }, { 0x223D1, 0x0460, NES_ROOM }, - { 0x22897, 0x090D, NES_ROOM }, { 0x24001, 0x0378, NES_ROOM }, { 0x247C9, 0x03CA, NES_ROOM }, { 0x24B93, 0x050D, NES_ROOM }, { 0x25267, 0x0346, NES_ROOM }, - { 0x17CD0, 0x01CA, NES_ROOM }, { 0x255AD, 0x0453, NES_ROOM }, { 0x25A00, 0x053E, NES_ROOM }, { 0x25F3E, 0x0647, NES_ROOM }, { 0x1BC49, 0x024B, NES_ROOM }, - { 0x26B58, 0x01FA, NES_ROOM }, { 0x26E27, 0x0217, NES_ROOM }, { 0x27345, 0x02F4, NES_ROOM }, { 0x27829, 0x045C, NES_ROOM }, { 0x28001, 0x098A, NES_ROOM }, - { 0x289DF, 0x05A1, NES_ROOM }, { 0x2A442, 0x0201, NES_ROOM }, { 0x2A6E9, 0x0325, NES_ROOM }, { 0x1FD75, 0x01FC, NES_ROOM }, { 0x2AC64, 0x02A9, NES_ROOM }, - { 0x2AF0D, 0x02D1, NES_ROOM }, { 0x2B2E6, 0x03CC, NES_ROOM }, { 0x23D61, 0x0205, NES_ROOM }, { 0x2B818, 0x0168, NES_ROOM }, { 0x27CF6, 0x0169, NES_ROOM } -}; -static const ScummNESFile::Resource res_rooms_fra[55] = { - { 0x00000, 0x0000, NES_ROOM }, { 0x14001, 0x0D76, NES_ROOM }, { 0x1328A, 0x04C6, NES_ROOM }, { 0x15451, 0x0885, NES_ROOM }, { 0x13750, 0x0693, NES_ROOM }, - { 0x15D68, 0x0709, NES_ROOM }, { 0x166D4, 0x0528, NES_ROOM }, { 0x16BFC, 0x0ACC, NES_ROOM }, { 0x18001, 0x06E2, NES_ROOM }, { 0x17A63, 0x03E5, NES_ROOM }, - { 0x18C3B, 0x066A, NES_ROOM }, { 0x19301, 0x049E, NES_ROOM }, { 0x199C8, 0x044B, NES_ROOM }, { 0x1A0B1, 0x0478, NES_ROOM }, { 0x1A529, 0x043F, NES_ROOM }, - { 0x1A968, 0x03C8, NES_ROOM }, { 0x1AD30, 0x086F, NES_ROOM }, { 0x1B5FF, 0x069B, NES_ROOM }, { 0x1C001, 0x0AA9, NES_ROOM }, { 0x1CC97, 0x049E, NES_ROOM }, - { 0x1D42C, 0x05A8, NES_ROOM }, { 0x1DF71, 0x054E, NES_ROOM }, { 0x1E9D1, 0x0606, NES_ROOM }, { 0x1F0A2, 0x039A, NES_ROOM }, { 0x1F74E, 0x071C, NES_ROOM }, - { 0x20001, 0x04B5, NES_ROOM }, { 0x2052E, 0x04FF, NES_ROOM }, { 0x2172E, 0x05DB, NES_ROOM }, { 0x21EAD, 0x0489, NES_ROOM }, { 0x223E1, 0x0465, NES_ROOM }, - { 0x228AC, 0x0957, NES_ROOM }, { 0x24001, 0x037E, NES_ROOM }, { 0x2481A, 0x03CA, NES_ROOM }, { 0x24BE4, 0x050D, NES_ROOM }, { 0x252C0, 0x0346, NES_ROOM }, - { 0x1BD30, 0x01CA, NES_ROOM }, { 0x25606, 0x046D, NES_ROOM }, { 0x25A73, 0x055A, NES_ROOM }, { 0x25FCD, 0x0654, NES_ROOM }, { 0x26C98, 0x024B, NES_ROOM }, - { 0x26EE3, 0x01FA, NES_ROOM }, { 0x271DD, 0x0217, NES_ROOM }, { 0x27713, 0x02F4, NES_ROOM }, { 0x28001, 0x045C, NES_ROOM }, { 0x284CE, 0x0975, NES_ROOM }, - { 0x28E97, 0x05E6, NES_ROOM }, { 0x27C3A, 0x0201, NES_ROOM }, { 0x2A9D6, 0x0325, NES_ROOM }, { 0x2AF88, 0x01FC, NES_ROOM }, { 0x2B184, 0x02A9, NES_ROOM }, - { 0x2B42D, 0x02DF, NES_ROOM }, { 0x2B818, 0x03EC, NES_ROOM }, { 0x2BD67, 0x0209, NES_ROOM }, { 0x2C001, 0x0168, NES_ROOM }, { 0x2C4BF, 0x0169, NES_ROOM } -}; -static const ScummNESFile::Resource res_rooms_ger[55] = { - { 0x00000, 0x0000, NES_ROOM }, { 0x14001, 0x0D63, NES_ROOM }, { 0x131E0, 0x04A9, NES_ROOM }, { 0x13689, 0x086B, NES_ROOM }, { 0x15421, 0x06A8, NES_ROOM }, - { 0x15B5D, 0x0731, NES_ROOM }, { 0x16507, 0x0501, NES_ROOM }, { 0x16A08, 0x0AE9, NES_ROOM }, { 0x18001, 0x06DA, NES_ROOM }, { 0x17880, 0x03D0, NES_ROOM }, - { 0x18C7B, 0x0651, NES_ROOM }, { 0x19328, 0x04A7, NES_ROOM }, { 0x199FE, 0x0447, NES_ROOM }, { 0x1A0F1, 0x0486, NES_ROOM }, { 0x1A577, 0x045D, NES_ROOM }, - { 0x1A9D4, 0x03AE, NES_ROOM }, { 0x1AD82, 0x0840, NES_ROOM }, { 0x1B622, 0x06C3, NES_ROOM }, { 0x1C001, 0x0B07, NES_ROOM }, { 0x1CD05, 0x0494, NES_ROOM }, - { 0x1D4A5, 0x05AC, NES_ROOM }, { 0x1DFD6, 0x0524, NES_ROOM }, { 0x1E9C0, 0x05F7, NES_ROOM }, { 0x1F09A, 0x038E, NES_ROOM }, { 0x1F75F, 0x0733, NES_ROOM }, - { 0x20001, 0x04A9, NES_ROOM }, { 0x2052A, 0x052E, NES_ROOM }, { 0x2177C, 0x0621, NES_ROOM }, { 0x21F57, 0x0495, NES_ROOM }, { 0x2249A, 0x045E, NES_ROOM }, - { 0x2295E, 0x0951, NES_ROOM }, { 0x24001, 0x036E, NES_ROOM }, { 0x247F9, 0x03CA, NES_ROOM }, { 0x24BC3, 0x050D, NES_ROOM }, { 0x252A8, 0x0346, NES_ROOM }, - { 0x17CA2, 0x01CA, NES_ROOM }, { 0x255EE, 0x046F, NES_ROOM }, { 0x25A5D, 0x054D, NES_ROOM }, { 0x25FAA, 0x064B, NES_ROOM }, { 0x26BE2, 0x024B, NES_ROOM }, - { 0x26E2D, 0x01FA, NES_ROOM }, { 0x2710F, 0x0217, NES_ROOM }, { 0x27663, 0x02F4, NES_ROOM }, { 0x28001, 0x045C, NES_ROOM }, { 0x284CE, 0x0A8F, NES_ROOM }, - { 0x28FB1, 0x05FF, NES_ROOM }, { 0x27B69, 0x0201, NES_ROOM }, { 0x2AAA9, 0x0325, NES_ROOM }, { 0x1BD7C, 0x01FC, NES_ROOM }, { 0x2B031, 0x02A9, NES_ROOM }, - { 0x2B2DA, 0x02D8, NES_ROOM }, { 0x2B6D2, 0x03D2, NES_ROOM }, { 0x2BC0D, 0x020D, NES_ROOM }, { 0x2C001, 0x0168, NES_ROOM }, { 0x27E11, 0x0169, NES_ROOM } -}; -#endif -static const ScummNESFile::Resource *res_rooms[ScummNESFile::kROMsetNum] = { - res_rooms_usa, - res_rooms_eur, - res_rooms_swe, - res_rooms_fra, - res_rooms_ger, -}; - -#ifdef PALMOS_68K -static const ScummNESFile::Resource *res_scripts_usa; -static const ScummNESFile::Resource *res_scripts_eur; -static const ScummNESFile::Resource *res_scripts_swe; -static const ScummNESFile::Resource *res_scripts_fra; -static const ScummNESFile::Resource *res_scripts_ger; -#else -static const ScummNESFile::Resource res_scripts_usa[179] = { - { 0x00000, 0x0000, NES_SCRIPT }, { 0x29966, 0x044D, NES_SCRIPT }, { 0x29DB3, 0x0207, NES_SCRIPT }, { 0x29FBA, 0x009F, NES_SCRIPT }, { 0x2A059, 0x03F4, NES_SCRIPT }, - { 0x2A44D, 0x01A1, NES_SCRIPT }, { 0x00000, 0x0000, NES_SCRIPT }, { 0x2A5EE, 0x004A, NES_SCRIPT }, { 0x00000, 0x0000, NES_SCRIPT }, { 0x2A638, 0x0005, NES_SCRIPT }, - { 0x2C6AA, 0x000D, NES_SCRIPT }, { 0x2C6B7, 0x000D, NES_SCRIPT }, { 0x186BB, 0x0040, NES_SCRIPT }, { 0x186FB, 0x0016, NES_SCRIPT }, { 0x1B639, 0x0046, NES_SCRIPT }, - { 0x1EEC6, 0x00BD, NES_SCRIPT }, { 0x21C31, 0x0055, NES_SCRIPT }, { 0x177A8, 0x0027, NES_SCRIPT }, { 0x1FD07, 0x0027, NES_SCRIPT }, { 0x1FD2E, 0x0027, NES_SCRIPT }, - { 0x1BD2B, 0x0022, NES_SCRIPT }, { 0x15BE0, 0x0088, NES_SCRIPT }, { 0x22241, 0x0020, NES_SCRIPT }, { 0x22261, 0x008F, NES_SCRIPT }, { 0x1924A, 0x002B, NES_SCRIPT }, - { 0x1CB4A, 0x0061, NES_SCRIPT }, { 0x1CBAB, 0x003C, NES_SCRIPT }, { 0x1CBE7, 0x0042, NES_SCRIPT }, { 0x1CC29, 0x004F, NES_SCRIPT }, { 0x2049B, 0x0076, NES_SCRIPT }, - { 0x16A96, 0x0035, NES_SCRIPT }, { 0x16ACB, 0x001C, NES_SCRIPT }, { 0x16AE7, 0x0014, NES_SCRIPT }, { 0x16AFB, 0x001C, NES_SCRIPT }, { 0x16B17, 0x0027, NES_SCRIPT }, - { 0x16B3E, 0x01AA, NES_SCRIPT }, { 0x1D1CF, 0x0096, NES_SCRIPT }, { 0x1D265, 0x010E, NES_SCRIPT }, { 0x1D373, 0x001C, NES_SCRIPT }, { 0x1D38F, 0x0056, NES_SCRIPT }, - { 0x1D3E5, 0x0072, NES_SCRIPT }, { 0x1E480, 0x0028, NES_SCRIPT }, { 0x1E4A8, 0x017D, NES_SCRIPT }, { 0x1E625, 0x0229, NES_SCRIPT }, { 0x28932, 0x0071, NES_SCRIPT }, - { 0x17EB8, 0x004D, NES_SCRIPT }, { 0x162ED, 0x0039, NES_SCRIPT }, { 0x18711, 0x028B, NES_SCRIPT }, { 0x1899C, 0x00BB, NES_SCRIPT }, { 0x18A57, 0x018B, NES_SCRIPT }, - { 0x00000, 0x0000, NES_SCRIPT }, { 0x19E87, 0x00ED, NES_SCRIPT }, { 0x21C86, 0x00F6, NES_SCRIPT }, { 0x1E84E, 0x009B, NES_SCRIPT }, { 0x21D7C, 0x0047, NES_SCRIPT }, - { 0x2C6C4, 0x004D, NES_SCRIPT }, { 0x16326, 0x0024, NES_SCRIPT }, { 0x14D0D, 0x0014, NES_SCRIPT }, { 0x177CF, 0x0059, NES_SCRIPT }, { 0x17828, 0x0109, NES_SCRIPT }, - { 0x17931, 0x0009, NES_SCRIPT }, { 0x14D21, 0x01B6, NES_SCRIPT }, { 0x2B0F6, 0x0243, NES_SCRIPT }, { 0x230BF, 0x067F, NES_SCRIPT }, { 0x2C711, 0x001C, NES_SCRIPT }, - { 0x2C72D, 0x001A, NES_SCRIPT }, { 0x2C747, 0x0021, NES_SCRIPT }, { 0x2C768, 0x0024, NES_SCRIPT }, { 0x2C78C, 0x0017, NES_SCRIPT }, { 0x2C7A3, 0x0017, NES_SCRIPT }, - { 0x2C7BA, 0x0014, NES_SCRIPT }, { 0x2C7CE, 0x0024, NES_SCRIPT }, { 0x00000, 0x0000, NES_SCRIPT }, { 0x2C7F2, 0x0011, NES_SCRIPT }, { 0x1793A, 0x009D, NES_SCRIPT }, - { 0x22750, 0x0066, NES_SCRIPT }, { 0x14ED7, 0x0075, NES_SCRIPT }, { 0x1F30C, 0x0120, NES_SCRIPT }, { 0x1FD55, 0x001D, NES_SCRIPT }, { 0x1F42C, 0x008F, NES_SCRIPT }, - { 0x1F4BB, 0x0097, NES_SCRIPT }, { 0x179D7, 0x006A, NES_SCRIPT }, { 0x17A41, 0x0030, NES_SCRIPT }, { 0x1F552, 0x0092, NES_SCRIPT }, { 0x2C803, 0x00CC, NES_SCRIPT }, - { 0x2C8CF, 0x00BA, NES_SCRIPT }, { 0x2C989, 0x0088, NES_SCRIPT }, { 0x20A09, 0x01B0, NES_SCRIPT }, { 0x20BB9, 0x0168, NES_SCRIPT }, { 0x20D21, 0x006C, NES_SCRIPT }, - { 0x20D8D, 0x0037, NES_SCRIPT }, { 0x20DC4, 0x00E4, NES_SCRIPT }, { 0x20EA8, 0x0045, NES_SCRIPT }, { 0x20EED, 0x00E1, NES_SCRIPT }, { 0x20FCE, 0x00F6, NES_SCRIPT }, - { 0x210C4, 0x0141, NES_SCRIPT }, { 0x21205, 0x0183, NES_SCRIPT }, { 0x21388, 0x0034, NES_SCRIPT }, { 0x213BC, 0x00A9, NES_SCRIPT }, { 0x24367, 0x011B, NES_SCRIPT }, - { 0x1BD4D, 0x0070, NES_SCRIPT }, { 0x1CC78, 0x0091, NES_SCRIPT }, { 0x29372, 0x0054, NES_SCRIPT }, { 0x19F74, 0x00CE, NES_SCRIPT }, { 0x1A042, 0x0077, NES_SCRIPT }, - { 0x14F4C, 0x0057, NES_SCRIPT }, { 0x27886, 0x02DF, NES_SCRIPT }, { 0x1DA2A, 0x0219, NES_SCRIPT }, { 0x1DC43, 0x00F9, NES_SCRIPT }, { 0x1DD3C, 0x0056, NES_SCRIPT }, - { 0x1DD92, 0x01C2, NES_SCRIPT }, { 0x14FA3, 0x004D, NES_SCRIPT }, { 0x27594, 0x00D9, NES_SCRIPT }, { 0x21DC3, 0x0013, NES_SCRIPT }, { 0x2A63D, 0x00F0, NES_SCRIPT }, - { 0x24482, 0x00E7, NES_SCRIPT }, { 0x21465, 0x00F2, NES_SCRIPT }, { 0x24569, 0x002B, NES_SCRIPT }, { 0x2C3CF, 0x010F, NES_SCRIPT }, { 0x24594, 0x00AA, NES_SCRIPT }, - { 0x24CE8, 0x0DAB, NES_SCRIPT }, { 0x1B67F, 0x000D, NES_SCRIPT }, { 0x1B68C, 0x000D, NES_SCRIPT }, { 0x2373E, 0x017C, NES_SCRIPT }, { 0x282F5, 0x01E1, NES_SCRIPT }, - { 0x238BA, 0x0153, NES_SCRIPT }, { 0x23A0D, 0x019C, NES_SCRIPT }, { 0x23BA9, 0x0016, NES_SCRIPT }, { 0x2C4DE, 0x005C, NES_SCRIPT }, { 0x23BBF, 0x0020, NES_SCRIPT }, - { 0x27D66, 0x00A5, NES_SCRIPT }, { 0x2A72D, 0x034D, NES_SCRIPT }, { 0x14FF0, 0x00E3, NES_SCRIPT }, { 0x2BABC, 0x005F, NES_SCRIPT }, { 0x00000, 0x0000, NES_SCRIPT }, - { 0x25A93, 0x003C, NES_SCRIPT }, { 0x1E8E9, 0x0011, NES_SCRIPT }, { 0x1634A, 0x0018, NES_SCRIPT }, { 0x26DFD, 0x001F, NES_SCRIPT }, { 0x26E1C, 0x0054, NES_SCRIPT }, - { 0x26E70, 0x0149, NES_SCRIPT }, { 0x26FB9, 0x004B, NES_SCRIPT }, { 0x27004, 0x017D, NES_SCRIPT }, { 0x27181, 0x0027, NES_SCRIPT }, { 0x271A8, 0x0041, NES_SCRIPT }, - { 0x271E9, 0x01B1, NES_SCRIPT }, { 0x16362, 0x001F, NES_SCRIPT }, { 0x2463E, 0x002A, NES_SCRIPT }, { 0x150D3, 0x019E, NES_SCRIPT }, { 0x19275, 0x0031, NES_SCRIPT }, - { 0x17A71, 0x007C, NES_SCRIPT }, { 0x21557, 0x00DC, NES_SCRIPT }, { 0x1D457, 0x0018, NES_SCRIPT }, { 0x1D46F, 0x0053, NES_SCRIPT }, { 0x18BE2, 0x0005, NES_SCRIPT }, - { 0x15271, 0x011B, NES_SCRIPT }, { 0x1538C, 0x000B, NES_SCRIPT }, { 0x24668, 0x0138, NES_SCRIPT }, { 0x247A0, 0x0014, NES_SCRIPT }, { 0x1DF54, 0x0018, NES_SCRIPT }, - { 0x247B4, 0x0027, NES_SCRIPT }, { 0x1A0B9, 0x004D, NES_SCRIPT }, { 0x00000, 0x0000, NES_SCRIPT }, { 0x2BB1B, 0x00A5, NES_SCRIPT }, { 0x2AA7A, 0x00C1, NES_SCRIPT }, - { 0x2AB3B, 0x0140, NES_SCRIPT }, { 0x19826, 0x00BF, NES_SCRIPT }, { 0x198E5, 0x014D, NES_SCRIPT }, { 0x19A32, 0x0012, NES_SCRIPT }, { 0x2AC7B, 0x0005, NES_SCRIPT }, - { 0x2AC80, 0x0005, NES_SCRIPT }, { 0x2AC85, 0x0005, NES_SCRIPT }, { 0x2AC8A, 0x0005, NES_SCRIPT }, { 0x2AC8F, 0x0005, NES_SCRIPT }, { 0x21633, 0x0033, NES_SCRIPT }, - { 0x2AC94, 0x0005, NES_SCRIPT }, { 0x00000, 0x0000, NES_SCRIPT }, { 0x2AC99, 0x009C, NES_SCRIPT }, { 0x2AD35, 0x009C, NES_SCRIPT } -}; -static const ScummNESFile::Resource res_scripts_eur[179] = { - { 0x00000, 0x0000, NES_SCRIPT }, { 0x29966, 0x044D, NES_SCRIPT }, { 0x29DB3, 0x0207, NES_SCRIPT }, { 0x29FBA, 0x009F, NES_SCRIPT }, { 0x2A059, 0x03F4, NES_SCRIPT }, - { 0x2A44D, 0x01A1, NES_SCRIPT }, { 0x00000, 0x0000, NES_SCRIPT }, { 0x2A5EE, 0x005C, NES_SCRIPT }, { 0x00000, 0x0000, NES_SCRIPT }, { 0x2A64A, 0x0005, NES_SCRIPT }, - { 0x2C6AA, 0x000D, NES_SCRIPT }, { 0x2C6B7, 0x000D, NES_SCRIPT }, { 0x17889, 0x0040, NES_SCRIPT }, { 0x178C9, 0x0016, NES_SCRIPT }, { 0x1B6AE, 0x0046, NES_SCRIPT }, - { 0x1EE47, 0x00BD, NES_SCRIPT }, { 0x21C3B, 0x0055, NES_SCRIPT }, { 0x18AC0, 0x0027, NES_SCRIPT }, { 0x1FC88, 0x0027, NES_SCRIPT }, { 0x1FCAF, 0x0027, NES_SCRIPT }, - { 0x1BDA0, 0x0022, NES_SCRIPT }, { 0x15BE0, 0x0088, NES_SCRIPT }, { 0x2224B, 0x0020, NES_SCRIPT }, { 0x2226B, 0x008F, NES_SCRIPT }, { 0x1947D, 0x002B, NES_SCRIPT }, - { 0x1CACB, 0x0061, NES_SCRIPT }, { 0x1CB2C, 0x003C, NES_SCRIPT }, { 0x1CB68, 0x0042, NES_SCRIPT }, { 0x1CBAA, 0x004F, NES_SCRIPT }, { 0x2049B, 0x0076, NES_SCRIPT }, - { 0x16A96, 0x0035, NES_SCRIPT }, { 0x16ACB, 0x001C, NES_SCRIPT }, { 0x16AE7, 0x0014, NES_SCRIPT }, { 0x16AFB, 0x001C, NES_SCRIPT }, { 0x16B17, 0x0027, NES_SCRIPT }, - { 0x16B3E, 0x01AA, NES_SCRIPT }, { 0x1D150, 0x0096, NES_SCRIPT }, { 0x1D1E6, 0x010E, NES_SCRIPT }, { 0x1D2F4, 0x001C, NES_SCRIPT }, { 0x1D310, 0x0056, NES_SCRIPT }, - { 0x1D366, 0x0072, NES_SCRIPT }, { 0x1E401, 0x0028, NES_SCRIPT }, { 0x1E429, 0x017D, NES_SCRIPT }, { 0x1E5A6, 0x0229, NES_SCRIPT }, { 0x28932, 0x0071, NES_SCRIPT }, - { 0x13EC6, 0x004D, NES_SCRIPT }, { 0x162ED, 0x0039, NES_SCRIPT }, { 0x178DF, 0x028B, NES_SCRIPT }, { 0x17B6A, 0x00BB, NES_SCRIPT }, { 0x17C25, 0x018B, NES_SCRIPT }, - { 0x00000, 0x0000, NES_SCRIPT }, { 0x19FE3, 0x00ED, NES_SCRIPT }, { 0x21C90, 0x00F6, NES_SCRIPT }, { 0x1E7CF, 0x009B, NES_SCRIPT }, { 0x21D86, 0x0047, NES_SCRIPT }, - { 0x2C6C4, 0x004D, NES_SCRIPT }, { 0x16326, 0x0024, NES_SCRIPT }, { 0x14D0D, 0x0014, NES_SCRIPT }, { 0x18AE7, 0x0059, NES_SCRIPT }, { 0x18B40, 0x011E, NES_SCRIPT }, - { 0x18C5E, 0x0009, NES_SCRIPT }, { 0x14D21, 0x01B6, NES_SCRIPT }, { 0x2B108, 0x0243, NES_SCRIPT }, { 0x230C9, 0x067F, NES_SCRIPT }, { 0x2C711, 0x001C, NES_SCRIPT }, - { 0x2C72D, 0x001A, NES_SCRIPT }, { 0x2C747, 0x0021, NES_SCRIPT }, { 0x2C768, 0x0024, NES_SCRIPT }, { 0x2C78C, 0x0017, NES_SCRIPT }, { 0x2C7A3, 0x0017, NES_SCRIPT }, - { 0x2C7BA, 0x0014, NES_SCRIPT }, { 0x2C7CE, 0x0024, NES_SCRIPT }, { 0x00000, 0x0000, NES_SCRIPT }, { 0x2C7F2, 0x0011, NES_SCRIPT }, { 0x18C67, 0x009D, NES_SCRIPT }, - { 0x2275A, 0x0066, NES_SCRIPT }, { 0x14ED7, 0x0075, NES_SCRIPT }, { 0x1F28D, 0x0120, NES_SCRIPT }, { 0x1FCD6, 0x001D, NES_SCRIPT }, { 0x1F3AD, 0x008F, NES_SCRIPT }, - { 0x1F43C, 0x0097, NES_SCRIPT }, { 0x18D04, 0x006A, NES_SCRIPT }, { 0x18D6E, 0x0030, NES_SCRIPT }, { 0x1F4D3, 0x0092, NES_SCRIPT }, { 0x2C803, 0x00CC, NES_SCRIPT }, - { 0x2C8CF, 0x00BA, NES_SCRIPT }, { 0x2C989, 0x0088, NES_SCRIPT }, { 0x20A09, 0x01B0, NES_SCRIPT }, { 0x20BB9, 0x0168, NES_SCRIPT }, { 0x20D21, 0x006C, NES_SCRIPT }, - { 0x20D8D, 0x0037, NES_SCRIPT }, { 0x20DC4, 0x00E4, NES_SCRIPT }, { 0x20EA8, 0x0045, NES_SCRIPT }, { 0x20EED, 0x00E1, NES_SCRIPT }, { 0x20FCE, 0x00F6, NES_SCRIPT }, - { 0x210C4, 0x0141, NES_SCRIPT }, { 0x21205, 0x0183, NES_SCRIPT }, { 0x21388, 0x0034, NES_SCRIPT }, { 0x213BC, 0x00A9, NES_SCRIPT }, { 0x24367, 0x011B, NES_SCRIPT }, - { 0x1BDC2, 0x0070, NES_SCRIPT }, { 0x1CBF9, 0x0091, NES_SCRIPT }, { 0x29372, 0x0054, NES_SCRIPT }, { 0x1A0D0, 0x00CE, NES_SCRIPT }, { 0x1A19E, 0x0077, NES_SCRIPT }, - { 0x14F4C, 0x0057, NES_SCRIPT }, { 0x2790A, 0x02DF, NES_SCRIPT }, { 0x1D9AB, 0x0219, NES_SCRIPT }, { 0x1DBC4, 0x00F9, NES_SCRIPT }, { 0x1DCBD, 0x0056, NES_SCRIPT }, - { 0x1DD13, 0x01C2, NES_SCRIPT }, { 0x14FA3, 0x004D, NES_SCRIPT }, { 0x27618, 0x00D9, NES_SCRIPT }, { 0x21DCD, 0x0013, NES_SCRIPT }, { 0x2A64F, 0x00F0, NES_SCRIPT }, - { 0x24482, 0x00E7, NES_SCRIPT }, { 0x21465, 0x00F2, NES_SCRIPT }, { 0x24569, 0x002B, NES_SCRIPT }, { 0x2C3CF, 0x010F, NES_SCRIPT }, { 0x24594, 0x00AA, NES_SCRIPT }, - { 0x250B2, 0x0DAB, NES_SCRIPT }, { 0x1B6F4, 0x000D, NES_SCRIPT }, { 0x1B701, 0x000D, NES_SCRIPT }, { 0x23748, 0x017C, NES_SCRIPT }, { 0x282F5, 0x01E1, NES_SCRIPT }, - { 0x238C4, 0x0153, NES_SCRIPT }, { 0x23A17, 0x019C, NES_SCRIPT }, { 0x23BB3, 0x0016, NES_SCRIPT }, { 0x2C4DE, 0x005C, NES_SCRIPT }, { 0x23BC9, 0x0020, NES_SCRIPT }, - { 0x27DEA, 0x00A5, NES_SCRIPT }, { 0x2A73F, 0x034D, NES_SCRIPT }, { 0x14FF0, 0x00E3, NES_SCRIPT }, { 0x2BACE, 0x005F, NES_SCRIPT }, { 0x00000, 0x0000, NES_SCRIPT }, - { 0x25E5D, 0x003C, NES_SCRIPT }, { 0x1E86A, 0x0011, NES_SCRIPT }, { 0x1634A, 0x0018, NES_SCRIPT }, { 0x26E81, 0x001F, NES_SCRIPT }, { 0x26EA0, 0x0054, NES_SCRIPT }, - { 0x26EF4, 0x0149, NES_SCRIPT }, { 0x2703D, 0x004B, NES_SCRIPT }, { 0x27088, 0x017D, NES_SCRIPT }, { 0x27205, 0x0027, NES_SCRIPT }, { 0x2722C, 0x0041, NES_SCRIPT }, - { 0x2726D, 0x01B1, NES_SCRIPT }, { 0x16362, 0x001F, NES_SCRIPT }, { 0x2463E, 0x002A, NES_SCRIPT }, { 0x150D3, 0x019E, NES_SCRIPT }, { 0x194A8, 0x0031, NES_SCRIPT }, - { 0x18D9E, 0x007C, NES_SCRIPT }, { 0x21557, 0x00DC, NES_SCRIPT }, { 0x1D3D8, 0x0018, NES_SCRIPT }, { 0x1D3F0, 0x0053, NES_SCRIPT }, { 0x17DB0, 0x0005, NES_SCRIPT }, - { 0x15271, 0x011B, NES_SCRIPT }, { 0x1538C, 0x000B, NES_SCRIPT }, { 0x24668, 0x0138, NES_SCRIPT }, { 0x247A0, 0x0014, NES_SCRIPT }, { 0x1DED5, 0x0018, NES_SCRIPT }, - { 0x247B4, 0x0027, NES_SCRIPT }, { 0x1A215, 0x004D, NES_SCRIPT }, { 0x00000, 0x0000, NES_SCRIPT }, { 0x2BB2D, 0x00A5, NES_SCRIPT }, { 0x2AA8C, 0x00C1, NES_SCRIPT }, - { 0x2AB4D, 0x0140, NES_SCRIPT }, { 0x19982, 0x00BF, NES_SCRIPT }, { 0x19A41, 0x014D, NES_SCRIPT }, { 0x19B8E, 0x0012, NES_SCRIPT }, { 0x2AC8D, 0x0005, NES_SCRIPT }, - { 0x2AC92, 0x0005, NES_SCRIPT }, { 0x2AC97, 0x0005, NES_SCRIPT }, { 0x2AC9C, 0x0005, NES_SCRIPT }, { 0x2ACA1, 0x0005, NES_SCRIPT }, { 0x21633, 0x0033, NES_SCRIPT }, - { 0x2ACA6, 0x0005, NES_SCRIPT }, { 0x00000, 0x0000, NES_SCRIPT }, { 0x2ACAB, 0x009C, NES_SCRIPT }, { 0x2AD47, 0x009C, NES_SCRIPT } -}; -static const ScummNESFile::Resource res_scripts_swe[179] = { - { 0x00000, 0x0000, NES_SCRIPT }, { 0x28F80, 0x043B, NES_SCRIPT }, { 0x293BB, 0x0209, NES_SCRIPT }, { 0x295C4, 0x00AB, NES_SCRIPT }, { 0x2966F, 0x03FD, NES_SCRIPT }, - { 0x29A6C, 0x01A1, NES_SCRIPT }, { 0x00000, 0x0000, NES_SCRIPT }, { 0x29C0D, 0x005C, NES_SCRIPT }, { 0x00000, 0x0000, NES_SCRIPT }, { 0x29C69, 0x0005, NES_SCRIPT }, - { 0x2B980, 0x000D, NES_SCRIPT }, { 0x2B98D, 0x000D, NES_SCRIPT }, { 0x186C8, 0x0040, NES_SCRIPT }, { 0x18708, 0x0016, NES_SCRIPT }, { 0x1B4B1, 0x0046, NES_SCRIPT }, - { 0x1EEBB, 0x00B8, NES_SCRIPT }, { 0x21CFA, 0x005C, NES_SCRIPT }, { 0x17537, 0x0027, NES_SCRIPT }, { 0x1FD0A, 0x0027, NES_SCRIPT }, { 0x1FD31, 0x0027, NES_SCRIPT }, - { 0x1BBB5, 0x0022, NES_SCRIPT }, { 0x15BC0, 0x0085, NES_SCRIPT }, { 0x22324, 0x001E, NES_SCRIPT }, { 0x22342, 0x008F, NES_SCRIPT }, { 0x19252, 0x002B, NES_SCRIPT }, - { 0x1CB1B, 0x006D, NES_SCRIPT }, { 0x1CB88, 0x004C, NES_SCRIPT }, { 0x1CBD4, 0x0044, NES_SCRIPT }, { 0x1CC18, 0x0053, NES_SCRIPT }, { 0x2049D, 0x0081, NES_SCRIPT }, - { 0x1634C, 0x0035, NES_SCRIPT }, { 0x16381, 0x001C, NES_SCRIPT }, { 0x1639D, 0x0014, NES_SCRIPT }, { 0x163B1, 0x001C, NES_SCRIPT }, { 0x163CD, 0x0027, NES_SCRIPT }, - { 0x163F4, 0x019B, NES_SCRIPT }, { 0x1D183, 0x0094, NES_SCRIPT }, { 0x1D217, 0x0117, NES_SCRIPT }, { 0x1D32E, 0x001C, NES_SCRIPT }, { 0x1D34A, 0x0056, NES_SCRIPT }, - { 0x1D3A0, 0x0072, NES_SCRIPT }, { 0x1E47F, 0x0028, NES_SCRIPT }, { 0x1E4A7, 0x0175, NES_SCRIPT }, { 0x1E61C, 0x022B, NES_SCRIPT }, { 0x27C85, 0x0071, NES_SCRIPT }, - { 0x17C86, 0x004A, NES_SCRIPT }, { 0x13DD6, 0x0039, NES_SCRIPT }, { 0x1871E, 0x0270, NES_SCRIPT }, { 0x1898E, 0x00C0, NES_SCRIPT }, { 0x18A4E, 0x01B6, NES_SCRIPT }, - { 0x00000, 0x0000, NES_SCRIPT }, { 0x19DC9, 0x00EE, NES_SCRIPT }, { 0x21D56, 0x00F5, NES_SCRIPT }, { 0x1E847, 0x0094, NES_SCRIPT }, { 0x21E4B, 0x0047, NES_SCRIPT }, - { 0x2B99A, 0x004D, NES_SCRIPT }, { 0x13E0F, 0x0024, NES_SCRIPT }, { 0x14D13, 0x0014, NES_SCRIPT }, { 0x1755E, 0x0054, NES_SCRIPT }, { 0x175B2, 0x011A, NES_SCRIPT }, - { 0x176CC, 0x0009, NES_SCRIPT }, { 0x14D27, 0x01B9, NES_SCRIPT }, { 0x2AA0E, 0x0256, NES_SCRIPT }, { 0x231A4, 0x06D2, NES_SCRIPT }, { 0x2B9E7, 0x001D, NES_SCRIPT }, - { 0x2BA04, 0x0016, NES_SCRIPT }, { 0x2BA1A, 0x002D, NES_SCRIPT }, { 0x2BA47, 0x0027, NES_SCRIPT }, { 0x2BA6E, 0x0016, NES_SCRIPT }, { 0x2BA84, 0x0014, NES_SCRIPT }, - { 0x2BA98, 0x0015, NES_SCRIPT }, { 0x2BAAD, 0x0029, NES_SCRIPT }, { 0x00000, 0x0000, NES_SCRIPT }, { 0x2BAD6, 0x0010, NES_SCRIPT }, { 0x176D5, 0x00A2, NES_SCRIPT }, - { 0x22831, 0x0066, NES_SCRIPT }, { 0x14EE0, 0x0077, NES_SCRIPT }, { 0x1F30B, 0x011A, NES_SCRIPT }, { 0x1FD58, 0x001D, NES_SCRIPT }, { 0x1F425, 0x0095, NES_SCRIPT }, - { 0x1F4BA, 0x009E, NES_SCRIPT }, { 0x17777, 0x006F, NES_SCRIPT }, { 0x177E6, 0x002F, NES_SCRIPT }, { 0x1F558, 0x0098, NES_SCRIPT }, { 0x2BAE6, 0x00C4, NES_SCRIPT }, - { 0x2BBAA, 0x00AE, NES_SCRIPT }, { 0x2BC58, 0x0088, NES_SCRIPT }, { 0x20A3C, 0x01BB, NES_SCRIPT }, { 0x20BF7, 0x0197, NES_SCRIPT }, { 0x20D8E, 0x006E, NES_SCRIPT }, - { 0x20DFC, 0x0028, NES_SCRIPT }, { 0x20E24, 0x00EA, NES_SCRIPT }, { 0x20F0E, 0x0049, NES_SCRIPT }, { 0x20F57, 0x00E7, NES_SCRIPT }, { 0x2103E, 0x010C, NES_SCRIPT }, - { 0x2114A, 0x0151, NES_SCRIPT }, { 0x2129B, 0x01B0, NES_SCRIPT }, { 0x2144B, 0x0034, NES_SCRIPT }, { 0x2147F, 0x00A9, NES_SCRIPT }, { 0x24379, 0x010E, NES_SCRIPT }, - { 0x1BBD7, 0x0072, NES_SCRIPT }, { 0x1CC6B, 0x0092, NES_SCRIPT }, { 0x2898B, 0x0054, NES_SCRIPT }, { 0x19EB7, 0x00D3, NES_SCRIPT }, { 0x19F8A, 0x0077, NES_SCRIPT }, - { 0x14F57, 0x0057, NES_SCRIPT }, { 0x2703E, 0x0307, NES_SCRIPT }, { 0x1D9FB, 0x024F, NES_SCRIPT }, { 0x1DC4A, 0x00E4, NES_SCRIPT }, { 0x1DD2E, 0x0059, NES_SCRIPT }, - { 0x1DD87, 0x01C2, NES_SCRIPT }, { 0x14FAE, 0x004D, NES_SCRIPT }, { 0x26D52, 0x00D5, NES_SCRIPT }, { 0x21E92, 0x0013, NES_SCRIPT }, { 0x29C6E, 0x00F0, NES_SCRIPT }, - { 0x24487, 0x00E0, NES_SCRIPT }, { 0x21528, 0x00F2, NES_SCRIPT }, { 0x24567, 0x0023, NES_SCRIPT }, { 0x2B6B2, 0x010B, NES_SCRIPT }, { 0x2458A, 0x00A1, NES_SCRIPT }, - { 0x250A0, 0x018B, NES_SCRIPT }, { 0x1B4F7, 0x000D, NES_SCRIPT }, { 0x1B504, 0x000D, NES_SCRIPT }, { 0x23876, 0x018E, NES_SCRIPT }, { 0x27639, 0x01F0, NES_SCRIPT }, - { 0x23A04, 0x017B, NES_SCRIPT }, { 0x23B7F, 0x01AC, NES_SCRIPT }, { 0x23D2B, 0x0016, NES_SCRIPT }, { 0x2B7BD, 0x005B, NES_SCRIPT }, { 0x23D41, 0x0020, NES_SCRIPT }, - { 0x2A643, 0x00A6, NES_SCRIPT }, { 0x29D5E, 0x0399, NES_SCRIPT }, { 0x14FFB, 0x00D2, NES_SCRIPT }, { 0x2B1DE, 0x0063, NES_SCRIPT }, { 0x00000, 0x0000, NES_SCRIPT }, - { 0x2522B, 0x003C, NES_SCRIPT }, { 0x1E8DB, 0x0011, NES_SCRIPT }, { 0x13E33, 0x0018, NES_SCRIPT }, { 0x26585, 0x001F, NES_SCRIPT }, { 0x265A4, 0x0054, NES_SCRIPT }, - { 0x265F8, 0x017D, NES_SCRIPT }, { 0x26775, 0x004B, NES_SCRIPT }, { 0x267C0, 0x0165, NES_SCRIPT }, { 0x26925, 0x0027, NES_SCRIPT }, { 0x2694C, 0x0041, NES_SCRIPT }, - { 0x2698D, 0x01CB, NES_SCRIPT }, { 0x13E4B, 0x001F, NES_SCRIPT }, { 0x2462B, 0x002A, NES_SCRIPT }, { 0x150CD, 0x0187, NES_SCRIPT }, { 0x1927D, 0x0031, NES_SCRIPT }, - { 0x17815, 0x0087, NES_SCRIPT }, { 0x2161A, 0x00D8, NES_SCRIPT }, { 0x1D412, 0x0018, NES_SCRIPT }, { 0x1D42A, 0x0058, NES_SCRIPT }, { 0x18C04, 0x0005, NES_SCRIPT }, - { 0x15254, 0x0108, NES_SCRIPT }, { 0x1535C, 0x000B, NES_SCRIPT }, { 0x24655, 0x0139, NES_SCRIPT }, { 0x2478E, 0x0014, NES_SCRIPT }, { 0x1DF49, 0x0018, NES_SCRIPT }, - { 0x247A2, 0x0027, NES_SCRIPT }, { 0x1A001, 0x004C, NES_SCRIPT }, { 0x00000, 0x0000, NES_SCRIPT }, { 0x2B241, 0x00A5, NES_SCRIPT }, { 0x2A0F7, 0x00B5, NES_SCRIPT }, - { 0x2A1AC, 0x0140, NES_SCRIPT }, { 0x19759, 0x00CA, NES_SCRIPT }, { 0x19823, 0x014D, NES_SCRIPT }, { 0x19970, 0x0012, NES_SCRIPT }, { 0x2A2EC, 0x0005, NES_SCRIPT }, - { 0x2A2F1, 0x0005, NES_SCRIPT }, { 0x2A2F6, 0x0005, NES_SCRIPT }, { 0x2A2FB, 0x0005, NES_SCRIPT }, { 0x2A300, 0x0005, NES_SCRIPT }, { 0x216F2, 0x0033, NES_SCRIPT }, - { 0x2A305, 0x0005, NES_SCRIPT }, { 0x00000, 0x0000, NES_SCRIPT }, { 0x2A30A, 0x009C, NES_SCRIPT }, { 0x2A3A6, 0x009C, NES_SCRIPT } -}; -static const ScummNESFile::Resource res_scripts_fra[179] = { - { 0x00000, 0x0000, NES_SCRIPT }, { 0x2947D, 0x0480, NES_SCRIPT }, { 0x298FD, 0x0226, NES_SCRIPT }, { 0x29B23, 0x0092, NES_SCRIPT }, { 0x29BB5, 0x040C, NES_SCRIPT }, - { 0x29FC1, 0x01A1, NES_SCRIPT }, { 0x00000, 0x0000, NES_SCRIPT }, { 0x2A162, 0x005C, NES_SCRIPT }, { 0x00000, 0x0000, NES_SCRIPT }, { 0x2A1BE, 0x0005, NES_SCRIPT }, - { 0x2C169, 0x000D, NES_SCRIPT }, { 0x2C176, 0x000D, NES_SCRIPT }, { 0x186E3, 0x0040, NES_SCRIPT }, { 0x18723, 0x0016, NES_SCRIPT }, { 0x1B59F, 0x0046, NES_SCRIPT }, - { 0x1EFD7, 0x00CB, NES_SCRIPT }, { 0x21D09, 0x0054, NES_SCRIPT }, { 0x176C8, 0x0027, NES_SCRIPT }, { 0x1FE6A, 0x0027, NES_SCRIPT }, { 0x1FE91, 0x0027, NES_SCRIPT }, - { 0x1BC9A, 0x0022, NES_SCRIPT }, { 0x15CD6, 0x0092, NES_SCRIPT }, { 0x22336, 0x001C, NES_SCRIPT }, { 0x22352, 0x008F, NES_SCRIPT }, { 0x192A5, 0x002B, NES_SCRIPT }, - { 0x1CAAA, 0x0069, NES_SCRIPT }, { 0x1CB13, 0x0054, NES_SCRIPT }, { 0x1CB67, 0x0048, NES_SCRIPT }, { 0x1CBAF, 0x0058, NES_SCRIPT }, { 0x204B6, 0x0078, NES_SCRIPT }, - { 0x16471, 0x0035, NES_SCRIPT }, { 0x164A6, 0x001C, NES_SCRIPT }, { 0x164C2, 0x0014, NES_SCRIPT }, { 0x164D6, 0x001C, NES_SCRIPT }, { 0x164F2, 0x0027, NES_SCRIPT }, - { 0x16519, 0x01BB, NES_SCRIPT }, { 0x1D135, 0x008D, NES_SCRIPT }, { 0x1D1C2, 0x0119, NES_SCRIPT }, { 0x1D2DB, 0x001C, NES_SCRIPT }, { 0x1D2F7, 0x0056, NES_SCRIPT }, - { 0x1D34D, 0x0072, NES_SCRIPT }, { 0x1E4BF, 0x0028, NES_SCRIPT }, { 0x1E4E7, 0x01E0, NES_SCRIPT }, { 0x1E6C7, 0x0241, NES_SCRIPT }, { 0x2845D, 0x0071, NES_SCRIPT }, - { 0x17E48, 0x004C, NES_SCRIPT }, { 0x13DE3, 0x0039, NES_SCRIPT }, { 0x18739, 0x0296, NES_SCRIPT }, { 0x189CF, 0x00C2, NES_SCRIPT }, { 0x18A91, 0x01A5, NES_SCRIPT }, - { 0x00000, 0x0000, NES_SCRIPT }, { 0x19E13, 0x00F3, NES_SCRIPT }, { 0x21D5D, 0x00F6, NES_SCRIPT }, { 0x1E908, 0x00B8, NES_SCRIPT }, { 0x21E53, 0x0047, NES_SCRIPT }, - { 0x2C183, 0x004D, NES_SCRIPT }, { 0x13E1C, 0x0024, NES_SCRIPT }, { 0x14D77, 0x0014, NES_SCRIPT }, { 0x176EF, 0x0059, NES_SCRIPT }, { 0x17748, 0x013F, NES_SCRIPT }, - { 0x17887, 0x0009, NES_SCRIPT }, { 0x14D8B, 0x01D4, NES_SCRIPT }, { 0x2ACFB, 0x028D, NES_SCRIPT }, { 0x23203, 0x0779, NES_SCRIPT }, { 0x2C1D0, 0x001B, NES_SCRIPT }, - { 0x2C1EB, 0x001F, NES_SCRIPT }, { 0x2C20A, 0x0024, NES_SCRIPT }, { 0x2C22E, 0x0019, NES_SCRIPT }, { 0x2C247, 0x0018, NES_SCRIPT }, { 0x2C25F, 0x001D, NES_SCRIPT }, - { 0x2C27C, 0x0016, NES_SCRIPT }, { 0x2C292, 0x0027, NES_SCRIPT }, { 0x00000, 0x0000, NES_SCRIPT }, { 0x2C2B9, 0x0011, NES_SCRIPT }, { 0x17890, 0x00AA, NES_SCRIPT }, - { 0x22846, 0x0066, NES_SCRIPT }, { 0x14F5F, 0x0083, NES_SCRIPT }, { 0x1F43C, 0x013A, NES_SCRIPT }, { 0x1FEB8, 0x001D, NES_SCRIPT }, { 0x1F576, 0x0098, NES_SCRIPT }, - { 0x1F60E, 0x009B, NES_SCRIPT }, { 0x1793A, 0x006E, NES_SCRIPT }, { 0x179A8, 0x0033, NES_SCRIPT }, { 0x1F6A9, 0x00A5, NES_SCRIPT }, { 0x2C2CA, 0x00BA, NES_SCRIPT }, - { 0x2C384, 0x00AC, NES_SCRIPT }, { 0x2C430, 0x008F, NES_SCRIPT }, { 0x20A2D, 0x01BE, NES_SCRIPT }, { 0x20BEB, 0x0158, NES_SCRIPT }, { 0x20D43, 0x0079, NES_SCRIPT }, - { 0x20DBC, 0x002B, NES_SCRIPT }, { 0x20DE7, 0x00E8, NES_SCRIPT }, { 0x20ECF, 0x004A, NES_SCRIPT }, { 0x20F19, 0x0110, NES_SCRIPT }, { 0x21029, 0x0136, NES_SCRIPT }, - { 0x2115F, 0x0152, NES_SCRIPT }, { 0x212B1, 0x01B3, NES_SCRIPT }, { 0x21464, 0x0032, NES_SCRIPT }, { 0x21496, 0x00A9, NES_SCRIPT }, { 0x2437F, 0x0133, NES_SCRIPT }, - { 0x1BCBC, 0x0074, NES_SCRIPT }, { 0x1CC07, 0x0090, NES_SCRIPT }, { 0x28E43, 0x0054, NES_SCRIPT }, { 0x19F06, 0x00DB, NES_SCRIPT }, { 0x19FE1, 0x0080, NES_SCRIPT }, - { 0x14FE2, 0x0057, NES_SCRIPT }, { 0x273F4, 0x031F, NES_SCRIPT }, { 0x1D9D4, 0x0238, NES_SCRIPT }, { 0x1DC0C, 0x00FE, NES_SCRIPT }, { 0x1DD0A, 0x005A, NES_SCRIPT }, - { 0x1DD64, 0x01F5, NES_SCRIPT }, { 0x15039, 0x004D, NES_SCRIPT }, { 0x270DD, 0x0100, NES_SCRIPT }, { 0x21E9A, 0x0013, NES_SCRIPT }, { 0x2A1C3, 0x00F0, NES_SCRIPT }, - { 0x244B2, 0x00E4, NES_SCRIPT }, { 0x2153F, 0x00EC, NES_SCRIPT }, { 0x24596, 0x0033, NES_SCRIPT }, { 0x2BC04, 0x0108, NES_SCRIPT }, { 0x245C9, 0x009F, NES_SCRIPT }, - { 0x250F1, 0x0193, NES_SCRIPT }, { 0x1B5E5, 0x000D, NES_SCRIPT }, { 0x1B5F2, 0x000D, NES_SCRIPT }, { 0x2397C, 0x0199, NES_SCRIPT }, { 0x27A07, 0x0233, NES_SCRIPT }, - { 0x23B15, 0x0171, NES_SCRIPT }, { 0x23C86, 0x01BC, NES_SCRIPT }, { 0x23E42, 0x0016, NES_SCRIPT }, { 0x2BD0C, 0x005B, NES_SCRIPT }, { 0x23E58, 0x0020, NES_SCRIPT }, - { 0x27E3B, 0x00B9, NES_SCRIPT }, { 0x2A2B3, 0x03D3, NES_SCRIPT }, { 0x15086, 0x00E4, NES_SCRIPT }, { 0x2B70C, 0x0067, NES_SCRIPT }, { 0x00000, 0x0000, NES_SCRIPT }, - { 0x25284, 0x003C, NES_SCRIPT }, { 0x1E9C0, 0x0011, NES_SCRIPT }, { 0x13E40, 0x0018, NES_SCRIPT }, { 0x26621, 0x001F, NES_SCRIPT }, { 0x26640, 0x0054, NES_SCRIPT }, - { 0x26694, 0x0173, NES_SCRIPT }, { 0x26807, 0x004B, NES_SCRIPT }, { 0x26852, 0x0190, NES_SCRIPT }, { 0x269E2, 0x0027, NES_SCRIPT }, { 0x26A09, 0x0041, NES_SCRIPT }, - { 0x26A4A, 0x024E, NES_SCRIPT }, { 0x13E58, 0x001F, NES_SCRIPT }, { 0x24668, 0x002A, NES_SCRIPT }, { 0x1516A, 0x01C9, NES_SCRIPT }, { 0x192D0, 0x0031, NES_SCRIPT }, - { 0x179DB, 0x0088, NES_SCRIPT }, { 0x2162B, 0x00D0, NES_SCRIPT }, { 0x1D3BF, 0x0018, NES_SCRIPT }, { 0x1D3D7, 0x0055, NES_SCRIPT }, { 0x18C36, 0x0005, NES_SCRIPT }, - { 0x15333, 0x0113, NES_SCRIPT }, { 0x15446, 0x000B, NES_SCRIPT }, { 0x24692, 0x014D, NES_SCRIPT }, { 0x247DF, 0x0014, NES_SCRIPT }, { 0x1DF59, 0x0018, NES_SCRIPT }, - { 0x247F3, 0x0027, NES_SCRIPT }, { 0x1A061, 0x0050, NES_SCRIPT }, { 0x00000, 0x0000, NES_SCRIPT }, { 0x2B773, 0x00A5, NES_SCRIPT }, { 0x2A686, 0x00BA, NES_SCRIPT }, - { 0x2A740, 0x0140, NES_SCRIPT }, { 0x1979F, 0x00CA, NES_SCRIPT }, { 0x19869, 0x014D, NES_SCRIPT }, { 0x199B6, 0x0012, NES_SCRIPT }, { 0x2A880, 0x0005, NES_SCRIPT }, - { 0x2A885, 0x0005, NES_SCRIPT }, { 0x2A88A, 0x0005, NES_SCRIPT }, { 0x2A88F, 0x0005, NES_SCRIPT }, { 0x2A894, 0x0005, NES_SCRIPT }, { 0x216FB, 0x0033, NES_SCRIPT }, - { 0x2A899, 0x0005, NES_SCRIPT }, { 0x00000, 0x0000, NES_SCRIPT }, { 0x2A89E, 0x009C, NES_SCRIPT }, { 0x2A93A, 0x009C, NES_SCRIPT } -}; -static const ScummNESFile::Resource res_scripts_ger[179] = { - { 0x00000, 0x0000, NES_SCRIPT }, { 0x295B0, 0x045A, NES_SCRIPT }, { 0x29A0A, 0x0218, NES_SCRIPT }, { 0x29C22, 0x00B1, NES_SCRIPT }, { 0x29CD3, 0x0408, NES_SCRIPT }, - { 0x2A0DB, 0x01A1, NES_SCRIPT }, { 0x00000, 0x0000, NES_SCRIPT }, { 0x2A27C, 0x005C, NES_SCRIPT }, { 0x00000, 0x0000, NES_SCRIPT }, { 0x2A2D8, 0x0005, NES_SCRIPT }, - { 0x2C169, 0x000D, NES_SCRIPT }, { 0x2C176, 0x000D, NES_SCRIPT }, { 0x186DB, 0x0040, NES_SCRIPT }, { 0x1871B, 0x0016, NES_SCRIPT }, { 0x1B5C2, 0x0046, NES_SCRIPT }, - { 0x1EFB7, 0x00E3, NES_SCRIPT }, { 0x21D9D, 0x0069, NES_SCRIPT }, { 0x174F1, 0x0027, NES_SCRIPT }, { 0x1FE92, 0x0027, NES_SCRIPT }, { 0x1FEB9, 0x0027, NES_SCRIPT }, - { 0x1BCE5, 0x0022, NES_SCRIPT }, { 0x13EF4, 0x0087, NES_SCRIPT }, { 0x223EC, 0x001F, NES_SCRIPT }, { 0x2240B, 0x008F, NES_SCRIPT }, { 0x192CC, 0x002B, NES_SCRIPT }, - { 0x1CB08, 0x006E, NES_SCRIPT }, { 0x1CB76, 0x004E, NES_SCRIPT }, { 0x1CBC4, 0x004D, NES_SCRIPT }, { 0x1CC11, 0x0059, NES_SCRIPT }, { 0x204AA, 0x0080, NES_SCRIPT }, - { 0x1628E, 0x0035, NES_SCRIPT }, { 0x162C3, 0x001C, NES_SCRIPT }, { 0x162DF, 0x0014, NES_SCRIPT }, { 0x162F3, 0x001C, NES_SCRIPT }, { 0x1630F, 0x0027, NES_SCRIPT }, - { 0x16336, 0x01D1, NES_SCRIPT }, { 0x1D199, 0x00A0, NES_SCRIPT }, { 0x1D239, 0x011C, NES_SCRIPT }, { 0x1D355, 0x001C, NES_SCRIPT }, { 0x1D371, 0x0056, NES_SCRIPT }, - { 0x1D3C7, 0x0072, NES_SCRIPT }, { 0x1E4FA, 0x0028, NES_SCRIPT }, { 0x1E522, 0x019D, NES_SCRIPT }, { 0x1E6BF, 0x023B, NES_SCRIPT }, { 0x2845D, 0x0071, NES_SCRIPT }, - { 0x17C50, 0x0052, NES_SCRIPT }, { 0x15AC9, 0x0039, NES_SCRIPT }, { 0x18731, 0x02E7, NES_SCRIPT }, { 0x18A18, 0x00BC, NES_SCRIPT }, { 0x18AD4, 0x01A2, NES_SCRIPT }, - { 0x00000, 0x0000, NES_SCRIPT }, { 0x19E45, 0x00F8, NES_SCRIPT }, { 0x21E06, 0x00F7, NES_SCRIPT }, { 0x1E8FA, 0x00B5, NES_SCRIPT }, { 0x21EFD, 0x0047, NES_SCRIPT }, - { 0x2C183, 0x004D, NES_SCRIPT }, { 0x15B02, 0x0024, NES_SCRIPT }, { 0x14D64, 0x0014, NES_SCRIPT }, { 0x17518, 0x005E, NES_SCRIPT }, { 0x17576, 0x0125, NES_SCRIPT }, - { 0x1769B, 0x0009, NES_SCRIPT }, { 0x14D78, 0x01C7, NES_SCRIPT }, { 0x2ADCE, 0x0263, NES_SCRIPT }, { 0x232AF, 0x077F, NES_SCRIPT }, { 0x2C1D0, 0x001E, NES_SCRIPT }, - { 0x2C1EE, 0x0024, NES_SCRIPT }, { 0x2C212, 0x002E, NES_SCRIPT }, { 0x2C240, 0x0022, NES_SCRIPT }, { 0x2C262, 0x0013, NES_SCRIPT }, { 0x2C275, 0x001E, NES_SCRIPT }, - { 0x2C293, 0x0016, NES_SCRIPT }, { 0x2C2A9, 0x0027, NES_SCRIPT }, { 0x00000, 0x0000, NES_SCRIPT }, { 0x2C2D0, 0x0012, NES_SCRIPT }, { 0x176A4, 0x00A4, NES_SCRIPT }, - { 0x228F8, 0x0066, NES_SCRIPT }, { 0x14F3F, 0x007F, NES_SCRIPT }, { 0x1F428, 0x013A, NES_SCRIPT }, { 0x1FEE0, 0x001D, NES_SCRIPT }, { 0x1F562, 0x00A0, NES_SCRIPT }, - { 0x1F602, 0x00A4, NES_SCRIPT }, { 0x17748, 0x0076, NES_SCRIPT }, { 0x177BE, 0x0036, NES_SCRIPT }, { 0x1F6A6, 0x00B9, NES_SCRIPT }, { 0x2C2E2, 0x00CB, NES_SCRIPT }, - { 0x2C3AD, 0x00B7, NES_SCRIPT }, { 0x2C464, 0x008A, NES_SCRIPT }, { 0x20A58, 0x01BD, NES_SCRIPT }, { 0x20C15, 0x0181, NES_SCRIPT }, { 0x20D96, 0x0078, NES_SCRIPT }, - { 0x20E0E, 0x003C, NES_SCRIPT }, { 0x20E4A, 0x00E9, NES_SCRIPT }, { 0x20F33, 0x0046, NES_SCRIPT }, { 0x20F79, 0x00F6, NES_SCRIPT }, { 0x2106F, 0x0118, NES_SCRIPT }, - { 0x21187, 0x015B, NES_SCRIPT }, { 0x212E2, 0x01AC, NES_SCRIPT }, { 0x2148E, 0x003F, NES_SCRIPT }, { 0x214CD, 0x00A9, NES_SCRIPT }, { 0x2436F, 0x0126, NES_SCRIPT }, - { 0x1BD07, 0x0075, NES_SCRIPT }, { 0x1CC6A, 0x009B, NES_SCRIPT }, { 0x28F5D, 0x0054, NES_SCRIPT }, { 0x19F3D, 0x00E1, NES_SCRIPT }, { 0x1A01E, 0x0086, NES_SCRIPT }, - { 0x14FBE, 0x0057, NES_SCRIPT }, { 0x27326, 0x033D, NES_SCRIPT }, { 0x1DA51, 0x023B, NES_SCRIPT }, { 0x1DC8C, 0x00FB, NES_SCRIPT }, { 0x1DD87, 0x0056, NES_SCRIPT }, - { 0x1DDDD, 0x01E1, NES_SCRIPT }, { 0x15015, 0x004D, NES_SCRIPT }, { 0x27027, 0x00E8, NES_SCRIPT }, { 0x21F44, 0x0013, NES_SCRIPT }, { 0x2A2DD, 0x00F0, NES_SCRIPT }, - { 0x24495, 0x00F8, NES_SCRIPT }, { 0x21576, 0x00F9, NES_SCRIPT }, { 0x2458D, 0x002B, NES_SCRIPT }, { 0x2BAA4, 0x010F, NES_SCRIPT }, { 0x245B8, 0x00A5, NES_SCRIPT }, - { 0x250D0, 0x019C, NES_SCRIPT }, { 0x1B608, 0x000D, NES_SCRIPT }, { 0x1B615, 0x000D, NES_SCRIPT }, { 0x23A2E, 0x0185, NES_SCRIPT }, { 0x27957, 0x0212, NES_SCRIPT }, - { 0x23BB3, 0x0158, NES_SCRIPT }, { 0x23D0B, 0x01C4, NES_SCRIPT }, { 0x23ECF, 0x0016, NES_SCRIPT }, { 0x2BBB3, 0x005A, NES_SCRIPT }, { 0x23EE5, 0x0020, NES_SCRIPT }, - { 0x27D6A, 0x00A7, NES_SCRIPT }, { 0x2A3CD, 0x038C, NES_SCRIPT }, { 0x15062, 0x00F6, NES_SCRIPT }, { 0x2B5B2, 0x007B, NES_SCRIPT }, { 0x00000, 0x0000, NES_SCRIPT }, - { 0x2526C, 0x003C, NES_SCRIPT }, { 0x1E9AF, 0x0011, NES_SCRIPT }, { 0x15B26, 0x0018, NES_SCRIPT }, { 0x265F5, 0x001F, NES_SCRIPT }, { 0x26614, 0x0054, NES_SCRIPT }, - { 0x26668, 0x018E, NES_SCRIPT }, { 0x267F6, 0x004B, NES_SCRIPT }, { 0x26841, 0x0196, NES_SCRIPT }, { 0x269D7, 0x0027, NES_SCRIPT }, { 0x269FE, 0x0041, NES_SCRIPT }, - { 0x26A3F, 0x01A3, NES_SCRIPT }, { 0x15B3E, 0x001F, NES_SCRIPT }, { 0x2465D, 0x002A, NES_SCRIPT }, { 0x15158, 0x0198, NES_SCRIPT }, { 0x192F7, 0x0031, NES_SCRIPT }, - { 0x177F4, 0x008C, NES_SCRIPT }, { 0x2166F, 0x00DA, NES_SCRIPT }, { 0x1D439, 0x0018, NES_SCRIPT }, { 0x1D451, 0x0054, NES_SCRIPT }, { 0x18C76, 0x0005, NES_SCRIPT }, - { 0x152F0, 0x0126, NES_SCRIPT }, { 0x15416, 0x000B, NES_SCRIPT }, { 0x24687, 0x0137, NES_SCRIPT }, { 0x247BE, 0x0014, NES_SCRIPT }, { 0x1DFBE, 0x0018, NES_SCRIPT }, - { 0x247D2, 0x0027, NES_SCRIPT }, { 0x1A0A4, 0x004D, NES_SCRIPT }, { 0x00000, 0x0000, NES_SCRIPT }, { 0x2B62D, 0x00A5, NES_SCRIPT }, { 0x2A759, 0x00BA, NES_SCRIPT }, - { 0x2A813, 0x0140, NES_SCRIPT }, { 0x197CF, 0x00D0, NES_SCRIPT }, { 0x1989F, 0x014D, NES_SCRIPT }, { 0x199EC, 0x0012, NES_SCRIPT }, { 0x2A953, 0x0005, NES_SCRIPT }, - { 0x2A958, 0x0005, NES_SCRIPT }, { 0x2A95D, 0x0005, NES_SCRIPT }, { 0x2A962, 0x0005, NES_SCRIPT }, { 0x2A967, 0x0005, NES_SCRIPT }, { 0x21749, 0x0033, NES_SCRIPT }, - { 0x2A96C, 0x0005, NES_SCRIPT }, { 0x00000, 0x0000, NES_SCRIPT }, { 0x2A971, 0x009C, NES_SCRIPT }, { 0x2AA0D, 0x009C, NES_SCRIPT } -}; -#endif -static const ScummNESFile::Resource *res_scripts[ScummNESFile::kROMsetNum] = { - res_scripts_usa, - res_scripts_eur, - res_scripts_swe, - res_scripts_fra, - res_scripts_ger, -}; - -#ifdef PALMOS_68K -static const ScummNESFile::Resource *res_sounds_usa; -static const ScummNESFile::Resource *res_sounds_eur; -static const ScummNESFile::Resource *res_sounds_swe; -static const ScummNESFile::Resource *res_sounds_fra; -static const ScummNESFile::Resource *res_sounds_ger; -#else -static const ScummNESFile::Resource res_sounds_usa[82] = { - { 0x0FFE8, 0x000A, NES_SOUND }, { 0x30ECA, 0x0832, NES_SOUND }, { 0x30ECA, 0x0832, NES_SOUND }, { 0x30ECA, 0x0832, NES_SOUND }, { 0x30ECA, 0x0832, NES_SOUND }, - { 0x30ECA, 0x0832, NES_SOUND }, { 0x17FCA, 0x0011, NES_SOUND }, { 0x27E0B, 0x0073, NES_SOUND }, { 0x17FDB, 0x0011, NES_SOUND }, { 0x17FEC, 0x0011, NES_SOUND }, - { 0x27E7E, 0x0056, NES_SOUND }, { 0x27ED4, 0x001F, NES_SOUND }, { 0x23FEE, 0x0011, NES_SOUND }, { 0x0FFF2, 0x000A, NES_SOUND }, { 0x27EF3, 0x000A, NES_SOUND }, - { 0x27EFD, 0x0019, NES_SOUND }, { 0x27F16, 0x004B, NES_SOUND }, { 0x27F61, 0x000A, NES_SOUND }, { 0x27F6B, 0x000F, NES_SOUND }, { 0x27F7A, 0x001D, NES_SOUND }, - { 0x27F97, 0x0045, NES_SOUND }, { 0x27FDC, 0x000F, NES_SOUND }, { 0x2FD42, 0x001B, NES_SOUND }, { 0x2FD5D, 0x0033, NES_SOUND }, { 0x27FEB, 0x0011, NES_SOUND }, - { 0x2BFEF, 0x000F, NES_SOUND }, { 0x2FD90, 0x0075, NES_SOUND }, { 0x2FE05, 0x0014, NES_SOUND }, { 0x0FFE8, 0x000A, NES_SOUND }, { 0x2FE19, 0x00FF, NES_SOUND }, - { 0x2FF18, 0x000F, NES_SOUND }, { 0x2FF27, 0x000F, NES_SOUND }, { 0x2FF36, 0x0092, NES_SOUND }, { 0x2FF36, 0x0092, NES_SOUND }, { 0x2FFC8, 0x002D, NES_SOUND }, - { 0x316FC, 0x00F8, NES_SOUND }, { 0x317F4, 0x0016, NES_SOUND }, { 0x3180A, 0x0011, NES_SOUND }, { 0x3181B, 0x004B, NES_SOUND }, { 0x31866, 0x0011, NES_SOUND }, - { 0x31877, 0x003B, NES_SOUND }, { 0x318B2, 0x008A, NES_SOUND }, { 0x3193C, 0x0011, NES_SOUND }, { 0x3194D, 0x000F, NES_SOUND }, { 0x3195C, 0x00A2, NES_SOUND }, - { 0x319FE, 0x00D3, NES_SOUND }, { 0x31AD1, 0x0097, NES_SOUND }, { 0x2BFEF, 0x000F, NES_SOUND }, { 0x3195C, 0x00A2, NES_SOUND }, { 0x31B68, 0x05D1, NES_SOUND }, - { 0x31B68, 0x05D1, NES_SOUND }, { 0x32139, 0x0011, NES_SOUND }, { 0x0FFE8, 0x000A, NES_SOUND }, { 0x2FD90, 0x0075, NES_SOUND }, { 0x27ED4, 0x001F, NES_SOUND }, - { 0x3214A, 0x098E, NES_SOUND }, { 0x3181B, 0x004B, NES_SOUND }, { 0x32AD8, 0x0011, NES_SOUND }, { 0x30ECA, 0x0832, NES_SOUND }, { 0x32AE9, 0x000F, NES_SOUND }, - { 0x32AF8, 0x002F, NES_SOUND }, { 0x32B27, 0x001D, NES_SOUND }, { 0x32B44, 0x0018, NES_SOUND }, { 0x32B5C, 0x0016, NES_SOUND }, { 0x32B72, 0x001B, NES_SOUND }, - { 0x32B8D, 0x0088, NES_SOUND }, { 0x32C15, 0x0065, NES_SOUND }, { 0x32C7A, 0x0065, NES_SOUND }, { 0x32CDF, 0x0073, NES_SOUND }, { 0x32D52, 0x00F9, NES_SOUND }, - { 0x32E4B, 0x049E, NES_SOUND }, { 0x34001, 0x0EA8, NES_SOUND }, { 0x332E9, 0x0B18, NES_SOUND }, { 0x34EA9, 0x0B9C, NES_SOUND }, { 0x35A45, 0x0C6B, NES_SOUND }, - { 0x366B0, 0x0E56, NES_SOUND }, { 0x38001, 0x0C70, NES_SOUND }, { 0x38C71, 0x0DEC, NES_SOUND }, { 0x39A5D, 0x0B77, NES_SOUND }, { 0x37506, 0x042F, NES_SOUND }, - { 0x3A5D4, 0x0AC5, NES_SOUND }, { 0x3B099, 0x0BE4, NES_SOUND } -}; -static const ScummNESFile::Resource res_sounds_eur[82] = { - { 0x0BF54, 0x000A, NES_SOUND }, { 0x30ECA, 0x0832, NES_SOUND }, { 0x30ECA, 0x0832, NES_SOUND }, { 0x30ECA, 0x0832, NES_SOUND }, { 0x30ECA, 0x0832, NES_SOUND }, - { 0x30ECA, 0x0832, NES_SOUND }, { 0x0BF5E, 0x0011, NES_SOUND }, { 0x27ECB, 0x0073, NES_SOUND }, { 0x0BF6F, 0x0011, NES_SOUND }, { 0x0FF5D, 0x0011, NES_SOUND }, - { 0x316FC, 0x0056, NES_SOUND }, { 0x13F4E, 0x001F, NES_SOUND }, { 0x0FF6E, 0x0011, NES_SOUND }, { 0x13F6D, 0x000A, NES_SOUND }, { 0x1BF47, 0x000A, NES_SOUND }, - { 0x1BF51, 0x0019, NES_SOUND }, { 0x31752, 0x004B, NES_SOUND }, { 0x1BF6A, 0x000A, NES_SOUND }, { 0x27F3E, 0x000F, NES_SOUND }, { 0x27F4D, 0x001D, NES_SOUND }, - { 0x3179D, 0x0045, NES_SOUND }, { 0x27F6A, 0x000F, NES_SOUND }, { 0x2BF40, 0x001B, NES_SOUND }, { 0x317E2, 0x0033, NES_SOUND }, { 0x2BF5B, 0x0011, NES_SOUND }, - { 0x2BF6C, 0x000F, NES_SOUND }, { 0x31815, 0x0075, NES_SOUND }, { 0x2FF6C, 0x0014, NES_SOUND }, { 0x0BF54, 0x000A, NES_SOUND }, { 0x3188A, 0x00FF, NES_SOUND }, - { 0x31989, 0x000F, NES_SOUND }, { 0x31998, 0x000F, NES_SOUND }, { 0x319A7, 0x0092, NES_SOUND }, { 0x319A7, 0x0092, NES_SOUND }, { 0x31A39, 0x002D, NES_SOUND }, - { 0x31A66, 0x00F8, NES_SOUND }, { 0x31B5E, 0x0016, NES_SOUND }, { 0x31B74, 0x0011, NES_SOUND }, { 0x31B85, 0x004B, NES_SOUND }, { 0x31BD0, 0x0011, NES_SOUND }, - { 0x31BE1, 0x003B, NES_SOUND }, { 0x31C1C, 0x008A, NES_SOUND }, { 0x31CA6, 0x0011, NES_SOUND }, { 0x31CB7, 0x000F, NES_SOUND }, { 0x31CC6, 0x00A2, NES_SOUND }, - { 0x31D68, 0x00D3, NES_SOUND }, { 0x31E3B, 0x0097, NES_SOUND }, { 0x2BF6C, 0x000F, NES_SOUND }, { 0x31CC6, 0x00A2, NES_SOUND }, { 0x31ED2, 0x05D1, NES_SOUND }, - { 0x31ED2, 0x05D1, NES_SOUND }, { 0x324A3, 0x0011, NES_SOUND }, { 0x0BF54, 0x000A, NES_SOUND }, { 0x31815, 0x0075, NES_SOUND }, { 0x13F4E, 0x001F, NES_SOUND }, - { 0x324B4, 0x098E, NES_SOUND }, { 0x31B85, 0x004B, NES_SOUND }, { 0x32E42, 0x0011, NES_SOUND }, { 0x30ECA, 0x0832, NES_SOUND }, { 0x32E53, 0x000F, NES_SOUND }, - { 0x32E62, 0x002F, NES_SOUND }, { 0x32E91, 0x001D, NES_SOUND }, { 0x32EAE, 0x0018, NES_SOUND }, { 0x32EC6, 0x0016, NES_SOUND }, { 0x32EDC, 0x001B, NES_SOUND }, - { 0x32EF7, 0x0088, NES_SOUND }, { 0x32F7F, 0x0065, NES_SOUND }, { 0x32FE4, 0x0065, NES_SOUND }, { 0x33049, 0x0073, NES_SOUND }, { 0x330BC, 0x00F9, NES_SOUND }, - { 0x331B5, 0x049E, NES_SOUND }, { 0x34001, 0x0EA8, NES_SOUND }, { 0x34EA9, 0x0B18, NES_SOUND }, { 0x359C1, 0x0B9C, NES_SOUND }, { 0x3655D, 0x0C6B, NES_SOUND }, - { 0x38001, 0x0E56, NES_SOUND }, { 0x371C8, 0x0C70, NES_SOUND }, { 0x38E57, 0x0DEC, NES_SOUND }, { 0x39C43, 0x0B77, NES_SOUND }, { 0x33653, 0x042F, NES_SOUND }, - { 0x3A7BA, 0x0AC5, NES_SOUND }, { 0x3B27F, 0x0BE4, NES_SOUND } -}; -static const ScummNESFile::Resource res_sounds_swe[82] = { - { 0x0BF58, 0x000A, NES_SOUND }, { 0x30352, 0x0832, NES_SOUND }, { 0x30352, 0x0832, NES_SOUND }, { 0x30352, 0x0832, NES_SOUND }, { 0x30352, 0x0832, NES_SOUND }, - { 0x30352, 0x0832, NES_SOUND }, { 0x0BF62, 0x0011, NES_SOUND }, { 0x27E5F, 0x0073, NES_SOUND }, { 0x17F5A, 0x0011, NES_SOUND }, { 0x17F6B, 0x0011, NES_SOUND }, - { 0x27ED2, 0x0056, NES_SOUND }, { 0x1BF55, 0x001F, NES_SOUND }, { 0x23F66, 0x0011, NES_SOUND }, { 0x0BF73, 0x000A, NES_SOUND }, { 0x1BF74, 0x000A, NES_SOUND }, - { 0x27F28, 0x0019, NES_SOUND }, { 0x2BF0A, 0x004B, NES_SOUND }, { 0x1FF71, 0x000A, NES_SOUND }, { 0x27F41, 0x000F, NES_SOUND }, { 0x27F50, 0x001D, NES_SOUND }, - { 0x2FEAA, 0x0045, NES_SOUND }, { 0x27F6D, 0x000F, NES_SOUND }, { 0x2BF55, 0x001B, NES_SOUND }, { 0x2FEEF, 0x0033, NES_SOUND }, { 0x2FF22, 0x0011, NES_SOUND }, - { 0x2BF70, 0x000F, NES_SOUND }, { 0x30B84, 0x0075, NES_SOUND }, { 0x2FF33, 0x0014, NES_SOUND }, { 0x0BF58, 0x000A, NES_SOUND }, { 0x30BF9, 0x00FF, NES_SOUND }, - { 0x2FF47, 0x000F, NES_SOUND }, { 0x2FF56, 0x000F, NES_SOUND }, { 0x30CF8, 0x0092, NES_SOUND }, { 0x30CF8, 0x0092, NES_SOUND }, { 0x30D8A, 0x002D, NES_SOUND }, - { 0x30DB7, 0x00F8, NES_SOUND }, { 0x2FF65, 0x0016, NES_SOUND }, { 0x30EAF, 0x0011, NES_SOUND }, { 0x30EC0, 0x004B, NES_SOUND }, { 0x30F0B, 0x0011, NES_SOUND }, - { 0x30F1C, 0x003B, NES_SOUND }, { 0x30F57, 0x008A, NES_SOUND }, { 0x30FE1, 0x0011, NES_SOUND }, { 0x30FF2, 0x000F, NES_SOUND }, { 0x31001, 0x00A2, NES_SOUND }, - { 0x310A3, 0x00D3, NES_SOUND }, { 0x31176, 0x0097, NES_SOUND }, { 0x2BF70, 0x000F, NES_SOUND }, { 0x31001, 0x00A2, NES_SOUND }, { 0x3120D, 0x05D1, NES_SOUND }, - { 0x3120D, 0x05D1, NES_SOUND }, { 0x317DE, 0x0011, NES_SOUND }, { 0x0BF58, 0x000A, NES_SOUND }, { 0x30B84, 0x0075, NES_SOUND }, { 0x1BF55, 0x001F, NES_SOUND }, - { 0x317EF, 0x098E, NES_SOUND }, { 0x30EC0, 0x004B, NES_SOUND }, { 0x3217D, 0x0011, NES_SOUND }, { 0x30352, 0x0832, NES_SOUND }, { 0x3218E, 0x000F, NES_SOUND }, - { 0x3219D, 0x002F, NES_SOUND }, { 0x321CC, 0x001D, NES_SOUND }, { 0x321E9, 0x0018, NES_SOUND }, { 0x32201, 0x0016, NES_SOUND }, { 0x32217, 0x001B, NES_SOUND }, - { 0x32232, 0x0088, NES_SOUND }, { 0x322BA, 0x0065, NES_SOUND }, { 0x3231F, 0x0065, NES_SOUND }, { 0x32384, 0x0073, NES_SOUND }, { 0x323F7, 0x00F9, NES_SOUND }, - { 0x324F0, 0x049E, NES_SOUND }, { 0x3298E, 0x0EA8, NES_SOUND }, { 0x34001, 0x0B18, NES_SOUND }, { 0x34B19, 0x0B9C, NES_SOUND }, { 0x356B5, 0x0C6B, NES_SOUND }, - { 0x36320, 0x0E56, NES_SOUND }, { 0x37176, 0x0C70, NES_SOUND }, { 0x38001, 0x0DEC, NES_SOUND }, { 0x38DED, 0x0B77, NES_SOUND }, { 0x33836, 0x042F, NES_SOUND }, - { 0x39964, 0x0AC5, NES_SOUND }, { 0x3A429, 0x0BE4, NES_SOUND } -}; -static const ScummNESFile::Resource res_sounds_fra[82] = { - { 0x07F74, 0x000A, NES_SOUND }, { 0x30ECA, 0x0832, NES_SOUND }, { 0x30ECA, 0x0832, NES_SOUND }, { 0x30ECA, 0x0832, NES_SOUND }, { 0x30ECA, 0x0832, NES_SOUND }, - { 0x30ECA, 0x0832, NES_SOUND }, { 0x0BF6C, 0x0011, NES_SOUND }, { 0x1BEFA, 0x0073, NES_SOUND }, { 0x17F10, 0x0011, NES_SOUND }, { 0x17F21, 0x0011, NES_SOUND }, - { 0x1FED5, 0x0056, NES_SOUND }, { 0x17F32, 0x001F, NES_SOUND }, { 0x17F51, 0x0011, NES_SOUND }, { 0x0FF76, 0x000A, NES_SOUND }, { 0x17F62, 0x000A, NES_SOUND }, - { 0x1FF2B, 0x0019, NES_SOUND }, { 0x23E78, 0x004B, NES_SOUND }, { 0x17F6C, 0x000A, NES_SOUND }, { 0x1BF6D, 0x000F, NES_SOUND }, { 0x1FF44, 0x001D, NES_SOUND }, - { 0x23EC3, 0x0045, NES_SOUND }, { 0x1FF61, 0x000F, NES_SOUND }, { 0x23F08, 0x001B, NES_SOUND }, { 0x23F23, 0x0033, NES_SOUND }, { 0x23F56, 0x0011, NES_SOUND }, - { 0x1FF70, 0x000F, NES_SOUND }, { 0x27EF4, 0x0075, NES_SOUND }, { 0x23F67, 0x0014, NES_SOUND }, { 0x07F74, 0x000A, NES_SOUND }, { 0x2FB83, 0x00FF, NES_SOUND }, - { 0x27F69, 0x000F, NES_SOUND }, { 0x2BF70, 0x000F, NES_SOUND }, { 0x2FC82, 0x0092, NES_SOUND }, { 0x2FC82, 0x0092, NES_SOUND }, { 0x2FD14, 0x002D, NES_SOUND }, - { 0x2FD41, 0x00F8, NES_SOUND }, { 0x2FE39, 0x0016, NES_SOUND }, { 0x2FE4F, 0x0011, NES_SOUND }, { 0x2FE60, 0x004B, NES_SOUND }, { 0x2FEAB, 0x0011, NES_SOUND }, - { 0x2FEBC, 0x003B, NES_SOUND }, { 0x316FC, 0x008A, NES_SOUND }, { 0x2FEF7, 0x0011, NES_SOUND }, { 0x2FF08, 0x000F, NES_SOUND }, { 0x31786, 0x00A2, NES_SOUND }, - { 0x31828, 0x00D3, NES_SOUND }, { 0x318FB, 0x0097, NES_SOUND }, { 0x1FF70, 0x000F, NES_SOUND }, { 0x31786, 0x00A2, NES_SOUND }, { 0x31992, 0x05D1, NES_SOUND }, - { 0x31992, 0x05D1, NES_SOUND }, { 0x2FF17, 0x0011, NES_SOUND }, { 0x07F74, 0x000A, NES_SOUND }, { 0x27EF4, 0x0075, NES_SOUND }, { 0x17F32, 0x001F, NES_SOUND }, - { 0x31F63, 0x098E, NES_SOUND }, { 0x2FE60, 0x004B, NES_SOUND }, { 0x2FF28, 0x0011, NES_SOUND }, { 0x30ECA, 0x0832, NES_SOUND }, { 0x2FF39, 0x000F, NES_SOUND }, - { 0x2FF48, 0x002F, NES_SOUND }, { 0x328F1, 0x001D, NES_SOUND }, { 0x3290E, 0x0018, NES_SOUND }, { 0x32926, 0x0016, NES_SOUND }, { 0x3293C, 0x001B, NES_SOUND }, - { 0x32957, 0x0088, NES_SOUND }, { 0x329DF, 0x0065, NES_SOUND }, { 0x32A44, 0x0065, NES_SOUND }, { 0x32AA9, 0x0073, NES_SOUND }, { 0x32B1C, 0x00F9, NES_SOUND }, - { 0x32C15, 0x049E, NES_SOUND }, { 0x330B3, 0x0EA8, NES_SOUND }, { 0x34001, 0x0B18, NES_SOUND }, { 0x34B19, 0x0B9C, NES_SOUND }, { 0x356B5, 0x0C6B, NES_SOUND }, - { 0x36320, 0x0E56, NES_SOUND }, { 0x37176, 0x0C70, NES_SOUND }, { 0x38001, 0x0DEC, NES_SOUND }, { 0x38DED, 0x0B77, NES_SOUND }, { 0x39964, 0x042F, NES_SOUND }, - { 0x39D93, 0x0AC5, NES_SOUND }, { 0x3A858, 0x0BE4, NES_SOUND } -}; -static const ScummNESFile::Resource res_sounds_ger[82] = { - { 0x0BF6D, 0x000A, NES_SOUND }, { 0x30ECA, 0x0832, NES_SOUND }, { 0x30ECA, 0x0832, NES_SOUND }, { 0x30ECA, 0x0832, NES_SOUND }, { 0x30ECA, 0x0832, NES_SOUND }, - { 0x30ECA, 0x0832, NES_SOUND }, { 0x23F05, 0x0011, NES_SOUND }, { 0x2FA49, 0x0073, NES_SOUND }, { 0x23F16, 0x0011, NES_SOUND }, { 0x23F27, 0x0011, NES_SOUND }, - { 0x2FABC, 0x0056, NES_SOUND }, { 0x23F38, 0x001F, NES_SOUND }, { 0x23F57, 0x0011, NES_SOUND }, { 0x0FF76, 0x000A, NES_SOUND }, { 0x17F71, 0x000A, NES_SOUND }, - { 0x2BF2F, 0x0019, NES_SOUND }, { 0x2FB12, 0x004B, NES_SOUND }, { 0x23F68, 0x000A, NES_SOUND }, { 0x2BF48, 0x000F, NES_SOUND }, { 0x2BF57, 0x001D, NES_SOUND }, - { 0x2FB5D, 0x0045, NES_SOUND }, { 0x2FBA2, 0x000F, NES_SOUND }, { 0x2FBB1, 0x001B, NES_SOUND }, { 0x2FBCC, 0x0033, NES_SOUND }, { 0x2FBFF, 0x0011, NES_SOUND }, - { 0x2FC10, 0x000F, NES_SOUND }, { 0x2FC1F, 0x0075, NES_SOUND }, { 0x2FC94, 0x0014, NES_SOUND }, { 0x0BF6D, 0x000A, NES_SOUND }, { 0x2FCA8, 0x00FF, NES_SOUND }, - { 0x2FDA7, 0x000F, NES_SOUND }, { 0x2FDB6, 0x000F, NES_SOUND }, { 0x2FDC5, 0x0092, NES_SOUND }, { 0x2FDC5, 0x0092, NES_SOUND }, { 0x2FE57, 0x002D, NES_SOUND }, - { 0x2FE84, 0x00F8, NES_SOUND }, { 0x316FC, 0x0016, NES_SOUND }, { 0x31712, 0x0011, NES_SOUND }, { 0x31723, 0x004B, NES_SOUND }, { 0x3176E, 0x0011, NES_SOUND }, - { 0x3177F, 0x003B, NES_SOUND }, { 0x317BA, 0x008A, NES_SOUND }, { 0x31844, 0x0011, NES_SOUND }, { 0x31855, 0x000F, NES_SOUND }, { 0x31864, 0x00A2, NES_SOUND }, - { 0x31906, 0x00D3, NES_SOUND }, { 0x319D9, 0x0097, NES_SOUND }, { 0x2FC10, 0x000F, NES_SOUND }, { 0x31864, 0x00A2, NES_SOUND }, { 0x31A70, 0x05D1, NES_SOUND }, - { 0x31A70, 0x05D1, NES_SOUND }, { 0x32041, 0x0011, NES_SOUND }, { 0x0BF6D, 0x000A, NES_SOUND }, { 0x2FC1F, 0x0075, NES_SOUND }, { 0x23F38, 0x001F, NES_SOUND }, - { 0x32052, 0x098E, NES_SOUND }, { 0x31723, 0x004B, NES_SOUND }, { 0x329E0, 0x0011, NES_SOUND }, { 0x30ECA, 0x0832, NES_SOUND }, { 0x329F1, 0x000F, NES_SOUND }, - { 0x32A00, 0x002F, NES_SOUND }, { 0x32A2F, 0x001D, NES_SOUND }, { 0x32A4C, 0x0018, NES_SOUND }, { 0x32A64, 0x0016, NES_SOUND }, { 0x32A7A, 0x001B, NES_SOUND }, - { 0x32A95, 0x0088, NES_SOUND }, { 0x32B1D, 0x0065, NES_SOUND }, { 0x32B82, 0x0065, NES_SOUND }, { 0x32BE7, 0x0073, NES_SOUND }, { 0x32C5A, 0x00F9, NES_SOUND }, - { 0x32D53, 0x049E, NES_SOUND }, { 0x34001, 0x0EA8, NES_SOUND }, { 0x331F1, 0x0B18, NES_SOUND }, { 0x34EA9, 0x0B9C, NES_SOUND }, { 0x35A45, 0x0C6B, NES_SOUND }, - { 0x366B0, 0x0E56, NES_SOUND }, { 0x38001, 0x0C70, NES_SOUND }, { 0x38C71, 0x0DEC, NES_SOUND }, { 0x39A5D, 0x0B77, NES_SOUND }, { 0x37506, 0x042F, NES_SOUND }, - { 0x3A5D4, 0x0AC5, NES_SOUND }, { 0x3B099, 0x0BE4, NES_SOUND } -}; -#endif -static const ScummNESFile::Resource *res_sounds[ScummNESFile::kROMsetNum] = { - res_sounds_usa, - res_sounds_eur, - res_sounds_swe, - res_sounds_fra, - res_sounds_ger, -}; - -#ifdef PALMOS_68K -static const ScummNESFile::Resource *res_costumes_usa; -static const ScummNESFile::Resource *res_costumes_eur; -static const ScummNESFile::Resource *res_costumes_swe; -static const ScummNESFile::Resource *res_costumes_fra; -static const ScummNESFile::Resource *res_costumes_ger; -#else -static const ScummNESFile::Resource res_costumes_usa[25] = { - { 0x17F05, 0x0055, NES_COSTUME }, { 0x17F05, 0x0055, NES_COSTUME }, { 0x17F05, 0x0055, NES_COSTUME }, { 0x17F05, 0x0055, NES_COSTUME }, { 0x17F05, 0x0055, NES_COSTUME }, - { 0x17F05, 0x0055, NES_COSTUME }, { 0x17F05, 0x0055, NES_COSTUME }, { 0x17F05, 0x0055, NES_COSTUME }, { 0x13FAB, 0x004B, NES_COSTUME }, { 0x17F05, 0x0055, NES_COSTUME }, - { 0x17F05, 0x0055, NES_COSTUME }, { 0x17F05, 0x0055, NES_COSTUME }, { 0x17F5A, 0x0036, NES_COSTUME }, { 0x17F90, 0x003A, NES_COSTUME }, { 0x17F90, 0x003A, NES_COSTUME }, - { 0x17F05, 0x0055, NES_COSTUME }, { 0x1BF87, 0x003B, NES_COSTUME }, { 0x17F05, 0x0055, NES_COSTUME }, { 0x23FA9, 0x0045, NES_COSTUME }, { 0x1FFBD, 0x0040, NES_COSTUME }, - { 0x1BFC2, 0x003C, NES_COSTUME }, { 0x17F90, 0x003A, NES_COSTUME }, { 0x17F90, 0x003A, NES_COSTUME }, { 0x17F05, 0x0055, NES_COSTUME }, { 0x13FAB, 0x004B, NES_COSTUME } -}; -static const ScummNESFile::Resource res_costumes_eur[25] = { - { 0x0BEFF, 0x0055, NES_COSTUME }, { 0x0BEFF, 0x0055, NES_COSTUME }, { 0x0BEFF, 0x0055, NES_COSTUME }, { 0x0BEFF, 0x0055, NES_COSTUME }, { 0x0BEFF, 0x0055, NES_COSTUME }, - { 0x0BEFF, 0x0055, NES_COSTUME }, { 0x0BEFF, 0x0055, NES_COSTUME }, { 0x0BEFF, 0x0055, NES_COSTUME }, { 0x0FEA2, 0x004B, NES_COSTUME }, { 0x0BEFF, 0x0055, NES_COSTUME }, - { 0x0BEFF, 0x0055, NES_COSTUME }, { 0x0BEFF, 0x0055, NES_COSTUME }, { 0x0FEED, 0x0036, NES_COSTUME }, { 0x0FF23, 0x003A, NES_COSTUME }, { 0x0FF23, 0x003A, NES_COSTUME }, - { 0x0BEFF, 0x0055, NES_COSTUME }, { 0x13F13, 0x003B, NES_COSTUME }, { 0x0BEFF, 0x0055, NES_COSTUME }, { 0x23F2F, 0x0045, NES_COSTUME }, { 0x1FF3E, 0x0040, NES_COSTUME }, - { 0x27E8F, 0x003C, NES_COSTUME }, { 0x0FF23, 0x003A, NES_COSTUME }, { 0x0FF23, 0x003A, NES_COSTUME }, { 0x0BEFF, 0x0055, NES_COSTUME }, { 0x0FEA2, 0x004B, NES_COSTUME } -}; -static const ScummNESFile::Resource res_costumes_swe[25] = { - { 0x0FEF5, 0x0055, NES_COSTUME }, { 0x0FEF5, 0x0055, NES_COSTUME }, { 0x0FEF5, 0x0055, NES_COSTUME }, { 0x0FEF5, 0x0055, NES_COSTUME }, { 0x0FEF5, 0x0055, NES_COSTUME }, - { 0x0FEF5, 0x0055, NES_COSTUME }, { 0x0FEF5, 0x0055, NES_COSTUME }, { 0x0FEF5, 0x0055, NES_COSTUME }, { 0x17E9A, 0x004B, NES_COSTUME }, { 0x0FEF5, 0x0055, NES_COSTUME }, - { 0x0FEF5, 0x0055, NES_COSTUME }, { 0x0FEF5, 0x0055, NES_COSTUME }, { 0x0FF4A, 0x0036, NES_COSTUME }, { 0x17EE5, 0x003A, NES_COSTUME }, { 0x17EE5, 0x003A, NES_COSTUME }, - { 0x0FEF5, 0x0055, NES_COSTUME }, { 0x17F1F, 0x003B, NES_COSTUME }, { 0x0FEF5, 0x0055, NES_COSTUME }, { 0x1BE94, 0x0045, NES_COSTUME }, { 0x1BED9, 0x0040, NES_COSTUME }, - { 0x1BF19, 0x003C, NES_COSTUME }, { 0x17EE5, 0x003A, NES_COSTUME }, { 0x17EE5, 0x003A, NES_COSTUME }, { 0x0FEF5, 0x0055, NES_COSTUME }, { 0x17E9A, 0x004B, NES_COSTUME } -}; -static const ScummNESFile::Resource res_costumes_fra[25] = { - { 0x0BF17, 0x0055, NES_COSTUME }, { 0x0BF17, 0x0055, NES_COSTUME }, { 0x0BF17, 0x0055, NES_COSTUME }, { 0x0BF17, 0x0055, NES_COSTUME }, { 0x0BF17, 0x0055, NES_COSTUME }, - { 0x0BF17, 0x0055, NES_COSTUME }, { 0x0BF17, 0x0055, NES_COSTUME }, { 0x0BF17, 0x0055, NES_COSTUME }, { 0x13E77, 0x004B, NES_COSTUME }, { 0x0BF17, 0x0055, NES_COSTUME }, - { 0x0BF17, 0x0055, NES_COSTUME }, { 0x0BF17, 0x0055, NES_COSTUME }, { 0x07F3E, 0x0036, NES_COSTUME }, { 0x13EC2, 0x003A, NES_COSTUME }, { 0x13EC2, 0x003A, NES_COSTUME }, - { 0x0BF17, 0x0055, NES_COSTUME }, { 0x13EFC, 0x003B, NES_COSTUME }, { 0x0BF17, 0x0055, NES_COSTUME }, { 0x13F37, 0x0045, NES_COSTUME }, { 0x17E94, 0x0040, NES_COSTUME }, - { 0x17ED4, 0x003C, NES_COSTUME }, { 0x13EC2, 0x003A, NES_COSTUME }, { 0x13EC2, 0x003A, NES_COSTUME }, { 0x0BF17, 0x0055, NES_COSTUME }, { 0x13E77, 0x004B, NES_COSTUME } -}; -static const ScummNESFile::Resource res_costumes_ger[25] = { - { 0x0FEEB, 0x0055, NES_COSTUME }, { 0x0FEEB, 0x0055, NES_COSTUME }, { 0x0FEEB, 0x0055, NES_COSTUME }, { 0x0FEEB, 0x0055, NES_COSTUME }, { 0x0FEEB, 0x0055, NES_COSTUME }, - { 0x0FEEB, 0x0055, NES_COSTUME }, { 0x0FEEB, 0x0055, NES_COSTUME }, { 0x0FEEB, 0x0055, NES_COSTUME }, { 0x17E6C, 0x004B, NES_COSTUME }, { 0x0FEEB, 0x0055, NES_COSTUME }, - { 0x0FEEB, 0x0055, NES_COSTUME }, { 0x0FEEB, 0x0055, NES_COSTUME }, { 0x0FF40, 0x0036, NES_COSTUME }, { 0x17EB7, 0x003A, NES_COSTUME }, { 0x17EB7, 0x003A, NES_COSTUME }, - { 0x0FEEB, 0x0055, NES_COSTUME }, { 0x17EF1, 0x003B, NES_COSTUME }, { 0x0FEEB, 0x0055, NES_COSTUME }, { 0x17F2C, 0x0045, NES_COSTUME }, { 0x1FEFD, 0x0040, NES_COSTUME }, - { 0x1FF3D, 0x003C, NES_COSTUME }, { 0x17EB7, 0x003A, NES_COSTUME }, { 0x17EB7, 0x003A, NES_COSTUME }, { 0x0FEEB, 0x0055, NES_COSTUME }, { 0x17E6C, 0x004B, NES_COSTUME } -}; -#endif -static const ScummNESFile::Resource *res_costumes[ScummNESFile::kROMsetNum] = { - res_costumes_usa, - res_costumes_eur, - res_costumes_swe, - res_costumes_fra, - res_costumes_ger, -}; - -#ifdef PALMOS_68K -static const ScummNESFile::Resource *res_globdata_usa; -static const ScummNESFile::Resource *res_globdata_eur; -static const ScummNESFile::Resource *res_globdata_swe; -static const ScummNESFile::Resource *res_globdata_fra; -static const ScummNESFile::Resource *res_globdata_ger; -#else -static const ScummNESFile::Resource res_globdata_usa[1] = { { 0x2CA11, 0x0307, NES_GLOBDATA } }; -static const ScummNESFile::Resource res_globdata_eur[1] = { { 0x2CA11, 0x0307, NES_GLOBDATA } }; -static const ScummNESFile::Resource res_globdata_swe[1] = { { 0x2C001, 0x0307, NES_GLOBDATA } }; -static const ScummNESFile::Resource res_globdata_fra[1] = { { 0x2C628, 0x0307, NES_GLOBDATA } }; -static const ScummNESFile::Resource res_globdata_ger[1] = { { 0x2C4EE, 0x0307, NES_GLOBDATA } }; -#endif -static const ScummNESFile::Resource *res_globdata[ScummNESFile::kROMsetNum] = { - res_globdata_usa, - res_globdata_eur, - res_globdata_swe, - res_globdata_fra, - res_globdata_ger, -}; - -#ifdef PALMOS_68K -static const ScummNESFile::Resource *res_sprpals_usa; -static const ScummNESFile::Resource *res_sprpals_eur; -static const ScummNESFile::Resource *res_sprpals_swe; -static const ScummNESFile::Resource *res_sprpals_fra; -static const ScummNESFile::Resource *res_sprpals_ger; -#else -// sprite palette data -static const ScummNESFile::Resource res_sprpals_usa[2] = { { 0x0BFC1, 0x0010, NES_SPRPALS }, { 0x0BFD1, 0x0010, NES_SPRPALS } }; -static const ScummNESFile::Resource res_sprpals_eur[2] = { { 0x07F61, 0x0010, NES_SPRPALS }, { 0x0BEB2, 0x0010, NES_SPRPALS } }; -static const ScummNESFile::Resource res_sprpals_swe[2] = { { 0x07F55, 0x0010, NES_SPRPALS }, { 0x07F65, 0x0010, NES_SPRPALS } }; -static const ScummNESFile::Resource res_sprpals_fra[2] = { { 0x07ED8, 0x0010, NES_SPRPALS }, { 0x07EE8, 0x0010, NES_SPRPALS } }; -static const ScummNESFile::Resource res_sprpals_ger[2] = { { 0x07F6B, 0x0010, NES_SPRPALS }, { 0x0BF17, 0x0010, NES_SPRPALS } }; -#endif -static const ScummNESFile::Resource *res_sprpals[ScummNESFile::kROMsetNum] = { - res_sprpals_usa, - res_sprpals_eur, - res_sprpals_swe, - res_sprpals_fra, - res_sprpals_ger, -}; - -#ifdef PALMOS_68K -static const ScummNESFile::Resource *res_sprdesc_usa; -static const ScummNESFile::Resource *res_sprdesc_eur; -static const ScummNESFile::Resource *res_sprdesc_swe; -static const ScummNESFile::Resource *res_sprdesc_fra; -static const ScummNESFile::Resource *res_sprdesc_ger; -#else -// associates costume IDs with sprite sets (indexes into SPRLENS/SPROFFS) -static const ScummNESFile::Resource res_sprdesc_usa[2] = { { 0x0FFB7, 0x0031, NES_SPRDESC }, { 0x0BFE1, 0x0009, NES_SPRDESC } }; -static const ScummNESFile::Resource res_sprdesc_eur[2] = { { 0x0BEC2, 0x0031, NES_SPRDESC }, { 0x07F71, 0x0009, NES_SPRDESC } }; -static const ScummNESFile::Resource res_sprdesc_swe[2] = { { 0x0BF1B, 0x0031, NES_SPRDESC }, { 0x07F75, 0x0009, NES_SPRDESC } }; -static const ScummNESFile::Resource res_sprdesc_fra[2] = { { 0x07EF8, 0x0031, NES_SPRDESC }, { 0x07F29, 0x0009, NES_SPRDESC } }; -static const ScummNESFile::Resource res_sprdesc_ger[2] = { { 0x0BF27, 0x0031, NES_SPRDESC }, { 0x0BF58, 0x0009, NES_SPRDESC } }; -#endif -static const ScummNESFile::Resource *res_sprdesc[ScummNESFile::kROMsetNum] = { - res_sprdesc_usa, - res_sprdesc_eur, - res_sprdesc_swe, - res_sprdesc_fra, - res_sprdesc_ger, -}; - -#ifdef PALMOS_68K -static const ScummNESFile::Resource *res_sprlens_usa; -static const ScummNESFile::Resource *res_sprlens_eur; -static const ScummNESFile::Resource *res_sprlens_swe; -static const ScummNESFile::Resource *res_sprlens_fra; -static const ScummNESFile::Resource *res_sprlens_ger; -#else -// number of sprites in each set (indicates length within SPRDATA) -static const ScummNESFile::Resource res_sprlens_usa[2] = { { 0x0FEA2, 0x0115, NES_SPRLENS }, { 0x07FF5, 0x0006, NES_SPRLENS } }; -static const ScummNESFile::Resource res_sprlens_eur[2] = { { 0x1BE32, 0x0115, NES_SPRLENS }, { 0x07F5B, 0x0006, NES_SPRLENS } }; -static const ScummNESFile::Resource res_sprlens_swe[2] = { { 0x13E6A, 0x0115, NES_SPRLENS }, { 0x07F4F, 0x0006, NES_SPRLENS } }; -static const ScummNESFile::Resource res_sprlens_fra[2] = { { 0x0FE61, 0x0115, NES_SPRLENS }, { 0x07ED2, 0x0006, NES_SPRLENS } }; -static const ScummNESFile::Resource res_sprlens_ger[2] = { { 0x2BE1A, 0x0115, NES_SPRLENS }, { 0x07F65, 0x0006, NES_SPRLENS } }; -#endif -static const ScummNESFile::Resource *res_sprlens[ScummNESFile::kROMsetNum] = { - res_sprlens_usa, - res_sprlens_eur, - res_sprlens_swe, - res_sprlens_fra, - res_sprlens_ger, -}; - -#ifdef PALMOS_68K -static const ScummNESFile::Resource *res_sproffs_usa; -static const ScummNESFile::Resource *res_sproffs_eur; -static const ScummNESFile::Resource *res_sproffs_swe; -static const ScummNESFile::Resource *res_sproffs_fra; -static const ScummNESFile::Resource *res_sproffs_ger; -#else -// offset of each sprite set (indexes into SPRDATA) -static const ScummNESFile::Resource res_sproffs_usa[2] = { { 0x2BDC5, 0x022A, NES_SPROFFS }, { 0x0BFEA, 0x000C, NES_SPROFFS } }; -static const ScummNESFile::Resource res_sproffs_eur[2] = { { 0x2FD42, 0x022A, NES_SPROFFS }, { 0x0BEF3, 0x000C, NES_SPROFFS } }; -static const ScummNESFile::Resource res_sproffs_swe[2] = { { 0x2BCE0, 0x022A, NES_SPROFFS }, { 0x0BF4C, 0x000C, NES_SPROFFS } }; -static const ScummNESFile::Resource res_sproffs_fra[2] = { { 0x2F959, 0x022A, NES_SPROFFS }, { 0x07F32, 0x000C, NES_SPROFFS } }; -static const ScummNESFile::Resource res_sproffs_ger[2] = { { 0x2F81F, 0x022A, NES_SPROFFS }, { 0x0BF61, 0x000C, NES_SPROFFS } }; -#endif -static const ScummNESFile::Resource *res_sproffs[ScummNESFile::kROMsetNum] = { - res_sproffs_usa, - res_sproffs_eur, - res_sproffs_swe, - res_sproffs_fra, - res_sproffs_ger, -}; - -#ifdef PALMOS_68K -static const ScummNESFile::Resource *res_sprdata_usa; -static const ScummNESFile::Resource *res_sprdata_eur; -static const ScummNESFile::Resource *res_sprdata_swe; -static const ScummNESFile::Resource *res_sprdata_fra; -static const ScummNESFile::Resource *res_sprdata_ger; -#else -// sprite data sets (packed NES sprite data) -static const ScummNESFile::Resource res_sprdata_usa[2] = { { 0x2CE11, 0x2BE0, NES_SPRDATA }, { 0x07F6B, 0x008A, NES_SPRDATA } }; -static const ScummNESFile::Resource res_sprdata_eur[2] = { { 0x2CE11, 0x2BE0, NES_SPRDATA }, { 0x0BE28, 0x008A, NES_SPRDATA } }; -static const ScummNESFile::Resource res_sprdata_swe[2] = { { 0x2C401, 0x2BE0, NES_SPRDATA }, { 0x0FE6B, 0x008A, NES_SPRDATA } }; -static const ScummNESFile::Resource res_sprdata_fra[2] = { { 0x2CA28, 0x2BE0, NES_SPRDATA }, { 0x07E48, 0x008A, NES_SPRDATA } }; -static const ScummNESFile::Resource res_sprdata_ger[2] = { { 0x2C8EE, 0x2BE0, NES_SPRDATA }, { 0x0FE61, 0x008A, NES_SPRDATA } }; -static const ScummNESFile::Resource *res_sprdata[ScummNESFile::kROMsetNum] = { - res_sprdata_usa, - res_sprdata_eur, - res_sprdata_swe, - res_sprdata_fra, - res_sprdata_ger, -}; -#endif - -#ifdef PALMOS_68K -static const ScummNESFile::Resource *res_charset_usa; -static const ScummNESFile::Resource *res_charset_eur; -static const ScummNESFile::Resource *res_charset_swe; -static const ScummNESFile::Resource *res_charset_fra; -static const ScummNESFile::Resource *res_charset_ger; -#else -static const ScummNESFile::Resource res_charset_usa[1] = { { 0x3F6EE, 0x0090, NES_CHARSET } }; -static const ScummNESFile::Resource res_charset_eur[1] = { { 0x3F724, 0x0090, NES_CHARSET } }; -static const ScummNESFile::Resource res_charset_swe[1] = { { 0x3F739, 0x0090, NES_CHARSET } }; -static const ScummNESFile::Resource res_charset_fra[1] = { { 0x3F739, 0x0090, NES_CHARSET } }; -static const ScummNESFile::Resource res_charset_ger[1] = { { 0x3F739, 0x0090, NES_CHARSET } }; -#endif -static const ScummNESFile::Resource *res_charset[ScummNESFile::kROMsetNum] = { - res_charset_usa, - res_charset_eur, - res_charset_swe, - res_charset_fra, - res_charset_ger, -}; - -#ifdef PALMOS_68K -static const ScummNESFile::Resource *res_preplist_usa; -static const ScummNESFile::Resource *res_preplist_eur; -static const ScummNESFile::Resource *res_preplist_swe; -static const ScummNESFile::Resource *res_preplist_fra; -static const ScummNESFile::Resource *res_preplist_ger; -#else -static const ScummNESFile::Resource res_preplist_usa[1] = { { 0x3FB5A, 0x000E, NES_PREPLIST } }; -static const ScummNESFile::Resource res_preplist_eur[1] = { { 0x3FB90, 0x000E, NES_PREPLIST } }; -static const ScummNESFile::Resource res_preplist_swe[1] = { { 0x3FBA9, 0x000E, NES_PREPLIST } }; -static const ScummNESFile::Resource res_preplist_fra[1] = { { 0x3FBAF, 0x0010, NES_PREPLIST } }; -static const ScummNESFile::Resource res_preplist_ger[1] = { { 0x3FBAB, 0x000F, NES_PREPLIST } }; -#endif -static const ScummNESFile::Resource *res_preplist[ScummNESFile::kROMsetNum] = { - res_preplist_usa, - res_preplist_eur, - res_preplist_swe, - res_preplist_fra, - res_preplist_ger, -}; - -uint16 write_byte(Common::WriteStream *out, byte val) { - val ^= 0xFF; - if (out != 0) - out->writeByte(val); - return 1; -} - -uint16 write_word(Common::WriteStream *out, uint16 val) { - val ^= 0xFFFF; - if (out != 0) - out->writeUint16LE(val); - return 2; -} - -byte ScummNESFile::fileReadByte() { - byte b = 0; - File::read(&b, 1); - return b; -} - -uint16 ScummNESFile::fileReadUint16LE() { - uint16 a = fileReadByte(); - uint16 b = fileReadByte(); - return a | (b << 8); -} - -uint16 ScummNESFile::extractResource(Common::WriteStream *output, const Resource *res) { - uint16 len, i, j; - byte val; - byte cnt; - uint16 reslen = 0; - - if (res == NULL) - error("extract_resource - no resource specified"); - - if ((res->offset == 0) && (res->length == 0)) - return 0; /* there are 8 scripts that are zero bytes long, so we should skip them */ - - File::seek(res->offset,SEEK_SET); - - switch (res->type) { - case NES_GLOBDATA: - len = res->length; - - for (i = 0; i < len; i++) - reslen += write_byte(output, fileReadByte()); - - break; - - case NES_ROOMGFX: - case NES_COSTUMEGFX: - reslen += write_word(output, (uint16)(res->length + 2)); - len = fileReadByte(); - reslen += write_byte(output, (byte)len); - - if (!len) - len = 256; - len = len << 4; - - for (i = 0; i < len;) { - reslen += write_byte(output, cnt = fileReadByte()); - for (j = 0; j < (cnt & 0x7F); j++, i++) - if ((cnt & 0x80) || (j == 0)) - reslen += write_byte(output, fileReadByte()); - } - - if (File::pos() - res->offset != res->length) - error("extract_resource - length mismatch while extracting graphics resource (was %04X, should be %04X)", File::pos() - res->offset, res->length); - - break; - - case NES_ROOM: - case NES_SCRIPT: - len = fileReadUint16LE(); - - if (len != res->length) - error("extract_resource - length mismatch while extracting room/script resource (was %04X, should be %04X)", len, res->length); - - File::seek(-2, SEEK_CUR); - - for (i = 0; i < len; i++) - reslen += write_byte(output, fileReadByte()); - - break; - - case NES_SOUND: - len = res->length + 2; - val = fileReadByte(); - cnt = fileReadByte(); - - if ((val == 2) && (cnt == 100)) { - reslen += write_word(output, len); - reslen += write_byte(output, val); - reslen += write_byte(output, cnt); - - cnt = fileReadByte(); - reslen += write_byte(output, cnt); - for (i = 0; i < cnt; i++) - reslen += write_byte(output, fileReadByte()); - for (i = 0; i < cnt; i++) - reslen += write_byte(output, fileReadByte()); - - while (1) { - reslen += write_byte(output, val = fileReadByte()); - if (val >= 0xFE) - break; - } - } else if (((val == 0) || (val == 1) || (val == 4)) && (cnt == 10)) { - reslen += write_word(output, len); - reslen += write_byte(output, val); - reslen += write_byte(output, cnt); - while (1) { - reslen += write_byte(output, val = fileReadByte()); - - if (val >= 0xFE) - break; - - if (val >= 0x10) - reslen += write_byte(output, fileReadByte()); - else { - reslen += write_byte(output, fileReadByte()); - reslen += write_byte(output, fileReadByte()); - reslen += write_byte(output, fileReadByte()); - reslen += write_byte(output, fileReadByte()); - } - } - } else - error("extract_resource - unknown sound type %d/%d detected",val,cnt); - - if (File::pos() - res->offset != res->length) - error("extract_resource - length mismatch while extracting sound resource (was %04X, should be %04X)", File::pos() - res->offset, res->length); - - break; - - case NES_COSTUME: - case NES_SPRPALS: - case NES_SPRDESC: - case NES_SPRLENS: - case NES_SPROFFS: - case NES_SPRDATA: - case NES_CHARSET: - len = res->length; - reslen += write_word(output, (uint16)(len + 2)); - - for (i = 0; i < len; i++) - reslen += write_byte(output, fileReadByte()); - - break; - - case NES_PREPLIST: - len = res->length; - reslen += write_word(output, 0x002A); - - reslen += write_byte(output, ' '); - for (i = 1; i < 8; i++) - reslen += write_byte(output, 0); - - for (j = 0; j < 4; j++) - { - reslen += write_byte(output,' '); - for (i = 1; (val = fileReadByte()); i++) - reslen += write_byte(output, val); - for (; i < 8; i++) - reslen += write_byte(output, 0); - } - break; - - default: - error("extract_resource - unknown resource type %d specified!", res->type); - } - - return reslen; -} - -struct ScummNESFile::LFLEntry { - const Resource **type; - int index; -}; - -// based on structure of Classic PC Maniac Mansion LFL files -// (roomgfx resources are arranged in order, one per file, -// after the room blocks) -static const ScummNESFile::LFLEntry lfl_01[] = { {res_rooms, 1}, {res_roomgfx, 1}, {res_scripts, 57}, {res_scripts, 61}, {res_scripts, 76}, {res_scripts, 105}, {res_scripts, 111}, {res_sounds, 5}, {res_scripts, 132}, {res_scripts, 148}, {res_scripts, 155}, {res_scripts, 156}, {res_sounds, 39}, {NULL, 0} }; -static const ScummNESFile::LFLEntry lfl_02[] = { {res_rooms, 2}, {res_roomgfx, 2}, {NULL, 0} }; -static const ScummNESFile::LFLEntry lfl_03[] = { {res_rooms, 3}, {res_roomgfx, 3}, {res_scripts, 21}, {res_sounds, 26}, {NULL, 0} }; -static const ScummNESFile::LFLEntry lfl_04[] = { {res_rooms, 4}, {res_roomgfx, 4}, {res_scripts, 46}, {res_scripts, 56}, {res_scripts, 137}, {res_scripts, 146}, {res_sounds, 12}, {res_sounds, 11}, {res_sounds, 13}, {res_sounds, 42}, {NULL, 0} }; -static const ScummNESFile::LFLEntry lfl_05[] = { {res_rooms, 5}, {res_roomgfx, 5}, {res_scripts, 30}, {res_scripts, 31}, {res_scripts, 32}, {res_scripts, 33}, {res_scripts, 34}, {res_scripts, 35}, {res_sounds, 22}, {res_sounds, 23}, {res_sounds, 24}, {res_sounds, 21}, {res_sounds, 46}, {NULL, 0} }; -static const ScummNESFile::LFLEntry lfl_06[] = { {res_rooms, 6}, {res_roomgfx, 6}, {NULL, 0} }; -static const ScummNESFile::LFLEntry lfl_07[] = { {res_rooms, 7}, {res_roomgfx, 7}, {res_scripts, 17}, {res_scripts, 58}, {res_scripts, 59}, {res_scripts, 60}, {res_scripts, 74}, {res_scripts, 81}, {res_scripts, 82}, {res_scripts, 150}, {res_sounds, 14}, {res_sounds, 15}, {res_sounds, 16}, {res_sounds, 17}, {NULL, 0} }; -static const ScummNESFile::LFLEntry lfl_08[] = { {res_rooms, 8}, {res_roomgfx, 8}, {res_scripts, 7}, {res_scripts, 12}, {res_scripts, 13}, {res_scripts, 47}, {res_scripts, 48}, {res_scripts, 49}, {res_scripts, 154}, {res_sounds, 32}, {res_sounds, 33}, {res_sounds, 36}, {NULL, 0} }; -static const ScummNESFile::LFLEntry lfl_09[] = { {res_rooms, 9}, {res_roomgfx, 9}, {res_scripts, 10}, {res_scripts, 11}, {res_scripts, 45}, {res_scripts, 55}, {res_scripts, 84}, {res_scripts, 85}, {res_scripts, 86}, {NULL, 0} }; -static const ScummNESFile::LFLEntry lfl_10[] = { {res_rooms, 10}, {res_roomgfx, 10}, {res_scripts, 24}, {res_scripts, 149}, {res_sounds, 28}, {NULL, 0} }; -static const ScummNESFile::LFLEntry lfl_11[] = { {res_rooms, 11}, {res_roomgfx, 11}, {res_scripts, 166}, {res_scripts, 167}, {res_scripts, 168}, {NULL, 0} }; -static const ScummNESFile::LFLEntry lfl_12[] = { {res_rooms, 12}, {res_roomgfx, 12}, {res_scripts, 51}, {res_scripts, 103}, {res_scripts, 104}, {res_scripts, 161}, {res_sounds, 63}, {res_costumes, 14}, {NULL, 0} }; -static const ScummNESFile::LFLEntry lfl_13[] = { {res_rooms, 13}, {res_roomgfx, 13}, {NULL, 0} }; -static const ScummNESFile::LFLEntry lfl_14[] = { {res_rooms, 14}, {res_roomgfx, 14}, {NULL, 0} }; -static const ScummNESFile::LFLEntry lfl_15[] = { {res_rooms, 15}, {res_roomgfx, 15}, {res_sounds, 27}, {NULL, 0} }; -static const ScummNESFile::LFLEntry lfl_16[] = { {res_rooms, 16}, {res_roomgfx, 16}, {res_scripts, 14}, {res_scripts, 121}, {res_scripts, 122}, {res_sounds, 40}, {res_sounds, 64}, {res_sounds, 68}, {NULL, 0} }; -static const ScummNESFile::LFLEntry lfl_17[] = { {res_rooms, 17}, {res_roomgfx, 17}, {res_scripts, 20}, {res_scripts, 100}, {res_sounds, 25}, {res_sounds, 44}, {res_sounds, 2}, {res_sounds, 50}, {res_sounds, 52}, {NULL, 0} }; -static const ScummNESFile::LFLEntry lfl_18[] = { {res_rooms, 18}, {res_roomgfx, 18}, {res_scripts, 25}, {res_scripts, 26}, {res_scripts, 27}, {res_scripts, 28}, {res_scripts, 64}, {res_scripts, 65}, {res_scripts, 66}, {res_scripts, 67}, {res_scripts, 68}, {res_scripts, 69}, {res_scripts, 70}, {res_scripts, 71}, {res_scripts, 73}, {res_scripts, 101}, {res_sounds, 35}, {NULL, 0} }; -static const ScummNESFile::LFLEntry lfl_19[] = { {res_rooms, 19}, {res_roomgfx, 19}, {res_scripts, 36}, {res_scripts, 37}, {res_scripts, 38}, {res_scripts, 39}, {res_scripts, 40}, {res_scripts, 152}, {res_scripts, 153}, {res_costumes, 10}, {NULL, 0} }; -static const ScummNESFile::LFLEntry lfl_20[] = { {res_rooms, 20}, {res_roomgfx, 20}, {res_scripts, 107}, {res_scripts, 108}, {res_scripts, 109}, {res_scripts, 110}, {res_scripts, 159}, {NULL, 0} }; -static const ScummNESFile::LFLEntry lfl_21[] = { {res_rooms, 21}, {res_roomgfx, 21}, {res_scripts, 41}, {res_scripts, 42}, {res_scripts, 43}, {res_scripts, 53}, {res_scripts, 136}, {res_sounds, 29}, {res_sounds, 20}, {res_sounds, 37}, {NULL, 0} }; -static const ScummNESFile::LFLEntry lfl_22[] = { {res_rooms, 22}, {res_roomgfx, 22}, {res_scripts, 15}, {NULL, 0} }; -static const ScummNESFile::LFLEntry lfl_23[] = { {res_rooms, 23}, {res_roomgfx, 23}, {res_scripts, 77}, {res_scripts, 79}, {res_scripts, 80}, {res_scripts, 83}, {res_sounds, 41}, {NULL, 0} }; -static const ScummNESFile::LFLEntry lfl_24[] = { {res_rooms, 24}, {res_roomgfx, 24}, {res_scripts, 18}, {res_scripts, 19}, {res_scripts, 78}, {res_sounds, 7}, {res_sounds, 3}, {res_sounds, 18}, {res_sounds, 34}, {res_costumes, 12}, {NULL, 0} }; -static const ScummNESFile::LFLEntry lfl_25[] = { {res_rooms, 25}, {res_roomgfx, 25}, {res_scripts, 29}, {res_sounds, 30}, {res_sounds, 31}, {NULL, 0} }; -static const ScummNESFile::LFLEntry lfl_26[] = { {res_rooms, 26}, {res_roomgfx, 26}, {res_scripts, 87}, {res_scripts, 88}, {res_scripts, 89}, {res_scripts, 90}, {res_scripts, 91}, {res_scripts, 92}, {res_scripts, 93}, {res_scripts, 94}, {res_scripts, 95}, {res_scripts, 96}, {res_scripts, 97}, {res_scripts, 98}, {res_scripts, 116}, {res_scripts, 151}, {res_scripts, 174}, {res_costumes, 11}, {NULL, 0} }; -static const ScummNESFile::LFLEntry lfl_27[] = { {res_rooms, 27}, {res_roomgfx, 27}, {res_scripts, 16}, {res_scripts, 52}, {res_scripts, 54}, {res_scripts, 113}, {res_sounds, 45}, {res_costumes, 19}, {NULL, 0} }; -static const ScummNESFile::LFLEntry lfl_28[] = { {res_rooms, 28}, {res_roomgfx, 28}, {res_scripts, 22}, {res_scripts, 23}, {NULL, 0} }; -static const ScummNESFile::LFLEntry lfl_29[] = { {res_rooms, 29}, {res_roomgfx, 29}, {res_scripts, 75}, {res_sounds, 43}, {NULL, 0} }; -static const ScummNESFile::LFLEntry lfl_30[] = { {res_rooms, 30}, {res_roomgfx, 30}, {res_scripts, 63}, {res_sounds, 0}, {res_scripts, 123}, {res_scripts, 125}, {res_scripts, 126}, {res_scripts, 127}, {res_scripts, 129}, {res_sounds, 55}, {res_sounds, 59}, {res_sounds, 60}, {res_costumes, 8}, {NULL, 0} }; -static const ScummNESFile::LFLEntry lfl_31[] = { {res_rooms, 31}, {res_roomgfx, 31}, {res_scripts, 99}, {res_scripts, 115}, {res_scripts, 117}, {res_scripts, 119}, {res_scripts, 147}, {res_scripts, 157}, {res_scripts, 158}, {res_scripts, 160}, {res_costumes, 13}, {res_costumes, 9}, {res_costumes, 23}, {res_costumes, 24}, {NULL, 0} }; -static const ScummNESFile::LFLEntry lfl_32[] = { {res_rooms, 32}, {res_roomgfx, 32}, {res_costumes, 15}, {NULL, 0} }; -static const ScummNESFile::LFLEntry lfl_33[] = { {res_rooms, 33}, {res_roomgfx, 33}, {res_scripts, 120}, {res_scripts, 135}, {res_sounds, 56}, {res_sounds, 57}, {res_sounds, 58}, {res_sounds, 1}, {res_costumes, 22}, {NULL, 0} }; -static const ScummNESFile::LFLEntry lfl_34[] = { {res_rooms, 34}, {res_roomgfx, 34}, {NULL, 0} }; -static const ScummNESFile::LFLEntry lfl_35[] = { {res_rooms, 35}, {res_roomgfx, 35}, {NULL, 0} }; -static const ScummNESFile::LFLEntry lfl_36[] = { {res_rooms, 36}, {res_roomgfx, 36}, {res_sounds, 10}, {res_sounds, 4}, {NULL, 0} }; -static const ScummNESFile::LFLEntry lfl_37[] = { {res_rooms, 37}, {res_roomgfx, 37}, {NULL, 0} }; -static const ScummNESFile::LFLEntry lfl_38[] = { {res_rooms, 38}, {res_roomgfx, 38}, {res_scripts, 138}, {res_scripts, 139}, {res_scripts, 140}, {res_scripts, 141}, {res_scripts, 142}, {res_scripts, 143}, {res_scripts, 144}, {res_scripts, 145}, {NULL, 0} }; -static const ScummNESFile::LFLEntry lfl_39[] = { {res_rooms, 39}, {res_roomgfx, 39}, {NULL, 0} }; -static const ScummNESFile::LFLEntry lfl_40[] = { {res_rooms, 40}, {res_roomgfx, 0}, {res_scripts, 112}, {res_costumes, 17}, {NULL, 0} }; -static const ScummNESFile::LFLEntry lfl_41[] = { {res_rooms, 41}, {res_scripts, 106}, {res_sounds, 47}, {res_sounds, 48}, {res_sounds, 53}, {res_sounds, 49}, {res_sounds, 51}, {NULL, 0} }; -static const ScummNESFile::LFLEntry lfl_42[] = { {res_rooms, 42}, {res_scripts, 124}, {res_costumes, 18}, {NULL, 0} }; -static const ScummNESFile::LFLEntry lfl_43[] = { {res_rooms, 43}, {res_scripts, 44}, {res_sounds, 19}, {NULL, 0} }; -static const ScummNESFile::LFLEntry lfl_44[] = { {res_rooms, 44}, {res_scripts, 102}, {res_sounds, 6}, {res_sounds, 38}, {res_sounds, 8}, {res_sounds, 9}, {res_costumes, 1}, {res_costumes, 2}, {res_costumes, 5}, {res_costumes, 6}, {res_costumes, 3}, {res_costumes, 4}, {res_costumes, 7}, {NULL, 0} }; -static const ScummNESFile::LFLEntry lfl_45[] = { {res_rooms, 45}, {res_scripts, 1}, {res_scripts, 2}, {res_scripts, 3}, {res_scripts, 4}, {res_scripts, 5}, {res_scripts, 9}, {res_scripts, 114}, {res_scripts, 131}, {res_scripts, 164}, {res_scripts, 165}, {res_scripts, 169}, {res_scripts, 170}, {res_scripts, 171}, {res_scripts, 172}, {res_scripts, 173}, {res_scripts, 175}, {res_sounds, 54}, {NULL, 0} }; -static const ScummNESFile::LFLEntry lfl_46[] = { {res_rooms, 46}, {res_scripts, 130}, {res_sounds, 65}, {res_costumes, 0}, {res_costumes, 21}, {NULL, 0} }; -static const ScummNESFile::LFLEntry lfl_47[] = { {res_rooms, 47}, {res_scripts, 62}, {res_sounds, 69}, {NULL, 0} }; -static const ScummNESFile::LFLEntry lfl_48[] = { {res_rooms, 48}, {NULL, 0} }; -static const ScummNESFile::LFLEntry lfl_49[] = { {res_rooms, 49}, {NULL, 0} }; -static const ScummNESFile::LFLEntry lfl_50[] = { {res_rooms, 50}, {res_scripts, 133}, {res_scripts, 163}, {NULL, 0} }; -static const ScummNESFile::LFLEntry lfl_51[] = { {res_rooms, 51}, {res_scripts, 118}, {res_scripts, 128}, {res_sounds, 61}, {res_sounds, 62}, {res_sounds, 67}, {res_sounds, 66}, {res_costumes, 16}, {res_costumes, 20}, {NULL, 0} }; -static const ScummNESFile::LFLEntry lfl_52[] = { {res_rooms, 52}, {NULL, 0} }; -// remaining 'standard' resources (not used by any of the original LFL files) -static const ScummNESFile::LFLEntry lfl_53[] = { {res_rooms, 53}, {res_scripts, 177}, {res_scripts, 178}, {res_sounds, 70}, {res_sounds, 71}, {res_sounds, 72}, {res_sounds, 73}, {res_sounds, 74}, {res_sounds, 75}, {res_sounds, 76}, {res_sounds, 77}, {res_sounds, 78}, {res_sounds, 79}, {res_sounds, 80}, {res_sounds, 81}, {NULL, 0} }; -// all 'non-standard' resources (the costume-related stuff) -static const ScummNESFile::LFLEntry lfl_54[] = { {res_rooms, 54}, {res_sprdesc, 0}, {res_sprdesc, 1}, {res_sprlens, 0}, {res_sprlens, 1}, {res_sproffs, 0}, {res_sproffs, 1}, {res_sprdata, 0}, {res_sprdata, 1}, {res_costumegfx, 0}, {res_costumegfx, 1}, {res_sprpals, 0}, {res_sprpals, 1}, {res_charset, 0}, {res_preplist, 0}, {NULL, 0} }; - -struct ScummNESFile::LFL { - int num; - const ScummNESFile::LFLEntry *entries; -}; - -static const ScummNESFile::LFL lfls[] = { - { 1, lfl_01 }, - { 2, lfl_02 }, - { 3, lfl_03 }, - { 4, lfl_04 }, - { 5, lfl_05 }, - { 6, lfl_06 }, - { 7, lfl_07 }, - { 8, lfl_08 }, - { 9, lfl_09 }, - { 10, lfl_10 }, - { 11, lfl_11 }, - { 12, lfl_12 }, - { 13, lfl_13 }, - { 14, lfl_14 }, - { 15, lfl_15 }, - { 16, lfl_16 }, - { 17, lfl_17 }, - { 18, lfl_18 }, - { 19, lfl_19 }, - { 20, lfl_20 }, - { 21, lfl_21 }, - { 22, lfl_22 }, - { 23, lfl_23 }, - { 24, lfl_24 }, - { 25, lfl_25 }, - { 26, lfl_26 }, - { 27, lfl_27 }, - { 28, lfl_28 }, - { 29, lfl_29 }, - { 30, lfl_30 }, - { 31, lfl_31 }, - { 32, lfl_32 }, - { 33, lfl_33 }, - { 34, lfl_34 }, - { 35, lfl_35 }, - { 36, lfl_36 }, - { 37, lfl_37 }, - { 38, lfl_38 }, - { 39, lfl_39 }, - { 40, lfl_40 }, - { 41, lfl_41 }, - { 42, lfl_42 }, - { 43, lfl_43 }, - { 44, lfl_44 }, - { 45, lfl_45 }, - { 46, lfl_46 }, - { 47, lfl_47 }, - { 48, lfl_48 }, - { 49, lfl_49 }, - { 50, lfl_50 }, - { 51, lfl_51 }, - { 52, lfl_52 }, - { 53, lfl_53 }, - { 54, lfl_54 }, - { -1, NULL } -}; - -#include "common/pack-start.h" // START STRUCT PACKING - -struct _lfl_index { - byte room_lfl[55]; - uint16 room_addr[55]; - byte costume_lfl[80]; - uint16 costume_addr[80]; - byte script_lfl[200]; - uint16 script_addr[200]; - byte sound_lfl[100]; - uint16 sound_addr[100]; -} PACKED_STRUCT; - -#include "common/pack-end.h" // END STRUCT PACKING - -_lfl_index lfl_index; - -bool ScummNESFile::generateResource(int res) { - const LFL *lfl = &lfls[res - 1]; - int j; - int bufsize = 2; - - for (j = 0; lfl->entries[j].type != NULL; j++) - bufsize += extractResource(0, &lfl->entries[j].type[_ROMset][lfl->entries[j].index]); - - free(_buf); - _buf = (byte *)calloc(1, bufsize); - - Common::MemoryWriteStream out(_buf, bufsize); - - for (j = 0; lfl->entries[j].type != NULL; j++) { - const Resource *entry = &lfl->entries[j].type[_ROMset][lfl->entries[j].index]; - extractResource(&out, entry); - } - write_byte(&out, 0xD1); - write_byte(&out, 0xF5); - - if (_stream) - delete _stream; - - _stream = new Common::MemoryReadStream(_buf, bufsize); - - return true; -} - -bool ScummNESFile::generateIndex() { - int i, j; - - for (i = 0; lfls[i].num != -1; i++) { - const LFL *lfl = &lfls[i]; - uint16 respos = 0; - - for (j = 0; lfl->entries[j].type != NULL; j++) { - const LFLEntry *entry = &lfl->entries[j]; - - switch (entry->type[_ROMset][entry->index].type) { - case NES_ROOM: - lfl_index.room_lfl[entry->index] = lfl->num; - lfl_index.room_addr[entry->index] = TO_LE_16(respos); - break; - case NES_COSTUME: - lfl_index.costume_lfl[entry->index] = lfl->num; - lfl_index.costume_addr[entry->index] = TO_LE_16(respos); - break; - case NES_SPRDESC: - lfl_index.costume_lfl[entry->index + 25] = lfl->num; - lfl_index.costume_addr[entry->index + 25] = TO_LE_16(respos); - break; - case NES_SPRLENS: - lfl_index.costume_lfl[entry->index + 27] = lfl->num; - lfl_index.costume_addr[entry->index + 27] = TO_LE_16(respos); - break; - case NES_SPROFFS: - lfl_index.costume_lfl[entry->index + 29] = lfl->num; - lfl_index.costume_addr[entry->index + 29] = TO_LE_16(respos); - break; - case NES_SPRDATA: - lfl_index.costume_lfl[entry->index + 31] = lfl->num; - lfl_index.costume_addr[entry->index + 31] = TO_LE_16(respos); - break; - case NES_COSTUMEGFX: - lfl_index.costume_lfl[entry->index + 33] = lfl->num; - lfl_index.costume_addr[entry->index + 33] = TO_LE_16(respos); - break; - case NES_SPRPALS: - lfl_index.costume_lfl[entry->index + 35] = lfl->num; - lfl_index.costume_addr[entry->index + 35] = TO_LE_16(respos); - break; - case NES_ROOMGFX: - lfl_index.costume_lfl[entry->index + 37] = lfl->num; - lfl_index.costume_addr[entry->index + 37] = TO_LE_16(respos); - break; - case NES_SCRIPT: - lfl_index.script_lfl[entry->index] = lfl->num; - lfl_index.script_addr[entry->index] = TO_LE_16(respos); - break; - case NES_SOUND: - lfl_index.sound_lfl[entry->index] = lfl->num; - lfl_index.sound_addr[entry->index] = TO_LE_16(respos); - break; - case NES_CHARSET: - lfl_index.costume_lfl[77] = lfl->num; - lfl_index.costume_addr[77] = TO_LE_16(respos); - break; - case NES_PREPLIST: - lfl_index.costume_lfl[78] = lfl->num; - lfl_index.costume_addr[78] = TO_LE_16(respos); - break; - default: - error("Unindexed entry found!"); - break; - } - respos += extractResource(0, &entry->type[_ROMset][entry->index]); - } - } - - int bufsize = 2; - - bufsize += 775; - bufsize += sizeof(lfl_index); - - free(_buf); - _buf = (byte *)calloc(1, bufsize); - - Common::MemoryWriteStream out(_buf, bufsize); - - write_byte(&out, 0x43); - write_byte(&out, 0x46); - - extractResource(&out, &res_globdata[_ROMset][0]); - - for (i = 0; i < (int)sizeof(lfl_index); i++) - write_byte(&out, ((byte *)&lfl_index)[i]); - - if (_stream) - delete _stream; - - _stream = new Common::MemoryReadStream(_buf, bufsize); - - return true; -} - -bool ScummNESFile::open(const Common::String &filename, AccessMode mode) { - - if (_ROMset == kROMsetNum) { - char md5str[32+1]; - if (Common::md5_file_string(filename.c_str(), md5str)) { - - if (!strcmp(md5str, "3905799e081b80a61d4460b7b733c206")) { - _ROMset = kROMsetUSA; - debug(1, "ROM contents verified as Maniac Mansion (USA)"); - } else if (!strcmp(md5str, "d8d07efcb88f396bee0b402b10c3b1c9")) { - _ROMset = kROMsetEurope; - debug(1, "ROM contents verified as Maniac Mansion (Europe)"); - } else if (!strcmp(md5str, "22d07d6c386c9c25aca5dac2a0c0d94b")) { - _ROMset = kROMsetSweden; - debug(1, "ROM contents verified as Maniac Mansion (Sweden)"); - } else if (!strcmp(md5str, "81bbfa181184cb494e7a81dcfa94fbd9")) { - _ROMset = kROMsetFrance; - debug(2, "ROM contents verified as Maniac Mansion (France)"); - } else if (!strcmp(md5str, "257f8c14d8c584f7ddd601bcb00920c7")) { - _ROMset = kROMsetGermany; - debug(2, "ROM contents verified as Maniac Mansion (Germany)"); - } else { - error("Unsupported Maniac Mansion ROM, md5: %s", md5str); - return false; - } - } else { - return false; - } - } - - if (File::open(filename, mode)) { - if (_stream) - delete _stream; - _stream = 0; - - free(_buf); - _buf = 0; - - return true; - } else { - return false; - } -} - -void ScummNESFile::close() { - if (_stream) - delete _stream; - _stream = 0; - - free(_buf); - _buf = 0; - - File::close(); -} - -bool ScummNESFile::openSubFile(const Common::String &filename) { - assert(isOpen()); - - const char *ext = strrchr(filename.c_str(), '.'); - char resNum[3]; - int res; - - // We always have file name in form of XX.lfl - resNum[0] = ext[-2]; - resNum[1] = ext[-1]; - resNum[2] = 0; - - res = atoi(resNum); - - if (res == 0) { - return generateIndex(); - } else { - return generateResource(res); - } -} - -#pragma mark - #pragma mark --- ScummDiskImage --- #pragma mark - @@ -1487,6 +215,20 @@ static const int zakResourcesPerFile[59] = { }; +static uint16 write_byte(Common::WriteStream *out, byte val) { + val ^= 0xFF; + if (out != 0) + out->writeByte(val); + return 1; +} + +static uint16 write_word(Common::WriteStream *out, uint16 val) { + val ^= 0xFFFF; + if (out != 0) + out->writeUint16LE(val); + return 2; +} + ScummDiskImage::ScummDiskImage(const char *disk1, const char *disk2, GameSettings game) : _stream(0), _buf(0) { _disk1 = disk1; _disk2 = disk2; diff --git a/engines/scumm/file.h b/engines/scumm/file.h index 18b7b8fb18..10ab031c7e 100644 --- a/engines/scumm/file.h +++ b/engines/scumm/file.h @@ -70,50 +70,6 @@ public: uint32 write(const void *dataPtr, uint32 dataSize); }; -class ScummNESFile : public BaseScummFile { -public: - enum ROMset { - kROMsetUSA, - kROMsetEurope, - kROMsetSweden, - kROMsetFrance, - kROMsetGermany, - kROMsetNum - }; - - struct Resource; - struct LFLEntry; - struct LFL; - -private: - Common::MemoryReadStream *_stream; - ROMset _ROMset; - byte *_buf; - - bool generateIndex(); - bool generateResource(int res); - uint16 extractResource(Common::WriteStream *out, const Resource *res); - - byte fileReadByte(); - uint16 fileReadUint16LE(); - -public: - ScummNESFile(); - void setEnc(byte value); - - bool open(const Common::String &filename, AccessMode mode = kFileReadMode); - bool openSubFile(const Common::String &filename); - - void close(); - bool eof() { return _stream->eos(); } - uint32 pos() { return _stream->pos(); } - uint32 size() { return _stream->size(); } - void seek(int32 offs, int whence = SEEK_SET) { _stream->seek(offs, whence); } - uint32 read(void *dataPtr, uint32 dataSize) { return _stream->read(dataPtr, dataSize); } - uint32 write(const void *dataPtr, uint32 dataSize); -}; - - class ScummDiskImage : public BaseScummFile { private: Common::MemoryReadStream *_stream; diff --git a/engines/scumm/file_nes.cpp b/engines/scumm/file_nes.cpp new file mode 100644 index 0000000000..88b4253a1d --- /dev/null +++ b/engines/scumm/file_nes.cpp @@ -0,0 +1,1317 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * $URL$ + * $Id$ + * + */ + +#include "scumm/file_nes.h" +#include "common/endian.h" +#include "common/md5.h" + +using Common::File; + +namespace Scumm { + +#pragma mark - +#pragma mark --- ScummNESFile --- +#pragma mark - + +enum ResType { + NES_UNKNOWN, + NES_GLOBDATA, + NES_ROOM, + NES_SCRIPT, + NES_SOUND, + NES_COSTUME, + NES_ROOMGFX, + NES_COSTUMEGFX, + NES_SPRPALS, + NES_SPRDESC, + NES_SPRLENS, + NES_SPROFFS, + NES_SPRDATA, + NES_CHARSET, + NES_PREPLIST +}; + +struct ScummNESFile::Resource { + uint32 offset; + uint16 length; + ResType type; +}; + +ScummNESFile::ScummNESFile() : _stream(0), _buf(0), _ROMset(kROMsetNum) { +} + +uint32 ScummNESFile::write(const void *, uint32) { + error("ScummNESFile does not support writing!"); + return 0; +} + +void ScummNESFile::setEnc(byte enc) { + _stream->setEnc(enc); +} + +static const ScummNESFile::Resource res_roomgfx_usa[40] = { + { 0x04001, 0x03C9, NES_ROOMGFX }, { 0x043CA, 0x069E, NES_ROOMGFX }, { 0x04A68, 0x0327, NES_ROOMGFX }, { 0x04D8F, 0x053B, NES_ROOMGFX }, { 0x052CA, 0x06BE, NES_ROOMGFX }, + { 0x05988, 0x0682, NES_ROOMGFX }, { 0x0600A, 0x0778, NES_ROOMGFX }, { 0x06782, 0x0517, NES_ROOMGFX }, { 0x06C99, 0x07FB, NES_ROOMGFX }, { 0x07494, 0x07BE, NES_ROOMGFX }, + { 0x08001, 0x07A5, NES_ROOMGFX }, { 0x087A6, 0x06DD, NES_ROOMGFX }, { 0x08E83, 0x04EA, NES_ROOMGFX }, { 0x0936D, 0x0846, NES_ROOMGFX }, { 0x09BB3, 0x08C8, NES_ROOMGFX }, + { 0x0A47B, 0x0844, NES_ROOMGFX }, { 0x0ACBF, 0x0515, NES_ROOMGFX }, { 0x0B1D4, 0x0799, NES_ROOMGFX }, { 0x0B96D, 0x04BB, NES_ROOMGFX }, { 0x07C52, 0x0319, NES_ROOMGFX }, + { 0x0C001, 0x0464, NES_ROOMGFX }, { 0x0C465, 0x076D, NES_ROOMGFX }, { 0x0CBD2, 0x0827, NES_ROOMGFX }, { 0x0D3F9, 0x0515, NES_ROOMGFX }, { 0x0D90E, 0x064E, NES_ROOMGFX }, + { 0x0DF5C, 0x0775, NES_ROOMGFX }, { 0x0E6D1, 0x06DD, NES_ROOMGFX }, { 0x0EDAE, 0x0376, NES_ROOMGFX }, { 0x0F124, 0x05F7, NES_ROOMGFX }, { 0x0F71B, 0x0787, NES_ROOMGFX }, + { 0x10001, 0x02D6, NES_ROOMGFX }, { 0x102D7, 0x06A3, NES_ROOMGFX }, { 0x1097A, 0x099F, NES_ROOMGFX }, { 0x11319, 0x0361, NES_ROOMGFX }, { 0x1167A, 0x0489, NES_ROOMGFX }, + { 0x11B03, 0x0437, NES_ROOMGFX }, { 0x11F3A, 0x084D, NES_ROOMGFX }, { 0x0BE28, 0x0199, NES_ROOMGFX }, { 0x12787, 0x09A7, NES_ROOMGFX }, { 0x1312E, 0x037A, NES_ROOMGFX } +}; +static const ScummNESFile::Resource res_roomgfx_eur[40] = { + { 0x04001, 0x03B9, NES_ROOMGFX }, { 0x043BA, 0x069E, NES_ROOMGFX }, { 0x04A58, 0x0327, NES_ROOMGFX }, { 0x04D7F, 0x053B, NES_ROOMGFX }, { 0x052BA, 0x06BE, NES_ROOMGFX }, + { 0x05978, 0x0682, NES_ROOMGFX }, { 0x05FFA, 0x0778, NES_ROOMGFX }, { 0x06772, 0x0517, NES_ROOMGFX }, { 0x06C89, 0x07FB, NES_ROOMGFX }, { 0x07484, 0x07BE, NES_ROOMGFX }, + { 0x08001, 0x07A5, NES_ROOMGFX }, { 0x087A6, 0x06DD, NES_ROOMGFX }, { 0x08E83, 0x04EA, NES_ROOMGFX }, { 0x0936D, 0x0846, NES_ROOMGFX }, { 0x09BB3, 0x08C8, NES_ROOMGFX }, + { 0x0A47B, 0x0844, NES_ROOMGFX }, { 0x0ACBF, 0x0515, NES_ROOMGFX }, { 0x0B1D4, 0x0799, NES_ROOMGFX }, { 0x0B96D, 0x04BB, NES_ROOMGFX }, { 0x07C42, 0x0319, NES_ROOMGFX }, + { 0x0C001, 0x0464, NES_ROOMGFX }, { 0x0C465, 0x076D, NES_ROOMGFX }, { 0x0CBD2, 0x0827, NES_ROOMGFX }, { 0x0D3F9, 0x0515, NES_ROOMGFX }, { 0x0D90E, 0x064E, NES_ROOMGFX }, + { 0x0DF5C, 0x0775, NES_ROOMGFX }, { 0x0E6D1, 0x06DD, NES_ROOMGFX }, { 0x0EDAE, 0x0376, NES_ROOMGFX }, { 0x0F124, 0x05F7, NES_ROOMGFX }, { 0x0F71B, 0x0787, NES_ROOMGFX }, + { 0x10001, 0x02D6, NES_ROOMGFX }, { 0x102D7, 0x06A3, NES_ROOMGFX }, { 0x1097A, 0x099F, NES_ROOMGFX }, { 0x11319, 0x0361, NES_ROOMGFX }, { 0x1167A, 0x0489, NES_ROOMGFX }, + { 0x11B03, 0x0437, NES_ROOMGFX }, { 0x11F3A, 0x084D, NES_ROOMGFX }, { 0x12787, 0x0199, NES_ROOMGFX }, { 0x12920, 0x09A7, NES_ROOMGFX }, { 0x132C7, 0x037A, NES_ROOMGFX } +}; +static const ScummNESFile::Resource res_roomgfx_swe[40] = { + { 0x04001, 0x03F0, NES_ROOMGFX }, { 0x043F1, 0x069E, NES_ROOMGFX }, { 0x04A8F, 0x0327, NES_ROOMGFX }, { 0x04DB6, 0x053B, NES_ROOMGFX }, { 0x052F1, 0x06BE, NES_ROOMGFX }, + { 0x059AF, 0x0682, NES_ROOMGFX }, { 0x06031, 0x0778, NES_ROOMGFX }, { 0x067A9, 0x0517, NES_ROOMGFX }, { 0x06CC0, 0x07FB, NES_ROOMGFX }, { 0x074BB, 0x07BE, NES_ROOMGFX }, + { 0x08001, 0x07A5, NES_ROOMGFX }, { 0x087A6, 0x06DD, NES_ROOMGFX }, { 0x08E83, 0x04EA, NES_ROOMGFX }, { 0x0936D, 0x07E2, NES_ROOMGFX }, { 0x09B4F, 0x0791, NES_ROOMGFX }, + { 0x0A2E0, 0x07B5, NES_ROOMGFX }, { 0x0AA95, 0x0515, NES_ROOMGFX }, { 0x0AFAA, 0x0799, NES_ROOMGFX }, { 0x0B743, 0x04BF, NES_ROOMGFX }, { 0x0BC02, 0x0319, NES_ROOMGFX }, + { 0x0C001, 0x0464, NES_ROOMGFX }, { 0x0C465, 0x072C, NES_ROOMGFX }, { 0x0CB91, 0x0827, NES_ROOMGFX }, { 0x0D3B8, 0x0515, NES_ROOMGFX }, { 0x0D8CD, 0x064E, NES_ROOMGFX }, + { 0x0DF1B, 0x0775, NES_ROOMGFX }, { 0x0E690, 0x06DD, NES_ROOMGFX }, { 0x0ED6D, 0x0376, NES_ROOMGFX }, { 0x0F0E3, 0x05F7, NES_ROOMGFX }, { 0x0F6DA, 0x0791, NES_ROOMGFX }, + { 0x07C79, 0x02D6, NES_ROOMGFX }, { 0x10001, 0x06A3, NES_ROOMGFX }, { 0x106A4, 0x0921, NES_ROOMGFX }, { 0x10FC5, 0x0361, NES_ROOMGFX }, { 0x11326, 0x0489, NES_ROOMGFX }, + { 0x117AF, 0x0437, NES_ROOMGFX }, { 0x11BE6, 0x084F, NES_ROOMGFX }, { 0x12435, 0x0199, NES_ROOMGFX }, { 0x125CE, 0x0947, NES_ROOMGFX }, { 0x12F15, 0x037A, NES_ROOMGFX } +}; +static const ScummNESFile::Resource res_roomgfx_fra[40] = { + { 0x04001, 0x0426, NES_ROOMGFX }, { 0x04427, 0x069E, NES_ROOMGFX }, { 0x04AC5, 0x0327, NES_ROOMGFX }, { 0x04DEC, 0x053B, NES_ROOMGFX }, { 0x05327, 0x06BE, NES_ROOMGFX }, + { 0x059E5, 0x0682, NES_ROOMGFX }, { 0x06067, 0x0778, NES_ROOMGFX }, { 0x067DF, 0x0517, NES_ROOMGFX }, { 0x06CF6, 0x07FB, NES_ROOMGFX }, { 0x074F1, 0x07BE, NES_ROOMGFX }, + { 0x08001, 0x07A5, NES_ROOMGFX }, { 0x087A6, 0x06DD, NES_ROOMGFX }, { 0x08E83, 0x04EA, NES_ROOMGFX }, { 0x0936D, 0x07E2, NES_ROOMGFX }, { 0x09B4F, 0x0791, NES_ROOMGFX }, + { 0x0A2E0, 0x07B5, NES_ROOMGFX }, { 0x0AA95, 0x0515, NES_ROOMGFX }, { 0x0AFAA, 0x0799, NES_ROOMGFX }, { 0x0B743, 0x04BB, NES_ROOMGFX }, { 0x0BBFE, 0x0319, NES_ROOMGFX }, + { 0x0C001, 0x0464, NES_ROOMGFX }, { 0x0C465, 0x072C, NES_ROOMGFX }, { 0x0CB91, 0x0827, NES_ROOMGFX }, { 0x0D3B8, 0x0515, NES_ROOMGFX }, { 0x0D8CD, 0x064E, NES_ROOMGFX }, + { 0x0DF1B, 0x0775, NES_ROOMGFX }, { 0x0E690, 0x06DD, NES_ROOMGFX }, { 0x0ED6D, 0x0376, NES_ROOMGFX }, { 0x0F0E3, 0x05F7, NES_ROOMGFX }, { 0x0F6DA, 0x0787, NES_ROOMGFX }, + { 0x10001, 0x02D6, NES_ROOMGFX }, { 0x102D7, 0x06A3, NES_ROOMGFX }, { 0x1097A, 0x0921, NES_ROOMGFX }, { 0x1129B, 0x0361, NES_ROOMGFX }, { 0x115FC, 0x0489, NES_ROOMGFX }, + { 0x11A85, 0x0437, NES_ROOMGFX }, { 0x11EBC, 0x070D, NES_ROOMGFX }, { 0x07CAF, 0x0199, NES_ROOMGFX }, { 0x125C9, 0x0947, NES_ROOMGFX }, { 0x12F10, 0x037A, NES_ROOMGFX } +}; +static const ScummNESFile::Resource res_roomgfx_ger[40] = { + { 0x04001, 0x0406, NES_ROOMGFX }, { 0x04407, 0x069E, NES_ROOMGFX }, { 0x04AA5, 0x0327, NES_ROOMGFX }, { 0x04DCC, 0x053B, NES_ROOMGFX }, { 0x05307, 0x06BE, NES_ROOMGFX }, + { 0x059C5, 0x0682, NES_ROOMGFX }, { 0x06047, 0x0778, NES_ROOMGFX }, { 0x067BF, 0x0517, NES_ROOMGFX }, { 0x06CD6, 0x07FB, NES_ROOMGFX }, { 0x074D1, 0x07BE, NES_ROOMGFX }, + { 0x08001, 0x07A5, NES_ROOMGFX }, { 0x087A6, 0x06DD, NES_ROOMGFX }, { 0x08E83, 0x04EA, NES_ROOMGFX }, { 0x0936D, 0x07E2, NES_ROOMGFX }, { 0x09B4F, 0x0791, NES_ROOMGFX }, + { 0x0A2E0, 0x07B5, NES_ROOMGFX }, { 0x0AA95, 0x0515, NES_ROOMGFX }, { 0x0AFAA, 0x0799, NES_ROOMGFX }, { 0x0B743, 0x04BB, NES_ROOMGFX }, { 0x0BBFE, 0x0319, NES_ROOMGFX }, + { 0x0C001, 0x0464, NES_ROOMGFX }, { 0x0C465, 0x072C, NES_ROOMGFX }, { 0x0CB91, 0x0827, NES_ROOMGFX }, { 0x0D3B8, 0x0515, NES_ROOMGFX }, { 0x0D8CD, 0x064E, NES_ROOMGFX }, + { 0x0DF1B, 0x0775, NES_ROOMGFX }, { 0x0E690, 0x06DD, NES_ROOMGFX }, { 0x0ED6D, 0x0376, NES_ROOMGFX }, { 0x0F0E3, 0x05F7, NES_ROOMGFX }, { 0x0F6DA, 0x0787, NES_ROOMGFX }, + { 0x07C8F, 0x02D6, NES_ROOMGFX }, { 0x10001, 0x06A3, NES_ROOMGFX }, { 0x106A4, 0x0921, NES_ROOMGFX }, { 0x10FC5, 0x0361, NES_ROOMGFX }, { 0x11326, 0x0489, NES_ROOMGFX }, + { 0x117AF, 0x0437, NES_ROOMGFX }, { 0x11BE6, 0x07A0, NES_ROOMGFX }, { 0x12386, 0x0199, NES_ROOMGFX }, { 0x1251F, 0x0947, NES_ROOMGFX }, { 0x12E66, 0x037A, NES_ROOMGFX } +}; +static const ScummNESFile::Resource res_roomgfx_esp[40] = { + { 0x04001, 0x041B, NES_ROOMGFX }, { 0x0441C, 0x069E, NES_ROOMGFX }, { 0x04ABA, 0x0327, NES_ROOMGFX }, { 0x04DE1, 0x053B, NES_ROOMGFX }, { 0x0531C, 0x06BE, NES_ROOMGFX }, + { 0x059DA, 0x0682, NES_ROOMGFX }, { 0x0605C, 0x0778, NES_ROOMGFX }, { 0x067D4, 0x0517, NES_ROOMGFX }, { 0x06CEB, 0x07FB, NES_ROOMGFX }, { 0x074E6, 0x07BE, NES_ROOMGFX }, + { 0x08001, 0x07A5, NES_ROOMGFX }, { 0x087A6, 0x06DD, NES_ROOMGFX }, { 0x08E83, 0x04EA, NES_ROOMGFX }, { 0x0936D, 0x07E2, NES_ROOMGFX }, { 0x09B4F, 0x0791, NES_ROOMGFX }, + { 0x0A2E0, 0x07B5, NES_ROOMGFX }, { 0x0AA95, 0x0515, NES_ROOMGFX }, { 0x0AFAA, 0x0799, NES_ROOMGFX }, { 0x0B743, 0x04B9, NES_ROOMGFX }, { 0x0BBFC, 0x0319, NES_ROOMGFX }, + { 0x0C001, 0x0464, NES_ROOMGFX }, { 0x0C465, 0x072C, NES_ROOMGFX }, { 0x0CB91, 0x0827, NES_ROOMGFX }, { 0x0D3B8, 0x0515, NES_ROOMGFX }, { 0x0D8CD, 0x064E, NES_ROOMGFX }, + { 0x0DF1B, 0x0775, NES_ROOMGFX }, { 0x0E690, 0x06DD, NES_ROOMGFX }, { 0x0ED6D, 0x0376, NES_ROOMGFX }, { 0x0F0E3, 0x05F7, NES_ROOMGFX }, { 0x0F6DA, 0x078D, NES_ROOMGFX }, + { 0x07CA4, 0x02D6, NES_ROOMGFX }, { 0x10001, 0x06A3, NES_ROOMGFX }, { 0x106A4, 0x091F, NES_ROOMGFX }, { 0x10FC3, 0x0361, NES_ROOMGFX }, { 0x11324, 0x0489, NES_ROOMGFX }, + { 0x117AD, 0x0437, NES_ROOMGFX }, { 0x11BE4, 0x086E, NES_ROOMGFX }, { 0x12452, 0x0199, NES_ROOMGFX }, { 0x125EB, 0x0947, NES_ROOMGFX }, { 0x12F32, 0x037A, NES_ROOMGFX } +}; + +static const ScummNESFile::Resource *res_roomgfx[ScummNESFile::kROMsetNum] = { + res_roomgfx_usa, + res_roomgfx_eur, + res_roomgfx_swe, + res_roomgfx_fra, + res_roomgfx_ger, + res_roomgfx_esp, +}; + +static const ScummNESFile::Resource res_costumegfx_usa[2] = { { 0x30001, 0x0EB8, NES_COSTUMEGFX }, { 0x2F9F1, 0x0340, NES_COSTUMEGFX } }; +static const ScummNESFile::Resource res_costumegfx_eur[2] = { { 0x30001, 0x0EB8, NES_COSTUMEGFX }, { 0x2F9F1, 0x0340, NES_COSTUMEGFX } }; +static const ScummNESFile::Resource res_costumegfx_swe[2] = { { 0x2EFE1, 0x0EB8, NES_COSTUMEGFX }, { 0x30001, 0x0340, NES_COSTUMEGFX } }; +static const ScummNESFile::Resource res_costumegfx_fra[2] = { { 0x30001, 0x0EB8, NES_COSTUMEGFX }, { 0x2F608, 0x0340, NES_COSTUMEGFX } }; +static const ScummNESFile::Resource res_costumegfx_ger[2] = { { 0x30001, 0x0EB8, NES_COSTUMEGFX }, { 0x2F4CE, 0x0340, NES_COSTUMEGFX } }; +static const ScummNESFile::Resource res_costumegfx_esp[2] = { { 0x30001, 0x0EB8, NES_COSTUMEGFX }, { 0x2F0F6, 0x0340, NES_COSTUMEGFX } }; + +static const ScummNESFile::Resource *res_costumegfx[ScummNESFile::kROMsetNum] = { + res_costumegfx_usa, + res_costumegfx_eur, + res_costumegfx_swe, + res_costumegfx_fra, + res_costumegfx_ger, + res_costumegfx_esp, +}; + +static const ScummNESFile::Resource res_rooms_usa[55] = { + { 0x00000, 0x0000, NES_ROOM }, { 0x14001, 0x0D0C, NES_ROOM }, { 0x134A8, 0x04B3, NES_ROOM }, { 0x15397, 0x0849, NES_ROOM }, { 0x15C68, 0x0685, NES_ROOM }, + { 0x16381, 0x0715, NES_ROOM }, { 0x1395B, 0x04E7, NES_ROOM }, { 0x16CE8, 0x0AC0, NES_ROOM }, { 0x18001, 0x06BA, NES_ROOM }, { 0x17AED, 0x03CB, NES_ROOM }, + { 0x18BE7, 0x0663, NES_ROOM }, { 0x192A6, 0x0580, NES_ROOM }, { 0x19A44, 0x0443, NES_ROOM }, { 0x1A106, 0x0563, NES_ROOM }, { 0x1A669, 0x0446, NES_ROOM }, + { 0x1AAAF, 0x03A7, NES_ROOM }, { 0x1AE56, 0x07E3, NES_ROOM }, { 0x1B699, 0x0692, NES_ROOM }, { 0x1C001, 0x0B49, NES_ROOM }, { 0x1CD09, 0x04C6, NES_ROOM }, + { 0x1D4C2, 0x0568, NES_ROOM }, { 0x1DF6C, 0x0514, NES_ROOM }, { 0x1E8FA, 0x05CC, NES_ROOM }, { 0x1EF83, 0x0389, NES_ROOM }, { 0x1F5E4, 0x0723, NES_ROOM }, + { 0x20001, 0x049A, NES_ROOM }, { 0x20511, 0x04F8, NES_ROOM }, { 0x21666, 0x05CB, NES_ROOM }, { 0x21DD6, 0x046B, NES_ROOM }, { 0x222F0, 0x0460, NES_ROOM }, + { 0x227B6, 0x0909, NES_ROOM }, { 0x24001, 0x0366, NES_ROOM }, { 0x23BDF, 0x03CA, NES_ROOM }, { 0x247DB, 0x050D, NES_ROOM }, { 0x25ACF, 0x0346, NES_ROOM }, + { 0x1BDBD, 0x01CA, NES_ROOM }, { 0x25E15, 0x0457, NES_ROOM }, { 0x2626C, 0x0547, NES_ROOM }, { 0x267B3, 0x064A, NES_ROOM }, { 0x1FD72, 0x024B, NES_ROOM }, + { 0x2739A, 0x01FA, NES_ROOM }, { 0x2766D, 0x0219, NES_ROOM }, { 0x28001, 0x02F4, NES_ROOM }, { 0x284D6, 0x045C, NES_ROOM }, { 0x289A3, 0x09CF, NES_ROOM }, + { 0x293C6, 0x05A0, NES_ROOM }, { 0x27B65, 0x0201, NES_ROOM }, { 0x2ADD1, 0x0325, NES_ROOM }, { 0x2B339, 0x01FC, NES_ROOM }, { 0x2B535, 0x02A9, NES_ROOM }, + { 0x2B7DE, 0x02DE, NES_ROOM }, { 0x2C001, 0x03CE, NES_ROOM }, { 0x2BBC0, 0x0205, NES_ROOM }, { 0x2C53A, 0x0170, NES_ROOM }, { 0x13E42, 0x0169, NES_ROOM } +}; +static const ScummNESFile::Resource res_rooms_eur[55] = { + { 0x00000, 0x0000, NES_ROOM }, { 0x14001, 0x0D0C, NES_ROOM }, { 0x13641, 0x04B3, NES_ROOM }, { 0x15397, 0x0849, NES_ROOM }, { 0x15C68, 0x0685, NES_ROOM }, + { 0x16381, 0x0715, NES_ROOM }, { 0x16CE8, 0x04E7, NES_ROOM }, { 0x18001, 0x0ABF, NES_ROOM }, { 0x171CF, 0x06BA, NES_ROOM }, { 0x13AF4, 0x03D2, NES_ROOM }, + { 0x18E1A, 0x0663, NES_ROOM }, { 0x194D9, 0x04A9, NES_ROOM }, { 0x19BA0, 0x0443, NES_ROOM }, { 0x1A262, 0x047C, NES_ROOM }, { 0x1A6DE, 0x0446, NES_ROOM }, + { 0x1AB24, 0x03A7, NES_ROOM }, { 0x1AECB, 0x07E3, NES_ROOM }, { 0x1B70E, 0x0692, NES_ROOM }, { 0x1C001, 0x0ACA, NES_ROOM }, { 0x1CC8A, 0x04C6, NES_ROOM }, + { 0x1D443, 0x0568, NES_ROOM }, { 0x1DEED, 0x0514, NES_ROOM }, { 0x1E87B, 0x05CC, NES_ROOM }, { 0x1EF04, 0x0389, NES_ROOM }, { 0x1F565, 0x0723, NES_ROOM }, + { 0x20001, 0x049A, NES_ROOM }, { 0x20511, 0x04F8, NES_ROOM }, { 0x21666, 0x05D5, NES_ROOM }, { 0x21DE0, 0x046B, NES_ROOM }, { 0x222FA, 0x0460, NES_ROOM }, + { 0x227C0, 0x0909, NES_ROOM }, { 0x24001, 0x0366, NES_ROOM }, { 0x247DB, 0x03CA, NES_ROOM }, { 0x24BA5, 0x050D, NES_ROOM }, { 0x23BE9, 0x0346, NES_ROOM }, + { 0x17DB5, 0x01CA, NES_ROOM }, { 0x25E99, 0x0457, NES_ROOM }, { 0x262F0, 0x0547, NES_ROOM }, { 0x26837, 0x064A, NES_ROOM }, { 0x1FCF3, 0x024B, NES_ROOM }, + { 0x2741E, 0x01FA, NES_ROOM }, { 0x276F1, 0x0219, NES_ROOM }, { 0x28001, 0x02F4, NES_ROOM }, { 0x284D6, 0x045C, NES_ROOM }, { 0x289A3, 0x09CF, NES_ROOM }, + { 0x293C6, 0x05A0, NES_ROOM }, { 0x27BE9, 0x0201, NES_ROOM }, { 0x2ADE3, 0x0325, NES_ROOM }, { 0x2B34B, 0x01FC, NES_ROOM }, { 0x2B547, 0x02A9, NES_ROOM }, + { 0x2B7F0, 0x02DE, NES_ROOM }, { 0x2C001, 0x03CE, NES_ROOM }, { 0x2BBD2, 0x0205, NES_ROOM }, { 0x2C53A, 0x0170, NES_ROOM }, { 0x2BDD7, 0x0169, NES_ROOM } +}; +static const ScummNESFile::Resource res_rooms_swe[55] = { + { 0x00000, 0x0000, NES_ROOM }, { 0x14001, 0x0D12, NES_ROOM }, { 0x1328F, 0x04B3, NES_ROOM }, { 0x15367, 0x0859, NES_ROOM }, { 0x13742, 0x0694, NES_ROOM }, + { 0x15C45, 0x0707, NES_ROOM }, { 0x1658F, 0x04E0, NES_ROOM }, { 0x16A6F, 0x0AC8, NES_ROOM }, { 0x18001, 0x06C7, NES_ROOM }, { 0x1789C, 0x03EA, NES_ROOM }, + { 0x18C09, 0x0649, NES_ROOM }, { 0x192AE, 0x04AB, NES_ROOM }, { 0x19982, 0x0447, NES_ROOM }, { 0x1A04D, 0x047E, NES_ROOM }, { 0x1A4CB, 0x0444, NES_ROOM }, + { 0x1A90F, 0x03B9, NES_ROOM }, { 0x1ACC8, 0x07E9, NES_ROOM }, { 0x1B511, 0x06A4, NES_ROOM }, { 0x1C001, 0x0B1A, NES_ROOM }, { 0x1CCFD, 0x0486, NES_ROOM }, + { 0x1D482, 0x0579, NES_ROOM }, { 0x1DF61, 0x051E, NES_ROOM }, { 0x1E8EC, 0x05CF, NES_ROOM }, { 0x1EF73, 0x0398, NES_ROOM }, { 0x1F5F0, 0x071A, NES_ROOM }, + { 0x20001, 0x049C, NES_ROOM }, { 0x2051E, 0x051E, NES_ROOM }, { 0x21725, 0x05D5, NES_ROOM }, { 0x21EA5, 0x047F, NES_ROOM }, { 0x223D1, 0x0460, NES_ROOM }, + { 0x22897, 0x090D, NES_ROOM }, { 0x24001, 0x0378, NES_ROOM }, { 0x247C9, 0x03CA, NES_ROOM }, { 0x24B93, 0x050D, NES_ROOM }, { 0x25267, 0x0346, NES_ROOM }, + { 0x17CD0, 0x01CA, NES_ROOM }, { 0x255AD, 0x0453, NES_ROOM }, { 0x25A00, 0x053E, NES_ROOM }, { 0x25F3E, 0x0647, NES_ROOM }, { 0x1BC49, 0x024B, NES_ROOM }, + { 0x26B58, 0x01FA, NES_ROOM }, { 0x26E27, 0x0217, NES_ROOM }, { 0x27345, 0x02F4, NES_ROOM }, { 0x27829, 0x045C, NES_ROOM }, { 0x28001, 0x098A, NES_ROOM }, + { 0x289DF, 0x05A1, NES_ROOM }, { 0x2A442, 0x0201, NES_ROOM }, { 0x2A6E9, 0x0325, NES_ROOM }, { 0x1FD75, 0x01FC, NES_ROOM }, { 0x2AC64, 0x02A9, NES_ROOM }, + { 0x2AF0D, 0x02D1, NES_ROOM }, { 0x2B2E6, 0x03CC, NES_ROOM }, { 0x23D61, 0x0205, NES_ROOM }, { 0x2B818, 0x0168, NES_ROOM }, { 0x27CF6, 0x0169, NES_ROOM } +}; +static const ScummNESFile::Resource res_rooms_fra[55] = { + { 0x00000, 0x0000, NES_ROOM }, { 0x14001, 0x0D76, NES_ROOM }, { 0x1328A, 0x04C6, NES_ROOM }, { 0x15451, 0x0885, NES_ROOM }, { 0x13750, 0x0693, NES_ROOM }, + { 0x15D68, 0x0709, NES_ROOM }, { 0x166D4, 0x0528, NES_ROOM }, { 0x16BFC, 0x0ACC, NES_ROOM }, { 0x18001, 0x06E2, NES_ROOM }, { 0x17A63, 0x03E5, NES_ROOM }, + { 0x18C3B, 0x066A, NES_ROOM }, { 0x19301, 0x049E, NES_ROOM }, { 0x199C8, 0x044B, NES_ROOM }, { 0x1A0B1, 0x0478, NES_ROOM }, { 0x1A529, 0x043F, NES_ROOM }, + { 0x1A968, 0x03C8, NES_ROOM }, { 0x1AD30, 0x086F, NES_ROOM }, { 0x1B5FF, 0x069B, NES_ROOM }, { 0x1C001, 0x0AA9, NES_ROOM }, { 0x1CC97, 0x049E, NES_ROOM }, + { 0x1D42C, 0x05A8, NES_ROOM }, { 0x1DF71, 0x054E, NES_ROOM }, { 0x1E9D1, 0x0606, NES_ROOM }, { 0x1F0A2, 0x039A, NES_ROOM }, { 0x1F74E, 0x071C, NES_ROOM }, + { 0x20001, 0x04B5, NES_ROOM }, { 0x2052E, 0x04FF, NES_ROOM }, { 0x2172E, 0x05DB, NES_ROOM }, { 0x21EAD, 0x0489, NES_ROOM }, { 0x223E1, 0x0465, NES_ROOM }, + { 0x228AC, 0x0957, NES_ROOM }, { 0x24001, 0x037E, NES_ROOM }, { 0x2481A, 0x03CA, NES_ROOM }, { 0x24BE4, 0x050D, NES_ROOM }, { 0x252C0, 0x0346, NES_ROOM }, + { 0x1BD30, 0x01CA, NES_ROOM }, { 0x25606, 0x046D, NES_ROOM }, { 0x25A73, 0x055A, NES_ROOM }, { 0x25FCD, 0x0654, NES_ROOM }, { 0x26C98, 0x024B, NES_ROOM }, + { 0x26EE3, 0x01FA, NES_ROOM }, { 0x271DD, 0x0217, NES_ROOM }, { 0x27713, 0x02F4, NES_ROOM }, { 0x28001, 0x045C, NES_ROOM }, { 0x284CE, 0x0975, NES_ROOM }, + { 0x28E97, 0x05E6, NES_ROOM }, { 0x27C3A, 0x0201, NES_ROOM }, { 0x2A9D6, 0x0325, NES_ROOM }, { 0x2AF88, 0x01FC, NES_ROOM }, { 0x2B184, 0x02A9, NES_ROOM }, + { 0x2B42D, 0x02DF, NES_ROOM }, { 0x2B818, 0x03EC, NES_ROOM }, { 0x2BD67, 0x0209, NES_ROOM }, { 0x2C001, 0x0168, NES_ROOM }, { 0x2C4BF, 0x0169, NES_ROOM } +}; +static const ScummNESFile::Resource res_rooms_ger[55] = { + { 0x00000, 0x0000, NES_ROOM }, { 0x14001, 0x0D63, NES_ROOM }, { 0x131E0, 0x04A9, NES_ROOM }, { 0x13689, 0x086B, NES_ROOM }, { 0x15421, 0x06A8, NES_ROOM }, + { 0x15B5D, 0x0731, NES_ROOM }, { 0x16507, 0x0501, NES_ROOM }, { 0x16A08, 0x0AE9, NES_ROOM }, { 0x18001, 0x06DA, NES_ROOM }, { 0x17880, 0x03D0, NES_ROOM }, + { 0x18C7B, 0x0651, NES_ROOM }, { 0x19328, 0x04A7, NES_ROOM }, { 0x199FE, 0x0447, NES_ROOM }, { 0x1A0F1, 0x0486, NES_ROOM }, { 0x1A577, 0x045D, NES_ROOM }, + { 0x1A9D4, 0x03AE, NES_ROOM }, { 0x1AD82, 0x0840, NES_ROOM }, { 0x1B622, 0x06C3, NES_ROOM }, { 0x1C001, 0x0B07, NES_ROOM }, { 0x1CD05, 0x0494, NES_ROOM }, + { 0x1D4A5, 0x05AC, NES_ROOM }, { 0x1DFD6, 0x0524, NES_ROOM }, { 0x1E9C0, 0x05F7, NES_ROOM }, { 0x1F09A, 0x038E, NES_ROOM }, { 0x1F75F, 0x0733, NES_ROOM }, + { 0x20001, 0x04A9, NES_ROOM }, { 0x2052A, 0x052E, NES_ROOM }, { 0x2177C, 0x0621, NES_ROOM }, { 0x21F57, 0x0495, NES_ROOM }, { 0x2249A, 0x045E, NES_ROOM }, + { 0x2295E, 0x0951, NES_ROOM }, { 0x24001, 0x036E, NES_ROOM }, { 0x247F9, 0x03CA, NES_ROOM }, { 0x24BC3, 0x050D, NES_ROOM }, { 0x252A8, 0x0346, NES_ROOM }, + { 0x17CA2, 0x01CA, NES_ROOM }, { 0x255EE, 0x046F, NES_ROOM }, { 0x25A5D, 0x054D, NES_ROOM }, { 0x25FAA, 0x064B, NES_ROOM }, { 0x26BE2, 0x024B, NES_ROOM }, + { 0x26E2D, 0x01FA, NES_ROOM }, { 0x2710F, 0x0217, NES_ROOM }, { 0x27663, 0x02F4, NES_ROOM }, { 0x28001, 0x045C, NES_ROOM }, { 0x284CE, 0x0A8F, NES_ROOM }, + { 0x28FB1, 0x05FF, NES_ROOM }, { 0x27B69, 0x0201, NES_ROOM }, { 0x2AAA9, 0x0325, NES_ROOM }, { 0x1BD7C, 0x01FC, NES_ROOM }, { 0x2B031, 0x02A9, NES_ROOM }, + { 0x2B2DA, 0x02D8, NES_ROOM }, { 0x2B6D2, 0x03D2, NES_ROOM }, { 0x2BC0D, 0x020D, NES_ROOM }, { 0x2C001, 0x0168, NES_ROOM }, { 0x27E11, 0x0169, NES_ROOM } +}; +static const ScummNESFile::Resource res_rooms_esp[55] = { + { 0x00000, 0x0000, NES_ROOM }, { 0x14001, 0x0D05, NES_ROOM }, { 0x132AC, 0x04B0, NES_ROOM }, { 0x153AB, 0x087B, NES_ROOM }, { 0x1375C, 0x06B3, NES_ROOM }, + { 0x15CB1, 0x0729, NES_ROOM }, { 0x16625, 0x04F0, NES_ROOM }, { 0x16B15, 0x0AD4, NES_ROOM }, { 0x18001, 0x06ED, NES_ROOM }, { 0x17936, 0x03DE, NES_ROOM }, + { 0x18C3E, 0x0671, NES_ROOM }, { 0x1930B, 0x04C4, NES_ROOM }, { 0x199EC, 0x0452, NES_ROOM }, { 0x1A0DA, 0x048F, NES_ROOM }, { 0x1A569, 0x0449, NES_ROOM }, + { 0x1A9B2, 0x03A8, NES_ROOM }, { 0x1AD5A, 0x0846, NES_ROOM }, { 0x1B600, 0x0686, NES_ROOM }, { 0x1C001, 0x0B58, NES_ROOM }, { 0x1CD42, 0x049C, NES_ROOM }, + { 0x1D4ED, 0x0586, NES_ROOM }, { 0x1DFE9, 0x0526, NES_ROOM }, { 0x1E9C9, 0x05CE, NES_ROOM }, { 0x1F04B, 0x0390, NES_ROOM }, { 0x1F6CA, 0x073C, NES_ROOM }, + { 0x20001, 0x04CB, NES_ROOM }, { 0x20543, 0x0530, NES_ROOM }, { 0x2171B, 0x05FC, NES_ROOM }, { 0x21EBE, 0x0470, NES_ROOM }, { 0x223DC, 0x045C, NES_ROOM }, + { 0x2289E, 0x0928, NES_ROOM }, { 0x24001, 0x036C, NES_ROOM }, { 0x247EC, 0x03CA, NES_ROOM }, { 0x24BB6, 0x050D, NES_ROOM }, { 0x25283, 0x0346, NES_ROOM }, + { 0x17D60, 0x01CA, NES_ROOM }, { 0x255C9, 0x0462, NES_ROOM }, { 0x25A2B, 0x055C, NES_ROOM }, { 0x25F87, 0x0659, NES_ROOM }, { 0x1BD19, 0x024B, NES_ROOM }, + { 0x26B8A, 0x01F7, NES_ROOM }, { 0x26E5D, 0x0217, NES_ROOM }, { 0x2736A, 0x02F4, NES_ROOM }, { 0x27845, 0x045C, NES_ROOM }, { 0x28001, 0x0969, NES_ROOM }, + { 0x289BE, 0x058E, NES_ROOM }, { 0x2A418, 0x0201, NES_ROOM }, { 0x2A6BE, 0x0325, NES_ROOM }, { 0x23D84, 0x01FC, NES_ROOM }, { 0x2AC46, 0x02A9, NES_ROOM }, + { 0x2AEEF, 0x02C9, NES_ROOM }, { 0x2B2C0, 0x03D2, NES_ROOM }, { 0x27D12, 0x0207, NES_ROOM }, { 0x2B7FC, 0x0168, NES_ROOM }, { 0x2BD06, 0x0169, NES_ROOM } +}; + +static const ScummNESFile::Resource *res_rooms[ScummNESFile::kROMsetNum] = { + res_rooms_usa, + res_rooms_eur, + res_rooms_swe, + res_rooms_fra, + res_rooms_ger, + res_rooms_esp, +}; + +static const ScummNESFile::Resource res_scripts_usa[179] = { + { 0x00000, 0x0000, NES_SCRIPT }, { 0x29966, 0x044D, NES_SCRIPT }, { 0x29DB3, 0x0207, NES_SCRIPT }, { 0x29FBA, 0x009F, NES_SCRIPT }, { 0x2A059, 0x03F4, NES_SCRIPT }, + { 0x2A44D, 0x01A1, NES_SCRIPT }, { 0x00000, 0x0000, NES_SCRIPT }, { 0x2A5EE, 0x004A, NES_SCRIPT }, { 0x00000, 0x0000, NES_SCRIPT }, { 0x2A638, 0x0005, NES_SCRIPT }, + { 0x2C6AA, 0x000D, NES_SCRIPT }, { 0x2C6B7, 0x000D, NES_SCRIPT }, { 0x186BB, 0x0040, NES_SCRIPT }, { 0x186FB, 0x0016, NES_SCRIPT }, { 0x1B639, 0x0046, NES_SCRIPT }, + { 0x1EEC6, 0x00BD, NES_SCRIPT }, { 0x21C31, 0x0055, NES_SCRIPT }, { 0x177A8, 0x0027, NES_SCRIPT }, { 0x1FD07, 0x0027, NES_SCRIPT }, { 0x1FD2E, 0x0027, NES_SCRIPT }, + { 0x1BD2B, 0x0022, NES_SCRIPT }, { 0x15BE0, 0x0088, NES_SCRIPT }, { 0x22241, 0x0020, NES_SCRIPT }, { 0x22261, 0x008F, NES_SCRIPT }, { 0x1924A, 0x002B, NES_SCRIPT }, + { 0x1CB4A, 0x0061, NES_SCRIPT }, { 0x1CBAB, 0x003C, NES_SCRIPT }, { 0x1CBE7, 0x0042, NES_SCRIPT }, { 0x1CC29, 0x004F, NES_SCRIPT }, { 0x2049B, 0x0076, NES_SCRIPT }, + { 0x16A96, 0x0035, NES_SCRIPT }, { 0x16ACB, 0x001C, NES_SCRIPT }, { 0x16AE7, 0x0014, NES_SCRIPT }, { 0x16AFB, 0x001C, NES_SCRIPT }, { 0x16B17, 0x0027, NES_SCRIPT }, + { 0x16B3E, 0x01AA, NES_SCRIPT }, { 0x1D1CF, 0x0096, NES_SCRIPT }, { 0x1D265, 0x010E, NES_SCRIPT }, { 0x1D373, 0x001C, NES_SCRIPT }, { 0x1D38F, 0x0056, NES_SCRIPT }, + { 0x1D3E5, 0x0072, NES_SCRIPT }, { 0x1E480, 0x0028, NES_SCRIPT }, { 0x1E4A8, 0x017D, NES_SCRIPT }, { 0x1E625, 0x0229, NES_SCRIPT }, { 0x28932, 0x0071, NES_SCRIPT }, + { 0x17EB8, 0x004D, NES_SCRIPT }, { 0x162ED, 0x0039, NES_SCRIPT }, { 0x18711, 0x028B, NES_SCRIPT }, { 0x1899C, 0x00BB, NES_SCRIPT }, { 0x18A57, 0x018B, NES_SCRIPT }, + { 0x00000, 0x0000, NES_SCRIPT }, { 0x19E87, 0x00ED, NES_SCRIPT }, { 0x21C86, 0x00F6, NES_SCRIPT }, { 0x1E84E, 0x009B, NES_SCRIPT }, { 0x21D7C, 0x0047, NES_SCRIPT }, + { 0x2C6C4, 0x004D, NES_SCRIPT }, { 0x16326, 0x0024, NES_SCRIPT }, { 0x14D0D, 0x0014, NES_SCRIPT }, { 0x177CF, 0x0059, NES_SCRIPT }, { 0x17828, 0x0109, NES_SCRIPT }, + { 0x17931, 0x0009, NES_SCRIPT }, { 0x14D21, 0x01B6, NES_SCRIPT }, { 0x2B0F6, 0x0243, NES_SCRIPT }, { 0x230BF, 0x067F, NES_SCRIPT }, { 0x2C711, 0x001C, NES_SCRIPT }, + { 0x2C72D, 0x001A, NES_SCRIPT }, { 0x2C747, 0x0021, NES_SCRIPT }, { 0x2C768, 0x0024, NES_SCRIPT }, { 0x2C78C, 0x0017, NES_SCRIPT }, { 0x2C7A3, 0x0017, NES_SCRIPT }, + { 0x2C7BA, 0x0014, NES_SCRIPT }, { 0x2C7CE, 0x0024, NES_SCRIPT }, { 0x00000, 0x0000, NES_SCRIPT }, { 0x2C7F2, 0x0011, NES_SCRIPT }, { 0x1793A, 0x009D, NES_SCRIPT }, + { 0x22750, 0x0066, NES_SCRIPT }, { 0x14ED7, 0x0075, NES_SCRIPT }, { 0x1F30C, 0x0120, NES_SCRIPT }, { 0x1FD55, 0x001D, NES_SCRIPT }, { 0x1F42C, 0x008F, NES_SCRIPT }, + { 0x1F4BB, 0x0097, NES_SCRIPT }, { 0x179D7, 0x006A, NES_SCRIPT }, { 0x17A41, 0x0030, NES_SCRIPT }, { 0x1F552, 0x0092, NES_SCRIPT }, { 0x2C803, 0x00CC, NES_SCRIPT }, + { 0x2C8CF, 0x00BA, NES_SCRIPT }, { 0x2C989, 0x0088, NES_SCRIPT }, { 0x20A09, 0x01B0, NES_SCRIPT }, { 0x20BB9, 0x0168, NES_SCRIPT }, { 0x20D21, 0x006C, NES_SCRIPT }, + { 0x20D8D, 0x0037, NES_SCRIPT }, { 0x20DC4, 0x00E4, NES_SCRIPT }, { 0x20EA8, 0x0045, NES_SCRIPT }, { 0x20EED, 0x00E1, NES_SCRIPT }, { 0x20FCE, 0x00F6, NES_SCRIPT }, + { 0x210C4, 0x0141, NES_SCRIPT }, { 0x21205, 0x0183, NES_SCRIPT }, { 0x21388, 0x0034, NES_SCRIPT }, { 0x213BC, 0x00A9, NES_SCRIPT }, { 0x24367, 0x011B, NES_SCRIPT }, + { 0x1BD4D, 0x0070, NES_SCRIPT }, { 0x1CC78, 0x0091, NES_SCRIPT }, { 0x29372, 0x0054, NES_SCRIPT }, { 0x19F74, 0x00CE, NES_SCRIPT }, { 0x1A042, 0x0077, NES_SCRIPT }, + { 0x14F4C, 0x0057, NES_SCRIPT }, { 0x27886, 0x02DF, NES_SCRIPT }, { 0x1DA2A, 0x0219, NES_SCRIPT }, { 0x1DC43, 0x00F9, NES_SCRIPT }, { 0x1DD3C, 0x0056, NES_SCRIPT }, + { 0x1DD92, 0x01C2, NES_SCRIPT }, { 0x14FA3, 0x004D, NES_SCRIPT }, { 0x27594, 0x00D9, NES_SCRIPT }, { 0x21DC3, 0x0013, NES_SCRIPT }, { 0x2A63D, 0x00F0, NES_SCRIPT }, + { 0x24482, 0x00E7, NES_SCRIPT }, { 0x21465, 0x00F2, NES_SCRIPT }, { 0x24569, 0x002B, NES_SCRIPT }, { 0x2C3CF, 0x010F, NES_SCRIPT }, { 0x24594, 0x00AA, NES_SCRIPT }, + { 0x24CE8, 0x0DAB, NES_SCRIPT }, { 0x1B67F, 0x000D, NES_SCRIPT }, { 0x1B68C, 0x000D, NES_SCRIPT }, { 0x2373E, 0x017C, NES_SCRIPT }, { 0x282F5, 0x01E1, NES_SCRIPT }, + { 0x238BA, 0x0153, NES_SCRIPT }, { 0x23A0D, 0x019C, NES_SCRIPT }, { 0x23BA9, 0x0016, NES_SCRIPT }, { 0x2C4DE, 0x005C, NES_SCRIPT }, { 0x23BBF, 0x0020, NES_SCRIPT }, + { 0x27D66, 0x00A5, NES_SCRIPT }, { 0x2A72D, 0x034D, NES_SCRIPT }, { 0x14FF0, 0x00E3, NES_SCRIPT }, { 0x2BABC, 0x005F, NES_SCRIPT }, { 0x00000, 0x0000, NES_SCRIPT }, + { 0x25A93, 0x003C, NES_SCRIPT }, { 0x1E8E9, 0x0011, NES_SCRIPT }, { 0x1634A, 0x0018, NES_SCRIPT }, { 0x26DFD, 0x001F, NES_SCRIPT }, { 0x26E1C, 0x0054, NES_SCRIPT }, + { 0x26E70, 0x0149, NES_SCRIPT }, { 0x26FB9, 0x004B, NES_SCRIPT }, { 0x27004, 0x017D, NES_SCRIPT }, { 0x27181, 0x0027, NES_SCRIPT }, { 0x271A8, 0x0041, NES_SCRIPT }, + { 0x271E9, 0x01B1, NES_SCRIPT }, { 0x16362, 0x001F, NES_SCRIPT }, { 0x2463E, 0x002A, NES_SCRIPT }, { 0x150D3, 0x019E, NES_SCRIPT }, { 0x19275, 0x0031, NES_SCRIPT }, + { 0x17A71, 0x007C, NES_SCRIPT }, { 0x21557, 0x00DC, NES_SCRIPT }, { 0x1D457, 0x0018, NES_SCRIPT }, { 0x1D46F, 0x0053, NES_SCRIPT }, { 0x18BE2, 0x0005, NES_SCRIPT }, + { 0x15271, 0x011B, NES_SCRIPT }, { 0x1538C, 0x000B, NES_SCRIPT }, { 0x24668, 0x0138, NES_SCRIPT }, { 0x247A0, 0x0014, NES_SCRIPT }, { 0x1DF54, 0x0018, NES_SCRIPT }, + { 0x247B4, 0x0027, NES_SCRIPT }, { 0x1A0B9, 0x004D, NES_SCRIPT }, { 0x00000, 0x0000, NES_SCRIPT }, { 0x2BB1B, 0x00A5, NES_SCRIPT }, { 0x2AA7A, 0x00C1, NES_SCRIPT }, + { 0x2AB3B, 0x0140, NES_SCRIPT }, { 0x19826, 0x00BF, NES_SCRIPT }, { 0x198E5, 0x014D, NES_SCRIPT }, { 0x19A32, 0x0012, NES_SCRIPT }, { 0x2AC7B, 0x0005, NES_SCRIPT }, + { 0x2AC80, 0x0005, NES_SCRIPT }, { 0x2AC85, 0x0005, NES_SCRIPT }, { 0x2AC8A, 0x0005, NES_SCRIPT }, { 0x2AC8F, 0x0005, NES_SCRIPT }, { 0x21633, 0x0033, NES_SCRIPT }, + { 0x2AC94, 0x0005, NES_SCRIPT }, { 0x00000, 0x0000, NES_SCRIPT }, { 0x2AC99, 0x009C, NES_SCRIPT }, { 0x2AD35, 0x009C, NES_SCRIPT } +}; +static const ScummNESFile::Resource res_scripts_eur[179] = { + { 0x00000, 0x0000, NES_SCRIPT }, { 0x29966, 0x044D, NES_SCRIPT }, { 0x29DB3, 0x0207, NES_SCRIPT }, { 0x29FBA, 0x009F, NES_SCRIPT }, { 0x2A059, 0x03F4, NES_SCRIPT }, + { 0x2A44D, 0x01A1, NES_SCRIPT }, { 0x00000, 0x0000, NES_SCRIPT }, { 0x2A5EE, 0x005C, NES_SCRIPT }, { 0x00000, 0x0000, NES_SCRIPT }, { 0x2A64A, 0x0005, NES_SCRIPT }, + { 0x2C6AA, 0x000D, NES_SCRIPT }, { 0x2C6B7, 0x000D, NES_SCRIPT }, { 0x17889, 0x0040, NES_SCRIPT }, { 0x178C9, 0x0016, NES_SCRIPT }, { 0x1B6AE, 0x0046, NES_SCRIPT }, + { 0x1EE47, 0x00BD, NES_SCRIPT }, { 0x21C3B, 0x0055, NES_SCRIPT }, { 0x18AC0, 0x0027, NES_SCRIPT }, { 0x1FC88, 0x0027, NES_SCRIPT }, { 0x1FCAF, 0x0027, NES_SCRIPT }, + { 0x1BDA0, 0x0022, NES_SCRIPT }, { 0x15BE0, 0x0088, NES_SCRIPT }, { 0x2224B, 0x0020, NES_SCRIPT }, { 0x2226B, 0x008F, NES_SCRIPT }, { 0x1947D, 0x002B, NES_SCRIPT }, + { 0x1CACB, 0x0061, NES_SCRIPT }, { 0x1CB2C, 0x003C, NES_SCRIPT }, { 0x1CB68, 0x0042, NES_SCRIPT }, { 0x1CBAA, 0x004F, NES_SCRIPT }, { 0x2049B, 0x0076, NES_SCRIPT }, + { 0x16A96, 0x0035, NES_SCRIPT }, { 0x16ACB, 0x001C, NES_SCRIPT }, { 0x16AE7, 0x0014, NES_SCRIPT }, { 0x16AFB, 0x001C, NES_SCRIPT }, { 0x16B17, 0x0027, NES_SCRIPT }, + { 0x16B3E, 0x01AA, NES_SCRIPT }, { 0x1D150, 0x0096, NES_SCRIPT }, { 0x1D1E6, 0x010E, NES_SCRIPT }, { 0x1D2F4, 0x001C, NES_SCRIPT }, { 0x1D310, 0x0056, NES_SCRIPT }, + { 0x1D366, 0x0072, NES_SCRIPT }, { 0x1E401, 0x0028, NES_SCRIPT }, { 0x1E429, 0x017D, NES_SCRIPT }, { 0x1E5A6, 0x0229, NES_SCRIPT }, { 0x28932, 0x0071, NES_SCRIPT }, + { 0x13EC6, 0x004D, NES_SCRIPT }, { 0x162ED, 0x0039, NES_SCRIPT }, { 0x178DF, 0x028B, NES_SCRIPT }, { 0x17B6A, 0x00BB, NES_SCRIPT }, { 0x17C25, 0x018B, NES_SCRIPT }, + { 0x00000, 0x0000, NES_SCRIPT }, { 0x19FE3, 0x00ED, NES_SCRIPT }, { 0x21C90, 0x00F6, NES_SCRIPT }, { 0x1E7CF, 0x009B, NES_SCRIPT }, { 0x21D86, 0x0047, NES_SCRIPT }, + { 0x2C6C4, 0x004D, NES_SCRIPT }, { 0x16326, 0x0024, NES_SCRIPT }, { 0x14D0D, 0x0014, NES_SCRIPT }, { 0x18AE7, 0x0059, NES_SCRIPT }, { 0x18B40, 0x011E, NES_SCRIPT }, + { 0x18C5E, 0x0009, NES_SCRIPT }, { 0x14D21, 0x01B6, NES_SCRIPT }, { 0x2B108, 0x0243, NES_SCRIPT }, { 0x230C9, 0x067F, NES_SCRIPT }, { 0x2C711, 0x001C, NES_SCRIPT }, + { 0x2C72D, 0x001A, NES_SCRIPT }, { 0x2C747, 0x0021, NES_SCRIPT }, { 0x2C768, 0x0024, NES_SCRIPT }, { 0x2C78C, 0x0017, NES_SCRIPT }, { 0x2C7A3, 0x0017, NES_SCRIPT }, + { 0x2C7BA, 0x0014, NES_SCRIPT }, { 0x2C7CE, 0x0024, NES_SCRIPT }, { 0x00000, 0x0000, NES_SCRIPT }, { 0x2C7F2, 0x0011, NES_SCRIPT }, { 0x18C67, 0x009D, NES_SCRIPT }, + { 0x2275A, 0x0066, NES_SCRIPT }, { 0x14ED7, 0x0075, NES_SCRIPT }, { 0x1F28D, 0x0120, NES_SCRIPT }, { 0x1FCD6, 0x001D, NES_SCRIPT }, { 0x1F3AD, 0x008F, NES_SCRIPT }, + { 0x1F43C, 0x0097, NES_SCRIPT }, { 0x18D04, 0x006A, NES_SCRIPT }, { 0x18D6E, 0x0030, NES_SCRIPT }, { 0x1F4D3, 0x0092, NES_SCRIPT }, { 0x2C803, 0x00CC, NES_SCRIPT }, + { 0x2C8CF, 0x00BA, NES_SCRIPT }, { 0x2C989, 0x0088, NES_SCRIPT }, { 0x20A09, 0x01B0, NES_SCRIPT }, { 0x20BB9, 0x0168, NES_SCRIPT }, { 0x20D21, 0x006C, NES_SCRIPT }, + { 0x20D8D, 0x0037, NES_SCRIPT }, { 0x20DC4, 0x00E4, NES_SCRIPT }, { 0x20EA8, 0x0045, NES_SCRIPT }, { 0x20EED, 0x00E1, NES_SCRIPT }, { 0x20FCE, 0x00F6, NES_SCRIPT }, + { 0x210C4, 0x0141, NES_SCRIPT }, { 0x21205, 0x0183, NES_SCRIPT }, { 0x21388, 0x0034, NES_SCRIPT }, { 0x213BC, 0x00A9, NES_SCRIPT }, { 0x24367, 0x011B, NES_SCRIPT }, + { 0x1BDC2, 0x0070, NES_SCRIPT }, { 0x1CBF9, 0x0091, NES_SCRIPT }, { 0x29372, 0x0054, NES_SCRIPT }, { 0x1A0D0, 0x00CE, NES_SCRIPT }, { 0x1A19E, 0x0077, NES_SCRIPT }, + { 0x14F4C, 0x0057, NES_SCRIPT }, { 0x2790A, 0x02DF, NES_SCRIPT }, { 0x1D9AB, 0x0219, NES_SCRIPT }, { 0x1DBC4, 0x00F9, NES_SCRIPT }, { 0x1DCBD, 0x0056, NES_SCRIPT }, + { 0x1DD13, 0x01C2, NES_SCRIPT }, { 0x14FA3, 0x004D, NES_SCRIPT }, { 0x27618, 0x00D9, NES_SCRIPT }, { 0x21DCD, 0x0013, NES_SCRIPT }, { 0x2A64F, 0x00F0, NES_SCRIPT }, + { 0x24482, 0x00E7, NES_SCRIPT }, { 0x21465, 0x00F2, NES_SCRIPT }, { 0x24569, 0x002B, NES_SCRIPT }, { 0x2C3CF, 0x010F, NES_SCRIPT }, { 0x24594, 0x00AA, NES_SCRIPT }, + { 0x250B2, 0x0DAB, NES_SCRIPT }, { 0x1B6F4, 0x000D, NES_SCRIPT }, { 0x1B701, 0x000D, NES_SCRIPT }, { 0x23748, 0x017C, NES_SCRIPT }, { 0x282F5, 0x01E1, NES_SCRIPT }, + { 0x238C4, 0x0153, NES_SCRIPT }, { 0x23A17, 0x019C, NES_SCRIPT }, { 0x23BB3, 0x0016, NES_SCRIPT }, { 0x2C4DE, 0x005C, NES_SCRIPT }, { 0x23BC9, 0x0020, NES_SCRIPT }, + { 0x27DEA, 0x00A5, NES_SCRIPT }, { 0x2A73F, 0x034D, NES_SCRIPT }, { 0x14FF0, 0x00E3, NES_SCRIPT }, { 0x2BACE, 0x005F, NES_SCRIPT }, { 0x00000, 0x0000, NES_SCRIPT }, + { 0x25E5D, 0x003C, NES_SCRIPT }, { 0x1E86A, 0x0011, NES_SCRIPT }, { 0x1634A, 0x0018, NES_SCRIPT }, { 0x26E81, 0x001F, NES_SCRIPT }, { 0x26EA0, 0x0054, NES_SCRIPT }, + { 0x26EF4, 0x0149, NES_SCRIPT }, { 0x2703D, 0x004B, NES_SCRIPT }, { 0x27088, 0x017D, NES_SCRIPT }, { 0x27205, 0x0027, NES_SCRIPT }, { 0x2722C, 0x0041, NES_SCRIPT }, + { 0x2726D, 0x01B1, NES_SCRIPT }, { 0x16362, 0x001F, NES_SCRIPT }, { 0x2463E, 0x002A, NES_SCRIPT }, { 0x150D3, 0x019E, NES_SCRIPT }, { 0x194A8, 0x0031, NES_SCRIPT }, + { 0x18D9E, 0x007C, NES_SCRIPT }, { 0x21557, 0x00DC, NES_SCRIPT }, { 0x1D3D8, 0x0018, NES_SCRIPT }, { 0x1D3F0, 0x0053, NES_SCRIPT }, { 0x17DB0, 0x0005, NES_SCRIPT }, + { 0x15271, 0x011B, NES_SCRIPT }, { 0x1538C, 0x000B, NES_SCRIPT }, { 0x24668, 0x0138, NES_SCRIPT }, { 0x247A0, 0x0014, NES_SCRIPT }, { 0x1DED5, 0x0018, NES_SCRIPT }, + { 0x247B4, 0x0027, NES_SCRIPT }, { 0x1A215, 0x004D, NES_SCRIPT }, { 0x00000, 0x0000, NES_SCRIPT }, { 0x2BB2D, 0x00A5, NES_SCRIPT }, { 0x2AA8C, 0x00C1, NES_SCRIPT }, + { 0x2AB4D, 0x0140, NES_SCRIPT }, { 0x19982, 0x00BF, NES_SCRIPT }, { 0x19A41, 0x014D, NES_SCRIPT }, { 0x19B8E, 0x0012, NES_SCRIPT }, { 0x2AC8D, 0x0005, NES_SCRIPT }, + { 0x2AC92, 0x0005, NES_SCRIPT }, { 0x2AC97, 0x0005, NES_SCRIPT }, { 0x2AC9C, 0x0005, NES_SCRIPT }, { 0x2ACA1, 0x0005, NES_SCRIPT }, { 0x21633, 0x0033, NES_SCRIPT }, + { 0x2ACA6, 0x0005, NES_SCRIPT }, { 0x00000, 0x0000, NES_SCRIPT }, { 0x2ACAB, 0x009C, NES_SCRIPT }, { 0x2AD47, 0x009C, NES_SCRIPT } +}; +static const ScummNESFile::Resource res_scripts_swe[179] = { + { 0x00000, 0x0000, NES_SCRIPT }, { 0x28F80, 0x043B, NES_SCRIPT }, { 0x293BB, 0x0209, NES_SCRIPT }, { 0x295C4, 0x00AB, NES_SCRIPT }, { 0x2966F, 0x03FD, NES_SCRIPT }, + { 0x29A6C, 0x01A1, NES_SCRIPT }, { 0x00000, 0x0000, NES_SCRIPT }, { 0x29C0D, 0x005C, NES_SCRIPT }, { 0x00000, 0x0000, NES_SCRIPT }, { 0x29C69, 0x0005, NES_SCRIPT }, + { 0x2B980, 0x000D, NES_SCRIPT }, { 0x2B98D, 0x000D, NES_SCRIPT }, { 0x186C8, 0x0040, NES_SCRIPT }, { 0x18708, 0x0016, NES_SCRIPT }, { 0x1B4B1, 0x0046, NES_SCRIPT }, + { 0x1EEBB, 0x00B8, NES_SCRIPT }, { 0x21CFA, 0x005C, NES_SCRIPT }, { 0x17537, 0x0027, NES_SCRIPT }, { 0x1FD0A, 0x0027, NES_SCRIPT }, { 0x1FD31, 0x0027, NES_SCRIPT }, + { 0x1BBB5, 0x0022, NES_SCRIPT }, { 0x15BC0, 0x0085, NES_SCRIPT }, { 0x22324, 0x001E, NES_SCRIPT }, { 0x22342, 0x008F, NES_SCRIPT }, { 0x19252, 0x002B, NES_SCRIPT }, + { 0x1CB1B, 0x006D, NES_SCRIPT }, { 0x1CB88, 0x004C, NES_SCRIPT }, { 0x1CBD4, 0x0044, NES_SCRIPT }, { 0x1CC18, 0x0053, NES_SCRIPT }, { 0x2049D, 0x0081, NES_SCRIPT }, + { 0x1634C, 0x0035, NES_SCRIPT }, { 0x16381, 0x001C, NES_SCRIPT }, { 0x1639D, 0x0014, NES_SCRIPT }, { 0x163B1, 0x001C, NES_SCRIPT }, { 0x163CD, 0x0027, NES_SCRIPT }, + { 0x163F4, 0x019B, NES_SCRIPT }, { 0x1D183, 0x0094, NES_SCRIPT }, { 0x1D217, 0x0117, NES_SCRIPT }, { 0x1D32E, 0x001C, NES_SCRIPT }, { 0x1D34A, 0x0056, NES_SCRIPT }, + { 0x1D3A0, 0x0072, NES_SCRIPT }, { 0x1E47F, 0x0028, NES_SCRIPT }, { 0x1E4A7, 0x0175, NES_SCRIPT }, { 0x1E61C, 0x022B, NES_SCRIPT }, { 0x27C85, 0x0071, NES_SCRIPT }, + { 0x17C86, 0x004A, NES_SCRIPT }, { 0x13DD6, 0x0039, NES_SCRIPT }, { 0x1871E, 0x0270, NES_SCRIPT }, { 0x1898E, 0x00C0, NES_SCRIPT }, { 0x18A4E, 0x01B6, NES_SCRIPT }, + { 0x00000, 0x0000, NES_SCRIPT }, { 0x19DC9, 0x00EE, NES_SCRIPT }, { 0x21D56, 0x00F5, NES_SCRIPT }, { 0x1E847, 0x0094, NES_SCRIPT }, { 0x21E4B, 0x0047, NES_SCRIPT }, + { 0x2B99A, 0x004D, NES_SCRIPT }, { 0x13E0F, 0x0024, NES_SCRIPT }, { 0x14D13, 0x0014, NES_SCRIPT }, { 0x1755E, 0x0054, NES_SCRIPT }, { 0x175B2, 0x011A, NES_SCRIPT }, + { 0x176CC, 0x0009, NES_SCRIPT }, { 0x14D27, 0x01B9, NES_SCRIPT }, { 0x2AA0E, 0x0256, NES_SCRIPT }, { 0x231A4, 0x06D2, NES_SCRIPT }, { 0x2B9E7, 0x001D, NES_SCRIPT }, + { 0x2BA04, 0x0016, NES_SCRIPT }, { 0x2BA1A, 0x002D, NES_SCRIPT }, { 0x2BA47, 0x0027, NES_SCRIPT }, { 0x2BA6E, 0x0016, NES_SCRIPT }, { 0x2BA84, 0x0014, NES_SCRIPT }, + { 0x2BA98, 0x0015, NES_SCRIPT }, { 0x2BAAD, 0x0029, NES_SCRIPT }, { 0x00000, 0x0000, NES_SCRIPT }, { 0x2BAD6, 0x0010, NES_SCRIPT }, { 0x176D5, 0x00A2, NES_SCRIPT }, + { 0x22831, 0x0066, NES_SCRIPT }, { 0x14EE0, 0x0077, NES_SCRIPT }, { 0x1F30B, 0x011A, NES_SCRIPT }, { 0x1FD58, 0x001D, NES_SCRIPT }, { 0x1F425, 0x0095, NES_SCRIPT }, + { 0x1F4BA, 0x009E, NES_SCRIPT }, { 0x17777, 0x006F, NES_SCRIPT }, { 0x177E6, 0x002F, NES_SCRIPT }, { 0x1F558, 0x0098, NES_SCRIPT }, { 0x2BAE6, 0x00C4, NES_SCRIPT }, + { 0x2BBAA, 0x00AE, NES_SCRIPT }, { 0x2BC58, 0x0088, NES_SCRIPT }, { 0x20A3C, 0x01BB, NES_SCRIPT }, { 0x20BF7, 0x0197, NES_SCRIPT }, { 0x20D8E, 0x006E, NES_SCRIPT }, + { 0x20DFC, 0x0028, NES_SCRIPT }, { 0x20E24, 0x00EA, NES_SCRIPT }, { 0x20F0E, 0x0049, NES_SCRIPT }, { 0x20F57, 0x00E7, NES_SCRIPT }, { 0x2103E, 0x010C, NES_SCRIPT }, + { 0x2114A, 0x0151, NES_SCRIPT }, { 0x2129B, 0x01B0, NES_SCRIPT }, { 0x2144B, 0x0034, NES_SCRIPT }, { 0x2147F, 0x00A9, NES_SCRIPT }, { 0x24379, 0x010E, NES_SCRIPT }, + { 0x1BBD7, 0x0072, NES_SCRIPT }, { 0x1CC6B, 0x0092, NES_SCRIPT }, { 0x2898B, 0x0054, NES_SCRIPT }, { 0x19EB7, 0x00D3, NES_SCRIPT }, { 0x19F8A, 0x0077, NES_SCRIPT }, + { 0x14F57, 0x0057, NES_SCRIPT }, { 0x2703E, 0x0307, NES_SCRIPT }, { 0x1D9FB, 0x024F, NES_SCRIPT }, { 0x1DC4A, 0x00E4, NES_SCRIPT }, { 0x1DD2E, 0x0059, NES_SCRIPT }, + { 0x1DD87, 0x01C2, NES_SCRIPT }, { 0x14FAE, 0x004D, NES_SCRIPT }, { 0x26D52, 0x00D5, NES_SCRIPT }, { 0x21E92, 0x0013, NES_SCRIPT }, { 0x29C6E, 0x00F0, NES_SCRIPT }, + { 0x24487, 0x00E0, NES_SCRIPT }, { 0x21528, 0x00F2, NES_SCRIPT }, { 0x24567, 0x0023, NES_SCRIPT }, { 0x2B6B2, 0x010B, NES_SCRIPT }, { 0x2458A, 0x00A1, NES_SCRIPT }, + { 0x250A0, 0x018B, NES_SCRIPT }, { 0x1B4F7, 0x000D, NES_SCRIPT }, { 0x1B504, 0x000D, NES_SCRIPT }, { 0x23876, 0x018E, NES_SCRIPT }, { 0x27639, 0x01F0, NES_SCRIPT }, + { 0x23A04, 0x017B, NES_SCRIPT }, { 0x23B7F, 0x01AC, NES_SCRIPT }, { 0x23D2B, 0x0016, NES_SCRIPT }, { 0x2B7BD, 0x005B, NES_SCRIPT }, { 0x23D41, 0x0020, NES_SCRIPT }, + { 0x2A643, 0x00A6, NES_SCRIPT }, { 0x29D5E, 0x0399, NES_SCRIPT }, { 0x14FFB, 0x00D2, NES_SCRIPT }, { 0x2B1DE, 0x0063, NES_SCRIPT }, { 0x00000, 0x0000, NES_SCRIPT }, + { 0x2522B, 0x003C, NES_SCRIPT }, { 0x1E8DB, 0x0011, NES_SCRIPT }, { 0x13E33, 0x0018, NES_SCRIPT }, { 0x26585, 0x001F, NES_SCRIPT }, { 0x265A4, 0x0054, NES_SCRIPT }, + { 0x265F8, 0x017D, NES_SCRIPT }, { 0x26775, 0x004B, NES_SCRIPT }, { 0x267C0, 0x0165, NES_SCRIPT }, { 0x26925, 0x0027, NES_SCRIPT }, { 0x2694C, 0x0041, NES_SCRIPT }, + { 0x2698D, 0x01CB, NES_SCRIPT }, { 0x13E4B, 0x001F, NES_SCRIPT }, { 0x2462B, 0x002A, NES_SCRIPT }, { 0x150CD, 0x0187, NES_SCRIPT }, { 0x1927D, 0x0031, NES_SCRIPT }, + { 0x17815, 0x0087, NES_SCRIPT }, { 0x2161A, 0x00D8, NES_SCRIPT }, { 0x1D412, 0x0018, NES_SCRIPT }, { 0x1D42A, 0x0058, NES_SCRIPT }, { 0x18C04, 0x0005, NES_SCRIPT }, + { 0x15254, 0x0108, NES_SCRIPT }, { 0x1535C, 0x000B, NES_SCRIPT }, { 0x24655, 0x0139, NES_SCRIPT }, { 0x2478E, 0x0014, NES_SCRIPT }, { 0x1DF49, 0x0018, NES_SCRIPT }, + { 0x247A2, 0x0027, NES_SCRIPT }, { 0x1A001, 0x004C, NES_SCRIPT }, { 0x00000, 0x0000, NES_SCRIPT }, { 0x2B241, 0x00A5, NES_SCRIPT }, { 0x2A0F7, 0x00B5, NES_SCRIPT }, + { 0x2A1AC, 0x0140, NES_SCRIPT }, { 0x19759, 0x00CA, NES_SCRIPT }, { 0x19823, 0x014D, NES_SCRIPT }, { 0x19970, 0x0012, NES_SCRIPT }, { 0x2A2EC, 0x0005, NES_SCRIPT }, + { 0x2A2F1, 0x0005, NES_SCRIPT }, { 0x2A2F6, 0x0005, NES_SCRIPT }, { 0x2A2FB, 0x0005, NES_SCRIPT }, { 0x2A300, 0x0005, NES_SCRIPT }, { 0x216F2, 0x0033, NES_SCRIPT }, + { 0x2A305, 0x0005, NES_SCRIPT }, { 0x00000, 0x0000, NES_SCRIPT }, { 0x2A30A, 0x009C, NES_SCRIPT }, { 0x2A3A6, 0x009C, NES_SCRIPT } +}; +static const ScummNESFile::Resource res_scripts_fra[179] = { + { 0x00000, 0x0000, NES_SCRIPT }, { 0x2947D, 0x0480, NES_SCRIPT }, { 0x298FD, 0x0226, NES_SCRIPT }, { 0x29B23, 0x0092, NES_SCRIPT }, { 0x29BB5, 0x040C, NES_SCRIPT }, + { 0x29FC1, 0x01A1, NES_SCRIPT }, { 0x00000, 0x0000, NES_SCRIPT }, { 0x2A162, 0x005C, NES_SCRIPT }, { 0x00000, 0x0000, NES_SCRIPT }, { 0x2A1BE, 0x0005, NES_SCRIPT }, + { 0x2C169, 0x000D, NES_SCRIPT }, { 0x2C176, 0x000D, NES_SCRIPT }, { 0x186E3, 0x0040, NES_SCRIPT }, { 0x18723, 0x0016, NES_SCRIPT }, { 0x1B59F, 0x0046, NES_SCRIPT }, + { 0x1EFD7, 0x00CB, NES_SCRIPT }, { 0x21D09, 0x0054, NES_SCRIPT }, { 0x176C8, 0x0027, NES_SCRIPT }, { 0x1FE6A, 0x0027, NES_SCRIPT }, { 0x1FE91, 0x0027, NES_SCRIPT }, + { 0x1BC9A, 0x0022, NES_SCRIPT }, { 0x15CD6, 0x0092, NES_SCRIPT }, { 0x22336, 0x001C, NES_SCRIPT }, { 0x22352, 0x008F, NES_SCRIPT }, { 0x192A5, 0x002B, NES_SCRIPT }, + { 0x1CAAA, 0x0069, NES_SCRIPT }, { 0x1CB13, 0x0054, NES_SCRIPT }, { 0x1CB67, 0x0048, NES_SCRIPT }, { 0x1CBAF, 0x0058, NES_SCRIPT }, { 0x204B6, 0x0078, NES_SCRIPT }, + { 0x16471, 0x0035, NES_SCRIPT }, { 0x164A6, 0x001C, NES_SCRIPT }, { 0x164C2, 0x0014, NES_SCRIPT }, { 0x164D6, 0x001C, NES_SCRIPT }, { 0x164F2, 0x0027, NES_SCRIPT }, + { 0x16519, 0x01BB, NES_SCRIPT }, { 0x1D135, 0x008D, NES_SCRIPT }, { 0x1D1C2, 0x0119, NES_SCRIPT }, { 0x1D2DB, 0x001C, NES_SCRIPT }, { 0x1D2F7, 0x0056, NES_SCRIPT }, + { 0x1D34D, 0x0072, NES_SCRIPT }, { 0x1E4BF, 0x0028, NES_SCRIPT }, { 0x1E4E7, 0x01E0, NES_SCRIPT }, { 0x1E6C7, 0x0241, NES_SCRIPT }, { 0x2845D, 0x0071, NES_SCRIPT }, + { 0x17E48, 0x004C, NES_SCRIPT }, { 0x13DE3, 0x0039, NES_SCRIPT }, { 0x18739, 0x0296, NES_SCRIPT }, { 0x189CF, 0x00C2, NES_SCRIPT }, { 0x18A91, 0x01A5, NES_SCRIPT }, + { 0x00000, 0x0000, NES_SCRIPT }, { 0x19E13, 0x00F3, NES_SCRIPT }, { 0x21D5D, 0x00F6, NES_SCRIPT }, { 0x1E908, 0x00B8, NES_SCRIPT }, { 0x21E53, 0x0047, NES_SCRIPT }, + { 0x2C183, 0x004D, NES_SCRIPT }, { 0x13E1C, 0x0024, NES_SCRIPT }, { 0x14D77, 0x0014, NES_SCRIPT }, { 0x176EF, 0x0059, NES_SCRIPT }, { 0x17748, 0x013F, NES_SCRIPT }, + { 0x17887, 0x0009, NES_SCRIPT }, { 0x14D8B, 0x01D4, NES_SCRIPT }, { 0x2ACFB, 0x028D, NES_SCRIPT }, { 0x23203, 0x0779, NES_SCRIPT }, { 0x2C1D0, 0x001B, NES_SCRIPT }, + { 0x2C1EB, 0x001F, NES_SCRIPT }, { 0x2C20A, 0x0024, NES_SCRIPT }, { 0x2C22E, 0x0019, NES_SCRIPT }, { 0x2C247, 0x0018, NES_SCRIPT }, { 0x2C25F, 0x001D, NES_SCRIPT }, + { 0x2C27C, 0x0016, NES_SCRIPT }, { 0x2C292, 0x0027, NES_SCRIPT }, { 0x00000, 0x0000, NES_SCRIPT }, { 0x2C2B9, 0x0011, NES_SCRIPT }, { 0x17890, 0x00AA, NES_SCRIPT }, + { 0x22846, 0x0066, NES_SCRIPT }, { 0x14F5F, 0x0083, NES_SCRIPT }, { 0x1F43C, 0x013A, NES_SCRIPT }, { 0x1FEB8, 0x001D, NES_SCRIPT }, { 0x1F576, 0x0098, NES_SCRIPT }, + { 0x1F60E, 0x009B, NES_SCRIPT }, { 0x1793A, 0x006E, NES_SCRIPT }, { 0x179A8, 0x0033, NES_SCRIPT }, { 0x1F6A9, 0x00A5, NES_SCRIPT }, { 0x2C2CA, 0x00BA, NES_SCRIPT }, + { 0x2C384, 0x00AC, NES_SCRIPT }, { 0x2C430, 0x008F, NES_SCRIPT }, { 0x20A2D, 0x01BE, NES_SCRIPT }, { 0x20BEB, 0x0158, NES_SCRIPT }, { 0x20D43, 0x0079, NES_SCRIPT }, + { 0x20DBC, 0x002B, NES_SCRIPT }, { 0x20DE7, 0x00E8, NES_SCRIPT }, { 0x20ECF, 0x004A, NES_SCRIPT }, { 0x20F19, 0x0110, NES_SCRIPT }, { 0x21029, 0x0136, NES_SCRIPT }, + { 0x2115F, 0x0152, NES_SCRIPT }, { 0x212B1, 0x01B3, NES_SCRIPT }, { 0x21464, 0x0032, NES_SCRIPT }, { 0x21496, 0x00A9, NES_SCRIPT }, { 0x2437F, 0x0133, NES_SCRIPT }, + { 0x1BCBC, 0x0074, NES_SCRIPT }, { 0x1CC07, 0x0090, NES_SCRIPT }, { 0x28E43, 0x0054, NES_SCRIPT }, { 0x19F06, 0x00DB, NES_SCRIPT }, { 0x19FE1, 0x0080, NES_SCRIPT }, + { 0x14FE2, 0x0057, NES_SCRIPT }, { 0x273F4, 0x031F, NES_SCRIPT }, { 0x1D9D4, 0x0238, NES_SCRIPT }, { 0x1DC0C, 0x00FE, NES_SCRIPT }, { 0x1DD0A, 0x005A, NES_SCRIPT }, + { 0x1DD64, 0x01F5, NES_SCRIPT }, { 0x15039, 0x004D, NES_SCRIPT }, { 0x270DD, 0x0100, NES_SCRIPT }, { 0x21E9A, 0x0013, NES_SCRIPT }, { 0x2A1C3, 0x00F0, NES_SCRIPT }, + { 0x244B2, 0x00E4, NES_SCRIPT }, { 0x2153F, 0x00EC, NES_SCRIPT }, { 0x24596, 0x0033, NES_SCRIPT }, { 0x2BC04, 0x0108, NES_SCRIPT }, { 0x245C9, 0x009F, NES_SCRIPT }, + { 0x250F1, 0x0193, NES_SCRIPT }, { 0x1B5E5, 0x000D, NES_SCRIPT }, { 0x1B5F2, 0x000D, NES_SCRIPT }, { 0x2397C, 0x0199, NES_SCRIPT }, { 0x27A07, 0x0233, NES_SCRIPT }, + { 0x23B15, 0x0171, NES_SCRIPT }, { 0x23C86, 0x01BC, NES_SCRIPT }, { 0x23E42, 0x0016, NES_SCRIPT }, { 0x2BD0C, 0x005B, NES_SCRIPT }, { 0x23E58, 0x0020, NES_SCRIPT }, + { 0x27E3B, 0x00B9, NES_SCRIPT }, { 0x2A2B3, 0x03D3, NES_SCRIPT }, { 0x15086, 0x00E4, NES_SCRIPT }, { 0x2B70C, 0x0067, NES_SCRIPT }, { 0x00000, 0x0000, NES_SCRIPT }, + { 0x25284, 0x003C, NES_SCRIPT }, { 0x1E9C0, 0x0011, NES_SCRIPT }, { 0x13E40, 0x0018, NES_SCRIPT }, { 0x26621, 0x001F, NES_SCRIPT }, { 0x26640, 0x0054, NES_SCRIPT }, + { 0x26694, 0x0173, NES_SCRIPT }, { 0x26807, 0x004B, NES_SCRIPT }, { 0x26852, 0x0190, NES_SCRIPT }, { 0x269E2, 0x0027, NES_SCRIPT }, { 0x26A09, 0x0041, NES_SCRIPT }, + { 0x26A4A, 0x024E, NES_SCRIPT }, { 0x13E58, 0x001F, NES_SCRIPT }, { 0x24668, 0x002A, NES_SCRIPT }, { 0x1516A, 0x01C9, NES_SCRIPT }, { 0x192D0, 0x0031, NES_SCRIPT }, + { 0x179DB, 0x0088, NES_SCRIPT }, { 0x2162B, 0x00D0, NES_SCRIPT }, { 0x1D3BF, 0x0018, NES_SCRIPT }, { 0x1D3D7, 0x0055, NES_SCRIPT }, { 0x18C36, 0x0005, NES_SCRIPT }, + { 0x15333, 0x0113, NES_SCRIPT }, { 0x15446, 0x000B, NES_SCRIPT }, { 0x24692, 0x014D, NES_SCRIPT }, { 0x247DF, 0x0014, NES_SCRIPT }, { 0x1DF59, 0x0018, NES_SCRIPT }, + { 0x247F3, 0x0027, NES_SCRIPT }, { 0x1A061, 0x0050, NES_SCRIPT }, { 0x00000, 0x0000, NES_SCRIPT }, { 0x2B773, 0x00A5, NES_SCRIPT }, { 0x2A686, 0x00BA, NES_SCRIPT }, + { 0x2A740, 0x0140, NES_SCRIPT }, { 0x1979F, 0x00CA, NES_SCRIPT }, { 0x19869, 0x014D, NES_SCRIPT }, { 0x199B6, 0x0012, NES_SCRIPT }, { 0x2A880, 0x0005, NES_SCRIPT }, + { 0x2A885, 0x0005, NES_SCRIPT }, { 0x2A88A, 0x0005, NES_SCRIPT }, { 0x2A88F, 0x0005, NES_SCRIPT }, { 0x2A894, 0x0005, NES_SCRIPT }, { 0x216FB, 0x0033, NES_SCRIPT }, + { 0x2A899, 0x0005, NES_SCRIPT }, { 0x00000, 0x0000, NES_SCRIPT }, { 0x2A89E, 0x009C, NES_SCRIPT }, { 0x2A93A, 0x009C, NES_SCRIPT } +}; +static const ScummNESFile::Resource res_scripts_ger[179] = { + { 0x00000, 0x0000, NES_SCRIPT }, { 0x295B0, 0x045A, NES_SCRIPT }, { 0x29A0A, 0x0218, NES_SCRIPT }, { 0x29C22, 0x00B1, NES_SCRIPT }, { 0x29CD3, 0x0408, NES_SCRIPT }, + { 0x2A0DB, 0x01A1, NES_SCRIPT }, { 0x00000, 0x0000, NES_SCRIPT }, { 0x2A27C, 0x005C, NES_SCRIPT }, { 0x00000, 0x0000, NES_SCRIPT }, { 0x2A2D8, 0x0005, NES_SCRIPT }, + { 0x2C169, 0x000D, NES_SCRIPT }, { 0x2C176, 0x000D, NES_SCRIPT }, { 0x186DB, 0x0040, NES_SCRIPT }, { 0x1871B, 0x0016, NES_SCRIPT }, { 0x1B5C2, 0x0046, NES_SCRIPT }, + { 0x1EFB7, 0x00E3, NES_SCRIPT }, { 0x21D9D, 0x0069, NES_SCRIPT }, { 0x174F1, 0x0027, NES_SCRIPT }, { 0x1FE92, 0x0027, NES_SCRIPT }, { 0x1FEB9, 0x0027, NES_SCRIPT }, + { 0x1BCE5, 0x0022, NES_SCRIPT }, { 0x13EF4, 0x0087, NES_SCRIPT }, { 0x223EC, 0x001F, NES_SCRIPT }, { 0x2240B, 0x008F, NES_SCRIPT }, { 0x192CC, 0x002B, NES_SCRIPT }, + { 0x1CB08, 0x006E, NES_SCRIPT }, { 0x1CB76, 0x004E, NES_SCRIPT }, { 0x1CBC4, 0x004D, NES_SCRIPT }, { 0x1CC11, 0x0059, NES_SCRIPT }, { 0x204AA, 0x0080, NES_SCRIPT }, + { 0x1628E, 0x0035, NES_SCRIPT }, { 0x162C3, 0x001C, NES_SCRIPT }, { 0x162DF, 0x0014, NES_SCRIPT }, { 0x162F3, 0x001C, NES_SCRIPT }, { 0x1630F, 0x0027, NES_SCRIPT }, + { 0x16336, 0x01D1, NES_SCRIPT }, { 0x1D199, 0x00A0, NES_SCRIPT }, { 0x1D239, 0x011C, NES_SCRIPT }, { 0x1D355, 0x001C, NES_SCRIPT }, { 0x1D371, 0x0056, NES_SCRIPT }, + { 0x1D3C7, 0x0072, NES_SCRIPT }, { 0x1E4FA, 0x0028, NES_SCRIPT }, { 0x1E522, 0x019D, NES_SCRIPT }, { 0x1E6BF, 0x023B, NES_SCRIPT }, { 0x2845D, 0x0071, NES_SCRIPT }, + { 0x17C50, 0x0052, NES_SCRIPT }, { 0x15AC9, 0x0039, NES_SCRIPT }, { 0x18731, 0x02E7, NES_SCRIPT }, { 0x18A18, 0x00BC, NES_SCRIPT }, { 0x18AD4, 0x01A2, NES_SCRIPT }, + { 0x00000, 0x0000, NES_SCRIPT }, { 0x19E45, 0x00F8, NES_SCRIPT }, { 0x21E06, 0x00F7, NES_SCRIPT }, { 0x1E8FA, 0x00B5, NES_SCRIPT }, { 0x21EFD, 0x0047, NES_SCRIPT }, + { 0x2C183, 0x004D, NES_SCRIPT }, { 0x15B02, 0x0024, NES_SCRIPT }, { 0x14D64, 0x0014, NES_SCRIPT }, { 0x17518, 0x005E, NES_SCRIPT }, { 0x17576, 0x0125, NES_SCRIPT }, + { 0x1769B, 0x0009, NES_SCRIPT }, { 0x14D78, 0x01C7, NES_SCRIPT }, { 0x2ADCE, 0x0263, NES_SCRIPT }, { 0x232AF, 0x077F, NES_SCRIPT }, { 0x2C1D0, 0x001E, NES_SCRIPT }, + { 0x2C1EE, 0x0024, NES_SCRIPT }, { 0x2C212, 0x002E, NES_SCRIPT }, { 0x2C240, 0x0022, NES_SCRIPT }, { 0x2C262, 0x0013, NES_SCRIPT }, { 0x2C275, 0x001E, NES_SCRIPT }, + { 0x2C293, 0x0016, NES_SCRIPT }, { 0x2C2A9, 0x0027, NES_SCRIPT }, { 0x00000, 0x0000, NES_SCRIPT }, { 0x2C2D0, 0x0012, NES_SCRIPT }, { 0x176A4, 0x00A4, NES_SCRIPT }, + { 0x228F8, 0x0066, NES_SCRIPT }, { 0x14F3F, 0x007F, NES_SCRIPT }, { 0x1F428, 0x013A, NES_SCRIPT }, { 0x1FEE0, 0x001D, NES_SCRIPT }, { 0x1F562, 0x00A0, NES_SCRIPT }, + { 0x1F602, 0x00A4, NES_SCRIPT }, { 0x17748, 0x0076, NES_SCRIPT }, { 0x177BE, 0x0036, NES_SCRIPT }, { 0x1F6A6, 0x00B9, NES_SCRIPT }, { 0x2C2E2, 0x00CB, NES_SCRIPT }, + { 0x2C3AD, 0x00B7, NES_SCRIPT }, { 0x2C464, 0x008A, NES_SCRIPT }, { 0x20A58, 0x01BD, NES_SCRIPT }, { 0x20C15, 0x0181, NES_SCRIPT }, { 0x20D96, 0x0078, NES_SCRIPT }, + { 0x20E0E, 0x003C, NES_SCRIPT }, { 0x20E4A, 0x00E9, NES_SCRIPT }, { 0x20F33, 0x0046, NES_SCRIPT }, { 0x20F79, 0x00F6, NES_SCRIPT }, { 0x2106F, 0x0118, NES_SCRIPT }, + { 0x21187, 0x015B, NES_SCRIPT }, { 0x212E2, 0x01AC, NES_SCRIPT }, { 0x2148E, 0x003F, NES_SCRIPT }, { 0x214CD, 0x00A9, NES_SCRIPT }, { 0x2436F, 0x0126, NES_SCRIPT }, + { 0x1BD07, 0x0075, NES_SCRIPT }, { 0x1CC6A, 0x009B, NES_SCRIPT }, { 0x28F5D, 0x0054, NES_SCRIPT }, { 0x19F3D, 0x00E1, NES_SCRIPT }, { 0x1A01E, 0x0086, NES_SCRIPT }, + { 0x14FBE, 0x0057, NES_SCRIPT }, { 0x27326, 0x033D, NES_SCRIPT }, { 0x1DA51, 0x023B, NES_SCRIPT }, { 0x1DC8C, 0x00FB, NES_SCRIPT }, { 0x1DD87, 0x0056, NES_SCRIPT }, + { 0x1DDDD, 0x01E1, NES_SCRIPT }, { 0x15015, 0x004D, NES_SCRIPT }, { 0x27027, 0x00E8, NES_SCRIPT }, { 0x21F44, 0x0013, NES_SCRIPT }, { 0x2A2DD, 0x00F0, NES_SCRIPT }, + { 0x24495, 0x00F8, NES_SCRIPT }, { 0x21576, 0x00F9, NES_SCRIPT }, { 0x2458D, 0x002B, NES_SCRIPT }, { 0x2BAA4, 0x010F, NES_SCRIPT }, { 0x245B8, 0x00A5, NES_SCRIPT }, + { 0x250D0, 0x019C, NES_SCRIPT }, { 0x1B608, 0x000D, NES_SCRIPT }, { 0x1B615, 0x000D, NES_SCRIPT }, { 0x23A2E, 0x0185, NES_SCRIPT }, { 0x27957, 0x0212, NES_SCRIPT }, + { 0x23BB3, 0x0158, NES_SCRIPT }, { 0x23D0B, 0x01C4, NES_SCRIPT }, { 0x23ECF, 0x0016, NES_SCRIPT }, { 0x2BBB3, 0x005A, NES_SCRIPT }, { 0x23EE5, 0x0020, NES_SCRIPT }, + { 0x27D6A, 0x00A7, NES_SCRIPT }, { 0x2A3CD, 0x038C, NES_SCRIPT }, { 0x15062, 0x00F6, NES_SCRIPT }, { 0x2B5B2, 0x007B, NES_SCRIPT }, { 0x00000, 0x0000, NES_SCRIPT }, + { 0x2526C, 0x003C, NES_SCRIPT }, { 0x1E9AF, 0x0011, NES_SCRIPT }, { 0x15B26, 0x0018, NES_SCRIPT }, { 0x265F5, 0x001F, NES_SCRIPT }, { 0x26614, 0x0054, NES_SCRIPT }, + { 0x26668, 0x018E, NES_SCRIPT }, { 0x267F6, 0x004B, NES_SCRIPT }, { 0x26841, 0x0196, NES_SCRIPT }, { 0x269D7, 0x0027, NES_SCRIPT }, { 0x269FE, 0x0041, NES_SCRIPT }, + { 0x26A3F, 0x01A3, NES_SCRIPT }, { 0x15B3E, 0x001F, NES_SCRIPT }, { 0x2465D, 0x002A, NES_SCRIPT }, { 0x15158, 0x0198, NES_SCRIPT }, { 0x192F7, 0x0031, NES_SCRIPT }, + { 0x177F4, 0x008C, NES_SCRIPT }, { 0x2166F, 0x00DA, NES_SCRIPT }, { 0x1D439, 0x0018, NES_SCRIPT }, { 0x1D451, 0x0054, NES_SCRIPT }, { 0x18C76, 0x0005, NES_SCRIPT }, + { 0x152F0, 0x0126, NES_SCRIPT }, { 0x15416, 0x000B, NES_SCRIPT }, { 0x24687, 0x0137, NES_SCRIPT }, { 0x247BE, 0x0014, NES_SCRIPT }, { 0x1DFBE, 0x0018, NES_SCRIPT }, + { 0x247D2, 0x0027, NES_SCRIPT }, { 0x1A0A4, 0x004D, NES_SCRIPT }, { 0x00000, 0x0000, NES_SCRIPT }, { 0x2B62D, 0x00A5, NES_SCRIPT }, { 0x2A759, 0x00BA, NES_SCRIPT }, + { 0x2A813, 0x0140, NES_SCRIPT }, { 0x197CF, 0x00D0, NES_SCRIPT }, { 0x1989F, 0x014D, NES_SCRIPT }, { 0x199EC, 0x0012, NES_SCRIPT }, { 0x2A953, 0x0005, NES_SCRIPT }, + { 0x2A958, 0x0005, NES_SCRIPT }, { 0x2A95D, 0x0005, NES_SCRIPT }, { 0x2A962, 0x0005, NES_SCRIPT }, { 0x2A967, 0x0005, NES_SCRIPT }, { 0x21749, 0x0033, NES_SCRIPT }, + { 0x2A96C, 0x0005, NES_SCRIPT }, { 0x00000, 0x0000, NES_SCRIPT }, { 0x2A971, 0x009C, NES_SCRIPT }, { 0x2AA0D, 0x009C, NES_SCRIPT } +}; +static const ScummNESFile::Resource res_scripts_esp[179] = { + { 0x00000, 0x0000, NES_SCRIPT }, { 0x28F4C, 0x0457, NES_SCRIPT }, { 0x293A3, 0x0213, NES_SCRIPT }, { 0x295B6, 0x009C, NES_SCRIPT }, { 0x29652, 0x03FE, NES_SCRIPT }, + { 0x29A50, 0x01A1, NES_SCRIPT }, { 0x00000, 0x0000, NES_SCRIPT }, { 0x29BF1, 0x005C, NES_SCRIPT }, { 0x00000, 0x0000, NES_SCRIPT }, { 0x29C4D, 0x0005, NES_SCRIPT }, + { 0x2B964, 0x000D, NES_SCRIPT }, { 0x2B971, 0x000D, NES_SCRIPT }, { 0x186EE, 0x0040, NES_SCRIPT }, { 0x1872E, 0x0016, NES_SCRIPT }, { 0x1B5A0, 0x0046, NES_SCRIPT }, + { 0x1EF97, 0x00B4, NES_SCRIPT }, { 0x21D17, 0x0056, NES_SCRIPT }, { 0x175E9, 0x0027, NES_SCRIPT }, { 0x1FE06, 0x0027, NES_SCRIPT }, { 0x1FE2D, 0x0027, NES_SCRIPT }, + { 0x1BC86, 0x0022, NES_SCRIPT }, { 0x15C26, 0x008B, NES_SCRIPT }, { 0x2232E, 0x001F, NES_SCRIPT }, { 0x2234D, 0x008F, NES_SCRIPT }, { 0x192AF, 0x002B, NES_SCRIPT }, + { 0x1CB59, 0x006B, NES_SCRIPT }, { 0x1CBC4, 0x0045, NES_SCRIPT }, { 0x1CC09, 0x0046, NES_SCRIPT }, { 0x1CC4F, 0x005D, NES_SCRIPT }, { 0x204CC, 0x0077, NES_SCRIPT }, + { 0x163DA, 0x0035, NES_SCRIPT }, { 0x1640F, 0x001C, NES_SCRIPT }, { 0x1642B, 0x0014, NES_SCRIPT }, { 0x1643F, 0x001C, NES_SCRIPT }, { 0x1645B, 0x0027, NES_SCRIPT }, + { 0x16482, 0x01A3, NES_SCRIPT }, { 0x1D1DE, 0x009E, NES_SCRIPT }, { 0x1D27C, 0x011A, NES_SCRIPT }, { 0x1D396, 0x001C, NES_SCRIPT }, { 0x1D3B2, 0x0056, NES_SCRIPT }, + { 0x1D408, 0x0072, NES_SCRIPT }, { 0x1E50F, 0x0028, NES_SCRIPT }, { 0x1E537, 0x0199, NES_SCRIPT }, { 0x1E6D0, 0x0240, NES_SCRIPT }, { 0x27CA1, 0x0071, NES_SCRIPT }, + { 0x17D14, 0x004C, NES_SCRIPT }, { 0x13E0F, 0x0039, NES_SCRIPT }, { 0x18744, 0x02B9, NES_SCRIPT }, { 0x189FD, 0x00B9, NES_SCRIPT }, { 0x18AB6, 0x0183, NES_SCRIPT }, + { 0x00000, 0x0000, NES_SCRIPT }, { 0x19E3E, 0x00F0, NES_SCRIPT }, { 0x21D6D, 0x00F7, NES_SCRIPT }, { 0x1E910, 0x00A8, NES_SCRIPT }, { 0x21E64, 0x0047, NES_SCRIPT }, + { 0x2B97E, 0x004D, NES_SCRIPT }, { 0x13E48, 0x0024, NES_SCRIPT }, { 0x14D06, 0x0014, NES_SCRIPT }, { 0x17610, 0x005B, NES_SCRIPT }, { 0x1766B, 0x0111, NES_SCRIPT }, + { 0x1777C, 0x0009, NES_SCRIPT }, { 0x14D1A, 0x01C9, NES_SCRIPT }, { 0x2A9E3, 0x0263, NES_SCRIPT }, { 0x231C6, 0x06D6, NES_SCRIPT }, { 0x2B9CB, 0x001C, NES_SCRIPT }, + { 0x2B9E7, 0x001C, NES_SCRIPT }, { 0x2BA03, 0x0025, NES_SCRIPT }, { 0x2BA28, 0x0023, NES_SCRIPT }, { 0x2BA4B, 0x002A, NES_SCRIPT }, { 0x2BA75, 0x0033, NES_SCRIPT }, + { 0x2BAA8, 0x0016, NES_SCRIPT }, { 0x2BABE, 0x0024, NES_SCRIPT }, { 0x00000, 0x0000, NES_SCRIPT }, { 0x2BAE2, 0x0011, NES_SCRIPT }, { 0x17785, 0x00A2, NES_SCRIPT }, + { 0x22838, 0x0066, NES_SCRIPT }, { 0x14EE3, 0x0079, NES_SCRIPT }, { 0x1F3DB, 0x010F, NES_SCRIPT }, { 0x1FE54, 0x001D, NES_SCRIPT }, { 0x1F4EA, 0x00A2, NES_SCRIPT }, + { 0x1F58C, 0x0097, NES_SCRIPT }, { 0x17827, 0x0061, NES_SCRIPT }, { 0x17888, 0x0032, NES_SCRIPT }, { 0x1F623, 0x00A7, NES_SCRIPT }, { 0x2BAF3, 0x00CD, NES_SCRIPT }, + { 0x2BBC0, 0x00BD, NES_SCRIPT }, { 0x2BC7D, 0x0089, NES_SCRIPT }, { 0x20A73, 0x01C2, NES_SCRIPT }, { 0x20C35, 0x016E, NES_SCRIPT }, { 0x20DA3, 0x006F, NES_SCRIPT }, + { 0x20E12, 0x0037, NES_SCRIPT }, { 0x20E49, 0x00EC, NES_SCRIPT }, { 0x20F35, 0x0047, NES_SCRIPT }, { 0x20F7C, 0x00F8, NES_SCRIPT }, { 0x21074, 0x0102, NES_SCRIPT }, + { 0x21176, 0x0133, NES_SCRIPT }, { 0x212A9, 0x0197, NES_SCRIPT }, { 0x21440, 0x002D, NES_SCRIPT }, { 0x2146D, 0x00A9, NES_SCRIPT }, { 0x2436D, 0x0125, NES_SCRIPT }, + { 0x1BCA8, 0x0071, NES_SCRIPT }, { 0x1CCAC, 0x0096, NES_SCRIPT }, { 0x2896A, 0x0054, NES_SCRIPT }, { 0x19F2E, 0x00DF, NES_SCRIPT }, { 0x1A00D, 0x007F, NES_SCRIPT }, + { 0x14F5C, 0x0057, NES_SCRIPT }, { 0x27074, 0x02F6, NES_SCRIPT }, { 0x1DA73, 0x023A, NES_SCRIPT }, { 0x1DCAD, 0x00E8, NES_SCRIPT }, { 0x1DD95, 0x0059, NES_SCRIPT }, + { 0x1DDEE, 0x01E3, NES_SCRIPT }, { 0x14FB3, 0x004D, NES_SCRIPT }, { 0x26D81, 0x00DC, NES_SCRIPT }, { 0x21EAB, 0x0013, NES_SCRIPT }, { 0x29C52, 0x00F0, NES_SCRIPT }, + { 0x24492, 0x00E4, NES_SCRIPT }, { 0x21516, 0x00EE, NES_SCRIPT }, { 0x24576, 0x002D, NES_SCRIPT }, { 0x2B692, 0x010D, NES_SCRIPT }, { 0x245A3, 0x00AC, NES_SCRIPT }, + { 0x250C3, 0x0184, NES_SCRIPT }, { 0x1B5E6, 0x000D, NES_SCRIPT }, { 0x1B5F3, 0x000D, NES_SCRIPT }, { 0x2389C, 0x0182, NES_SCRIPT }, { 0x2765E, 0x01E7, NES_SCRIPT }, + { 0x23A1E, 0x017A, NES_SCRIPT }, { 0x23B98, 0x01B6, NES_SCRIPT }, { 0x23D4E, 0x0016, NES_SCRIPT }, { 0x2B79F, 0x005D, NES_SCRIPT }, { 0x23D64, 0x0020, NES_SCRIPT }, + { 0x2A619, 0x00A5, NES_SCRIPT }, { 0x29D42, 0x038F, NES_SCRIPT }, { 0x15000, 0x00ED, NES_SCRIPT }, { 0x2B1B8, 0x0063, NES_SCRIPT }, { 0x00000, 0x0000, NES_SCRIPT }, + { 0x25247, 0x003C, NES_SCRIPT }, { 0x1E9B8, 0x0011, NES_SCRIPT }, { 0x13E6C, 0x0018, NES_SCRIPT }, { 0x265E0, 0x001F, NES_SCRIPT }, { 0x265FF, 0x0054, NES_SCRIPT }, + { 0x26653, 0x0147, NES_SCRIPT }, { 0x2679A, 0x004B, NES_SCRIPT }, { 0x267E5, 0x0184, NES_SCRIPT }, { 0x26969, 0x0027, NES_SCRIPT }, { 0x26990, 0x0041, NES_SCRIPT }, + { 0x269D1, 0x01B9, NES_SCRIPT }, { 0x13E84, 0x001F, NES_SCRIPT }, { 0x2464F, 0x002A, NES_SCRIPT }, { 0x150ED, 0x01A4, NES_SCRIPT }, { 0x192DA, 0x0031, NES_SCRIPT }, + { 0x178BA, 0x007C, NES_SCRIPT }, { 0x21604, 0x00E4, NES_SCRIPT }, { 0x1D47A, 0x0018, NES_SCRIPT }, { 0x1D492, 0x005B, NES_SCRIPT }, { 0x18C39, 0x0005, NES_SCRIPT }, + { 0x15291, 0x010F, NES_SCRIPT }, { 0x153A0, 0x000B, NES_SCRIPT }, { 0x24679, 0x0138, NES_SCRIPT }, { 0x247B1, 0x0014, NES_SCRIPT }, { 0x1DFD1, 0x0018, NES_SCRIPT }, + { 0x247C5, 0x0027, NES_SCRIPT }, { 0x1A08C, 0x004E, NES_SCRIPT }, { 0x00000, 0x0000, NES_SCRIPT }, { 0x2B21B, 0x00A5, NES_SCRIPT }, { 0x2A0D1, 0x00B1, NES_SCRIPT }, + { 0x2A182, 0x0140, NES_SCRIPT }, { 0x197CF, 0x00BE, NES_SCRIPT }, { 0x1988D, 0x014D, NES_SCRIPT }, { 0x199DA, 0x0012, NES_SCRIPT }, { 0x2A2C2, 0x0005, NES_SCRIPT }, + { 0x2A2C7, 0x0005, NES_SCRIPT }, { 0x2A2CC, 0x0005, NES_SCRIPT }, { 0x2A2D1, 0x0005, NES_SCRIPT }, { 0x2A2D6, 0x0005, NES_SCRIPT }, { 0x216E8, 0x0033, NES_SCRIPT }, + { 0x2A2DB, 0x0005, NES_SCRIPT }, { 0x00000, 0x0000, NES_SCRIPT }, { 0x2A2E0, 0x009C, NES_SCRIPT }, { 0x2A37C, 0x009C, NES_SCRIPT } +}; + +static const ScummNESFile::Resource *res_scripts[ScummNESFile::kROMsetNum] = { + res_scripts_usa, + res_scripts_eur, + res_scripts_swe, + res_scripts_fra, + res_scripts_ger, + res_scripts_esp, +}; + +static const ScummNESFile::Resource res_sounds_usa[82] = { + { 0x0FFE8, 0x000A, NES_SOUND }, { 0x30ECA, 0x0832, NES_SOUND }, { 0x30ECA, 0x0832, NES_SOUND }, { 0x30ECA, 0x0832, NES_SOUND }, { 0x30ECA, 0x0832, NES_SOUND }, + { 0x30ECA, 0x0832, NES_SOUND }, { 0x17FCA, 0x0011, NES_SOUND }, { 0x27E0B, 0x0073, NES_SOUND }, { 0x17FDB, 0x0011, NES_SOUND }, { 0x17FEC, 0x0011, NES_SOUND }, + { 0x27E7E, 0x0056, NES_SOUND }, { 0x27ED4, 0x001F, NES_SOUND }, { 0x23FEE, 0x0011, NES_SOUND }, { 0x0FFF2, 0x000A, NES_SOUND }, { 0x27EF3, 0x000A, NES_SOUND }, + { 0x27EFD, 0x0019, NES_SOUND }, { 0x27F16, 0x004B, NES_SOUND }, { 0x27F61, 0x000A, NES_SOUND }, { 0x27F6B, 0x000F, NES_SOUND }, { 0x27F7A, 0x001D, NES_SOUND }, + { 0x27F97, 0x0045, NES_SOUND }, { 0x27FDC, 0x000F, NES_SOUND }, { 0x2FD42, 0x001B, NES_SOUND }, { 0x2FD5D, 0x0033, NES_SOUND }, { 0x27FEB, 0x0011, NES_SOUND }, + { 0x2BFEF, 0x000F, NES_SOUND }, { 0x2FD90, 0x0075, NES_SOUND }, { 0x2FE05, 0x0014, NES_SOUND }, { 0x0FFE8, 0x000A, NES_SOUND }, { 0x2FE19, 0x00FF, NES_SOUND }, + { 0x2FF18, 0x000F, NES_SOUND }, { 0x2FF27, 0x000F, NES_SOUND }, { 0x2FF36, 0x0092, NES_SOUND }, { 0x2FF36, 0x0092, NES_SOUND }, { 0x2FFC8, 0x002D, NES_SOUND }, + { 0x316FC, 0x00F8, NES_SOUND }, { 0x317F4, 0x0016, NES_SOUND }, { 0x3180A, 0x0011, NES_SOUND }, { 0x3181B, 0x004B, NES_SOUND }, { 0x31866, 0x0011, NES_SOUND }, + { 0x31877, 0x003B, NES_SOUND }, { 0x318B2, 0x008A, NES_SOUND }, { 0x3193C, 0x0011, NES_SOUND }, { 0x3194D, 0x000F, NES_SOUND }, { 0x3195C, 0x00A2, NES_SOUND }, + { 0x319FE, 0x00D3, NES_SOUND }, { 0x31AD1, 0x0097, NES_SOUND }, { 0x2BFEF, 0x000F, NES_SOUND }, { 0x3195C, 0x00A2, NES_SOUND }, { 0x31B68, 0x05D1, NES_SOUND }, + { 0x31B68, 0x05D1, NES_SOUND }, { 0x32139, 0x0011, NES_SOUND }, { 0x0FFE8, 0x000A, NES_SOUND }, { 0x2FD90, 0x0075, NES_SOUND }, { 0x27ED4, 0x001F, NES_SOUND }, + { 0x3214A, 0x098E, NES_SOUND }, { 0x3181B, 0x004B, NES_SOUND }, { 0x32AD8, 0x0011, NES_SOUND }, { 0x30ECA, 0x0832, NES_SOUND }, { 0x32AE9, 0x000F, NES_SOUND }, + { 0x32AF8, 0x002F, NES_SOUND }, { 0x32B27, 0x001D, NES_SOUND }, { 0x32B44, 0x0018, NES_SOUND }, { 0x32B5C, 0x0016, NES_SOUND }, { 0x32B72, 0x001B, NES_SOUND }, + { 0x32B8D, 0x0088, NES_SOUND }, { 0x32C15, 0x0065, NES_SOUND }, { 0x32C7A, 0x0065, NES_SOUND }, { 0x32CDF, 0x0073, NES_SOUND }, { 0x32D52, 0x00F9, NES_SOUND }, + { 0x32E4B, 0x049E, NES_SOUND }, { 0x34001, 0x0EA8, NES_SOUND }, { 0x332E9, 0x0B18, NES_SOUND }, { 0x34EA9, 0x0B9C, NES_SOUND }, { 0x35A45, 0x0C6B, NES_SOUND }, + { 0x366B0, 0x0E56, NES_SOUND }, { 0x38001, 0x0C70, NES_SOUND }, { 0x38C71, 0x0DEC, NES_SOUND }, { 0x39A5D, 0x0B77, NES_SOUND }, { 0x37506, 0x042F, NES_SOUND }, + { 0x3A5D4, 0x0AC5, NES_SOUND }, { 0x3B099, 0x0BE4, NES_SOUND } +}; +static const ScummNESFile::Resource res_sounds_eur[82] = { + { 0x0BF54, 0x000A, NES_SOUND }, { 0x30ECA, 0x0832, NES_SOUND }, { 0x30ECA, 0x0832, NES_SOUND }, { 0x30ECA, 0x0832, NES_SOUND }, { 0x30ECA, 0x0832, NES_SOUND }, + { 0x30ECA, 0x0832, NES_SOUND }, { 0x0BF5E, 0x0011, NES_SOUND }, { 0x27ECB, 0x0073, NES_SOUND }, { 0x0BF6F, 0x0011, NES_SOUND }, { 0x0FF5D, 0x0011, NES_SOUND }, + { 0x316FC, 0x0056, NES_SOUND }, { 0x13F4E, 0x001F, NES_SOUND }, { 0x0FF6E, 0x0011, NES_SOUND }, { 0x13F6D, 0x000A, NES_SOUND }, { 0x1BF47, 0x000A, NES_SOUND }, + { 0x1BF51, 0x0019, NES_SOUND }, { 0x31752, 0x004B, NES_SOUND }, { 0x1BF6A, 0x000A, NES_SOUND }, { 0x27F3E, 0x000F, NES_SOUND }, { 0x27F4D, 0x001D, NES_SOUND }, + { 0x3179D, 0x0045, NES_SOUND }, { 0x27F6A, 0x000F, NES_SOUND }, { 0x2BF40, 0x001B, NES_SOUND }, { 0x317E2, 0x0033, NES_SOUND }, { 0x2BF5B, 0x0011, NES_SOUND }, + { 0x2BF6C, 0x000F, NES_SOUND }, { 0x31815, 0x0075, NES_SOUND }, { 0x2FF6C, 0x0014, NES_SOUND }, { 0x0BF54, 0x000A, NES_SOUND }, { 0x3188A, 0x00FF, NES_SOUND }, + { 0x31989, 0x000F, NES_SOUND }, { 0x31998, 0x000F, NES_SOUND }, { 0x319A7, 0x0092, NES_SOUND }, { 0x319A7, 0x0092, NES_SOUND }, { 0x31A39, 0x002D, NES_SOUND }, + { 0x31A66, 0x00F8, NES_SOUND }, { 0x31B5E, 0x0016, NES_SOUND }, { 0x31B74, 0x0011, NES_SOUND }, { 0x31B85, 0x004B, NES_SOUND }, { 0x31BD0, 0x0011, NES_SOUND }, + { 0x31BE1, 0x003B, NES_SOUND }, { 0x31C1C, 0x008A, NES_SOUND }, { 0x31CA6, 0x0011, NES_SOUND }, { 0x31CB7, 0x000F, NES_SOUND }, { 0x31CC6, 0x00A2, NES_SOUND }, + { 0x31D68, 0x00D3, NES_SOUND }, { 0x31E3B, 0x0097, NES_SOUND }, { 0x2BF6C, 0x000F, NES_SOUND }, { 0x31CC6, 0x00A2, NES_SOUND }, { 0x31ED2, 0x05D1, NES_SOUND }, + { 0x31ED2, 0x05D1, NES_SOUND }, { 0x324A3, 0x0011, NES_SOUND }, { 0x0BF54, 0x000A, NES_SOUND }, { 0x31815, 0x0075, NES_SOUND }, { 0x13F4E, 0x001F, NES_SOUND }, + { 0x324B4, 0x098E, NES_SOUND }, { 0x31B85, 0x004B, NES_SOUND }, { 0x32E42, 0x0011, NES_SOUND }, { 0x30ECA, 0x0832, NES_SOUND }, { 0x32E53, 0x000F, NES_SOUND }, + { 0x32E62, 0x002F, NES_SOUND }, { 0x32E91, 0x001D, NES_SOUND }, { 0x32EAE, 0x0018, NES_SOUND }, { 0x32EC6, 0x0016, NES_SOUND }, { 0x32EDC, 0x001B, NES_SOUND }, + { 0x32EF7, 0x0088, NES_SOUND }, { 0x32F7F, 0x0065, NES_SOUND }, { 0x32FE4, 0x0065, NES_SOUND }, { 0x33049, 0x0073, NES_SOUND }, { 0x330BC, 0x00F9, NES_SOUND }, + { 0x331B5, 0x049E, NES_SOUND }, { 0x34001, 0x0EA8, NES_SOUND }, { 0x34EA9, 0x0B18, NES_SOUND }, { 0x359C1, 0x0B9C, NES_SOUND }, { 0x3655D, 0x0C6B, NES_SOUND }, + { 0x38001, 0x0E56, NES_SOUND }, { 0x371C8, 0x0C70, NES_SOUND }, { 0x38E57, 0x0DEC, NES_SOUND }, { 0x39C43, 0x0B77, NES_SOUND }, { 0x33653, 0x042F, NES_SOUND }, + { 0x3A7BA, 0x0AC5, NES_SOUND }, { 0x3B27F, 0x0BE4, NES_SOUND } +}; +static const ScummNESFile::Resource res_sounds_swe[82] = { + { 0x0BF58, 0x000A, NES_SOUND }, { 0x30352, 0x0832, NES_SOUND }, { 0x30352, 0x0832, NES_SOUND }, { 0x30352, 0x0832, NES_SOUND }, { 0x30352, 0x0832, NES_SOUND }, + { 0x30352, 0x0832, NES_SOUND }, { 0x0BF62, 0x0011, NES_SOUND }, { 0x27E5F, 0x0073, NES_SOUND }, { 0x17F5A, 0x0011, NES_SOUND }, { 0x17F6B, 0x0011, NES_SOUND }, + { 0x27ED2, 0x0056, NES_SOUND }, { 0x1BF55, 0x001F, NES_SOUND }, { 0x23F66, 0x0011, NES_SOUND }, { 0x0BF73, 0x000A, NES_SOUND }, { 0x1BF74, 0x000A, NES_SOUND }, + { 0x27F28, 0x0019, NES_SOUND }, { 0x2BF0A, 0x004B, NES_SOUND }, { 0x1FF71, 0x000A, NES_SOUND }, { 0x27F41, 0x000F, NES_SOUND }, { 0x27F50, 0x001D, NES_SOUND }, + { 0x2FEAA, 0x0045, NES_SOUND }, { 0x27F6D, 0x000F, NES_SOUND }, { 0x2BF55, 0x001B, NES_SOUND }, { 0x2FEEF, 0x0033, NES_SOUND }, { 0x2FF22, 0x0011, NES_SOUND }, + { 0x2BF70, 0x000F, NES_SOUND }, { 0x30B84, 0x0075, NES_SOUND }, { 0x2FF33, 0x0014, NES_SOUND }, { 0x0BF58, 0x000A, NES_SOUND }, { 0x30BF9, 0x00FF, NES_SOUND }, + { 0x2FF47, 0x000F, NES_SOUND }, { 0x2FF56, 0x000F, NES_SOUND }, { 0x30CF8, 0x0092, NES_SOUND }, { 0x30CF8, 0x0092, NES_SOUND }, { 0x30D8A, 0x002D, NES_SOUND }, + { 0x30DB7, 0x00F8, NES_SOUND }, { 0x2FF65, 0x0016, NES_SOUND }, { 0x30EAF, 0x0011, NES_SOUND }, { 0x30EC0, 0x004B, NES_SOUND }, { 0x30F0B, 0x0011, NES_SOUND }, + { 0x30F1C, 0x003B, NES_SOUND }, { 0x30F57, 0x008A, NES_SOUND }, { 0x30FE1, 0x0011, NES_SOUND }, { 0x30FF2, 0x000F, NES_SOUND }, { 0x31001, 0x00A2, NES_SOUND }, + { 0x310A3, 0x00D3, NES_SOUND }, { 0x31176, 0x0097, NES_SOUND }, { 0x2BF70, 0x000F, NES_SOUND }, { 0x31001, 0x00A2, NES_SOUND }, { 0x3120D, 0x05D1, NES_SOUND }, + { 0x3120D, 0x05D1, NES_SOUND }, { 0x317DE, 0x0011, NES_SOUND }, { 0x0BF58, 0x000A, NES_SOUND }, { 0x30B84, 0x0075, NES_SOUND }, { 0x1BF55, 0x001F, NES_SOUND }, + { 0x317EF, 0x098E, NES_SOUND }, { 0x30EC0, 0x004B, NES_SOUND }, { 0x3217D, 0x0011, NES_SOUND }, { 0x30352, 0x0832, NES_SOUND }, { 0x3218E, 0x000F, NES_SOUND }, + { 0x3219D, 0x002F, NES_SOUND }, { 0x321CC, 0x001D, NES_SOUND }, { 0x321E9, 0x0018, NES_SOUND }, { 0x32201, 0x0016, NES_SOUND }, { 0x32217, 0x001B, NES_SOUND }, + { 0x32232, 0x0088, NES_SOUND }, { 0x322BA, 0x0065, NES_SOUND }, { 0x3231F, 0x0065, NES_SOUND }, { 0x32384, 0x0073, NES_SOUND }, { 0x323F7, 0x00F9, NES_SOUND }, + { 0x324F0, 0x049E, NES_SOUND }, { 0x3298E, 0x0EA8, NES_SOUND }, { 0x34001, 0x0B18, NES_SOUND }, { 0x34B19, 0x0B9C, NES_SOUND }, { 0x356B5, 0x0C6B, NES_SOUND }, + { 0x36320, 0x0E56, NES_SOUND }, { 0x37176, 0x0C70, NES_SOUND }, { 0x38001, 0x0DEC, NES_SOUND }, { 0x38DED, 0x0B77, NES_SOUND }, { 0x33836, 0x042F, NES_SOUND }, + { 0x39964, 0x0AC5, NES_SOUND }, { 0x3A429, 0x0BE4, NES_SOUND } +}; +static const ScummNESFile::Resource res_sounds_fra[82] = { + { 0x07F74, 0x000A, NES_SOUND }, { 0x30ECA, 0x0832, NES_SOUND }, { 0x30ECA, 0x0832, NES_SOUND }, { 0x30ECA, 0x0832, NES_SOUND }, { 0x30ECA, 0x0832, NES_SOUND }, + { 0x30ECA, 0x0832, NES_SOUND }, { 0x0BF6C, 0x0011, NES_SOUND }, { 0x1BEFA, 0x0073, NES_SOUND }, { 0x17F10, 0x0011, NES_SOUND }, { 0x17F21, 0x0011, NES_SOUND }, + { 0x1FED5, 0x0056, NES_SOUND }, { 0x17F32, 0x001F, NES_SOUND }, { 0x17F51, 0x0011, NES_SOUND }, { 0x0FF76, 0x000A, NES_SOUND }, { 0x17F62, 0x000A, NES_SOUND }, + { 0x1FF2B, 0x0019, NES_SOUND }, { 0x23E78, 0x004B, NES_SOUND }, { 0x17F6C, 0x000A, NES_SOUND }, { 0x1BF6D, 0x000F, NES_SOUND }, { 0x1FF44, 0x001D, NES_SOUND }, + { 0x23EC3, 0x0045, NES_SOUND }, { 0x1FF61, 0x000F, NES_SOUND }, { 0x23F08, 0x001B, NES_SOUND }, { 0x23F23, 0x0033, NES_SOUND }, { 0x23F56, 0x0011, NES_SOUND }, + { 0x1FF70, 0x000F, NES_SOUND }, { 0x27EF4, 0x0075, NES_SOUND }, { 0x23F67, 0x0014, NES_SOUND }, { 0x07F74, 0x000A, NES_SOUND }, { 0x2FB83, 0x00FF, NES_SOUND }, + { 0x27F69, 0x000F, NES_SOUND }, { 0x2BF70, 0x000F, NES_SOUND }, { 0x2FC82, 0x0092, NES_SOUND }, { 0x2FC82, 0x0092, NES_SOUND }, { 0x2FD14, 0x002D, NES_SOUND }, + { 0x2FD41, 0x00F8, NES_SOUND }, { 0x2FE39, 0x0016, NES_SOUND }, { 0x2FE4F, 0x0011, NES_SOUND }, { 0x2FE60, 0x004B, NES_SOUND }, { 0x2FEAB, 0x0011, NES_SOUND }, + { 0x2FEBC, 0x003B, NES_SOUND }, { 0x316FC, 0x008A, NES_SOUND }, { 0x2FEF7, 0x0011, NES_SOUND }, { 0x2FF08, 0x000F, NES_SOUND }, { 0x31786, 0x00A2, NES_SOUND }, + { 0x31828, 0x00D3, NES_SOUND }, { 0x318FB, 0x0097, NES_SOUND }, { 0x1FF70, 0x000F, NES_SOUND }, { 0x31786, 0x00A2, NES_SOUND }, { 0x31992, 0x05D1, NES_SOUND }, + { 0x31992, 0x05D1, NES_SOUND }, { 0x2FF17, 0x0011, NES_SOUND }, { 0x07F74, 0x000A, NES_SOUND }, { 0x27EF4, 0x0075, NES_SOUND }, { 0x17F32, 0x001F, NES_SOUND }, + { 0x31F63, 0x098E, NES_SOUND }, { 0x2FE60, 0x004B, NES_SOUND }, { 0x2FF28, 0x0011, NES_SOUND }, { 0x30ECA, 0x0832, NES_SOUND }, { 0x2FF39, 0x000F, NES_SOUND }, + { 0x2FF48, 0x002F, NES_SOUND }, { 0x328F1, 0x001D, NES_SOUND }, { 0x3290E, 0x0018, NES_SOUND }, { 0x32926, 0x0016, NES_SOUND }, { 0x3293C, 0x001B, NES_SOUND }, + { 0x32957, 0x0088, NES_SOUND }, { 0x329DF, 0x0065, NES_SOUND }, { 0x32A44, 0x0065, NES_SOUND }, { 0x32AA9, 0x0073, NES_SOUND }, { 0x32B1C, 0x00F9, NES_SOUND }, + { 0x32C15, 0x049E, NES_SOUND }, { 0x330B3, 0x0EA8, NES_SOUND }, { 0x34001, 0x0B18, NES_SOUND }, { 0x34B19, 0x0B9C, NES_SOUND }, { 0x356B5, 0x0C6B, NES_SOUND }, + { 0x36320, 0x0E56, NES_SOUND }, { 0x37176, 0x0C70, NES_SOUND }, { 0x38001, 0x0DEC, NES_SOUND }, { 0x38DED, 0x0B77, NES_SOUND }, { 0x39964, 0x042F, NES_SOUND }, + { 0x39D93, 0x0AC5, NES_SOUND }, { 0x3A858, 0x0BE4, NES_SOUND } +}; +static const ScummNESFile::Resource res_sounds_ger[82] = { + { 0x0BF6D, 0x000A, NES_SOUND }, { 0x30ECA, 0x0832, NES_SOUND }, { 0x30ECA, 0x0832, NES_SOUND }, { 0x30ECA, 0x0832, NES_SOUND }, { 0x30ECA, 0x0832, NES_SOUND }, + { 0x30ECA, 0x0832, NES_SOUND }, { 0x23F05, 0x0011, NES_SOUND }, { 0x2FA49, 0x0073, NES_SOUND }, { 0x23F16, 0x0011, NES_SOUND }, { 0x23F27, 0x0011, NES_SOUND }, + { 0x2FABC, 0x0056, NES_SOUND }, { 0x23F38, 0x001F, NES_SOUND }, { 0x23F57, 0x0011, NES_SOUND }, { 0x0FF76, 0x000A, NES_SOUND }, { 0x17F71, 0x000A, NES_SOUND }, + { 0x2BF2F, 0x0019, NES_SOUND }, { 0x2FB12, 0x004B, NES_SOUND }, { 0x23F68, 0x000A, NES_SOUND }, { 0x2BF48, 0x000F, NES_SOUND }, { 0x2BF57, 0x001D, NES_SOUND }, + { 0x2FB5D, 0x0045, NES_SOUND }, { 0x2FBA2, 0x000F, NES_SOUND }, { 0x2FBB1, 0x001B, NES_SOUND }, { 0x2FBCC, 0x0033, NES_SOUND }, { 0x2FBFF, 0x0011, NES_SOUND }, + { 0x2FC10, 0x000F, NES_SOUND }, { 0x2FC1F, 0x0075, NES_SOUND }, { 0x2FC94, 0x0014, NES_SOUND }, { 0x0BF6D, 0x000A, NES_SOUND }, { 0x2FCA8, 0x00FF, NES_SOUND }, + { 0x2FDA7, 0x000F, NES_SOUND }, { 0x2FDB6, 0x000F, NES_SOUND }, { 0x2FDC5, 0x0092, NES_SOUND }, { 0x2FDC5, 0x0092, NES_SOUND }, { 0x2FE57, 0x002D, NES_SOUND }, + { 0x2FE84, 0x00F8, NES_SOUND }, { 0x316FC, 0x0016, NES_SOUND }, { 0x31712, 0x0011, NES_SOUND }, { 0x31723, 0x004B, NES_SOUND }, { 0x3176E, 0x0011, NES_SOUND }, + { 0x3177F, 0x003B, NES_SOUND }, { 0x317BA, 0x008A, NES_SOUND }, { 0x31844, 0x0011, NES_SOUND }, { 0x31855, 0x000F, NES_SOUND }, { 0x31864, 0x00A2, NES_SOUND }, + { 0x31906, 0x00D3, NES_SOUND }, { 0x319D9, 0x0097, NES_SOUND }, { 0x2FC10, 0x000F, NES_SOUND }, { 0x31864, 0x00A2, NES_SOUND }, { 0x31A70, 0x05D1, NES_SOUND }, + { 0x31A70, 0x05D1, NES_SOUND }, { 0x32041, 0x0011, NES_SOUND }, { 0x0BF6D, 0x000A, NES_SOUND }, { 0x2FC1F, 0x0075, NES_SOUND }, { 0x23F38, 0x001F, NES_SOUND }, + { 0x32052, 0x098E, NES_SOUND }, { 0x31723, 0x004B, NES_SOUND }, { 0x329E0, 0x0011, NES_SOUND }, { 0x30ECA, 0x0832, NES_SOUND }, { 0x329F1, 0x000F, NES_SOUND }, + { 0x32A00, 0x002F, NES_SOUND }, { 0x32A2F, 0x001D, NES_SOUND }, { 0x32A4C, 0x0018, NES_SOUND }, { 0x32A64, 0x0016, NES_SOUND }, { 0x32A7A, 0x001B, NES_SOUND }, + { 0x32A95, 0x0088, NES_SOUND }, { 0x32B1D, 0x0065, NES_SOUND }, { 0x32B82, 0x0065, NES_SOUND }, { 0x32BE7, 0x0073, NES_SOUND }, { 0x32C5A, 0x00F9, NES_SOUND }, + { 0x32D53, 0x049E, NES_SOUND }, { 0x34001, 0x0EA8, NES_SOUND }, { 0x331F1, 0x0B18, NES_SOUND }, { 0x34EA9, 0x0B9C, NES_SOUND }, { 0x35A45, 0x0C6B, NES_SOUND }, + { 0x366B0, 0x0E56, NES_SOUND }, { 0x38001, 0x0C70, NES_SOUND }, { 0x38C71, 0x0DEC, NES_SOUND }, { 0x39A5D, 0x0B77, NES_SOUND }, { 0x37506, 0x042F, NES_SOUND }, + { 0x3A5D4, 0x0AC5, NES_SOUND }, { 0x3B099, 0x0BE4, NES_SOUND } +}; +static const ScummNESFile::Resource res_sounds_esp[82] = { + { 0x13F63, 0x000A, NES_SOUND }, { 0x2F671, 0x0832, NES_SOUND }, { 0x2F671, 0x0832, NES_SOUND }, { 0x2F671, 0x0832, NES_SOUND }, { 0x2F671, 0x0832, NES_SOUND }, + { 0x2F671, 0x0832, NES_SOUND }, { 0x13F6D, 0x0011, NES_SOUND }, { 0x1FEED, 0x0073, NES_SOUND }, { 0x17F6F, 0x0011, NES_SOUND }, { 0x1BF64, 0x0011, NES_SOUND }, + { 0x27F19, 0x0056, NES_SOUND }, { 0x1FF60, 0x001F, NES_SOUND }, { 0x27F6F, 0x0011, NES_SOUND }, { 0x1BF75, 0x000A, NES_SOUND }, { 0x2BE6F, 0x000A, NES_SOUND }, + { 0x2BE79, 0x0019, NES_SOUND }, { 0x2BE92, 0x004B, NES_SOUND }, { 0x2BEDD, 0x000A, NES_SOUND }, { 0x2BEE7, 0x000F, NES_SOUND }, { 0x2BEF6, 0x001D, NES_SOUND }, + { 0x2BF13, 0x0045, NES_SOUND }, { 0x2BF58, 0x000F, NES_SOUND }, { 0x2FEA3, 0x001B, NES_SOUND }, { 0x2FEBE, 0x0033, NES_SOUND }, { 0x2BF67, 0x0011, NES_SOUND }, + { 0x2FEF1, 0x000F, NES_SOUND }, { 0x2FF00, 0x0075, NES_SOUND }, { 0x30ECA, 0x0014, NES_SOUND }, { 0x13F63, 0x000A, NES_SOUND }, { 0x30EDE, 0x00FF, NES_SOUND }, + { 0x30FDD, 0x000F, NES_SOUND }, { 0x30FEC, 0x000F, NES_SOUND }, { 0x30FFB, 0x0092, NES_SOUND }, { 0x30FFB, 0x0092, NES_SOUND }, { 0x3108D, 0x002D, NES_SOUND }, + { 0x310BA, 0x00F8, NES_SOUND }, { 0x311B2, 0x0016, NES_SOUND }, { 0x311C8, 0x0011, NES_SOUND }, { 0x311D9, 0x004B, NES_SOUND }, { 0x31224, 0x0011, NES_SOUND }, + { 0x31235, 0x003B, NES_SOUND }, { 0x31270, 0x008A, NES_SOUND }, { 0x312FA, 0x0011, NES_SOUND }, { 0x3130B, 0x000F, NES_SOUND }, { 0x3131A, 0x00A2, NES_SOUND }, + { 0x313BC, 0x00D3, NES_SOUND }, { 0x3148F, 0x0097, NES_SOUND }, { 0x2FEF1, 0x000F, NES_SOUND }, { 0x3131A, 0x00A2, NES_SOUND }, { 0x31526, 0x05D1, NES_SOUND }, + { 0x31526, 0x05D1, NES_SOUND }, { 0x31AF7, 0x0011, NES_SOUND }, { 0x13F63, 0x000A, NES_SOUND }, { 0x2FF00, 0x0075, NES_SOUND }, { 0x1FF60, 0x001F, NES_SOUND }, + { 0x31B08, 0x098E, NES_SOUND }, { 0x311D9, 0x004B, NES_SOUND }, { 0x32496, 0x0011, NES_SOUND }, { 0x2F671, 0x0832, NES_SOUND }, { 0x324A7, 0x000F, NES_SOUND }, + { 0x324B6, 0x002F, NES_SOUND }, { 0x324E5, 0x001D, NES_SOUND }, { 0x32502, 0x0018, NES_SOUND }, { 0x3251A, 0x0016, NES_SOUND }, { 0x32530, 0x001B, NES_SOUND }, + { 0x3254B, 0x0088, NES_SOUND }, { 0x325D3, 0x0065, NES_SOUND }, { 0x32638, 0x0065, NES_SOUND }, { 0x3269D, 0x0073, NES_SOUND }, { 0x32710, 0x00F9, NES_SOUND }, + { 0x32809, 0x049E, NES_SOUND }, { 0x32CA7, 0x0EA8, NES_SOUND }, { 0x34001, 0x0B18, NES_SOUND }, { 0x34B19, 0x0B9C, NES_SOUND }, { 0x356B5, 0x0C6B, NES_SOUND }, + { 0x36320, 0x0E56, NES_SOUND }, { 0x37176, 0x0C70, NES_SOUND }, { 0x38001, 0x0DEC, NES_SOUND }, { 0x38DED, 0x0B77, NES_SOUND }, { 0x33B4F, 0x042F, NES_SOUND }, + { 0x39964, 0x0AC5, NES_SOUND }, { 0x3A429, 0x0BE4, NES_SOUND } +}; + +static const ScummNESFile::Resource *res_sounds[ScummNESFile::kROMsetNum] = { + res_sounds_usa, + res_sounds_eur, + res_sounds_swe, + res_sounds_fra, + res_sounds_ger, + res_sounds_esp, +}; + +static const ScummNESFile::Resource res_costumes_usa[25] = { + { 0x17F05, 0x0055, NES_COSTUME }, { 0x17F05, 0x0055, NES_COSTUME }, { 0x17F05, 0x0055, NES_COSTUME }, { 0x17F05, 0x0055, NES_COSTUME }, { 0x17F05, 0x0055, NES_COSTUME }, + { 0x17F05, 0x0055, NES_COSTUME }, { 0x17F05, 0x0055, NES_COSTUME }, { 0x17F05, 0x0055, NES_COSTUME }, { 0x13FAB, 0x004B, NES_COSTUME }, { 0x17F05, 0x0055, NES_COSTUME }, + { 0x17F05, 0x0055, NES_COSTUME }, { 0x17F05, 0x0055, NES_COSTUME }, { 0x17F5A, 0x0036, NES_COSTUME }, { 0x17F90, 0x003A, NES_COSTUME }, { 0x17F90, 0x003A, NES_COSTUME }, + { 0x17F05, 0x0055, NES_COSTUME }, { 0x1BF87, 0x003B, NES_COSTUME }, { 0x17F05, 0x0055, NES_COSTUME }, { 0x23FA9, 0x0045, NES_COSTUME }, { 0x1FFBD, 0x0040, NES_COSTUME }, + { 0x1BFC2, 0x003C, NES_COSTUME }, { 0x17F90, 0x003A, NES_COSTUME }, { 0x17F90, 0x003A, NES_COSTUME }, { 0x17F05, 0x0055, NES_COSTUME }, { 0x13FAB, 0x004B, NES_COSTUME } +}; +static const ScummNESFile::Resource res_costumes_eur[25] = { + { 0x0BEFF, 0x0055, NES_COSTUME }, { 0x0BEFF, 0x0055, NES_COSTUME }, { 0x0BEFF, 0x0055, NES_COSTUME }, { 0x0BEFF, 0x0055, NES_COSTUME }, { 0x0BEFF, 0x0055, NES_COSTUME }, + { 0x0BEFF, 0x0055, NES_COSTUME }, { 0x0BEFF, 0x0055, NES_COSTUME }, { 0x0BEFF, 0x0055, NES_COSTUME }, { 0x0FEA2, 0x004B, NES_COSTUME }, { 0x0BEFF, 0x0055, NES_COSTUME }, + { 0x0BEFF, 0x0055, NES_COSTUME }, { 0x0BEFF, 0x0055, NES_COSTUME }, { 0x0FEED, 0x0036, NES_COSTUME }, { 0x0FF23, 0x003A, NES_COSTUME }, { 0x0FF23, 0x003A, NES_COSTUME }, + { 0x0BEFF, 0x0055, NES_COSTUME }, { 0x13F13, 0x003B, NES_COSTUME }, { 0x0BEFF, 0x0055, NES_COSTUME }, { 0x23F2F, 0x0045, NES_COSTUME }, { 0x1FF3E, 0x0040, NES_COSTUME }, + { 0x27E8F, 0x003C, NES_COSTUME }, { 0x0FF23, 0x003A, NES_COSTUME }, { 0x0FF23, 0x003A, NES_COSTUME }, { 0x0BEFF, 0x0055, NES_COSTUME }, { 0x0FEA2, 0x004B, NES_COSTUME } +}; +static const ScummNESFile::Resource res_costumes_swe[25] = { + { 0x0FEF5, 0x0055, NES_COSTUME }, { 0x0FEF5, 0x0055, NES_COSTUME }, { 0x0FEF5, 0x0055, NES_COSTUME }, { 0x0FEF5, 0x0055, NES_COSTUME }, { 0x0FEF5, 0x0055, NES_COSTUME }, + { 0x0FEF5, 0x0055, NES_COSTUME }, { 0x0FEF5, 0x0055, NES_COSTUME }, { 0x0FEF5, 0x0055, NES_COSTUME }, { 0x17E9A, 0x004B, NES_COSTUME }, { 0x0FEF5, 0x0055, NES_COSTUME }, + { 0x0FEF5, 0x0055, NES_COSTUME }, { 0x0FEF5, 0x0055, NES_COSTUME }, { 0x0FF4A, 0x0036, NES_COSTUME }, { 0x17EE5, 0x003A, NES_COSTUME }, { 0x17EE5, 0x003A, NES_COSTUME }, + { 0x0FEF5, 0x0055, NES_COSTUME }, { 0x17F1F, 0x003B, NES_COSTUME }, { 0x0FEF5, 0x0055, NES_COSTUME }, { 0x1BE94, 0x0045, NES_COSTUME }, { 0x1BED9, 0x0040, NES_COSTUME }, + { 0x1BF19, 0x003C, NES_COSTUME }, { 0x17EE5, 0x003A, NES_COSTUME }, { 0x17EE5, 0x003A, NES_COSTUME }, { 0x0FEF5, 0x0055, NES_COSTUME }, { 0x17E9A, 0x004B, NES_COSTUME } +}; +static const ScummNESFile::Resource res_costumes_fra[25] = { + { 0x0BF17, 0x0055, NES_COSTUME }, { 0x0BF17, 0x0055, NES_COSTUME }, { 0x0BF17, 0x0055, NES_COSTUME }, { 0x0BF17, 0x0055, NES_COSTUME }, { 0x0BF17, 0x0055, NES_COSTUME }, + { 0x0BF17, 0x0055, NES_COSTUME }, { 0x0BF17, 0x0055, NES_COSTUME }, { 0x0BF17, 0x0055, NES_COSTUME }, { 0x13E77, 0x004B, NES_COSTUME }, { 0x0BF17, 0x0055, NES_COSTUME }, + { 0x0BF17, 0x0055, NES_COSTUME }, { 0x0BF17, 0x0055, NES_COSTUME }, { 0x07F3E, 0x0036, NES_COSTUME }, { 0x13EC2, 0x003A, NES_COSTUME }, { 0x13EC2, 0x003A, NES_COSTUME }, + { 0x0BF17, 0x0055, NES_COSTUME }, { 0x13EFC, 0x003B, NES_COSTUME }, { 0x0BF17, 0x0055, NES_COSTUME }, { 0x13F37, 0x0045, NES_COSTUME }, { 0x17E94, 0x0040, NES_COSTUME }, + { 0x17ED4, 0x003C, NES_COSTUME }, { 0x13EC2, 0x003A, NES_COSTUME }, { 0x13EC2, 0x003A, NES_COSTUME }, { 0x0BF17, 0x0055, NES_COSTUME }, { 0x13E77, 0x004B, NES_COSTUME } +}; +static const ScummNESFile::Resource res_costumes_ger[25] = { + { 0x0FEEB, 0x0055, NES_COSTUME }, { 0x0FEEB, 0x0055, NES_COSTUME }, { 0x0FEEB, 0x0055, NES_COSTUME }, { 0x0FEEB, 0x0055, NES_COSTUME }, { 0x0FEEB, 0x0055, NES_COSTUME }, + { 0x0FEEB, 0x0055, NES_COSTUME }, { 0x0FEEB, 0x0055, NES_COSTUME }, { 0x0FEEB, 0x0055, NES_COSTUME }, { 0x17E6C, 0x004B, NES_COSTUME }, { 0x0FEEB, 0x0055, NES_COSTUME }, + { 0x0FEEB, 0x0055, NES_COSTUME }, { 0x0FEEB, 0x0055, NES_COSTUME }, { 0x0FF40, 0x0036, NES_COSTUME }, { 0x17EB7, 0x003A, NES_COSTUME }, { 0x17EB7, 0x003A, NES_COSTUME }, + { 0x0FEEB, 0x0055, NES_COSTUME }, { 0x17EF1, 0x003B, NES_COSTUME }, { 0x0FEEB, 0x0055, NES_COSTUME }, { 0x17F2C, 0x0045, NES_COSTUME }, { 0x1FEFD, 0x0040, NES_COSTUME }, + { 0x1FF3D, 0x003C, NES_COSTUME }, { 0x17EB7, 0x003A, NES_COSTUME }, { 0x17EB7, 0x003A, NES_COSTUME }, { 0x0FEEB, 0x0055, NES_COSTUME }, { 0x17E6C, 0x004B, NES_COSTUME } +}; +static const ScummNESFile::Resource res_costumes_esp[25] = { + { 0x0FEF1, 0x0055, NES_COSTUME }, { 0x0FEF1, 0x0055, NES_COSTUME }, { 0x0FEF1, 0x0055, NES_COSTUME }, { 0x0FEF1, 0x0055, NES_COSTUME }, { 0x0FEF1, 0x0055, NES_COSTUME }, + { 0x0FEF1, 0x0055, NES_COSTUME }, { 0x0FEF1, 0x0055, NES_COSTUME }, { 0x0FEF1, 0x0055, NES_COSTUME }, { 0x13EA3, 0x004B, NES_COSTUME }, { 0x0FEF1, 0x0055, NES_COSTUME }, + { 0x0FEF1, 0x0055, NES_COSTUME }, { 0x0FEF1, 0x0055, NES_COSTUME }, { 0x0FF46, 0x0036, NES_COSTUME }, { 0x13EEE, 0x003A, NES_COSTUME }, { 0x13EEE, 0x003A, NES_COSTUME }, + { 0x0FEF1, 0x0055, NES_COSTUME }, { 0x13F28, 0x003B, NES_COSTUME }, { 0x0FEF1, 0x0055, NES_COSTUME }, { 0x17F2A, 0x0045, NES_COSTUME }, { 0x1FE71, 0x0040, NES_COSTUME }, + { 0x1FEB1, 0x003C, NES_COSTUME }, { 0x13EEE, 0x003A, NES_COSTUME }, { 0x13EEE, 0x003A, NES_COSTUME }, { 0x0FEF1, 0x0055, NES_COSTUME }, { 0x13EA3, 0x004B, NES_COSTUME } +}; + +static const ScummNESFile::Resource *res_costumes[ScummNESFile::kROMsetNum] = { + res_costumes_usa, + res_costumes_eur, + res_costumes_swe, + res_costumes_fra, + res_costumes_ger, + res_costumes_esp, +}; + +static const ScummNESFile::Resource res_globdata_usa[1] = { { 0x2CA11, 0x0307, NES_GLOBDATA } }; +static const ScummNESFile::Resource res_globdata_eur[1] = { { 0x2CA11, 0x0307, NES_GLOBDATA } }; +static const ScummNESFile::Resource res_globdata_swe[1] = { { 0x2C001, 0x0307, NES_GLOBDATA } }; +static const ScummNESFile::Resource res_globdata_fra[1] = { { 0x2C628, 0x0307, NES_GLOBDATA } }; +static const ScummNESFile::Resource res_globdata_ger[1] = { { 0x2C4EE, 0x0307, NES_GLOBDATA } }; +static const ScummNESFile::Resource res_globdata_esp[1] = { { 0x2C001, 0x0307, NES_GLOBDATA } }; + +static const ScummNESFile::Resource *res_globdata[ScummNESFile::kROMsetNum] = { + res_globdata_usa, + res_globdata_eur, + res_globdata_swe, + res_globdata_fra, + res_globdata_ger, + res_globdata_esp, +}; + +// sprite palette data +static const ScummNESFile::Resource res_sprpals_usa[2] = { { 0x0BFC1, 0x0010, NES_SPRPALS }, { 0x0BFD1, 0x0010, NES_SPRPALS } }; +static const ScummNESFile::Resource res_sprpals_eur[2] = { { 0x07F61, 0x0010, NES_SPRPALS }, { 0x0BEB2, 0x0010, NES_SPRPALS } }; +static const ScummNESFile::Resource res_sprpals_swe[2] = { { 0x07F55, 0x0010, NES_SPRPALS }, { 0x07F65, 0x0010, NES_SPRPALS } }; +static const ScummNESFile::Resource res_sprpals_fra[2] = { { 0x07ED8, 0x0010, NES_SPRPALS }, { 0x07EE8, 0x0010, NES_SPRPALS } }; +static const ScummNESFile::Resource res_sprpals_ger[2] = { { 0x07F6B, 0x0010, NES_SPRPALS }, { 0x0BF17, 0x0010, NES_SPRPALS } }; +static const ScummNESFile::Resource res_sprpals_esp[2] = { { 0x0BF15, 0x0010, NES_SPRPALS }, { 0x0BF25, 0x0010, NES_SPRPALS } }; + +static const ScummNESFile::Resource *res_sprpals[ScummNESFile::kROMsetNum] = { + res_sprpals_usa, + res_sprpals_eur, + res_sprpals_swe, + res_sprpals_fra, + res_sprpals_ger, + res_sprpals_esp, +}; + +// associates costume IDs with sprite sets (indexes into SPRLENS/SPROFFS) +static const ScummNESFile::Resource res_sprdesc_usa[2] = { { 0x0FFB7, 0x0031, NES_SPRDESC }, { 0x0BFE1, 0x0009, NES_SPRDESC } }; +static const ScummNESFile::Resource res_sprdesc_eur[2] = { { 0x0BEC2, 0x0031, NES_SPRDESC }, { 0x07F71, 0x0009, NES_SPRDESC } }; +static const ScummNESFile::Resource res_sprdesc_swe[2] = { { 0x0BF1B, 0x0031, NES_SPRDESC }, { 0x07F75, 0x0009, NES_SPRDESC } }; +static const ScummNESFile::Resource res_sprdesc_fra[2] = { { 0x07EF8, 0x0031, NES_SPRDESC }, { 0x07F29, 0x0009, NES_SPRDESC } }; +static const ScummNESFile::Resource res_sprdesc_ger[2] = { { 0x0BF27, 0x0031, NES_SPRDESC }, { 0x0BF58, 0x0009, NES_SPRDESC } }; +static const ScummNESFile::Resource res_sprdesc_esp[2] = { { 0x0BF35, 0x0031, NES_SPRDESC }, { 0x0BF66, 0x0009, NES_SPRDESC } }; + +static const ScummNESFile::Resource *res_sprdesc[ScummNESFile::kROMsetNum] = { + res_sprdesc_usa, + res_sprdesc_eur, + res_sprdesc_swe, + res_sprdesc_fra, + res_sprdesc_ger, + res_sprdesc_esp, +}; + +// number of sprites in each set (indicates length within SPRDATA) +static const ScummNESFile::Resource res_sprlens_usa[2] = { { 0x0FEA2, 0x0115, NES_SPRLENS }, { 0x07FF5, 0x0006, NES_SPRLENS } }; +static const ScummNESFile::Resource res_sprlens_eur[2] = { { 0x1BE32, 0x0115, NES_SPRLENS }, { 0x07F5B, 0x0006, NES_SPRLENS } }; +static const ScummNESFile::Resource res_sprlens_swe[2] = { { 0x13E6A, 0x0115, NES_SPRLENS }, { 0x07F4F, 0x0006, NES_SPRLENS } }; +static const ScummNESFile::Resource res_sprlens_fra[2] = { { 0x0FE61, 0x0115, NES_SPRLENS }, { 0x07ED2, 0x0006, NES_SPRLENS } }; +static const ScummNESFile::Resource res_sprlens_ger[2] = { { 0x2BE1A, 0x0115, NES_SPRLENS }, { 0x07F65, 0x0006, NES_SPRLENS } }; +static const ScummNESFile::Resource res_sprlens_esp[2] = { { 0x2EFE1, 0x0115, NES_SPRLENS }, { 0x07F7A, 0x0006, NES_SPRLENS } }; + +static const ScummNESFile::Resource *res_sprlens[ScummNESFile::kROMsetNum] = { + res_sprlens_usa, + res_sprlens_eur, + res_sprlens_swe, + res_sprlens_fra, + res_sprlens_ger, + res_sprlens_esp, +}; + +// offset of each sprite set (indexes into SPRDATA) +static const ScummNESFile::Resource res_sproffs_usa[2] = { { 0x2BDC5, 0x022A, NES_SPROFFS }, { 0x0BFEA, 0x000C, NES_SPROFFS } }; +static const ScummNESFile::Resource res_sproffs_eur[2] = { { 0x2FD42, 0x022A, NES_SPROFFS }, { 0x0BEF3, 0x000C, NES_SPROFFS } }; +static const ScummNESFile::Resource res_sproffs_swe[2] = { { 0x2BCE0, 0x022A, NES_SPROFFS }, { 0x0BF4C, 0x000C, NES_SPROFFS } }; +static const ScummNESFile::Resource res_sproffs_fra[2] = { { 0x2F959, 0x022A, NES_SPROFFS }, { 0x07F32, 0x000C, NES_SPROFFS } }; +static const ScummNESFile::Resource res_sproffs_ger[2] = { { 0x2F81F, 0x022A, NES_SPROFFS }, { 0x0BF61, 0x000C, NES_SPROFFS } }; +static const ScummNESFile::Resource res_sproffs_esp[2] = { { 0x2F447, 0x022A, NES_SPROFFS }, { 0x0BF6F, 0x000C, NES_SPROFFS } }; + +static const ScummNESFile::Resource *res_sproffs[ScummNESFile::kROMsetNum] = { + res_sproffs_usa, + res_sproffs_eur, + res_sproffs_swe, + res_sproffs_fra, + res_sproffs_ger, + res_sproffs_esp, +}; + +// sprite data sets (packed NES sprite data) +static const ScummNESFile::Resource res_sprdata_usa[2] = { { 0x2CE11, 0x2BE0, NES_SPRDATA }, { 0x07F6B, 0x008A, NES_SPRDATA } }; +static const ScummNESFile::Resource res_sprdata_eur[2] = { { 0x2CE11, 0x2BE0, NES_SPRDATA }, { 0x0BE28, 0x008A, NES_SPRDATA } }; +static const ScummNESFile::Resource res_sprdata_swe[2] = { { 0x2C401, 0x2BE0, NES_SPRDATA }, { 0x0FE6B, 0x008A, NES_SPRDATA } }; +static const ScummNESFile::Resource res_sprdata_fra[2] = { { 0x2CA28, 0x2BE0, NES_SPRDATA }, { 0x07E48, 0x008A, NES_SPRDATA } }; +static const ScummNESFile::Resource res_sprdata_ger[2] = { { 0x2C8EE, 0x2BE0, NES_SPRDATA }, { 0x0FE61, 0x008A, NES_SPRDATA } }; +static const ScummNESFile::Resource res_sprdata_esp[2] = { { 0x2C401, 0x2BE0, NES_SPRDATA }, { 0x0FE67, 0x008A, NES_SPRDATA } }; +static const ScummNESFile::Resource *res_sprdata[ScummNESFile::kROMsetNum] = { + res_sprdata_usa, + res_sprdata_eur, + res_sprdata_swe, + res_sprdata_fra, + res_sprdata_ger, + res_sprdata_esp, +}; + +static const ScummNESFile::Resource res_charset_usa[1] = { { 0x3F6EE, 0x0090, NES_CHARSET } }; +static const ScummNESFile::Resource res_charset_eur[1] = { { 0x3F724, 0x0090, NES_CHARSET } }; +static const ScummNESFile::Resource res_charset_swe[1] = { { 0x3F739, 0x0090, NES_CHARSET } }; +static const ScummNESFile::Resource res_charset_fra[1] = { { 0x3F739, 0x0090, NES_CHARSET } }; +static const ScummNESFile::Resource res_charset_ger[1] = { { 0x3F739, 0x0090, NES_CHARSET } }; +static const ScummNESFile::Resource res_charset_esp[1] = { { 0x3F739, 0x0090, NES_CHARSET } }; + +static const ScummNESFile::Resource *res_charset[ScummNESFile::kROMsetNum] = { + res_charset_usa, + res_charset_eur, + res_charset_swe, + res_charset_fra, + res_charset_ger, + res_charset_esp, +}; + +static const ScummNESFile::Resource res_preplist_usa[1] = { { 0x3FB5A, 0x000E, NES_PREPLIST } }; +static const ScummNESFile::Resource res_preplist_eur[1] = { { 0x3FB90, 0x000E, NES_PREPLIST } }; +static const ScummNESFile::Resource res_preplist_swe[1] = { { 0x3FBA9, 0x000E, NES_PREPLIST } }; +static const ScummNESFile::Resource res_preplist_fra[1] = { { 0x3FBAF, 0x0010, NES_PREPLIST } }; +static const ScummNESFile::Resource res_preplist_ger[1] = { { 0x3FBAB, 0x000F, NES_PREPLIST } }; +static const ScummNESFile::Resource res_preplist_esp[1] = { { 0x3FBAE, 0x000F, NES_PREPLIST } }; + +static const ScummNESFile::Resource *res_preplist[ScummNESFile::kROMsetNum] = { + res_preplist_usa, + res_preplist_eur, + res_preplist_swe, + res_preplist_fra, + res_preplist_ger, + res_preplist_esp, +}; + +static uint16 write_byte(Common::WriteStream *out, byte val) { + val ^= 0xFF; + if (out != 0) + out->writeByte(val); + return 1; +} + +static uint16 write_word(Common::WriteStream *out, uint16 val) { + val ^= 0xFFFF; + if (out != 0) + out->writeUint16LE(val); + return 2; +} + +byte ScummNESFile::fileReadByte() { + byte b = 0; + File::read(&b, 1); + return b; +} + +uint16 ScummNESFile::fileReadUint16LE() { + uint16 a = fileReadByte(); + uint16 b = fileReadByte(); + return a | (b << 8); +} + +uint16 ScummNESFile::extractResource(Common::WriteStream *output, const Resource *res) { + uint16 len, i, j; + byte val; + byte cnt; + uint16 reslen = 0; + + if (res == NULL) + error("extract_resource - no resource specified"); + + if ((res->offset == 0) && (res->length == 0)) + return 0; /* there are 8 scripts that are zero bytes long, so we should skip them */ + + File::seek(res->offset,SEEK_SET); + + switch (res->type) { + case NES_GLOBDATA: + len = res->length; + + for (i = 0; i < len; i++) + reslen += write_byte(output, fileReadByte()); + + break; + + case NES_ROOMGFX: + case NES_COSTUMEGFX: + reslen += write_word(output, (uint16)(res->length + 2)); + len = fileReadByte(); + reslen += write_byte(output, (byte)len); + + if (!len) + len = 256; + len = len << 4; + + for (i = 0; i < len;) { + reslen += write_byte(output, cnt = fileReadByte()); + for (j = 0; j < (cnt & 0x7F); j++, i++) + if ((cnt & 0x80) || (j == 0)) + reslen += write_byte(output, fileReadByte()); + } + + if (File::pos() - res->offset != res->length) + error("extract_resource - length mismatch while extracting graphics resource (was %04X, should be %04X)", File::pos() - res->offset, res->length); + + break; + + case NES_ROOM: + case NES_SCRIPT: + len = fileReadUint16LE(); + + if (len != res->length) + error("extract_resource - length mismatch while extracting room/script resource (was %04X, should be %04X)", len, res->length); + + File::seek(-2, SEEK_CUR); + + for (i = 0; i < len; i++) + reslen += write_byte(output, fileReadByte()); + + break; + + case NES_SOUND: + len = res->length + 2; + val = fileReadByte(); + cnt = fileReadByte(); + + if ((val == 2) && (cnt == 100)) { + reslen += write_word(output, len); + reslen += write_byte(output, val); + reslen += write_byte(output, cnt); + + cnt = fileReadByte(); + reslen += write_byte(output, cnt); + for (i = 0; i < cnt; i++) + reslen += write_byte(output, fileReadByte()); + for (i = 0; i < cnt; i++) + reslen += write_byte(output, fileReadByte()); + + while (1) { + reslen += write_byte(output, val = fileReadByte()); + if (val >= 0xFE) + break; + } + } else if (((val == 0) || (val == 1) || (val == 4)) && (cnt == 10)) { + reslen += write_word(output, len); + reslen += write_byte(output, val); + reslen += write_byte(output, cnt); + while (1) { + reslen += write_byte(output, val = fileReadByte()); + + if (val >= 0xFE) + break; + + if (val >= 0x10) + reslen += write_byte(output, fileReadByte()); + else { + reslen += write_byte(output, fileReadByte()); + reslen += write_byte(output, fileReadByte()); + reslen += write_byte(output, fileReadByte()); + reslen += write_byte(output, fileReadByte()); + } + } + } else + error("extract_resource - unknown sound type %d/%d detected",val,cnt); + + if (File::pos() - res->offset != res->length) + error("extract_resource - length mismatch while extracting sound resource (was %04X, should be %04X)", File::pos() - res->offset, res->length); + + break; + + case NES_COSTUME: + case NES_SPRPALS: + case NES_SPRDESC: + case NES_SPRLENS: + case NES_SPROFFS: + case NES_SPRDATA: + case NES_CHARSET: + len = res->length; + reslen += write_word(output, (uint16)(len + 2)); + + for (i = 0; i < len; i++) + reslen += write_byte(output, fileReadByte()); + + break; + + case NES_PREPLIST: + len = res->length; + reslen += write_word(output, 0x002A); + + reslen += write_byte(output, ' '); + for (i = 1; i < 8; i++) + reslen += write_byte(output, 0); + + for (j = 0; j < 4; j++) { + reslen += write_byte(output,' '); + for (i = 1; (val = fileReadByte()); i++) + reslen += write_byte(output, val); + for (; i < 8; i++) + reslen += write_byte(output, 0); + } + break; + + default: + error("extract_resource - unknown resource type %d specified!", res->type); + } + + return reslen; +} + +struct ScummNESFile::LFLEntry { + const Resource **type; + int index; +}; + +// based on structure of Classic PC Maniac Mansion LFL files +// (roomgfx resources are arranged in order, one per file, +// after the room blocks) +static const ScummNESFile::LFLEntry lfl_01[] = { {res_rooms, 1}, {res_roomgfx, 1}, {res_scripts, 57}, {res_scripts, 61}, {res_scripts, 76}, {res_scripts, 105}, {res_scripts, 111}, {res_sounds, 5}, {res_scripts, 132}, {res_scripts, 148}, {res_scripts, 155}, {res_scripts, 156}, {res_sounds, 39}, {NULL, 0} }; +static const ScummNESFile::LFLEntry lfl_02[] = { {res_rooms, 2}, {res_roomgfx, 2}, {NULL, 0} }; +static const ScummNESFile::LFLEntry lfl_03[] = { {res_rooms, 3}, {res_roomgfx, 3}, {res_scripts, 21}, {res_sounds, 26}, {NULL, 0} }; +static const ScummNESFile::LFLEntry lfl_04[] = { {res_rooms, 4}, {res_roomgfx, 4}, {res_scripts, 46}, {res_scripts, 56}, {res_scripts, 137}, {res_scripts, 146}, {res_sounds, 12}, {res_sounds, 11}, {res_sounds, 13}, {res_sounds, 42}, {NULL, 0} }; +static const ScummNESFile::LFLEntry lfl_05[] = { {res_rooms, 5}, {res_roomgfx, 5}, {res_scripts, 30}, {res_scripts, 31}, {res_scripts, 32}, {res_scripts, 33}, {res_scripts, 34}, {res_scripts, 35}, {res_sounds, 22}, {res_sounds, 23}, {res_sounds, 24}, {res_sounds, 21}, {res_sounds, 46}, {NULL, 0} }; +static const ScummNESFile::LFLEntry lfl_06[] = { {res_rooms, 6}, {res_roomgfx, 6}, {NULL, 0} }; +static const ScummNESFile::LFLEntry lfl_07[] = { {res_rooms, 7}, {res_roomgfx, 7}, {res_scripts, 17}, {res_scripts, 58}, {res_scripts, 59}, {res_scripts, 60}, {res_scripts, 74}, {res_scripts, 81}, {res_scripts, 82}, {res_scripts, 150}, {res_sounds, 14}, {res_sounds, 15}, {res_sounds, 16}, {res_sounds, 17}, {NULL, 0} }; +static const ScummNESFile::LFLEntry lfl_08[] = { {res_rooms, 8}, {res_roomgfx, 8}, {res_scripts, 7}, {res_scripts, 12}, {res_scripts, 13}, {res_scripts, 47}, {res_scripts, 48}, {res_scripts, 49}, {res_scripts, 154}, {res_sounds, 32}, {res_sounds, 33}, {res_sounds, 36}, {NULL, 0} }; +static const ScummNESFile::LFLEntry lfl_09[] = { {res_rooms, 9}, {res_roomgfx, 9}, {res_scripts, 10}, {res_scripts, 11}, {res_scripts, 45}, {res_scripts, 55}, {res_scripts, 84}, {res_scripts, 85}, {res_scripts, 86}, {NULL, 0} }; +static const ScummNESFile::LFLEntry lfl_10[] = { {res_rooms, 10}, {res_roomgfx, 10}, {res_scripts, 24}, {res_scripts, 149}, {res_sounds, 28}, {NULL, 0} }; +static const ScummNESFile::LFLEntry lfl_11[] = { {res_rooms, 11}, {res_roomgfx, 11}, {res_scripts, 166}, {res_scripts, 167}, {res_scripts, 168}, {NULL, 0} }; +static const ScummNESFile::LFLEntry lfl_12[] = { {res_rooms, 12}, {res_roomgfx, 12}, {res_scripts, 51}, {res_scripts, 103}, {res_scripts, 104}, {res_scripts, 161}, {res_sounds, 63}, {res_costumes, 14}, {NULL, 0} }; +static const ScummNESFile::LFLEntry lfl_13[] = { {res_rooms, 13}, {res_roomgfx, 13}, {NULL, 0} }; +static const ScummNESFile::LFLEntry lfl_14[] = { {res_rooms, 14}, {res_roomgfx, 14}, {NULL, 0} }; +static const ScummNESFile::LFLEntry lfl_15[] = { {res_rooms, 15}, {res_roomgfx, 15}, {res_sounds, 27}, {NULL, 0} }; +static const ScummNESFile::LFLEntry lfl_16[] = { {res_rooms, 16}, {res_roomgfx, 16}, {res_scripts, 14}, {res_scripts, 121}, {res_scripts, 122}, {res_sounds, 40}, {res_sounds, 64}, {res_sounds, 68}, {NULL, 0} }; +static const ScummNESFile::LFLEntry lfl_17[] = { {res_rooms, 17}, {res_roomgfx, 17}, {res_scripts, 20}, {res_scripts, 100}, {res_sounds, 25}, {res_sounds, 44}, {res_sounds, 2}, {res_sounds, 50}, {res_sounds, 52}, {NULL, 0} }; +static const ScummNESFile::LFLEntry lfl_18[] = { {res_rooms, 18}, {res_roomgfx, 18}, {res_scripts, 25}, {res_scripts, 26}, {res_scripts, 27}, {res_scripts, 28}, {res_scripts, 64}, {res_scripts, 65}, {res_scripts, 66}, {res_scripts, 67}, {res_scripts, 68}, {res_scripts, 69}, {res_scripts, 70}, {res_scripts, 71}, {res_scripts, 73}, {res_scripts, 101}, {res_sounds, 35}, {NULL, 0} }; +static const ScummNESFile::LFLEntry lfl_19[] = { {res_rooms, 19}, {res_roomgfx, 19}, {res_scripts, 36}, {res_scripts, 37}, {res_scripts, 38}, {res_scripts, 39}, {res_scripts, 40}, {res_scripts, 152}, {res_scripts, 153}, {res_costumes, 10}, {NULL, 0} }; +static const ScummNESFile::LFLEntry lfl_20[] = { {res_rooms, 20}, {res_roomgfx, 20}, {res_scripts, 107}, {res_scripts, 108}, {res_scripts, 109}, {res_scripts, 110}, {res_scripts, 159}, {NULL, 0} }; +static const ScummNESFile::LFLEntry lfl_21[] = { {res_rooms, 21}, {res_roomgfx, 21}, {res_scripts, 41}, {res_scripts, 42}, {res_scripts, 43}, {res_scripts, 53}, {res_scripts, 136}, {res_sounds, 29}, {res_sounds, 20}, {res_sounds, 37}, {NULL, 0} }; +static const ScummNESFile::LFLEntry lfl_22[] = { {res_rooms, 22}, {res_roomgfx, 22}, {res_scripts, 15}, {NULL, 0} }; +static const ScummNESFile::LFLEntry lfl_23[] = { {res_rooms, 23}, {res_roomgfx, 23}, {res_scripts, 77}, {res_scripts, 79}, {res_scripts, 80}, {res_scripts, 83}, {res_sounds, 41}, {NULL, 0} }; +static const ScummNESFile::LFLEntry lfl_24[] = { {res_rooms, 24}, {res_roomgfx, 24}, {res_scripts, 18}, {res_scripts, 19}, {res_scripts, 78}, {res_sounds, 7}, {res_sounds, 3}, {res_sounds, 18}, {res_sounds, 34}, {res_costumes, 12}, {NULL, 0} }; +static const ScummNESFile::LFLEntry lfl_25[] = { {res_rooms, 25}, {res_roomgfx, 25}, {res_scripts, 29}, {res_sounds, 30}, {res_sounds, 31}, {NULL, 0} }; +static const ScummNESFile::LFLEntry lfl_26[] = { {res_rooms, 26}, {res_roomgfx, 26}, {res_scripts, 87}, {res_scripts, 88}, {res_scripts, 89}, {res_scripts, 90}, {res_scripts, 91}, {res_scripts, 92}, {res_scripts, 93}, {res_scripts, 94}, {res_scripts, 95}, {res_scripts, 96}, {res_scripts, 97}, {res_scripts, 98}, {res_scripts, 116}, {res_scripts, 151}, {res_scripts, 174}, {res_costumes, 11}, {NULL, 0} }; +static const ScummNESFile::LFLEntry lfl_27[] = { {res_rooms, 27}, {res_roomgfx, 27}, {res_scripts, 16}, {res_scripts, 52}, {res_scripts, 54}, {res_scripts, 113}, {res_sounds, 45}, {res_costumes, 19}, {NULL, 0} }; +static const ScummNESFile::LFLEntry lfl_28[] = { {res_rooms, 28}, {res_roomgfx, 28}, {res_scripts, 22}, {res_scripts, 23}, {NULL, 0} }; +static const ScummNESFile::LFLEntry lfl_29[] = { {res_rooms, 29}, {res_roomgfx, 29}, {res_scripts, 75}, {res_sounds, 43}, {NULL, 0} }; +static const ScummNESFile::LFLEntry lfl_30[] = { {res_rooms, 30}, {res_roomgfx, 30}, {res_scripts, 63}, {res_sounds, 0}, {res_scripts, 123}, {res_scripts, 125}, {res_scripts, 126}, {res_scripts, 127}, {res_scripts, 129}, {res_sounds, 55}, {res_sounds, 59}, {res_sounds, 60}, {res_costumes, 8}, {NULL, 0} }; +static const ScummNESFile::LFLEntry lfl_31[] = { {res_rooms, 31}, {res_roomgfx, 31}, {res_scripts, 99}, {res_scripts, 115}, {res_scripts, 117}, {res_scripts, 119}, {res_scripts, 147}, {res_scripts, 157}, {res_scripts, 158}, {res_scripts, 160}, {res_costumes, 13}, {res_costumes, 9}, {res_costumes, 23}, {res_costumes, 24}, {NULL, 0} }; +static const ScummNESFile::LFLEntry lfl_32[] = { {res_rooms, 32}, {res_roomgfx, 32}, {res_costumes, 15}, {NULL, 0} }; +static const ScummNESFile::LFLEntry lfl_33[] = { {res_rooms, 33}, {res_roomgfx, 33}, {res_scripts, 120}, {res_scripts, 135}, {res_sounds, 56}, {res_sounds, 57}, {res_sounds, 58}, {res_sounds, 1}, {res_costumes, 22}, {NULL, 0} }; +static const ScummNESFile::LFLEntry lfl_34[] = { {res_rooms, 34}, {res_roomgfx, 34}, {NULL, 0} }; +static const ScummNESFile::LFLEntry lfl_35[] = { {res_rooms, 35}, {res_roomgfx, 35}, {NULL, 0} }; +static const ScummNESFile::LFLEntry lfl_36[] = { {res_rooms, 36}, {res_roomgfx, 36}, {res_sounds, 10}, {res_sounds, 4}, {NULL, 0} }; +static const ScummNESFile::LFLEntry lfl_37[] = { {res_rooms, 37}, {res_roomgfx, 37}, {NULL, 0} }; +static const ScummNESFile::LFLEntry lfl_38[] = { {res_rooms, 38}, {res_roomgfx, 38}, {res_scripts, 138}, {res_scripts, 139}, {res_scripts, 140}, {res_scripts, 141}, {res_scripts, 142}, {res_scripts, 143}, {res_scripts, 144}, {res_scripts, 145}, {NULL, 0} }; +static const ScummNESFile::LFLEntry lfl_39[] = { {res_rooms, 39}, {res_roomgfx, 39}, {NULL, 0} }; +static const ScummNESFile::LFLEntry lfl_40[] = { {res_rooms, 40}, {res_roomgfx, 0}, {res_scripts, 112}, {res_costumes, 17}, {NULL, 0} }; +static const ScummNESFile::LFLEntry lfl_41[] = { {res_rooms, 41}, {res_scripts, 106}, {res_sounds, 47}, {res_sounds, 48}, {res_sounds, 53}, {res_sounds, 49}, {res_sounds, 51}, {NULL, 0} }; +static const ScummNESFile::LFLEntry lfl_42[] = { {res_rooms, 42}, {res_scripts, 124}, {res_costumes, 18}, {NULL, 0} }; +static const ScummNESFile::LFLEntry lfl_43[] = { {res_rooms, 43}, {res_scripts, 44}, {res_sounds, 19}, {NULL, 0} }; +static const ScummNESFile::LFLEntry lfl_44[] = { {res_rooms, 44}, {res_scripts, 102}, {res_sounds, 6}, {res_sounds, 38}, {res_sounds, 8}, {res_sounds, 9}, {res_costumes, 1}, {res_costumes, 2}, {res_costumes, 5}, {res_costumes, 6}, {res_costumes, 3}, {res_costumes, 4}, {res_costumes, 7}, {NULL, 0} }; +static const ScummNESFile::LFLEntry lfl_45[] = { {res_rooms, 45}, {res_scripts, 1}, {res_scripts, 2}, {res_scripts, 3}, {res_scripts, 4}, {res_scripts, 5}, {res_scripts, 9}, {res_scripts, 114}, {res_scripts, 131}, {res_scripts, 164}, {res_scripts, 165}, {res_scripts, 169}, {res_scripts, 170}, {res_scripts, 171}, {res_scripts, 172}, {res_scripts, 173}, {res_scripts, 175}, {res_sounds, 54}, {NULL, 0} }; +static const ScummNESFile::LFLEntry lfl_46[] = { {res_rooms, 46}, {res_scripts, 130}, {res_sounds, 65}, {res_costumes, 0}, {res_costumes, 21}, {NULL, 0} }; +static const ScummNESFile::LFLEntry lfl_47[] = { {res_rooms, 47}, {res_scripts, 62}, {res_sounds, 69}, {NULL, 0} }; +static const ScummNESFile::LFLEntry lfl_48[] = { {res_rooms, 48}, {NULL, 0} }; +static const ScummNESFile::LFLEntry lfl_49[] = { {res_rooms, 49}, {NULL, 0} }; +static const ScummNESFile::LFLEntry lfl_50[] = { {res_rooms, 50}, {res_scripts, 133}, {res_scripts, 163}, {NULL, 0} }; +static const ScummNESFile::LFLEntry lfl_51[] = { {res_rooms, 51}, {res_scripts, 118}, {res_scripts, 128}, {res_sounds, 61}, {res_sounds, 62}, {res_sounds, 67}, {res_sounds, 66}, {res_costumes, 16}, {res_costumes, 20}, {NULL, 0} }; +static const ScummNESFile::LFLEntry lfl_52[] = { {res_rooms, 52}, {NULL, 0} }; +// remaining 'standard' resources (not used by any of the original LFL files) +static const ScummNESFile::LFLEntry lfl_53[] = { {res_rooms, 53}, {res_scripts, 177}, {res_scripts, 178}, {res_sounds, 70}, {res_sounds, 71}, {res_sounds, 72}, {res_sounds, 73}, {res_sounds, 74}, {res_sounds, 75}, {res_sounds, 76}, {res_sounds, 77}, {res_sounds, 78}, {res_sounds, 79}, {res_sounds, 80}, {res_sounds, 81}, {NULL, 0} }; +// all 'non-standard' resources (the costume-related stuff) +static const ScummNESFile::LFLEntry lfl_54[] = { {res_rooms, 54}, {res_sprdesc, 0}, {res_sprdesc, 1}, {res_sprlens, 0}, {res_sprlens, 1}, {res_sproffs, 0}, {res_sproffs, 1}, {res_sprdata, 0}, {res_sprdata, 1}, {res_costumegfx, 0}, {res_costumegfx, 1}, {res_sprpals, 0}, {res_sprpals, 1}, {res_charset, 0}, {res_preplist, 0}, {NULL, 0} }; + +struct ScummNESFile::LFL { + int num; + const ScummNESFile::LFLEntry *entries; +}; + +static const ScummNESFile::LFL lfls[] = { + { 1, lfl_01 }, + { 2, lfl_02 }, + { 3, lfl_03 }, + { 4, lfl_04 }, + { 5, lfl_05 }, + { 6, lfl_06 }, + { 7, lfl_07 }, + { 8, lfl_08 }, + { 9, lfl_09 }, + { 10, lfl_10 }, + { 11, lfl_11 }, + { 12, lfl_12 }, + { 13, lfl_13 }, + { 14, lfl_14 }, + { 15, lfl_15 }, + { 16, lfl_16 }, + { 17, lfl_17 }, + { 18, lfl_18 }, + { 19, lfl_19 }, + { 20, lfl_20 }, + { 21, lfl_21 }, + { 22, lfl_22 }, + { 23, lfl_23 }, + { 24, lfl_24 }, + { 25, lfl_25 }, + { 26, lfl_26 }, + { 27, lfl_27 }, + { 28, lfl_28 }, + { 29, lfl_29 }, + { 30, lfl_30 }, + { 31, lfl_31 }, + { 32, lfl_32 }, + { 33, lfl_33 }, + { 34, lfl_34 }, + { 35, lfl_35 }, + { 36, lfl_36 }, + { 37, lfl_37 }, + { 38, lfl_38 }, + { 39, lfl_39 }, + { 40, lfl_40 }, + { 41, lfl_41 }, + { 42, lfl_42 }, + { 43, lfl_43 }, + { 44, lfl_44 }, + { 45, lfl_45 }, + { 46, lfl_46 }, + { 47, lfl_47 }, + { 48, lfl_48 }, + { 49, lfl_49 }, + { 50, lfl_50 }, + { 51, lfl_51 }, + { 52, lfl_52 }, + { 53, lfl_53 }, + { 54, lfl_54 }, + { -1, NULL } +}; + +#include "common/pack-start.h" // START STRUCT PACKING + +struct _lfl_index { + byte room_lfl[55]; + uint16 room_addr[55]; + byte costume_lfl[80]; + uint16 costume_addr[80]; + byte script_lfl[200]; + uint16 script_addr[200]; + byte sound_lfl[100]; + uint16 sound_addr[100]; +} PACKED_STRUCT; + +#include "common/pack-end.h" // END STRUCT PACKING + +_lfl_index lfl_index; + +bool ScummNESFile::generateResource(int res) { + const LFL *lfl = &lfls[res - 1]; + int j; + int bufsize = 2; + + for (j = 0; lfl->entries[j].type != NULL; j++) + bufsize += extractResource(0, &lfl->entries[j].type[_ROMset][lfl->entries[j].index]); + + free(_buf); + _buf = (byte *)calloc(1, bufsize); + + Common::MemoryWriteStream out(_buf, bufsize); + + for (j = 0; lfl->entries[j].type != NULL; j++) { + const Resource *entry = &lfl->entries[j].type[_ROMset][lfl->entries[j].index]; + extractResource(&out, entry); + } + write_byte(&out, 0xD1); + write_byte(&out, 0xF5); + + if (_stream) + delete _stream; + + _stream = new Common::MemoryReadStream(_buf, bufsize); + + return true; +} + +bool ScummNESFile::generateIndex() { + int i, j; + + for (i = 0; lfls[i].num != -1; i++) { + const LFL *lfl = &lfls[i]; + uint16 respos = 0; + + for (j = 0; lfl->entries[j].type != NULL; j++) { + const LFLEntry *entry = &lfl->entries[j]; + + switch (entry->type[_ROMset][entry->index].type) { + case NES_ROOM: + lfl_index.room_lfl[entry->index] = lfl->num; + lfl_index.room_addr[entry->index] = TO_LE_16(respos); + break; + case NES_COSTUME: + lfl_index.costume_lfl[entry->index] = lfl->num; + lfl_index.costume_addr[entry->index] = TO_LE_16(respos); + break; + case NES_SPRDESC: + lfl_index.costume_lfl[entry->index + 25] = lfl->num; + lfl_index.costume_addr[entry->index + 25] = TO_LE_16(respos); + break; + case NES_SPRLENS: + lfl_index.costume_lfl[entry->index + 27] = lfl->num; + lfl_index.costume_addr[entry->index + 27] = TO_LE_16(respos); + break; + case NES_SPROFFS: + lfl_index.costume_lfl[entry->index + 29] = lfl->num; + lfl_index.costume_addr[entry->index + 29] = TO_LE_16(respos); + break; + case NES_SPRDATA: + lfl_index.costume_lfl[entry->index + 31] = lfl->num; + lfl_index.costume_addr[entry->index + 31] = TO_LE_16(respos); + break; + case NES_COSTUMEGFX: + lfl_index.costume_lfl[entry->index + 33] = lfl->num; + lfl_index.costume_addr[entry->index + 33] = TO_LE_16(respos); + break; + case NES_SPRPALS: + lfl_index.costume_lfl[entry->index + 35] = lfl->num; + lfl_index.costume_addr[entry->index + 35] = TO_LE_16(respos); + break; + case NES_ROOMGFX: + lfl_index.costume_lfl[entry->index + 37] = lfl->num; + lfl_index.costume_addr[entry->index + 37] = TO_LE_16(respos); + break; + case NES_SCRIPT: + lfl_index.script_lfl[entry->index] = lfl->num; + lfl_index.script_addr[entry->index] = TO_LE_16(respos); + break; + case NES_SOUND: + lfl_index.sound_lfl[entry->index] = lfl->num; + lfl_index.sound_addr[entry->index] = TO_LE_16(respos); + break; + case NES_CHARSET: + lfl_index.costume_lfl[77] = lfl->num; + lfl_index.costume_addr[77] = TO_LE_16(respos); + break; + case NES_PREPLIST: + lfl_index.costume_lfl[78] = lfl->num; + lfl_index.costume_addr[78] = TO_LE_16(respos); + break; + default: + error("Unindexed entry found!"); + break; + } + respos += extractResource(0, &entry->type[_ROMset][entry->index]); + } + } + + int bufsize = 2; + + bufsize += 775; + bufsize += sizeof(lfl_index); + + free(_buf); + _buf = (byte *)calloc(1, bufsize); + + Common::MemoryWriteStream out(_buf, bufsize); + + write_byte(&out, 0x43); + write_byte(&out, 0x46); + + extractResource(&out, &res_globdata[_ROMset][0]); + + for (i = 0; i < (int)sizeof(lfl_index); i++) + write_byte(&out, ((byte *)&lfl_index)[i]); + + if (_stream) + delete _stream; + + _stream = new Common::MemoryReadStream(_buf, bufsize); + + return true; +} + +bool ScummNESFile::open(const Common::String &filename, AccessMode mode) { + + if (_ROMset == kROMsetNum) { + char md5str[32+1]; + if (Common::md5_file_string(filename.c_str(), md5str)) { + + if (!strcmp(md5str, "3905799e081b80a61d4460b7b733c206")) { + _ROMset = kROMsetUSA; + debug(1, "ROM contents verified as Maniac Mansion (USA)"); + } else if (!strcmp(md5str, "d8d07efcb88f396bee0b402b10c3b1c9")) { + _ROMset = kROMsetEurope; + debug(1, "ROM contents verified as Maniac Mansion (Europe)"); + } else if (!strcmp(md5str, "22d07d6c386c9c25aca5dac2a0c0d94b")) { + _ROMset = kROMsetSweden; + debug(1, "ROM contents verified as Maniac Mansion (Sweden)"); + } else if (!strcmp(md5str, "81bbfa181184cb494e7a81dcfa94fbd9")) { + _ROMset = kROMsetFrance; + debug(2, "ROM contents verified as Maniac Mansion (France)"); + } else if (!strcmp(md5str, "257f8c14d8c584f7ddd601bcb00920c7")) { + _ROMset = kROMsetGermany; + debug(2, "ROM contents verified as Maniac Mansion (Germany)"); + } else if (!strcmp(md5str, "f163cf53f7850e43fb482471e5c52e1a")) { + _ROMset = kROMsetSpain; + debug(2, "ROM contents verified as Maniac Mansion (Spain)"); + } else { + error("Unsupported Maniac Mansion ROM, md5: %s", md5str); + return false; + } + } else { + return false; + } + } + + if (File::open(filename, mode)) { + if (_stream) + delete _stream; + _stream = 0; + + free(_buf); + _buf = 0; + + return true; + } else { + return false; + } +} + +void ScummNESFile::close() { + if (_stream) + delete _stream; + _stream = 0; + + free(_buf); + _buf = 0; + + File::close(); +} + +bool ScummNESFile::openSubFile(const Common::String &filename) { + assert(isOpen()); + + const char *ext = strrchr(filename.c_str(), '.'); + char resNum[3]; + int res; + + // We always have file name in form of XX.lfl + resNum[0] = ext[-2]; + resNum[1] = ext[-1]; + resNum[2] = 0; + + res = atoi(resNum); + + if (res == 0) { + return generateIndex(); + } else { + return generateResource(res); + } +} + + +} // End of namespace Scumm diff --git a/engines/scumm/file_nes.h b/engines/scumm/file_nes.h new file mode 100644 index 0000000000..d601c2c496 --- /dev/null +++ b/engines/scumm/file_nes.h @@ -0,0 +1,81 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * $URL$ + * $Id$ + * + */ + +#ifndef SCUMM_FILE_NES_H +#define SCUMM_FILE_NES_H + +#include "common/file.h" + +#include "scumm/file.h" + +namespace Scumm { + +class ScummNESFile : public BaseScummFile { +public: + enum ROMset { + kROMsetUSA, + kROMsetEurope, + kROMsetSweden, + kROMsetFrance, + kROMsetGermany, + kROMsetSpain, + kROMsetNum + }; + + struct Resource; + struct LFLEntry; + struct LFL; + +private: + Common::MemoryReadStream *_stream; + ROMset _ROMset; + byte *_buf; + + bool generateIndex(); + bool generateResource(int res); + uint16 extractResource(Common::WriteStream *out, const Resource *res); + + byte fileReadByte(); + uint16 fileReadUint16LE(); + +public: + ScummNESFile(); + void setEnc(byte value); + + bool open(const Common::String &filename, AccessMode mode = kFileReadMode); + bool openSubFile(const Common::String &filename); + + void close(); + bool eof() { return _stream->eos(); } + uint32 pos() { return _stream->pos(); } + uint32 size() { return _stream->size(); } + void seek(int32 offs, int whence = SEEK_SET) { _stream->seek(offs, whence); } + uint32 read(void *dataPtr, uint32 dataSize) { return _stream->read(dataPtr, dataSize); } + uint32 write(const void *dataPtr, uint32 dataSize); +}; + +} // End of namespace Scumm + +#endif diff --git a/engines/scumm/gfx.cpp b/engines/scumm/gfx.cpp index c1e06609b9..8d111492a2 100644 --- a/engines/scumm/gfx.cpp +++ b/engines/scumm/gfx.cpp @@ -51,6 +51,7 @@ static void copy8Col(byte *dst, int dstPitch, const byte *src, int height); static void clear8Col(byte *dst, int dstPitch, int height); static void ditherHerc(byte *src, byte *hercbuf, int srcPitch, int *x, int *y, int *width, int *height); +static void scale2x(byte *dst, int dstPitch, const byte *src, int srcPitch, int w, int h); struct StripTable { int offsets[160]; @@ -90,9 +91,6 @@ struct TransitionEffect { byte stripTable[16]; // ditto }; -#ifdef PALMOS_68K -static const TransitionEffect *transitionEffects; -#else static const TransitionEffect transitionEffects[6] = { // Iris effect (looks like an opening/closing camera iris) { @@ -197,7 +195,6 @@ static const TransitionEffect transitionEffects[6] = { } }; -#endif Gdi::Gdi(ScummEngine *vm) : _vm(vm) { @@ -322,7 +319,7 @@ void ScummEngine::initScreens(int b, int h) { void ScummEngine::initVirtScreen(VirtScreenNumber slot, int top, int width, int height, bool twobufs, bool scrollable) { - VirtScreen *vs = &virtscr[slot]; + VirtScreen *vs = &_virtscr[slot]; int size; assert(height >= 0); @@ -378,7 +375,7 @@ void ScummEngine::initVirtScreen(VirtScreenNumber slot, int top, int width, int } VirtScreen *ScummEngine::findVirtScreen(int y) { - VirtScreen *vs = virtscr; + VirtScreen *vs = _virtscr; int i; for (i = 0; i < 3; i++, vs++) { @@ -390,7 +387,7 @@ VirtScreen *ScummEngine::findVirtScreen(int y) { } void ScummEngine::markRectAsDirty(VirtScreenNumber virt, int left, int right, int top, int bottom, int dirtybit) { - VirtScreen *vs = &virtscr[virt]; + VirtScreen *vs = &_virtscr[virt]; int lp, rp; if (left > right || top > bottom) @@ -456,7 +453,7 @@ void ScummEngine::drawDirtyScreenParts() { // Update game area ("stage") if (camera._last.x != camera._cur.x || (_game.version >= 7 && (camera._cur.y != camera._last.y))) { // Camera moved: redraw everything - VirtScreen *vs = &virtscr[kMainVirtScreen]; + VirtScreen *vs = &_virtscr[kMainVirtScreen]; drawStripToScreen(vs, 0, vs->w, 0, vs->h); vs->setDirtyRange(vs->h, 0); } else { @@ -501,7 +498,7 @@ void ScummEngine_v6::drawDirtyScreenParts() { * a full blit is done, otherwise only the visible dirty areas are updated. */ void ScummEngine::updateDirtyScreen(VirtScreenNumber slot) { - VirtScreen *vs = &virtscr[slot]; + VirtScreen *vs = &_virtscr[slot]; // Do nothing for unused virtual screens if (vs->h == 0) @@ -745,7 +742,7 @@ void ditherHerc(byte *src, byte *hercbuf, int srcPitch, int *x, int *y, int *wid *height = dsty - *y; } -void ScummEngine::scale2x(byte *dst, int dstPitch, const byte *src, int srcPitch, int w, int h) { +void scale2x(byte *dst, int dstPitch, const byte *src, int srcPitch, int w, int h) { byte *dstL1 = dst; byte *dstL2 = dst + dstPitch; @@ -779,7 +776,7 @@ void ScummEngine::initBGBuffers(int height) { // Resize main virtual screen in V7 games. This is necessary // because in V7, rooms may be higher than one screen, so we have // to accomodate for that. - initVirtScreen(kMainVirtScreen, virtscr[0].topline, _screenWidth, height, true, true); + initVirtScreen(kMainVirtScreen, _virtscr[kMainVirtScreen].topline, _screenWidth, height, true, true); } if (_game.heversion >= 70) @@ -903,7 +900,7 @@ void ScummEngine_v71he::redrawBGAreas() { byte *room = getResourceAddress(rtRoomImage, _roomResource) + _IM00_offs; if (_fullRedraw) { _bgNeedsRedraw = false; - _gdi->drawBMAPBg(room, &virtscr[0]); + _gdi->drawBMAPBg(room, &_virtscr[kMainVirtScreen]); } drawRoomObjects(0); @@ -929,7 +926,7 @@ void ScummEngine::redrawBGStrip(int start, int num) { else room = getResourceAddress(rtRoom, _roomResource); - _gdi->drawBitmap(room + _IM00_offs, &virtscr[0], s, 0, _roomWidth, virtscr[0].h, s, num, 0); + _gdi->drawBitmap(room + _IM00_offs, &_virtscr[kMainVirtScreen], s, 0, _roomWidth, _virtscr[kMainVirtScreen].h, s, num, 0); } void ScummEngine::restoreBackground(Common::Rect rect, byte backColor) { @@ -987,7 +984,7 @@ void ScummEngine::restoreCharsetBg() { // restoreBackground(), but was changed to only restore those parts which are // currently covered by the charset mask. - VirtScreen *vs = &virtscr[_charset->_textScreenID]; + VirtScreen *vs = &_virtscr[_charset->_textScreenID]; if (!vs->h) return; @@ -1022,7 +1019,7 @@ void ScummEngine::clearTextSurface() { } byte *ScummEngine::getMaskBuffer(int x, int y, int z) { - return _gdi->getMaskBuffer((x + virtscr[0].xstart) / 8, y, z); + return _gdi->getMaskBuffer((x + _virtscr[kMainVirtScreen].xstart) / 8, y, z); } byte *Gdi::getMaskBuffer(int x, int y, int z) { @@ -1223,7 +1220,7 @@ void ScummEngine_v5::clearFlashlight() { void ScummEngine_v5::drawFlashlight() { int i, j, x, y; - VirtScreen *vs = &virtscr[kMainVirtScreen]; + VirtScreen *vs = &_virtscr[kMainVirtScreen]; // Remove the flash light first if it was previously drawn if (_flashlight.isDrawn) { @@ -1923,7 +1920,7 @@ void Gdi::drawBMAPObject(const byte *ptr, VirtScreen *vs, int obj, int x, int y, if (code == 8 || code == 9) { Common::Rect rScreen(0, 0, vs->w, vs->h); - byte *dst = (byte *)_vm->virtscr[0].backBuf + scrX; + byte *dst = (byte *)_vm->_virtscr[kMainVirtScreen].backBuf + scrX; Wiz::copyWizImage(dst, bmap_ptr, vs->w, vs->h, x - scrX, y, w, h, &rScreen); } @@ -1943,7 +1940,7 @@ void Gdi::drawBMAPObject(const byte *ptr, VirtScreen *vs, int obj, int x, int y, void ScummEngine_v70he::restoreBackgroundHE(Common::Rect rect, int dirtybit) { byte *src, *dst; - VirtScreen *vs = &virtscr[0]; + VirtScreen *vs = &_virtscr[kMainVirtScreen]; if (rect.top > vs->h || rect.bottom < 0) return; @@ -1969,12 +1966,12 @@ void ScummEngine_v70he::restoreBackgroundHE(Common::Rect rect, int dirtybit) { if (rw == 0 || rh == 0) return; - src = virtscr[0].getBackPixels(rect.left, rect.top); - dst = virtscr[0].getPixels(rect.left, rect.top); + src = _virtscr[kMainVirtScreen].getBackPixels(rect.left, rect.top); + dst = _virtscr[kMainVirtScreen].getPixels(rect.left, rect.top); assert(rw <= _screenWidth && rw > 0); assert(rh <= _screenHeight && rh > 0); - blit(dst, virtscr[0].pitch, src, virtscr[0].pitch, rw, rh); + blit(dst, _virtscr[kMainVirtScreen].pitch, src, _virtscr[kMainVirtScreen].pitch, rw, rh); markRectAsDirty(kMainVirtScreen, rect, dirtybit); } #endif @@ -1983,7 +1980,7 @@ void ScummEngine_v70he::restoreBackgroundHE(Common::Rect rect, int dirtybit) { * Reset the background behind an actor or blast object. */ void Gdi::resetBackground(int top, int bottom, int strip) { - VirtScreen *vs = &_vm->virtscr[0]; + VirtScreen *vs = &_vm->_virtscr[kMainVirtScreen]; byte *backbuff_ptr, *bgbak_ptr; int numLinesToProcess; @@ -3162,7 +3159,7 @@ void ScummEngine::fadeIn(int effect) { // that broke the FOA intro. Probably other things as well. // // Hopefully it's safe to do it at this point, at least. - virtscr[0].setDirtyRange(0, 0); + _virtscr[kMainVirtScreen].setDirtyRange(0, 0); transitionEffect(effect - 1); break; case 128: @@ -3180,7 +3177,7 @@ void ScummEngine::fadeIn(int effect) { dissolveEffect(1, 1); break; case 135: - dissolveEffect(1, virtscr[0].h); + dissolveEffect(1, _virtscr[kMainVirtScreen].h); break; default: error("Unknown screen effect, %d", effect); @@ -3189,7 +3186,7 @@ void ScummEngine::fadeIn(int effect) { } void ScummEngine::fadeOut(int effect) { - VirtScreen *vs = &virtscr[0]; + VirtScreen *vs = &_virtscr[kMainVirtScreen]; vs->setDirtyRange(0, 0); if (_game.version < 7) @@ -3226,7 +3223,7 @@ void ScummEngine::fadeOut(int effect) { dissolveEffect(1, 1); break; case 135: - dissolveEffect(1, virtscr[0].h); + dissolveEffect(1, _virtscr[kMainVirtScreen].h); break; default: error("fadeOut: default case %d", effect); @@ -3256,7 +3253,7 @@ void ScummEngine::transitionEffect(int a) { int i, j; int bottom; int l, t, r, b; - const int height = MIN((int)virtscr[0].h, _screenHeight); + const int height = MIN((int)_virtscr[kMainVirtScreen].h, _screenHeight); const int delay = (VAR_FADE_DELAY != 0xFF) ? VAR(VAR_FADE_DELAY) * kFadeDelay : kPictureDelay; for (i = 0; i < 16; i++) { @@ -3278,8 +3275,8 @@ void ScummEngine::transitionEffect(int a) { if (t == b) { while (l <= r) { if (l >= 0 && l < _gdi->_numStrips && t < bottom) { - virtscr[0].tdirty[l] = _screenTop + t * 8; - virtscr[0].bdirty[l] = _screenTop + (b + 1) * 8; + _virtscr[kMainVirtScreen].tdirty[l] = _screenTop + t * 8; + _virtscr[kMainVirtScreen].bdirty[l] = _screenTop + (b + 1) * 8; } l++; } @@ -3290,8 +3287,8 @@ void ScummEngine::transitionEffect(int a) { b = bottom; if (t < 0) t = 0; - virtscr[0].tdirty[l] = _screenTop + t * 8; - virtscr[0].bdirty[l] = _screenTop + (b + 1) * 8; + _virtscr[kMainVirtScreen].tdirty[l] = _screenTop + t * 8; + _virtscr[kMainVirtScreen].bdirty[l] = _screenTop + (b + 1) * 8; } updateDirtyScreen(kMainVirtScreen); } @@ -3314,16 +3311,7 @@ void ScummEngine::transitionEffect(int a) { * dissolveEffect(virtsrc[0].width, 1) produces a line-by-line dissolve */ void ScummEngine::dissolveEffect(int width, int height) { -#ifdef PALMOS_68K - // Remove this dissolve effect for now on PalmOS since it is a bit - // too slow using 68k emulation - if (width == 1 && height == 1) { - waitForTimer(30); - return; - } -#endif - - VirtScreen *vs = &virtscr[0]; + VirtScreen *vs = &_virtscr[kMainVirtScreen]; int *offsets; int blits_before_refresh, blits; int x, y; @@ -3432,7 +3420,7 @@ void ScummEngine::dissolveEffect(int width, int height) { } void ScummEngine::scrollEffect(int dir) { - VirtScreen *vs = &virtscr[0]; + VirtScreen *vs = &_virtscr[kMainVirtScreen]; int x, y; int step; @@ -3557,15 +3545,3 @@ void ScummEngine::unkScreenEffect6() { } // End of namespace Scumm -#ifdef PALMOS_68K -#include "scumm_globals.h" - -_GINIT(Gfx) -_GSETPTR(Scumm::transitionEffects, GBVARS_TRANSITIONEFFECTS_INDEX, Scumm::TransitionEffect, GBVARS_SCUMM) -_GEND - -_GRELEASE(Gfx) -_GRELEASEPTR(GBVARS_TRANSITIONEFFECTS_INDEX, GBVARS_SCUMM) -_GEND - -#endif diff --git a/engines/scumm/gfx.h b/engines/scumm/gfx.h index fb8da562c8..4e92fad0fd 100644 --- a/engines/scumm/gfx.h +++ b/engines/scumm/gfx.h @@ -84,7 +84,7 @@ enum VirtScreenNumber { struct VirtScreen : Graphics::Surface { /** * The unique id of this screen (corresponds to its position in the - * ScummEngine:virtscr array). + * ScummEngine:_virtscr array). */ VirtScreenNumber number; diff --git a/engines/scumm/he/animation_he.cpp b/engines/scumm/he/animation_he.cpp index 3bc2f3e5d7..3c7d742ba2 100644 --- a/engines/scumm/he/animation_he.cpp +++ b/engines/scumm/he/animation_he.cpp @@ -89,7 +89,7 @@ void MoviePlayer::handleNextFrame() { return; } - VirtScreen *pvs = &_vm->virtscr[kMainVirtScreen]; + VirtScreen *pvs = &_vm->_virtscr[kMainVirtScreen]; decodeNextFrame(); diff --git a/engines/scumm/he/floodfill_he.cpp b/engines/scumm/he/floodfill_he.cpp index 1fdd11fce8..ea2043d69f 100644 --- a/engines/scumm/he/floodfill_he.cpp +++ b/engines/scumm/he/floodfill_he.cpp @@ -179,7 +179,7 @@ skip: void floodFill(FloodFillParameters *ffp, ScummEngine_v90he *vm) { uint8 *dst; - VirtScreen *vs = &vm->virtscr[kMainVirtScreen]; + VirtScreen *vs = &vm->_virtscr[kMainVirtScreen]; if (ffp->flags & 0x8000) { dst = vs->getBackPixels(0, vs->topline); } else { diff --git a/engines/scumm/he/script_v60he.cpp b/engines/scumm/he/script_v60he.cpp index baee2f3e49..0b9c94fe18 100644 --- a/engines/scumm/he/script_v60he.cpp +++ b/engines/scumm/he/script_v60he.cpp @@ -801,7 +801,7 @@ void ScummEngine_v60he::o60_kernelSetFunctions() { void ScummEngine_v60he::virtScreenLoad(int resIdx, int x1, int y1, int x2, int y2) { vsUnpackCtx ctx; memset(&ctx, 0, sizeof(ctx)); - VirtScreen &vs = virtscr[kMainVirtScreen]; + VirtScreen &vs = _virtscr[kMainVirtScreen]; ArrayHeader *ah = (ArrayHeader *)getResourceAddress(rtString, resIdx); virtScreenLoadUnpack(&ctx, ah->data); @@ -875,7 +875,7 @@ void ScummEngine_v60he::o60_kernelGetFunctions() { int ScummEngine_v60he::virtScreenSave(byte *dst, int x1, int y1, int x2, int y2) { int packedSize = 0; - VirtScreen &vs = virtscr[kMainVirtScreen]; + VirtScreen &vs = _virtscr[kMainVirtScreen]; for (int j = y1; j <= y2; ++j) { uint8 *p = vs.getBackPixels(x1, j - vs.topline); diff --git a/engines/scumm/he/sprite_he.cpp b/engines/scumm/he/sprite_he.cpp index 8e6f3ce4c2..15698dedba 100644 --- a/engines/scumm/he/sprite_he.cpp +++ b/engines/scumm/he/sprite_he.cpp @@ -1120,7 +1120,7 @@ void Sprite::resetBackground() { } void Sprite::setRedrawFlags(bool checkZOrder) { - VirtScreen *vs = &_vm->virtscr[kMainVirtScreen]; + VirtScreen *vs = &_vm->_virtscr[kMainVirtScreen]; for (int i = 0; i < _numSpritesToProcess; ++i) { SpriteInfo *spi = _activeSpritesTable[i]; if (!(spi->flags & kSFNeedRedraw)) { diff --git a/engines/scumm/he/wiz_he.cpp b/engines/scumm/he/wiz_he.cpp index 549e4480f6..a99f3b1ad5 100644 --- a/engines/scumm/he/wiz_he.cpp +++ b/engines/scumm/he/wiz_he.cpp @@ -1009,7 +1009,7 @@ static int wizPackType0(uint8 *dst, const uint8 *src, int srcPitch, const Common void Wiz::captureWizImage(int resNum, const Common::Rect& r, bool backBuffer, int compType) { debug(5, "ScummEngine_v72he::captureWizImage(%d, %d, [%d,%d,%d,%d])", resNum, compType, r.left, r.top, r.right, r.bottom); uint8 *src = NULL; - VirtScreen *pvs = &_vm->virtscr[kMainVirtScreen]; + VirtScreen *pvs = &_vm->_virtscr[kMainVirtScreen]; if (backBuffer) { src = pvs->getBackPixels(0, 0); } else { @@ -1182,7 +1182,7 @@ uint8 *Wiz::drawWizImage(int resNum, int state, int x1, int y1, int zorder, int assert(dst); getWizImageDim(dstResNum, 0, cw, ch); } else { - VirtScreen *pvs = &_vm->virtscr[kMainVirtScreen]; + VirtScreen *pvs = &_vm->_virtscr[kMainVirtScreen]; if (flags & kWIFMarkBufferDirty) { dst = pvs->getPixels(0, pvs->topline); } else { @@ -1377,7 +1377,7 @@ void Wiz::drawWizPolygonTransform(int resNum, int state, Common::Point *wp, int if (srcWizBuf) { uint8 *dst; int32 dstw, dsth, dstpitch, wizW, wizH; - VirtScreen *pvs = &_vm->virtscr[kMainVirtScreen]; + VirtScreen *pvs = &_vm->_virtscr[kMainVirtScreen]; int transColor = (_vm->VAR_WIZ_TCOLOR != 0xFF) ? _vm->VAR(_vm->VAR_WIZ_TCOLOR) : 5; if (dstResNum) { diff --git a/engines/scumm/imuse_digi/dimuse.h b/engines/scumm/imuse_digi/dimuse.h index dca9baac60..caff9958f3 100644 --- a/engines/scumm/imuse_digi/dimuse.h +++ b/engines/scumm/imuse_digi/dimuse.h @@ -237,16 +237,6 @@ struct imuseFtSeqTable { byte volume; }; -#ifdef PALMOS_68K -extern const imuseRoomMap *_digStateMusicMap; -extern const imuseDigTable *_digStateMusicTable; -extern const imuseDigTable *_digSeqMusicTable; -extern const imuseComiTable *_comiStateMusicTable; -extern const imuseComiTable *_comiSeqMusicTable; -extern const imuseFtStateTable *_ftStateMusicTable; -extern const imuseFtSeqTable *_ftSeqMusicTable; -extern const imuseFtNames *_ftSeqNames; -#else extern const imuseRoomMap _digStateMusicMap[]; extern const imuseDigTable _digStateMusicTable[]; extern const imuseDigTable _digSeqMusicTable[]; @@ -255,7 +245,6 @@ extern const imuseComiTable _comiSeqMusicTable[]; extern const imuseFtStateTable _ftStateMusicTable[]; extern const imuseFtSeqTable _ftSeqMusicTable[]; extern const imuseFtNames _ftSeqNames[]; -#endif } // End of namespace Scumm diff --git a/engines/scumm/imuse_digi/dimuse_codecs.cpp b/engines/scumm/imuse_digi/dimuse_codecs.cpp index 17082f5256..b79c7111f9 100644 --- a/engines/scumm/imuse_digi/dimuse_codecs.cpp +++ b/engines/scumm/imuse_digi/dimuse_codecs.cpp @@ -62,9 +62,6 @@ uint32 decode12BitsSample(const byte *src, byte **dst, uint32 size) { static byte _imcTableEntryBitCount[89]; -#ifdef PALMOS_68K -static const int16 *imcTable; -#else static const int16 imcTable[89] = { 7, 8, 9, 10, 11, 12, 13, 14, 16, 17, 19, 21, 23, 25, 28, 31, @@ -79,7 +76,6 @@ static const int16 imcTable[89] = { 15289,16818,18500,20350,22385,24623,27086,29794, 32767 }; -#endif static const byte imxOtherTable[6][64] = { { @@ -651,16 +647,3 @@ int32 decompressCodec(int32 codec, byte *compInput, byte *compOutput, int32 inpu } // End of namespace BundleCodecs } // End of namespace Scumm - -#ifdef PALMOS_68K -#include "scumm_globals.h" - -_GINIT(DimuseCodecs) -_GSETPTR(Scumm::BundleCodecs::imcTable, GBVARS_IMCTABLE_INDEX, int16, GBVARS_SCUMM) -_GEND - -_GRELEASE(DimuseCodecs) -_GRELEASEPTR(GBVARS_IMCTABLE_INDEX, GBVARS_SCUMM) -_GEND - -#endif diff --git a/engines/scumm/imuse_digi/dimuse_tables.cpp b/engines/scumm/imuse_digi/dimuse_tables.cpp index 0b014b5f5e..9c56063557 100644 --- a/engines/scumm/imuse_digi/dimuse_tables.cpp +++ b/engines/scumm/imuse_digi/dimuse_tables.cpp @@ -27,16 +27,6 @@ namespace Scumm { -#ifdef PALMOS_68K -const imuseRoomMap *_digStateMusicMap; -const imuseDigTable *_digStateMusicTable; -const imuseDigTable *_digSeqMusicTable; -const imuseComiTable *_comiStateMusicTable; -const imuseComiTable *_comiSeqMusicTable; -const imuseFtStateTable *_ftStateMusicTable; -const imuseFtSeqTable *_ftSeqMusicTable; -const imuseFtNames *_ftSeqNames; -#else const imuseRoomMap _digStateMusicMap[] = { {0, 0, 0, 0, 0, 0 }, {1, 0, 0, 0, 0, 0 }, @@ -852,33 +842,5 @@ const imuseFtSeqTable _ftSeqMusicTable[] = { {"legavox", 2, 127}, {"chances", 2, 90 }, }; -#endif } // End of namespace Scumm - -#ifdef PALMOS_68K -#include "scumm_globals.h" - -_GINIT(DimuseTables) -_GSETPTR(Scumm::_digStateMusicMap, GBVARS_DIGSTATEMUSICMAP_INDEX, Scumm::imuseRoomMap , GBVARS_SCUMM) -_GSETPTR(Scumm::_digStateMusicTable, GBVARS_DIGSTATEMUSICTABLE_INDEX, Scumm::imuseDigTable , GBVARS_SCUMM) -_GSETPTR(Scumm::_digSeqMusicTable, GBVARS_DIGSEQMUSICTABLE_INDEX, Scumm::imuseDigTable , GBVARS_SCUMM) -_GSETPTR(Scumm::_comiStateMusicTable, GBVARS_COMISTATEMUSICTABLE_INDEX, Scumm::imuseComiTable , GBVARS_SCUMM) -_GSETPTR(Scumm::_comiSeqMusicTable, GBVARS_COMISEQMUSICTABLE_INDEX, Scumm::imuseComiTable , GBVARS_SCUMM) -_GSETPTR(Scumm::_ftStateMusicTable, GBVARS_FTSTATEMUSICTABLE_INDEX, Scumm::imuseFtStateTable, GBVARS_SCUMM) -_GSETPTR(Scumm::_ftSeqMusicTable, GBVARS_FTSEQMUSICTABLE_INDEX, Scumm::imuseFtSeqTable , GBVARS_SCUMM) -_GSETPTR(Scumm::_ftSeqNames, GBVARS_FTSEQNAMES_INDEX, Scumm::imuseFtNames , GBVARS_SCUMM) -_GEND - -_GRELEASE(DimuseTables) -_GRELEASEPTR(GBVARS_DIGSTATEMUSICMAP_INDEX , GBVARS_SCUMM) -_GRELEASEPTR(GBVARS_DIGSTATEMUSICTABLE_INDEX , GBVARS_SCUMM) -_GRELEASEPTR(GBVARS_DIGSEQMUSICTABLE_INDEX , GBVARS_SCUMM) -_GRELEASEPTR(GBVARS_COMISTATEMUSICTABLE_INDEX , GBVARS_SCUMM) -_GRELEASEPTR(GBVARS_COMISEQMUSICTABLE_INDEX , GBVARS_SCUMM) -_GRELEASEPTR(GBVARS_FTSTATEMUSICTABLE_INDEX , GBVARS_SCUMM) -_GRELEASEPTR(GBVARS_FTSEQMUSICTABLE_INDEX , GBVARS_SCUMM) -_GRELEASEPTR(GBVARS_FTSEQNAMES_INDEX , GBVARS_SCUMM) -_GEND - -#endif diff --git a/engines/scumm/input.cpp b/engines/scumm/input.cpp index 6647e9fe8d..94fafc78de 100644 --- a/engines/scumm/input.cpp +++ b/engines/scumm/input.cpp @@ -249,14 +249,15 @@ void ScummEngine::processInput() { if (_mouse.y > _screenHeight-1) _mouse.y = _screenHeight-1; - _virtualMouse.x = _mouse.x + virtscr[0].xstart; - _virtualMouse.y = _mouse.y - virtscr[0].topline; + VirtScreen *vs = &_virtscr[kMainVirtScreen]; + _virtualMouse.x = _mouse.x + vs->xstart; + _virtualMouse.y = _mouse.y - vs->topline; if (_game.version >= 7) _virtualMouse.y += _screenTop; if (_virtualMouse.y < 0) _virtualMouse.y = -1; - if (_virtualMouse.y >= virtscr[0].h) + if (_virtualMouse.y >= vs->h) _virtualMouse.y = -1; // diff --git a/engines/scumm/insane/insane.cpp b/engines/scumm/insane/insane.cpp index 252407913e..af09daff96 100644 --- a/engines/scumm/insane/insane.cpp +++ b/engines/scumm/insane/insane.cpp @@ -1169,8 +1169,6 @@ int Insane::smlayer_loadCostume(int id, int phase) { _vm->ensureResourceLoaded(rtCostume, resid); _vm->_res->setResourceCounter(rtCostume, resid, 1); - // smlayer_lock(rtCostume, resid); // FIXME - if (phase == 1) { _objArray1Idx2++; _objArray1[_objArray1Idx2] = id; diff --git a/engines/scumm/insane/insane_scenes.cpp b/engines/scumm/insane/insane_scenes.cpp index 5843e85f0f..0cf6623664 100644 --- a/engines/scumm/insane/insane_scenes.cpp +++ b/engines/scumm/insane/insane_scenes.cpp @@ -171,7 +171,7 @@ void Insane::runScene(int arraynum) { writeArray(339, _enemy[EN_VULTF2].isEmpty); writeArray(340, _enemy[EN_VULTM2].isEmpty); } - // insane_unlock(); // FIXME + _vm->_sound->stopAllSounds(); // IMUSE_StopAllSounds(); } @@ -328,8 +328,7 @@ int Insane::loadSceneData(int scene, int flag, int phase) { int retvalue = 1; debugC(DEBUG_INSANE, "Insane::loadSceneData(%d, %d, %d)", scene, flag, phase); - //if (phase == 1) /// FIXME - // insane_unlock(); + switch (scene) { case 1: smlayer_loadSound(88, flag, phase); diff --git a/engines/scumm/module.mk b/engines/scumm/module.mk index a340f564b3..2d70b167ea 100644 --- a/engines/scumm/module.mk +++ b/engines/scumm/module.mk @@ -14,6 +14,7 @@ MODULE_OBJS := \ detection.o \ dialogs.o \ file.o \ + file_nes.o \ gfx.o \ he/script_v60he.o \ he/sound_he.o \ diff --git a/engines/scumm/object.cpp b/engines/scumm/object.cpp index a88c56bc5a..128270538d 100644 --- a/engines/scumm/object.cpp +++ b/engines/scumm/object.cpp @@ -156,11 +156,14 @@ void ScummEngine::setOwnerOf(int obj, int owner) { } void ScummEngine::clearOwnerOf(int obj) { - int i, j; + int i; uint16 *a; + // Stop the associated object script code (else crashes might occurs) stopObjectScript(obj); + // If the object is "owned" by a the current room, we scan the + // object list and (only if it's a floating object) nuke it. if (getOwner(obj) == OF_OWNER_ROOM) { for (i = 0; i < _numLocalObjects; i++) { if (_objs[i].obj_nr == obj && _objs[i].fl_object_index) { @@ -170,26 +173,28 @@ void ScummEngine::clearOwnerOf(int obj) { _objs[i].fl_object_index = 0; } } - return; - } - - for (i = 0; i < _numInventory; i++) { - if (_inventory[i] == obj) { - j = whereIsObject(obj); - if (j == WIO_INVENTORY) { + } else { + + // Alternatively, scan the inventory to see if the object is in there... + for (i = 0; i < _numInventory; i++) { + if (_inventory[i] == obj) { + assert(WIO_INVENTORY == whereIsObject(obj)); + // Found the object! Nuke it from the inventory. _res->nukeResource(rtInventory, i); _inventory[i] = 0; - } - a = _inventory; - for (i = 0; i < _numInventory - 1; i++, a++) { - if (!a[0] && a[1]) { - a[0] = a[1]; - a[1] = 0; - _res->address[rtInventory][i] = _res->address[rtInventory][i + 1]; - _res->address[rtInventory][i + 1] = NULL; + + // Now fill up the gap removing the object from the inventory created. + a = _inventory; + for (i = 0; i < _numInventory - 1; i++, a++) { + if (!_inventory[i] && _inventory[i+1]) { + _inventory[i] = _inventory[i+1]; + _inventory[i+1] = 0; + _res->address[rtInventory][i] = _res->address[rtInventory][i + 1]; + _res->address[rtInventory][i + 1] = NULL; + } } + break; } - return; } } } @@ -583,11 +588,7 @@ void ScummEngine::drawObject(int obj, int arg) { return; ptr = getOBIMFromObjectData(od); - - if (_game.features & GF_OLD_BUNDLE) - ptr += 0; - else - ptr = getObjectImage(ptr, getState(od.obj_nr)); + ptr = getObjectImage(ptr, getState(od.obj_nr)); if (!ptr) return; @@ -619,10 +620,10 @@ void ScummEngine::drawObject(int obj, int arg) { #ifndef DISABLE_HE if (_game.heversion >= 70 && findResource(MKID_BE('SMAP'), ptr) == NULL) - _gdi->drawBMAPObject(ptr, &virtscr[0], obj, od.x_pos, od.y_pos, od.width, od.height); + _gdi->drawBMAPObject(ptr, &_virtscr[kMainVirtScreen], obj, od.x_pos, od.y_pos, od.width, od.height); else #endif - _gdi->drawBitmap(ptr, &virtscr[0], x, ypos, width * 8, height, x - xpos, numstrip, flags); + _gdi->drawBitmap(ptr, &_virtscr[kMainVirtScreen], x, ypos, width * 8, height, x - xpos, numstrip, flags); } } @@ -1394,7 +1395,9 @@ void ScummEngine::findObjectInRoom(FindObjectInRoom *fo, byte findWhat, uint id, if (id2 == (uint16)id) { if (findWhat & foCodeHeader) { fo->obcd = obcdptr; - fo->cdhd = (const CodeHeader *)(obcdptr + 10); // TODO - FIXME + // We assume that the code header starts at a fixed offset. + // A bit hackish, but works reasonably well. + fo->cdhd = (const CodeHeader *)(obcdptr + 10); } if (findWhat & foImageHeader) { fo->obim = obimptr; @@ -1626,7 +1629,7 @@ void ScummEngine_v6::drawBlastObject(BlastObject *eo) { int objnum; BompDrawData bdd; - vs = &virtscr[0]; + vs = &_virtscr[kMainVirtScreen]; assertRange(30, eo->number, _numGlobalObjects - 1, "blast object"); @@ -1704,7 +1707,7 @@ void ScummEngine_v6::removeBlastObjects() { } void ScummEngine_v6::removeBlastObject(BlastObject *eo) { - VirtScreen *vs = &virtscr[0]; + VirtScreen *vs = &_virtscr[kMainVirtScreen]; Common::Rect r; int left_strip, right_strip; diff --git a/engines/scumm/player_v2.cpp b/engines/scumm/player_v2.cpp index ae7985011b..82bb2cb4ec 100644 --- a/engines/scumm/player_v2.cpp +++ b/engines/scumm/player_v2.cpp @@ -44,16 +44,6 @@ namespace Scumm { #define FB_WNOISE 0x12000 /* feedback for white noise */ #define FB_PNOISE 0x08000 /* feedback for periodic noise */ -#ifdef PALMOS_68K -const uint8 *note_lengths; -static const uint16 *hull_offsets; -static const int16 *hulls; -static const uint16 *freqmod_lengths; -static const uint16 *freqmod_offsets; -static const int8 *freqmod_table; -static const uint16 *spk_freq_table; -static const uint16 *pcjr_freq_table; -#else const uint8 note_lengths[] = { 0, 0, 0, 2, @@ -341,7 +331,6 @@ static const uint16 pcjr_freq_table[12] = { 65472, 61760, 58304, 55040, 52032, 49024, 46272, 43648, 41216, 38912, 36736, 34624 }; -#endif Player_V2::Player_V2(ScummEngine *scumm, Audio::Mixer *mixer, bool pcjr) { @@ -977,30 +966,3 @@ void Player_V2::mutex_down() { } } // End of namespace Scumm - -#ifdef PALMOS_68K -#include "scumm_globals.h" - -_GINIT(PlayerV2) -_GSETPTR(Scumm::note_lengths, GBVARS_NOTELENGTHS_INDEX, uint8, GBVARS_SCUMM) -_GSETPTR(Scumm::hull_offsets, GBVARS_HULLOFFSETS_INDEX, uint16, GBVARS_SCUMM) -_GSETPTR(Scumm::hulls, GBVARS_HULLS_INDEX, int16, GBVARS_SCUMM) -_GSETPTR(Scumm::freqmod_lengths, GBVARS_FREQMODLENGTHS_INDEX, uint16, GBVARS_SCUMM) -_GSETPTR(Scumm::freqmod_offsets, GBVARS_FREQMODOFFSETS_INDEX, uint16, GBVARS_SCUMM) -_GSETPTR(Scumm::freqmod_table, GBVARS_FREQMODTABLE_INDEX, int8, GBVARS_SCUMM) -_GSETPTR(Scumm::spk_freq_table, GBVARS_SPKFREQTABLE_INDEX, uint16, GBVARS_SCUMM) -_GSETPTR(Scumm::pcjr_freq_table, GBVARS_PCJRFREQTABLE_INDEX, uint16, GBVARS_SCUMM) -_GEND - -_GRELEASE(PlayerV2) -_GRELEASEPTR(GBVARS_NOTELENGTHS_INDEX, GBVARS_SCUMM) -_GRELEASEPTR(GBVARS_HULLOFFSETS_INDEX, GBVARS_SCUMM) -_GRELEASEPTR(GBVARS_HULLS_INDEX, GBVARS_SCUMM) -_GRELEASEPTR(GBVARS_FREQMODLENGTHS_INDEX, GBVARS_SCUMM) -_GRELEASEPTR(GBVARS_FREQMODOFFSETS_INDEX, GBVARS_SCUMM) -_GRELEASEPTR(GBVARS_FREQMODTABLE_INDEX, GBVARS_SCUMM) -_GRELEASEPTR(GBVARS_SPKFREQTABLE_INDEX, GBVARS_SCUMM) -_GRELEASEPTR(GBVARS_PCJRFREQTABLE_INDEX, GBVARS_SCUMM) -_GEND - -#endif diff --git a/engines/scumm/player_v2a.cpp b/engines/scumm/player_v2a.cpp index 7096021be9..ceabbc7d95 100644 --- a/engines/scumm/player_v2a.cpp +++ b/engines/scumm/player_v2a.cpp @@ -32,20 +32,15 @@ namespace Scumm { #define BASE_FREQUENCY 3579545 -#ifdef PALMOS_68K -static uint32 *CRCtable = NULL; -#else static uint32 CRCtable[256]; -#endif -static void InitCRC (void) -{ + +static void InitCRC (void) { const uint32 poly = 0xEDB88320; int i, j; uint32 n; - for (i = 0; i < 256; i++) - { + for (i = 0; i < 256; i++) { n = i; for (j = 0; j < 8; j++) n = (n & 1) ? ((n >> 1) ^ poly) : (n >> 1); @@ -53,8 +48,7 @@ static void InitCRC (void) } } -static uint32 GetCRC (byte *data, int len) -{ +static uint32 GetCRC (byte *data, int len) { uint32 CRC = 0xFFFFFFFF; int i; for (i = 0; i < len; i++) @@ -1116,8 +1110,7 @@ public: } virtual bool update() { assert(_id); - if (_curfreq >= _freq2) - { + if (_curfreq >= _freq2) { _mod->setChannelFreq(_id, BASE_FREQUENCY / _curfreq); _curfreq -= _bendrate; if (--_bendctr) @@ -1125,9 +1118,7 @@ public: _bendrate--; if (_bendrate < 2) _bendrate = 2; - } - else - { + } else { if (!--_holdctr) return false; } @@ -1163,15 +1154,12 @@ public: } virtual bool update() { assert(_id); - if (!_loop) - { + if (!_loop) { _vol--; if (_vol) _mod->setChannelVol(_id, _vol); else return false; - } - else if (!--_loop) - { + } else if (!--_loop) { _mod->stopChannel(_id); char *tmp_data = (char *)malloc(_size2); memcpy(tmp_data, _data + _offset2, _size2); @@ -1309,9 +1297,6 @@ Player_V2A::Player_V2A(ScummEngine *scumm, Audio::Mixer *mixer) { int i; _vm = scumm; -#ifdef PALMOS_68K - if (!CRCtable) CRCtable = (uint32 *)calloc(256, sizeof(uint32)); -#endif InitCRC(); for (i = 0; i < V2A_MAXSLOTS; i++) { @@ -1325,9 +1310,6 @@ Player_V2A::Player_V2A(ScummEngine *scumm, Audio::Mixer *mixer) { Player_V2A::~Player_V2A() { delete _mod; -#ifdef PALMOS_68K - free(CRCtable); -#endif } void Player_V2A::setMusicVolume (int vol) { diff --git a/engines/scumm/resource.cpp b/engines/scumm/resource.cpp index 88df9da6c7..d96ecc58f6 100644 --- a/engines/scumm/resource.cpp +++ b/engines/scumm/resource.cpp @@ -597,7 +597,7 @@ void ScummEngine::ensureResourceLoaded(int type, int i) { i = _resourceMapper[i & 0x7F]; } - // FIXME - TODO: This check used to be "i==0". However, that causes + // FIXME: This check used to be "i==0". However, that causes // problems when using this function to ensure charset 0 is loaded. // This is done for many games, e.g. Zak256 or Indy3 (EGA and VGA). // For now we restrict the check to anything which is not a charset. diff --git a/engines/scumm/saveload.cpp b/engines/scumm/saveload.cpp index 3f638946c4..0e485e226a 100644 --- a/engines/scumm/saveload.cpp +++ b/engines/scumm/saveload.cpp @@ -344,7 +344,7 @@ bool ScummEngine::loadState(int slot, bool compat) { // Restore the virtual screens and force a fade to black. initScreens(0, _screenHeight); - VirtScreen *vs = &virtscr[kMainVirtScreen]; + VirtScreen *vs = &_virtscr[kMainVirtScreen]; memset(vs->getPixels(0, 0), 0, vs->pitch * vs->h); vs->setDirtyRange(0, vs->h); updateDirtyScreen(kMainVirtScreen); diff --git a/engines/scumm/script_v0.cpp b/engines/scumm/script_v0.cpp index 62e5cee03b..143e926604 100644 --- a/engines/scumm/script_v0.cpp +++ b/engines/scumm/script_v0.cpp @@ -527,9 +527,9 @@ void ScummEngine_v0::drawSentence() { } _string[2].charset = 1; - _string[2].ypos = virtscr[kVerbVirtScreen].topline; + _string[2].ypos = _virtscr[kVerbVirtScreen].topline; _string[2].xpos = 0; - _string[2].right = virtscr[kVerbVirtScreen].w - 1; + _string[2].right = _virtscr[kVerbVirtScreen].w - 1; _string[2].color = 16; byte string[80]; @@ -550,10 +550,10 @@ void ScummEngine_v0::drawSentence() { } string[i] = 0; - sentenceline.top = virtscr[kVerbVirtScreen].topline; - sentenceline.bottom = virtscr[kVerbVirtScreen].topline + 8; + sentenceline.top = _virtscr[kVerbVirtScreen].topline; + sentenceline.bottom = _virtscr[kVerbVirtScreen].topline + 8; sentenceline.left = 0; - sentenceline.right = virtscr[kVerbVirtScreen].w - 1; + sentenceline.right = _virtscr[kVerbVirtScreen].w - 1; restoreBackground(sentenceline); drawString(2, (byte*)string); diff --git a/engines/scumm/script_v2.cpp b/engines/scumm/script_v2.cpp index 767d9495cc..532acc98a3 100644 --- a/engines/scumm/script_v2.cpp +++ b/engines/scumm/script_v2.cpp @@ -1053,9 +1053,9 @@ void ScummEngine_v2::o2_drawSentence() { } _string[2].charset = 1; - _string[2].ypos = virtscr[kVerbVirtScreen].topline; + _string[2].ypos = _virtscr[kVerbVirtScreen].topline; _string[2].xpos = 0; - _string[2].right = virtscr[kVerbVirtScreen].w - 1; + _string[2].right = _virtscr[kVerbVirtScreen].w - 1; if (_game.platform == Common::kPlatformNES) { _string[2].xpos = 16; _string[2].color = 0; @@ -1087,15 +1087,15 @@ void ScummEngine_v2::o2_drawSentence() { string[i] = 0; if (_game.platform == Common::kPlatformNES) { - sentenceline.top = virtscr[kVerbVirtScreen].topline; - sentenceline.bottom = virtscr[kVerbVirtScreen].topline + 16; + sentenceline.top = _virtscr[kVerbVirtScreen].topline; + sentenceline.bottom = _virtscr[kVerbVirtScreen].topline + 16; sentenceline.left = 16; - sentenceline.right = virtscr[kVerbVirtScreen].w - 1; + sentenceline.right = _virtscr[kVerbVirtScreen].w - 1; } else { - sentenceline.top = virtscr[kVerbVirtScreen].topline; - sentenceline.bottom = virtscr[kVerbVirtScreen].topline + 8; + sentenceline.top = _virtscr[kVerbVirtScreen].topline; + sentenceline.bottom = _virtscr[kVerbVirtScreen].topline + 8; sentenceline.left = 0; - sentenceline.right = virtscr[kVerbVirtScreen].w - 1; + sentenceline.right = _virtscr[kVerbVirtScreen].w - 1; } restoreBackground(sentenceline); @@ -1590,9 +1590,9 @@ void ScummEngine_v2::setUserState(byte state) { // Hide all verbs and inventory Common::Rect rect; - rect.top = virtscr[kVerbVirtScreen].topline; - rect.bottom = virtscr[kVerbVirtScreen].topline + 8 * 88; - rect.right = virtscr[kVerbVirtScreen].w - 1; + rect.top = _virtscr[kVerbVirtScreen].topline; + rect.bottom = _virtscr[kVerbVirtScreen].topline + 8 * 88; + rect.right = _virtscr[kVerbVirtScreen].w - 1; if (_game.platform == Common::kPlatformNES) { rect.left = 16; } else { diff --git a/engines/scumm/script_v5.cpp b/engines/scumm/script_v5.cpp index c4f7937aa4..3cd71bac08 100644 --- a/engines/scumm/script_v5.cpp +++ b/engines/scumm/script_v5.cpp @@ -2929,8 +2929,8 @@ void ScummEngine_v5::o5_oldRoomEffect() { // For now, we force a redraw of the screen background. This // way the Zak end credits seem to work mostly correct. - VirtScreen *vs = &virtscr[0]; - restoreBackground(Common::Rect(0,vs->topline, vs->w, vs->topline + vs->h)); + VirtScreen *vs = &_virtscr[kMainVirtScreen]; + restoreBackground(Common::Rect(0, vs->topline, vs->w, vs->topline + vs->h)); vs->setDirtyRange(0, vs->h); updateDirtyScreen(kMainVirtScreen); diff --git a/engines/scumm/script_v6.cpp b/engines/scumm/script_v6.cpp index 7e0d705377..e436489f25 100644 --- a/engines/scumm/script_v6.cpp +++ b/engines/scumm/script_v6.cpp @@ -2715,7 +2715,7 @@ void ScummEngine_v6::o6_kernelGetFunctions() { int i; int slot; Actor *a; - VirtScreen *vs = &virtscr[0]; + VirtScreen *vs = &_virtscr[kMainVirtScreen]; getStackList(args, ARRAYSIZE(args)); diff --git a/engines/scumm/scumm-md5.h b/engines/scumm/scumm-md5.h index 4f6b2477c6..69d2bea3e0 100644 --- a/engines/scumm/scumm-md5.h +++ b/engines/scumm/scumm-md5.h @@ -1,5 +1,5 @@ /* - This file was generated by the md5table tool on Fri Jul 20 21:25:14 2007 + This file was generated by the md5table tool on Mon Aug 13 12:40:13 2007 DO NOT EDIT MANUALLY! */ @@ -104,9 +104,9 @@ static const MD5Table md5table[] = { { "2232b0b9411575b1f9961713ebc9de61", "balloon", "HE 80", "", -1, Common::ES_ESP, Common::kPlatformWindows }, { "225e18566e810c634bf7de63e7568e3e", "mustard", "", "", -1, Common::EN_USA, Common::kPlatformUnknown }, { "22c9eb04455440131ffc157aeb8d40a8", "fbear", "HE 70", "Demo", -1, Common::EN_ANY, Common::kPlatformWindows }, - { "22d07d6c386c9c25aca5dac2a0c0d94b", "maniac", "NES", "", -1, Common::SE_SWE, Common::kPlatformNES }, + { "22d07d6c386c9c25aca5dac2a0c0d94b", "maniac", "NES", "", 262144, Common::SE_SWE, Common::kPlatformNES }, { "22f4ea88a09da12df9308ba30bcb7d0f", "loom", "EGA", "EGA", -1, Common::EN_ANY, Common::kPlatformPC }, - { "257f8c14d8c584f7ddd601bcb00920c7", "maniac", "NES", "", -1, Common::DE_DEU, Common::kPlatformNES }, + { "257f8c14d8c584f7ddd601bcb00920c7", "maniac", "NES", "", 262144, Common::DE_DEU, Common::kPlatformNES }, { "2723fea3dae0cb47768c424b145ae0e7", "tentacle", "", "Floppy", 7932, Common::EN_ANY, Common::kPlatformPC }, { "27b3a4224ad63d5b04627595c1c1a025", "zak", "V2", "V2", -1, Common::IT_ITA, Common::kPlatformAmiga }, { "28d24a33448fab6795850bc9f159a4a2", "atlantis", "", "Demo", 11170, Common::JA_JPN, Common::kPlatformFMTowns }, @@ -147,7 +147,7 @@ static const MD5Table md5table[] = { { "37ff1b308999c4cca7319edfcc1280a0", "puttputt", "HE 70", "Demo", 8269, Common::EN_ANY, Common::kPlatformWindows }, { "3824e60cdf639d22f6df92a03dc4b131", "fbear", "HE 61", "", 7732, Common::EN_ANY, Common::kPlatformPC }, { "387a544b8b10b26912d8413bab63a853", "monkey2", "", "Demo", -1, Common::EN_ANY, Common::kPlatformPC }, - { "3905799e081b80a61d4460b7b733c206", "maniac", "NES", "", -1, Common::EN_GRB, Common::kPlatformNES }, + { "3905799e081b80a61d4460b7b733c206", "maniac", "NES", "", 262144, Common::EN_GRB, Common::kPlatformNES }, { "3938ee1aa4433fca9d9308c9891172b1", "zak", "FM-TOWNS", "Demo", -1, Common::EN_ANY, Common::kPlatformFMTowns }, { "399b217b0c8d65d0398076da486363a9", "indy3", "VGA", "VGA", 6295, Common::DE_DEU, Common::kPlatformPC }, { "39cb9dec16fa16f38d79acd80effb059", "loom", "EGA", "EGA", -1, Common::FR_FRA, Common::kPlatformAmiga }, @@ -312,7 +312,7 @@ static const MD5Table md5table[] = { { "7f945525abcd48015adf1632637a44a1", "pajama", "", "Demo", -1, Common::FR_FRA, Common::kPlatformUnknown }, { "7fc6cdb46b4c9d384c52327f4bca6416", "football", "", "", -1, Common::EN_ANY, Common::kPlatformUnknown }, { "810a9da887aefa597b0cf3c77d262897", "BluesABCTime", "", "Demo", -1, Common::EN_ANY, Common::kPlatformUnknown }, - { "81bbfa181184cb494e7a81dcfa94fbd9", "maniac", "NES", "", -1, Common::FR_FRA, Common::kPlatformNES }, + { "81bbfa181184cb494e7a81dcfa94fbd9", "maniac", "NES", "", 262144, Common::FR_FRA, Common::kPlatformNES }, { "8299d9b8a1b0e7b881bae7a9971dc5e2", "zak", "V2", "Demo", 1916, Common::EN_ANY, Common::kPlatformAtariST }, { "8368f552b1e3eba559f8d559bcc4cadb", "freddi3", "", "", -1, Common::UNK_LANG, Common::kPlatformUnknown }, { "83cedbe26aa8b58988e984e3d34cac8e", "freddi3", "HE 99", "", -1, Common::DE_DEU, Common::kPlatformUnknown }, @@ -414,6 +414,7 @@ static const MD5Table md5table[] = { { "b5298a5c15ffbe8b381d51ea4e26d35c", "freddi4", "HE 99", "", -1, Common::DE_DEU, Common::kPlatformUnknown }, { "b597e0403cc0002f69170e6caba7edd9", "indy3", "EGA", "EGA Demo", 5361, Common::EN_ANY, Common::kPlatformPC }, { "b628506f7def772e40de0aa5440fb8e1", "activity", "HE 70", "", -1, Common::EN_ANY, Common::kPlatformWindows }, + { "b7d37d6b786b5a22deea3b038eca96ca", "maniac", "NES", "extracted", 2082, Common::ES_ESP, Common::kPlatformNES }, { "b886b0a5d909c7158a914e1d7c1c6c65", "loom", "EGA", "EGA", -1, Common::FR_FRA, Common::kPlatformPC }, { "b8955d7d23b4972229060d1592489fef", "freddicove", "HE 100", "", -1, Common::NL_NLD, Common::kPlatformUnknown }, { "b9ba19ce376efc69be78ef3baef8d2b9", "monkey", "CD", "", -1, Common::EN_ANY, Common::kPlatformMacintosh }, @@ -426,6 +427,7 @@ static const MD5Table md5table[] = { { "bf8b52fdd9a69c67f34e8e9fec72661c", "farm", "HE 71", "Demo", -1, Common::EN_ANY, Common::kPlatformWindows }, { "bfdf584b01503f0762baded581f6a0a2", "SoccerMLS", "", "", -1, Common::EN_ANY, Common::kPlatformWindows }, { "c0039ad982999c92d0de81910d640fa0", "freddi", "HE 71", "", -1, Common::NL_NLD, Common::kPlatformWindows }, + { "c0d5c89550381ac433624fedad5e1100", "loom", "PC-Engine", "", -1, Common::JA_JPN, Common::kPlatformPCEngine }, { "c13225cb1bbd3bc9fe578301696d8021", "monkey", "SEGA", "", -1, Common::EN_ANY, Common::kPlatformSegaCD }, { "c24c490373aeb48fbd54caa8e7ae376d", "loom", "No Adlib", "EGA", -1, Common::DE_DEU, Common::kPlatformAtariST }, { "c25755b08a8d0d47695e05f1e2111bfc", "freddi4", "", "Demo", -1, Common::EN_USA, Common::kPlatformUnknown }, @@ -488,7 +490,7 @@ static const MD5Table md5table[] = { { "d7b247c26bf1f01f8f7daf142be84de3", "balloon", "HE 99", "Updated", -1, Common::EN_ANY, Common::kPlatformWindows }, { "d831f7c048574dd9d5d85db2a1468099", "maniac", "C64", "", -1, Common::EN_ANY, Common::kPlatformC64 }, { "d8323015ecb8b10bf53474f6e6b0ae33", "dig", "", "", 16304, Common::UNK_LANG, Common::kPlatformUnknown }, - { "d8d07efcb88f396bee0b402b10c3b1c9", "maniac", "NES", "", -1, Common::EN_USA, Common::kPlatformNES }, + { "d8d07efcb88f396bee0b402b10c3b1c9", "maniac", "NES", "", 262144, Common::EN_USA, Common::kPlatformNES }, { "d917f311a448e3cc7239c31bddb00dd2", "samnmax", "", "CD", 9080, Common::EN_ANY, Common::kPlatformUnknown }, { "d9d0dd93d16ab4dec55cabc2b86bbd17", "samnmax", "", "Demo", 6478, Common::EN_ANY, Common::kPlatformPC }, { "da09e666fc8f5b78d7b0ac65d1a3b56e", "monkey2", "", "", 11135, Common::EN_ANY, Common::kPlatformFMTowns }, @@ -537,6 +539,7 @@ static const MD5Table md5table[] = { { "f049e38c1f8302b5db6170f1872af89a", "monkey", "CD", "CD", 8955, Common::ES_ESP, Common::kPlatformPC }, { "f06e66fd45b2f8b0f4a2833ff4476050", "fbpack", "", "", -1, Common::HB_ISR, Common::kPlatformPC }, { "f08145577e4f13584cc90b3d6e9caa55", "pajama3", "", "Demo", -1, Common::NL_NLD, Common::kPlatformUnknown }, + { "f163cf53f7850e43fb482471e5c52e1a", "maniac", "NES", "", 262144, Common::ES_ESP, Common::kPlatformNES }, { "f1b0e0d587b85052de5534a3847e68fe", "water", "HE 99", "Updated", -1, Common::EN_ANY, Common::kPlatformUnknown }, { "f237bf8a5ef9af78b2a6a4f3901da341", "pajama", "", "Demo", 18354, Common::EN_ANY, Common::kPlatformUnknown }, { "f27b1ba0eadaf2a6617b2b58192d1dbf", "samnmax", "", "Floppy", -1, Common::DE_DEU, Common::kPlatformPC }, diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp index e54060c9e1..60911a97dd 100644 --- a/engines/scumm/scumm.cpp +++ b/engines/scumm/scumm.cpp @@ -41,6 +41,7 @@ #include "scumm/debugger.h" #include "scumm/dialogs.h" #include "scumm/file.h" +#include "scumm/file_nes.h" #include "scumm/imuse/imuse.h" #include "scumm/imuse_digi/dimuse.h" #include "scumm/smush/smush_mixer.h" @@ -227,7 +228,7 @@ ScummEngine::ScummEngine(OSystem *syst, const DetectorResult &dr) _roomWidth = 0; _screenHeight = 0; _screenWidth = 0; - memset(virtscr, 0, sizeof(virtscr)); + memset(_virtscr, 0, sizeof(_virtscr)); memset(&camera, 0, sizeof(CameraData)); memset(_colorCycle, 0, sizeof(_colorCycle)); memset(_colorUsedByCycle, 0, sizeof(_colorUsedByCycle)); @@ -1196,12 +1197,7 @@ void ScummEngine::setupScumm() { } int maxHeapThreshold = -1; -#ifdef PALMOS_68K - if (_game.features & GF_NEW_COSTUMES) - maxHeapThreshold = gVars->memory[kMemScummNewCostGames]; - else - maxHeapThreshold = gVars->memory[kMemScummOldCostGames]; -#else + if (_game.features & GF_NEW_COSTUMES) { // Since the new costumes are very big, we increase the heap limit, to avoid having // to constantly reload stuff from the data files. @@ -1209,7 +1205,7 @@ void ScummEngine::setupScumm() { } else { maxHeapThreshold = 550000; } -#endif + _res->setHeapThreshold(400000, maxHeapThreshold); #if (defined(PALMOS_ARM) || defined(PALMOS_DEBUG) || defined(__GP32__)) @@ -1381,7 +1377,7 @@ void ScummEngine::resetScumm() { } camera._follows = 0; - virtscr[0].xstart = 0; + _virtscr[0].xstart = 0; _mouse.x = 104; _mouse.y = 56; diff --git a/engines/scumm/scumm.h b/engines/scumm/scumm.h index 18c2275029..2a155c7e02 100644 --- a/engines/scumm/scumm.h +++ b/engines/scumm/scumm.h @@ -917,7 +917,7 @@ protected: public: int _roomHeight, _roomWidth; int _screenHeight, _screenWidth; - VirtScreen virtscr[4]; // Virtual screen areas + VirtScreen _virtscr[4]; // Virtual screen areas CameraData camera; // 'Camera' - viewport int _screenStartStrip, _screenEndStrip; @@ -1031,7 +1031,6 @@ protected: void updateDirtyScreen(VirtScreenNumber slot); void drawStripToScreen(VirtScreen *vs, int x, int w, int t, int b); void ditherCGA(byte *dst, int dstPitch, int x, int y, int width, int height) const; - void scale2x(byte *dst, int dstPitch, const byte *src, int srcPitch, int w, int h); public: VirtScreen *findVirtScreen(int y); diff --git a/engines/scumm/smush/codec47.cpp b/engines/scumm/smush/codec47.cpp index 6904e96c11..739c7308d3 100644 --- a/engines/scumm/smush/codec47.cpp +++ b/engines/scumm/smush/codec47.cpp @@ -88,9 +88,6 @@ static const int8 codec47_table_big2[] = { 0, 0, 0, 0, 1, 3, 4, 6, 7, 7, 7, 7, 6, 4, 3, 1, }; -#ifdef PALMOS_68K -static const int8 *codec47_table; -#else static const int8 codec47_table[] = { 0, 0, -1, -43, 6, -43, -9, -42, 13, -41, -16, -40, 19, -39, -23, -36, 26, -34, -2, -33, @@ -144,7 +141,6 @@ static const int8 codec47_table[] = { 23, 36, -19, 39, 16, 40, -13, 41, 9, 42, -6, 43, 1, 43, 0, 0, 0, 0, 0, 0 }; -#endif void Codec47Decoder::makeTablesInterpolation(int param) { int32 variable1, variable2; @@ -617,16 +613,3 @@ bool Codec47Decoder::decode(byte *dst, const byte *src) { } } // End of namespace Scumm - -#ifdef PALMOS_68K -#include "scumm_globals.h" - -_GINIT(Codec47) -_GSETPTR(Scumm::codec47_table, GBVARS_CODEC47TABLE_INDEX, int8, GBVARS_SCUMM) -_GEND - -_GRELEASE(Codec47) -_GRELEASEPTR(GBVARS_CODEC47TABLE_INDEX, GBVARS_SCUMM) -_GEND - -#endif diff --git a/engines/scumm/smush/smush_player.cpp b/engines/scumm/smush/smush_player.cpp index ce39302e25..612f2771db 100644 --- a/engines/scumm/smush/smush_player.cpp +++ b/engines/scumm/smush/smush_player.cpp @@ -265,6 +265,8 @@ SmushPlayer::~SmushPlayer() { } void SmushPlayer::init(int32 speed) { + VirtScreen *vs = &_vm->_virtscr[kMainVirtScreen]; + _frame = 0; _speed = speed; _endOfFile = false; @@ -273,7 +275,7 @@ void SmushPlayer::init(int32 speed) { _vm->_smushActive = true; _vm->setDirtyColors(0, 255); - _dst = _vm->virtscr[0].getPixels(0, 0); + _dst = vs->getPixels(0, 0); // HACK HACK HACK: This is an *evil* trick, beware! // We do this to fix bug #1037052. A proper solution would change all the @@ -281,10 +283,10 @@ void SmushPlayer::init(int32 speed) { // However, since a lot of the SMUSH code currently assumes the screen // width and pitch to be equal, this will require lots of changes. So // we resort to this hackish solution for now. - _origPitch = _vm->virtscr[0].pitch; + _origPitch = vs->pitch; _origNumStrips = _vm->_gdi->_numStrips; - _vm->virtscr[0].pitch = _vm->virtscr[0].w; - _vm->_gdi->_numStrips = _vm->virtscr[0].w / 8; + vs->pitch = vs->w; + _vm->_gdi->_numStrips = vs->w / 8; _vm->_mixer->stopHandle(_compressedFileSoundHandle); _vm->_mixer->stopHandle(_IACTchannel); @@ -319,7 +321,7 @@ void SmushPlayer::release() { // HACK HACK HACK: This is an *evil* trick, beware! See above for // some explanation. - _vm->virtscr[0].pitch = _origPitch; + _vm->_virtscr[kMainVirtScreen].pitch = _origPitch; _vm->_gdi->_numStrips = _origNumStrips; delete _codec37; diff --git a/engines/scumm/string.cpp b/engines/scumm/string.cpp index 32fdf0e04e..83b4e90cf6 100644 --- a/engines/scumm/string.cpp +++ b/engines/scumm/string.cpp @@ -456,7 +456,7 @@ void ScummEngine::CHARSET_1() { if (a && _string[0].overhead) { int s; - _string[0].xpos = a->getPos().x - virtscr[0].xstart; + _string[0].xpos = a->getPos().x - _virtscr[kMainVirtScreen].xstart; _string[0].ypos = a->getPos().y - a->getElevation() - _screenTop; if (_game.version <= 5) { @@ -586,7 +586,7 @@ void ScummEngine::CHARSET_1() { _nextTop += _charset->getFontHeight(); } if (_game.version > 3) { - // FIXME - is this really needed? + // FIXME: is this really needed? _charset->_disableOffsX = true; } continue; @@ -678,7 +678,7 @@ void ScummEngine_v8::CHARSET_1() { if (a && _string[0].overhead) { int s; - _string[0].xpos = a->getPos().x - virtscr[0].xstart; + _string[0].xpos = a->getPos().x - _virtscr[kMainVirtScreen].xstart; s = a->_scalex * a->_talkPosX / 255; _string[0].xpos += (a->_talkPosX - s) / 2 + s; diff --git a/engines/scumm/thumbnail.cpp b/engines/scumm/thumbnail.cpp index 01255f1c1d..360d0de932 100644 --- a/engines/scumm/thumbnail.cpp +++ b/engines/scumm/thumbnail.cpp @@ -99,7 +99,7 @@ Graphics::Surface *ScummEngine::loadThumbnail(Common::InSaveFile *file) { void ScummEngine::saveThumbnail(Common::OutSaveFile *file) { Graphics::Surface thumb; -#if !defined(PALMOS_68K) || !defined(__DS__) +#if !defined(__DS__) if (!createThumbnailFromScreen(&thumb)) #endif thumb.create(kThumbnailWidth, kThumbnailHeight2, sizeof(uint16)); diff --git a/engines/scumm/verbs.cpp b/engines/scumm/verbs.cpp index 56ee454240..3c5713d241 100644 --- a/engines/scumm/verbs.cpp +++ b/engines/scumm/verbs.cpp @@ -86,7 +86,7 @@ static const VerbSettings v0VerbTable_German[] = { }; void ScummEngine_v0::resetVerbs() { - VirtScreen *virt = &virtscr[kVerbVirtScreen]; + VirtScreen *virt = &_virtscr[kVerbVirtScreen]; VerbSlot *vs; int i; @@ -121,7 +121,7 @@ void ScummEngine_v0::resetVerbs() { } void ScummEngine_v0::setNewKidVerbs() { - VirtScreen *virt = &virtscr[kVerbVirtScreen]; + VirtScreen *virt = &_virtscr[kVerbVirtScreen]; VerbSlot *vs; int i; @@ -283,7 +283,7 @@ void ScummEngine_v2::initNESMouseOver() { } void ScummEngine_v2::checkV2MouseOver(Common::Point pos) { - VirtScreen *vs = &virtscr[kVerbVirtScreen]; + VirtScreen *vs = &_virtscr[kVerbVirtScreen]; Common::Rect rect; byte *ptr, *dst; int i, x, y, new_box = -1; @@ -346,7 +346,7 @@ void ScummEngine_v2::checkV2Inventory(int x, int y) { int inventoryArea = (_game.platform == Common::kPlatformNES) ? 48: 32; int object = 0; - y -= virtscr[kVerbVirtScreen].topline; + y -= _virtscr[kVerbVirtScreen].topline; if ((y < inventoryArea) || !(_mouseAndKeyboardStat & MBS_LEFT_CLICK)) return; @@ -391,7 +391,7 @@ void ScummEngine_v2::checkV2Inventory(int x, int y) { } void ScummEngine_v2::redrawV2Inventory() { - VirtScreen *vs = &virtscr[kVerbVirtScreen]; + VirtScreen *vs = &_virtscr[kVerbVirtScreen]; int i; int max_inv; Common::Rect inventoryBox; @@ -405,7 +405,7 @@ void ScummEngine_v2::redrawV2Inventory() { // Clear on all invocations inventoryBox.top = vs->topline + inventoryArea; - inventoryBox.bottom = vs->topline + virtscr[kVerbVirtScreen].h; + inventoryBox.bottom = vs->topline + vs->h; inventoryBox.left = 0; inventoryBox.right = vs->w; restoreBackground(inventoryBox); @@ -1014,8 +1014,8 @@ void ScummEngine::setVerbObject(uint room, uint object, uint verb) { } else if (_game.features & GF_SMALL_HEADER) { for (i = (_numLocalObjects-1); i > 0; i--) { if (_objs[i].obj_nr == object) { - // FIXME - the only thing we need from the OBCD is the image size! - // So we could use almost the same code (save for offsets) + // FIXME: the only thing we need from the OBCD is the image size! + // So we could use almost the same code (except for offsets) // as in the GF_OLD_BUNDLE code. But of course that would break save games // unless we insert special conversion code... <sigh> findObjectInRoom(&foir, foImageHeader, object, room); diff --git a/engines/sky/hufftext.cpp b/engines/sky/hufftext.cpp index b3e299d00c..677ea4817e 100644 --- a/engines/sky/hufftext.cpp +++ b/engines/sky/hufftext.cpp @@ -27,17 +27,6 @@ namespace Sky { -#ifdef PALMOS_68K -const HuffTree *Text::_huffTree_00109; -const HuffTree *Text::_huffTree_00267; -const HuffTree *Text::_huffTree_00288; -const HuffTree *Text::_huffTree_00303; -const HuffTree *Text::_huffTree_00331; -const HuffTree *Text::_huffTree_00348; -const HuffTree *Text::_huffTree_00365; -const HuffTree *Text::_huffTree_00368; -const HuffTree *Text::_huffTree_00372; -#else const HuffTree Text::_huffTree_00109[] = { { 1, 22, 0 }, { 2, 9, 0 }, @@ -2015,35 +2004,5 @@ const HuffTree Text::_huffTree_00372[] = { { 0, 0, 148 }, { 0, 0, '!' }, }; -#endif } // End of namespace Sky - -#ifdef PALMOS_68K -#include "scumm_globals.h" - -_GINIT(Sky_Hufftext) -_GSETPTR(Sky::Text::_huffTree_00109, GBVARS_HUFFTREE_00109_INDEX, const Sky::HuffTree, GBVARS_QUEEN) -_GSETPTR(Sky::Text::_huffTree_00267, GBVARS_HUFFTREE_00267_INDEX, const Sky::HuffTree, GBVARS_QUEEN) -_GSETPTR(Sky::Text::_huffTree_00288, GBVARS_HUFFTREE_00288_INDEX, const Sky::HuffTree, GBVARS_QUEEN) -_GSETPTR(Sky::Text::_huffTree_00303, GBVARS_HUFFTREE_00303_INDEX, const Sky::HuffTree, GBVARS_QUEEN) -_GSETPTR(Sky::Text::_huffTree_00331, GBVARS_HUFFTREE_00331_INDEX, const Sky::HuffTree, GBVARS_QUEEN) -_GSETPTR(Sky::Text::_huffTree_00348, GBVARS_HUFFTREE_00348_INDEX, const Sky::HuffTree, GBVARS_QUEEN) -_GSETPTR(Sky::Text::_huffTree_00365, GBVARS_HUFFTREE_00365_INDEX, const Sky::HuffTree, GBVARS_QUEEN) -_GSETPTR(Sky::Text::_huffTree_00368, GBVARS_HUFFTREE_00368_INDEX, const Sky::HuffTree, GBVARS_QUEEN) -_GSETPTR(Sky::Text::_huffTree_00372, GBVARS_HUFFTREE_00372_INDEX, const Sky::HuffTree, GBVARS_QUEEN) -_GEND - -_GRELEASE(Sky_Hufftext) -_GRELEASEPTR(GBVARS_HUFFTREE_00109_INDEX, GBVARS_QUEEN) -_GRELEASEPTR(GBVARS_HUFFTREE_00267_INDEX, GBVARS_QUEEN) -_GRELEASEPTR(GBVARS_HUFFTREE_00288_INDEX, GBVARS_QUEEN) -_GRELEASEPTR(GBVARS_HUFFTREE_00303_INDEX, GBVARS_QUEEN) -_GRELEASEPTR(GBVARS_HUFFTREE_00331_INDEX, GBVARS_QUEEN) -_GRELEASEPTR(GBVARS_HUFFTREE_00348_INDEX, GBVARS_QUEEN) -_GRELEASEPTR(GBVARS_HUFFTREE_00365_INDEX, GBVARS_QUEEN) -_GRELEASEPTR(GBVARS_HUFFTREE_00368_INDEX, GBVARS_QUEEN) -_GRELEASEPTR(GBVARS_HUFFTREE_00372_INDEX, GBVARS_QUEEN) -_GEND - -#endif diff --git a/engines/sky/text.h b/engines/sky/text.h index be09f5a437..dd73b51db4 100644 --- a/engines/sky/text.h +++ b/engines/sky/text.h @@ -96,7 +96,6 @@ private: static const uint16 _patchLangIdx[8]; static const uint16 _patchLangNum[8]; -#ifndef PALMOS_68K static const HuffTree _huffTree_00109[]; // trees moved to hufftext.cpp static const HuffTree _huffTree_00267[]; static const HuffTree _huffTree_00288[]; @@ -106,18 +105,6 @@ private: static const HuffTree _huffTree_00365[]; static const HuffTree _huffTree_00368[]; static const HuffTree _huffTree_00372[]; -#else -public: - static const HuffTree *_huffTree_00109; // trees moved to hufftext.cpp - static const HuffTree *_huffTree_00267; - static const HuffTree *_huffTree_00288; - static const HuffTree *_huffTree_00303; - static const HuffTree *_huffTree_00331; - static const HuffTree *_huffTree_00348; - static const HuffTree *_huffTree_00365; - static const HuffTree *_huffTree_00368; - static const HuffTree *_huffTree_00372; -#endif }; } // End of namespace Sky diff --git a/engines/sword1/logic.cpp b/engines/sword1/logic.cpp index 7c15d66a46..60103ba5f9 100644 --- a/engines/sword1/logic.cpp +++ b/engines/sword1/logic.cpp @@ -317,8 +317,7 @@ int Logic::logicArAnimate(Object *compact, uint32 id) { } compact->o_walk_pc++; - if (route[compact->o_walk_pc].frame == 512) //end of sequence - { + if (route[compact->o_walk_pc].frame == 512) { //end of sequence compact->o_logic = LOGIC_script; if (((_scriptVars[GEORGE_WALKING] == 2) || (_scriptVars[GEORGE_WALKING] == 1)) && (id == PLAYER)) { diff --git a/engines/sword1/router.cpp b/engines/sword1/router.cpp index 685e11fd32..6478674eb2 100644 --- a/engines/sword1/router.cpp +++ b/engines/sword1/router.cpp @@ -130,8 +130,7 @@ int32 Router::routeFinder(int32 id, Object *megaObject, int32 x, int32 y, int32 slowInFrames = 0; slowOutFrames = 0; - if (megaId == GEORGE) - { + if (megaId == GEORGE) { turnFramesLeft = 3 * _framesPerChar + NO_DIRECTIONS + 2 * SLOW_IN + 4 * SLOW_OUT; turnFramesRight = 3 * _framesPerChar + NO_DIRECTIONS + 2 * SLOW_IN + 4 * SLOW_OUT + NO_DIRECTIONS; walkFramesLeft = _framesPerChar + NO_DIRECTIONS; @@ -703,8 +702,7 @@ void Router::slidyWalkAnimator(WalkData *walkAnim) { // TURN TO START THE WALK //**************************************************************************** // rotate if we need to - if (lastDir != currentDir) - { + if (lastDir != currentDir) { // get the direction to turn turnDir = currentDir - lastDir; if ( turnDir < 0) @@ -717,10 +715,8 @@ void Router::slidyWalkAnimator(WalkData *walkAnim) { // rotate to new walk direction // for george and nico put in a head turn at the start - if ((megaId == GEORGE) || (megaId == NICO)) - { - if ( turnDir < 0) // new frames for turn frames 29oct95jps - { + if ((megaId == GEORGE) || (megaId == NICO)) { + if ( turnDir < 0) { // new frames for turn frames 29oct95jps module = turnFramesLeft + lastDir; } else { module = turnFramesRight + lastDir; @@ -734,11 +730,9 @@ void Router::slidyWalkAnimator(WalkData *walkAnim) { } // rotate till were facing new dir then go back 45 degrees - while (lastDir != currentDir) - { + while (lastDir != currentDir) { lastDir += turnDir; - if ( turnDir < 0) // new frames for turn frames 29oct95jps - { + if ( turnDir < 0) { // new frames for turn frames 29oct95jps if ( lastDir < 0) lastDir += NO_DIRECTIONS; module = turnFramesLeft + lastDir; @@ -774,8 +768,7 @@ void Router::slidyWalkAnimator(WalkData *walkAnim) { lastDir = 99;// this ensures that we don't put in turn frames for the start currentDir = 99;// this ensures that we don't put in turn frames for the start do { - while (_modularPath[p].num == 0) - { + while (_modularPath[p].num == 0) { p = p + 1; if (currentDir != 99) lastRealDir = currentDir; @@ -784,8 +777,7 @@ void Router::slidyWalkAnimator(WalkData *walkAnim) { } //calculate average amount to lose in each step on the way to the next _node currentDir = _modularPath[p].dir; - if (currentDir < NO_DIRECTIONS) - { + if (currentDir < NO_DIRECTIONS) { module = currentDir * _framesPerStep * 2 + left; if (left == 0) left = _framesPerStep; @@ -814,22 +806,18 @@ void Router::slidyWalkAnimator(WalkData *walkAnim) { errorX = errorX * stepX; errorY = _modularPath[p].y - moduleY; errorY = errorY * stepY; - if ((errorX < 0) || (errorY < 0)) - { + if ((errorX < 0) || (errorY < 0)) { _modularPath[p].num = 0; // the end of the path // okay those last steps took us past our target but do we want to scoot or moonwalk frames = stepCount - lastCount; errorX = _modularPath[p].x - walkAnim[stepCount-1].x; errorY = _modularPath[p].y - walkAnim[stepCount-1].y; - if (frames > _framesPerStep) - { + if (frames > _framesPerStep) { lastErrorX = _modularPath[p].x - walkAnim[stepCount-7].x; lastErrorY = _modularPath[p].y - walkAnim[stepCount-7].y; - if (stepX==0) - { - if (3*ABS(lastErrorY) < ABS(errorY)) //the last stop was closest - { + if (stepX==0) { + if (3*ABS(lastErrorY) < ABS(errorY)) { //the last stop was closest stepCount -= _framesPerStep; if (left == 0) left = _framesPerStep; @@ -837,8 +825,7 @@ void Router::slidyWalkAnimator(WalkData *walkAnim) { left = 0; } } else { - if (3*ABS(lastErrorX) < ABS(errorX)) //the last stop was closest - { + if (3*ABS(lastErrorX) < ABS(errorX)) { //the last stop was closest stepCount -= _framesPerStep; if (left == 0) left = _framesPerStep; @@ -850,8 +837,7 @@ void Router::slidyWalkAnimator(WalkData *walkAnim) { errorX = _modularPath[p].x - walkAnim[stepCount-1].x; errorY = _modularPath[p].y - walkAnim[stepCount-1].y; // okay we've reached the end but we still have an error - if (errorX != 0) - { + if (errorX != 0) { frameCount = 0; frames = stepCount - lastCount; do { @@ -859,8 +845,7 @@ void Router::slidyWalkAnimator(WalkData *walkAnim) { walkAnim[lastCount + frameCount - 1].x += errorX*frameCount/frames; } while (frameCount<frames); } - if (errorY != 0) - { + if (errorY != 0) { frameCount = 0; frames = stepCount - lastCount; do { @@ -874,25 +859,20 @@ void Router::slidyWalkAnimator(WalkData *walkAnim) { if (currentDir != 99) lastRealDir = currentDir; // check each turn condition in turn - if (((lastDir != 99) && (currentDir != 99)) && (megaId == GEORGE)) // only for george - { + if (((lastDir != 99) && (currentDir != 99)) && (megaId == GEORGE)) { // only for george lastDir = currentDir - lastDir;//1 and -7 going right -1 and 7 going left - if (((lastDir == -1) || (lastDir == 7)) || ((lastDir == -2) || (lastDir == 6))) - { + if (((lastDir == -1) || (lastDir == 7)) || ((lastDir == -2) || (lastDir == 6))) { // turn at the end of the last walk frame = lastCount - _framesPerStep; - do - { + do { walkAnim[frame].frame += 104;//turning left frame += 1; } while (frame < lastCount ); } - if (((lastDir == 1) || (lastDir == -7)) || ((lastDir == 2) || (lastDir == -6))) - { + if (((lastDir == 1) || (lastDir == -7)) || ((lastDir == 2) || (lastDir == -6))) { // turn at the end of the current walk frame = lastCount - _framesPerStep; - do - { + do { walkAnim[frame].frame += 200; //was 60 now 116 frame += 1; } while (frame < lastCount ); @@ -912,8 +892,7 @@ void Router::slidyWalkAnimator(WalkData *walkAnim) { - if (lastRealDir == 99) - { + if (lastRealDir == 99) { error("SlidyWalkAnimatorlast direction error\n"); } //**************************************************************************** @@ -924,8 +903,7 @@ void Router::slidyWalkAnimator(WalkData *walkAnim) { // We've done the walk now put in any turns at the end - if (_targetDir == NO_DIRECTIONS) // stand in the last direction - { + if (_targetDir == NO_DIRECTIONS) { // stand in the last direction module = standFrames + lastRealDir; _targetDir = lastRealDir; walkAnim[stepCount].frame = module; @@ -935,10 +913,8 @@ void Router::slidyWalkAnimator(WalkData *walkAnim) { walkAnim[stepCount].y = moduleY; stepCount += 1; } - if (_targetDir == 9) - { - if (stepCount == 0) - { + if (_targetDir == 9) { + if (stepCount == 0) { module = _framesPerChar + lastRealDir; walkAnim[stepCount].frame = module; walkAnim[stepCount].step = 0; @@ -947,8 +923,7 @@ void Router::slidyWalkAnimator(WalkData *walkAnim) { walkAnim[stepCount].y = moduleY; stepCount += 1; } - } else if (_targetDir != lastRealDir) // rotate to _targetDir - { + } else if (_targetDir != lastRealDir) { // rotate to _targetDir // rotate to target direction turnDir = _targetDir - lastRealDir; if ( turnDir < 0) @@ -961,10 +936,8 @@ void Router::slidyWalkAnimator(WalkData *walkAnim) { // rotate to target direction // for george and nico put in a head turn at the start - if ((megaId == GEORGE) || (megaId == NICO)) - { - if ( turnDir < 0) // new frames for turn frames 29oct95jps - { + if ((megaId == GEORGE) || (megaId == NICO)) { + if ( turnDir < 0) { // new frames for turn frames 29oct95jps module = turnFramesLeft + lastDir; } else { module = turnFramesRight + lastDir; @@ -978,11 +951,9 @@ void Router::slidyWalkAnimator(WalkData *walkAnim) { } // rotate if we need to - while (lastRealDir != _targetDir) - { + while (lastRealDir != _targetDir) { lastRealDir += turnDir; - if ( turnDir < 0) // new frames for turn frames 29oct95jps - { + if ( turnDir < 0) { // new frames for turn frames 29oct95jps if ( lastRealDir < 0) lastRealDir += NO_DIRECTIONS; module = turnFramesLeft + lastRealDir; @@ -1000,8 +971,7 @@ void Router::slidyWalkAnimator(WalkData *walkAnim) { } module = standFrames + lastRealDir; walkAnim[stepCount-1].frame = module; - } else // just stand at the end - { + } else { // just stand at the end module = standFrames + lastRealDir; walkAnim[stepCount].frame = module; walkAnim[stepCount].step = 0; @@ -1150,8 +1120,7 @@ int32 Router::solidWalkAnimator(WalkData *walkAnim) { // TURN TO START THE WALK //**************************************************************************** // rotate if we need to - if (lastDir != currentDir) - { + if (lastDir != currentDir) { // get the direction to turn turnDir = currentDir - lastDir; if ( turnDir < 0) @@ -1164,10 +1133,8 @@ int32 Router::solidWalkAnimator(WalkData *walkAnim) { // rotate to new walk direction // for george and nico put in a head turn at the start - if ((megaId == GEORGE) || (megaId == NICO)) - { - if ( turnDir < 0) // new frames for turn frames 29oct95jps - { + if ((megaId == GEORGE) || (megaId == NICO)) { + if ( turnDir < 0) { // new frames for turn frames 29oct95jps module = turnFramesLeft + lastDir; } else { module = turnFramesRight + lastDir; @@ -1181,11 +1148,9 @@ int32 Router::solidWalkAnimator(WalkData *walkAnim) { } // rotate till were facing new dir then go back 45 degrees - while (lastDir != currentDir) - { + while (lastDir != currentDir) { lastDir += turnDir; - if ( turnDir < 0) // new frames for turn frames 29oct95jps - { + if ( turnDir < 0) { // new frames for turn frames 29oct95jps if ( lastDir < 0) lastDir += NO_DIRECTIONS; module = turnFramesLeft + lastDir; @@ -1882,8 +1847,7 @@ int32 Router::checkTarget(int32 x, int32 y) { // * THE SETUP ROUTINES // **************************************************************************** -int32 Router::LoadWalkResources(Object *megaObject, int32 x, int32 y, int32 dir) -{ +int32 Router::LoadWalkResources(Object *megaObject, int32 x, int32 y, int32 dir) { WalkGridHeader floorHeader; int32 i; uint8 *fPolygrid; @@ -1915,8 +1879,7 @@ int32 Router::LoadWalkResources(Object *megaObject, int32 x, int32 y, int32 dir) fPolygrid += sizeof(WalkGridHeader); _nBars = _resMan->getUint32(floorHeader.numBars); - if (_nBars >= O_GRID_SIZE) - { + if (_nBars >= O_GRID_SIZE) { #ifdef DEBUG //check for id > number in file, error("RouteFinder Error too many _bars %d", _nBars); #endif @@ -1925,8 +1888,7 @@ int32 Router::LoadWalkResources(Object *megaObject, int32 x, int32 y, int32 dir) _nNodes = _resMan->getUint32(floorHeader.numNodes)+1; //array starts at 0 begins at a start _node has nnodes nodes and a target _node - if (_nNodes >= O_GRID_SIZE) - { + if (_nNodes >= O_GRID_SIZE) { #ifdef DEBUG //check for id > number in file, error("RouteFinder Error too many nodes %d", _nNodes); #endif diff --git a/engines/sword1/sound.h b/engines/sword1/sound.h index fafc9c2d06..da793bc45a 100644 --- a/engines/sword1/sound.h +++ b/engines/sword1/sound.h @@ -118,12 +118,8 @@ private: char _filePath[100]; static const char _musicList[270]; static const uint16 _roomsFixedFx[TOTAL_ROOMS][TOTAL_FX_PER_ROOM]; -#ifdef PALMOS_68K -public: - static const FxDef *_fxList; -#else static const FxDef _fxList[312]; -#endif + }; } // End of namespace Sword1 diff --git a/engines/sword1/staticres.cpp b/engines/sword1/staticres.cpp index 08e6a108c4..63a1ce35ef 100644 --- a/engines/sword1/staticres.cpp +++ b/engines/sword1/staticres.cpp @@ -2894,9 +2894,6 @@ const char Music::_tuneList[TOTAL_TUNES][8] = { "rm3d", // DONE 269 ONe the scene change after the Grand Master says, "George, we have watched you..." This one might need a bit of fiddling to get it to match to the fisticuffs. }; -#ifdef PALMOS_68K -const FxDef *Sound::_fxList; -#else const FxDef Sound::_fxList[312] = { // 0 { @@ -6445,7 +6442,7 @@ const FxDef Sound::_fxList[312] = { }, //------------------------ }; -#endif + //-------------------------------------------------------------------------------------- // Continuous & random background sound effects for each location @@ -7156,16 +7153,3 @@ const uint8 *Logic::_helperData[] = { }; } // End of namespace Sword1 - -#ifdef PALMOS_68K -#include "scumm_globals.h" - -_GINIT(Sword1_fxList) -_GSETPTR(Sword1::Sound::_fxList, GBVARS_FXLIST_INDEX, Sword1::FxDef, GBVARS_SWORD1) -_GEND - -_GRELEASE(Sword1_fxList) -_GRELEASEPTR(GBVARS_FXLIST_INDEX, GBVARS_SWORD1) -_GEND - -#endif diff --git a/engines/touche/detection.cpp b/engines/touche/detection.cpp index 2860d832dd..8e8de71e9c 100644 --- a/engines/touche/detection.cpp +++ b/engines/touche/detection.cpp @@ -18,8 +18,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL:https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/branches/gsoc2007-fsnode/engines/touche/detection.cpp $ - * $Id:detection.cpp 26949 2007-05-26 20:23:24Z david_corrales $ + * $URL$ + * $Id$ * */ diff --git a/engines/touche/touche.cpp b/engines/touche/touche.cpp index c67b1e9be3..f3d1f33dfd 100644 --- a/engines/touche/touche.cpp +++ b/engines/touche/touche.cpp @@ -148,10 +148,7 @@ void ToucheEngine::restart() { _waitingSetKeyCharNum3 = -1; _currentEpisodeNum = 0; - _newEpisodeNum = ConfMan.getInt("boot_param"); - if (_newEpisodeNum == 0) { - _newEpisodeNum = kStartupEpisode; - } + _newEpisodeNum = kStartupEpisode; _newMusicNum = 0; _currentMusicNum = 0; @@ -252,15 +249,22 @@ void ToucheEngine::mainLoop() { readConfigurationSettings(); + _inp_leftMouseButtonPressed = false; + _inp_rightMouseButtonPressed = false; + if (ConfMan.hasKey("save_slot")) { loadGameState(ConfMan.getInt("save_slot")); - _newEpisodeNum = _currentEpisodeNum; + _newEpisodeNum = 0; + resetSortedKeyCharsTable(); + showCursor(true); + } else { + _newEpisodeNum = ConfMan.getInt("boot_param"); + if (_newEpisodeNum == 0) { + _newEpisodeNum = kStartupEpisode; + } + showCursor(_newEpisodeNum != kStartupEpisode); } - _inp_leftMouseButtonPressed = false; - _inp_rightMouseButtonPressed = false; - showCursor(_newEpisodeNum != kStartupEpisode); - uint32 frameTimeStamp = _system->getMillis(); for (uint32 cycleCounter = 0; _flagsTable[611] == 0; ++cycleCounter) { if ((cycleCounter % 3) == 0) { diff --git a/graphics/colormasks.h b/graphics/colormasks.h index c5e463e2c2..b8bfe26535 100644 --- a/graphics/colormasks.h +++ b/graphics/colormasks.h @@ -48,7 +48,8 @@ The meaning of these is masks is the following: R = ((color & kRedMask) >> kRedShift) << (8-kRedBits) Actually, instead of the simple left shift, one might want to use somewhat - more sophisticated code (which fills up the lower most bits. + more sophisticated code (which fills up the least significant bits with + appropriate data). The highBits / lowBits / qhighBits / qlowBits are special values that are diff --git a/graphics/fonts/scummfont.cpp b/graphics/fonts/scummfont.cpp index 8975665813..0dc0c50f18 100644 --- a/graphics/fonts/scummfont.cpp +++ b/graphics/fonts/scummfont.cpp @@ -27,9 +27,6 @@ namespace Graphics { -#ifdef PALMOS_68K -static const byte *guifont; -#else // Built-in font static const byte guifont[] = { // Header @@ -279,7 +276,6 @@ static const byte guifont[] = { 28, 54, 54, 124, 102, 102, 124, 64, // 225 0, 0, 0 // ??? }; -#endif int ScummFont::getCharWidth(byte chr) const { return guifont[chr+6]; @@ -318,16 +314,3 @@ void ScummFont::drawChar(Surface *dst, byte chr, int tx, int ty, uint32 color) c } } // End of namespace Graphics - -#ifdef PALMOS_68K -#include "scumm_globals.h" - -_GINIT(ScummFont) -_GSETPTR(Graphics::guifont, GBVARS_GUIFONT_INDEX, byte, GBVARS_COMMON) -_GEND - -_GRELEASE(ScummFont) -_GRELEASEPTR(GBVARS_GUIFONT_INDEX, GBVARS_COMMON) -_GEND - -#endif diff --git a/graphics/iff.cpp b/graphics/iff.cpp index f9f324b1d5..ac51531eee 100644 --- a/graphics/iff.cpp +++ b/graphics/iff.cpp @@ -18,8 +18,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL:https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/branches/gsoc2007-fsnode/graphics/iff.cpp $ - * $Id:iff.cpp 26949 2007-05-26 20:23:24Z david_corrales $ + * $URL$ + * $Id$ */ #include "graphics/iff.h" diff --git a/graphics/iff.h b/graphics/iff.h index 50877dbd6f..148a145a1d 100644 --- a/graphics/iff.h +++ b/graphics/iff.h @@ -18,8 +18,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL:https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/branches/gsoc2007-fsnode/graphics/iff.h $ - * $Id:iff.h 26949 2007-05-26 20:23:24Z david_corrales $ + * $URL$ + * $Id$ */ diff --git a/graphics/scaler/thumbnail.cpp b/graphics/scaler/thumbnail.cpp index 40d0cba156..b17f66bb3d 100644 --- a/graphics/scaler/thumbnail.cpp +++ b/graphics/scaler/thumbnail.cpp @@ -27,6 +27,7 @@ #include "common/scummsys.h" #include "common/system.h" +#include "graphics/colormasks.h" #include "graphics/scaler.h" #include "graphics/scaler/intern.h" @@ -118,7 +119,7 @@ static bool grabScreen565(Graphics::Surface *surf) { g = palette[((uint8*)screen->pixels)[y * screen->pitch + x] * 4 + 1]; b = palette[((uint8*)screen->pixels)[y * screen->pitch + x] * 4 + 2]; - ((uint16*)surf->pixels)[y * surf->w + x] = (((r >> 3) & 0x1F) << 11) | (((g >> 2) & 0x3F) << 5) | ((b >> 3) & 0x1F); + ((uint16*)surf->pixels)[y * surf->w + x] = RGBToColor<ColorMasks<565> >(r, g, b); } } diff --git a/gui/PopUpWidget.cpp b/gui/PopUpWidget.cpp index ac91376269..9e5f1f46cf 100644 --- a/gui/PopUpWidget.cpp +++ b/gui/PopUpWidget.cpp @@ -402,7 +402,6 @@ void PopUpWidget::clearEntries() { } void PopUpWidget::setSelected(int item) { - // FIXME if (item != _selectedItem) { if (item >= 0 && item < (int)_entries.size()) { _selectedItem = item; diff --git a/gui/editable.cpp b/gui/editable.cpp index 1333bf0a9d..ef6bf44d0e 100644 --- a/gui/editable.cpp +++ b/gui/editable.cpp @@ -42,7 +42,7 @@ EditableWidget::EditableWidget(GuiObject *boss, const String &name) void EditableWidget::init() { _caretVisible = false; _caretTime = 0; - _caretPos = 0; // FIXME + _caretPos = 0; _caretInverse = false; diff --git a/gui/message.cpp b/gui/message.cpp index 958d8e3dc8..7843225a1f 100644 --- a/gui/message.cpp +++ b/gui/message.cpp @@ -87,8 +87,6 @@ MessageDialog::MessageDialog(const Common::String &message, const char *defaultB lines[i], kTextAlignCenter); } - // FIXME - allow for more than two buttons, and return in runModal() which one - // was selected. if (defaultButton && altButton) { okButtonPos = (_w - (buttonWidth * 2)) / 2; cancelButtonPos = ((_w - (buttonWidth * 2)) / 2) + buttonWidth + 10; diff --git a/gui/options.cpp b/gui/options.cpp index c233c892b9..66786eff6c 100644 --- a/gui/options.cpp +++ b/gui/options.cpp @@ -33,7 +33,7 @@ #include "gui/PopUpWidget.h" #include "gui/TabWidget.h" -//#include "common/fs.h" +#include "common/fs.h" #include "common/config-manager.h" #include "common/system.h" @@ -814,8 +814,7 @@ void GlobalOptionsDialog::handleCommand(CommandSender *sender, uint32 cmd, uint3 if (browser.runModal() > 0) { // User made his choice... FilesystemNode dir(browser.getResult()); - if(dir.isWritable()) - { + if(dir.isWritable()) { _savePath->setLabel(dir.getPath()); } else { MessageDialog error("The chosen directory cannot be written to. Please select another one."); diff --git a/sound/fmopl.cpp b/sound/fmopl.cpp index 5b228d0fc4..9cf604ba49 100644 --- a/sound/fmopl.cpp +++ b/sound/fmopl.cpp @@ -183,11 +183,8 @@ static int *VIB_TABLE; /* envelope output curve table */ /* attack + decay + OFF */ //static int ENV_CURVE[2*EG_ENT+1]; -#ifndef PALMOS_68K static int ENV_CURVE[2 * 4096 + 1]; // to keep it static ... -#else -static int *ENV_CURVE = NULL; // to keep it static ... -#endif + /* multiple table */ #define ML(a) (int)(a * 2) @@ -636,11 +633,6 @@ static int OPLOpenTable(void) { int i,j; double pom; -#ifdef PALMOS_68K - if (!ENV_CURVE) - ENV_CURVE = (int *)calloc(2 * 4096 + 1, sizeof(int)); -#endif - #ifdef __DS__ DS::fastRamReset(); @@ -732,10 +724,6 @@ static void OPLCloseTable(void) { free(SIN_TABLE); free(AMS_TABLE); free(VIB_TABLE); -#ifdef PALMOS_68K - free(ENV_CURVE); - ENV_CURVE = NULL; -#endif } /* CSM Key Controll */ diff --git a/sound/iff.cpp b/sound/iff.cpp index b7cab4e01a..7b6b38acb7 100644 --- a/sound/iff.cpp +++ b/sound/iff.cpp @@ -18,8 +18,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL:https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/branches/gsoc2007-fsnode/sound/iff.cpp $ - * $Id:iff.cpp 26949 2007-05-26 20:23:24Z david_corrales $ + * $URL$ + * $Id$ * */ diff --git a/sound/iff.h b/sound/iff.h index f9b1f11ff7..44831fe863 100644 --- a/sound/iff.h +++ b/sound/iff.h @@ -18,8 +18,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL:https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/branches/gsoc2007-fsnode/sound/iff.h $ - * $Id:iff.h 26949 2007-05-26 20:23:24Z david_corrales $ + * $URL$ + * $Id$ * */ diff --git a/sound/midiparser.h b/sound/midiparser.h index 9587d1787f..d5209acb10 100644 --- a/sound/midiparser.h +++ b/sound/midiparser.h @@ -283,7 +283,7 @@ protected: bool _smartJump; //!< Support smart expiration of hanging notes when jumping bool _centerPitchWheelOnUnload; //!< Center the pitch wheels when unloading a song - // FIXME: ? Was 32 here, Kyra tracks use 120(!!!) which seems wrong. this is a hacky + // FIXME: Was 32 here, Kyra tracks use 120(!!!) which seems wrong. this is a hacky // workaround until situation is investigated. byte * _tracks[120]; //!< Multi-track MIDI formats are supported, up to 120 tracks. byte _num_tracks; //!< Count of total tracks for multi-track MIDI formats. 1 for single-track formats. diff --git a/sound/mods/soundfx.cpp b/sound/mods/soundfx.cpp index e60fd8468a..b68a664a39 100644 --- a/sound/mods/soundfx.cpp +++ b/sound/mods/soundfx.cpp @@ -18,8 +18,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL:https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/branches/gsoc2007-fsnode/sound/mods/soundfx.cpp $ - * $Id:soundfx.cpp 26949 2007-05-26 20:23:24Z david_corrales $ + * $URL$ + * $Id$ * */ diff --git a/sound/softsynth/adlib.cpp b/sound/softsynth/adlib.cpp index d46309217a..a0c492874a 100644 --- a/sound/softsynth/adlib.cpp +++ b/sound/softsynth/adlib.cpp @@ -280,7 +280,7 @@ static const byte note_to_f_num[] = { 203, 205, 206, 208, 209, 211, 212, 214, 215, 217, 218, 220, 222, 223, 225, 226, 228, 230, 231, 233, 235, 236, 238, 240, - 242, 243, 245, 247, 249, 251, 252, 254, + 242, 243, 245, 247, 249, 251, 252, 254 }; static const byte map_gm_to_fm[128][30] = { @@ -472,7 +472,7 @@ static const byte gm_percussion_lookup[128] = { 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, 0x20, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x21, 0x22, 0x23, 0xFF, 0xFF, 0x24, 0x25, 0xFF, 0xFF, 0xFF, 0x26, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF }; static byte lookup_table[64][32]; diff --git a/tools/create_kyradat/create_kyradat.cpp b/tools/create_kyradat/create_kyradat.cpp index 3596751ff1..665db7d454 100644 --- a/tools/create_kyradat/create_kyradat.cpp +++ b/tools/create_kyradat/create_kyradat.cpp @@ -40,7 +40,7 @@ enum { #include "amiga.h" const Game kyra1FanTranslations[] = { - { kKyra1, IT_ITA, kTalkieVersion, "7a6887428c4847625db132a461cabbbf", kyra1FreCD }, + { kKyra1, IT_ITA, kTalkieVersion, "d0f1752098236083d81b9497bd2b6989", kyra1FreCD }, GAME_DUMMY_ENTRY }; diff --git a/tools/create_lure/create_lure_dat.cpp b/tools/create_lure/create_lure_dat.cpp index 13f7c97964..dbcd03faab 100644 --- a/tools/create_lure/create_lure_dat.cpp +++ b/tools/create_lure/create_lure_dat.cpp @@ -478,6 +478,7 @@ void read_room_exit_joins(byte *&data, uint16 &totalSize) { void read_anim_data(byte *&data, uint16 &totalSize) { // Add special pixel records + add_anim_record(0x184B); // Restart/Restore buttons add_anim_record(0x55C0); // Player midswing animation add_anim_record(0x55C9); // Player mid-level defend add_anim_record(0x55D2); // Player high-level strike @@ -1006,6 +1007,14 @@ void save_text_strings(byte *&data, uint16 &totalSize) { } } +void save_sound_desc_data(byte *&data, uint16 &totalSize) { + lure_exe.seek(DATA_SEGMENT + SOUND_1_OFFSET); + + totalSize = SOUND_1_SIZE; + data = (byte *) malloc(totalSize); + lure_exe.read(data, totalSize); +} + void getEntry(uint8 entryIndex, uint16 &resourceId, byte *&data, uint16 &size) { resourceId = 0x3f01 + entryIndex; @@ -1127,6 +1136,11 @@ void getEntry(uint8 entryIndex, uint16 &resourceId, byte *&data, uint16 &size) save_text_strings(data, size); break; + case 23: + // Save the sound header desc data + save_sound_desc_data(data, size); + break; + default: data = NULL; size = 0; diff --git a/tools/create_lure/create_lure_dat.h b/tools/create_lure/create_lure_dat.h index 4429baf8bb..8b9bc03e02 100644 --- a/tools/create_lure/create_lure_dat.h +++ b/tools/create_lure/create_lure_dat.h @@ -30,7 +30,7 @@ #include "common/endian.h" #define VERSION_MAJOR 1 -#define VERSION_MINOR 20 +#define VERSION_MINOR 21 #define ENGLISH_LURE #define DATA_SEGMENT 0xac50 @@ -88,6 +88,9 @@ #define EXIT_HOTSPOTS_OFFSET 0x2E57 +#define SOUND_1_OFFSET 0x5671 +#define SOUND_1_SIZE 265 + #pragma pack(1) // Rect currently copied from common/rect.h - if I try directly including it, diff --git a/tools/scumm-md5.txt b/tools/scumm-md5.txt index 6db30d428d..23bbd89312 100644 --- a/tools/scumm-md5.txt +++ b/tools/scumm-md5.txt @@ -58,15 +58,17 @@ maniac Maniac Mansion 7f45ddd6dbfbf8f80c0c0efea4c295bc 1972 en DOS V1 V1 - Fingolfin - d8d07efcb88f396bee0b402b10c3b1c9 -1 us NES NES - - - 3905799e081b80a61d4460b7b733c206 -1 gb NES NES - - - 81bbfa181184cb494e7a81dcfa94fbd9 -1 fr NES NES - - - 257f8c14d8c584f7ddd601bcb00920c7 -1 de NES NES - - - 22d07d6c386c9c25aca5dac2a0c0d94b -1 se NES NES - - + d8d07efcb88f396bee0b402b10c3b1c9 262144 us NES NES - - + 3905799e081b80a61d4460b7b733c206 262144 gb NES NES - - + 81bbfa181184cb494e7a81dcfa94fbd9 262144 fr NES NES - - + 257f8c14d8c584f7ddd601bcb00920c7 262144 de NES NES - - + f163cf53f7850e43fb482471e5c52e1a 262144 es NES NES - - + 22d07d6c386c9c25aca5dac2a0c0d94b 262144 se NES NES - - 17f7296f63c78642724f057fd8e736a7 -1 us NES NES extracted - 91d5db93187fab54d823f73bd6441cb6 -1 gb NES NES extracted - 1c7e7db2cfab1ad62746ab680a634204 -1 fr NES NES extracted - 3a5ec90d556d4920976c5578bfbfaf79 -1 de NES NES extracted - + b7d37d6b786b5a22deea3b038eca96ca 2082 es NES NES extracted - 6b5a3fef241e90d4b2e77f1e222773ee -1 se NES NES extracted - e781230da44a44e2f0770edb2b3b3633 -1 en Amiga V2 V2 - dhewg, Andrea Petrucci @@ -172,6 +174,7 @@ loom Loom 31b8fda4c8c7413fa6b39997e776eba4 -1 jp FM-TOWNS FM-TOWNS - - khalek, Andrea Petrucci 0650e8ab1432564607cd651c0fa3f344 -1 en PC-Engine PC-Engine - - Kirben + c0d5c89550381ac433624fedad5e1100 -1 jp PC-Engine PC-Engine - - clone2727 5a35e36fd777e9c37a49c5b2faca52f9 6108 en DOS EGA EGA Demo non-interactive Fingolfin a00554c31d623fdb9fcb0f924b89b42b -1 en DOS EGA EGA Demo non-interactive Adrian C. Fruehwirth |