2010-07-21 14:18:26 +00:00
|
|
|
/* 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.
|
2014-02-18 02:34:24 +01:00
|
|
|
*
|
2010-07-21 14:18:26 +00:00
|
|
|
* 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.
|
2014-02-18 02:34:24 +01:00
|
|
|
*
|
2010-07-21 14:18:26 +00:00
|
|
|
* 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.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef SCI_ENGINE_WORKAROUNDS_H
|
|
|
|
#define SCI_ENGINE_WORKAROUNDS_H
|
|
|
|
|
2010-07-21 14:54:06 +00:00
|
|
|
#include "sci/engine/vm_types.h"
|
|
|
|
#include "sci/sci.h"
|
|
|
|
|
2010-07-21 14:18:26 +00:00
|
|
|
namespace Sci {
|
|
|
|
|
2010-07-21 14:54:06 +00:00
|
|
|
enum SciWorkaroundType {
|
|
|
|
WORKAROUND_NONE, // only used by terminator or when no workaround was found
|
|
|
|
WORKAROUND_IGNORE, // ignore kernel call
|
|
|
|
WORKAROUND_STILLCALL, // still do kernel call
|
|
|
|
WORKAROUND_FAKE // fake kernel call / replace temp value / fake opcode
|
|
|
|
};
|
|
|
|
|
2010-07-23 14:32:24 +00:00
|
|
|
struct SciTrackOriginReply {
|
|
|
|
int scriptNr;
|
|
|
|
Common::String objectName;
|
|
|
|
Common::String methodName;
|
|
|
|
int localCallOffset;
|
|
|
|
};
|
|
|
|
|
2010-07-21 14:54:06 +00:00
|
|
|
struct SciWorkaroundSolution {
|
|
|
|
SciWorkaroundType type;
|
|
|
|
uint16 value;
|
|
|
|
};
|
|
|
|
|
2010-07-22 09:36:04 +00:00
|
|
|
/**
|
|
|
|
* A structure describing a 'workaround' for a SCI script bug.
|
|
|
|
*
|
|
|
|
* Arrays of SciWorkaroundEntry instances are terminated by
|
|
|
|
* a fake entry in which "objectName" is NULL.
|
|
|
|
*/
|
2010-07-21 14:54:06 +00:00
|
|
|
struct SciWorkaroundEntry {
|
|
|
|
SciGameId gameId;
|
|
|
|
int roomNr;
|
|
|
|
int scriptNr;
|
|
|
|
int16 inheritanceLevel;
|
|
|
|
const char *objectName;
|
|
|
|
const char *methodName;
|
|
|
|
int localCallOffset;
|
|
|
|
int index;
|
|
|
|
SciWorkaroundSolution newValue;
|
|
|
|
};
|
|
|
|
|
2011-02-17 17:33:36 +02:00
|
|
|
extern const SciWorkaroundEntry arithmeticWorkarounds[];
|
2010-07-22 08:58:59 +00:00
|
|
|
extern const SciWorkaroundEntry uninitializedReadWorkarounds[];
|
|
|
|
extern const SciWorkaroundEntry kAbs_workarounds[];
|
2010-07-28 03:54:14 +00:00
|
|
|
extern const SciWorkaroundEntry kCelHigh_workarounds[];
|
|
|
|
extern const SciWorkaroundEntry kCelWide_workarounds[];
|
2010-07-30 18:45:28 +00:00
|
|
|
extern const SciWorkaroundEntry kDeviceInfo_workarounds[];
|
2010-07-23 14:32:24 +00:00
|
|
|
extern const SciWorkaroundEntry kDisplay_workarounds[];
|
2010-08-18 05:27:13 +00:00
|
|
|
extern const SciWorkaroundEntry kDirLoop_workarounds[];
|
2010-07-22 08:58:59 +00:00
|
|
|
extern const SciWorkaroundEntry kDisposeScript_workarounds[];
|
|
|
|
extern const SciWorkaroundEntry kDoSoundFade_workarounds[];
|
2010-07-27 14:51:08 +00:00
|
|
|
extern const SciWorkaroundEntry kFindKey_workarounds[];
|
2010-07-27 10:00:17 +00:00
|
|
|
extern const SciWorkaroundEntry kGetAngle_workarounds[];
|
2010-07-22 08:58:59 +00:00
|
|
|
extern const SciWorkaroundEntry kGraphDrawLine_workarounds[];
|
2010-07-24 20:36:36 +00:00
|
|
|
extern const SciWorkaroundEntry kGraphSaveBox_workarounds[];
|
2010-07-22 08:58:59 +00:00
|
|
|
extern const SciWorkaroundEntry kGraphRestoreBox_workarounds[];
|
2010-08-02 09:04:14 +00:00
|
|
|
extern const SciWorkaroundEntry kGraphUpdateBox_workarounds[];
|
2010-07-22 08:58:59 +00:00
|
|
|
extern const SciWorkaroundEntry kGraphFillBoxForeground_workarounds[];
|
|
|
|
extern const SciWorkaroundEntry kGraphFillBoxAny_workarounds[];
|
2010-07-22 14:43:19 +00:00
|
|
|
extern const SciWorkaroundEntry kGraphRedrawBox_workarounds[];
|
2010-07-26 09:16:57 +00:00
|
|
|
extern const SciWorkaroundEntry kIsObject_workarounds[];
|
2010-07-26 06:30:15 +00:00
|
|
|
extern const SciWorkaroundEntry kMemory_workarounds[];
|
2011-01-12 23:33:30 +00:00
|
|
|
extern const SciWorkaroundEntry kMoveCursor_workarounds[];
|
2010-07-27 09:40:29 +00:00
|
|
|
extern const SciWorkaroundEntry kNewWindow_workarounds[];
|
2013-10-30 08:40:09 +02:00
|
|
|
extern const SciWorkaroundEntry kReadNumber_workarounds[];
|
2010-07-26 08:21:43 +00:00
|
|
|
extern const SciWorkaroundEntry kPaletteUnsetFlag_workarounds[];
|
2010-07-30 15:26:30 +00:00
|
|
|
extern const SciWorkaroundEntry kSetCursor_workarounds[];
|
2010-07-22 08:58:59 +00:00
|
|
|
extern const SciWorkaroundEntry kSetPort_workarounds[];
|
2010-08-02 11:46:03 +00:00
|
|
|
extern const SciWorkaroundEntry kStrAt_workarounds[];
|
2014-02-19 03:02:44 +02:00
|
|
|
extern const SciWorkaroundEntry kStrCpy_workarounds[];
|
2010-10-31 23:34:36 +00:00
|
|
|
extern const SciWorkaroundEntry kStrLen_workarounds[];
|
2010-07-22 08:58:59 +00:00
|
|
|
extern const SciWorkaroundEntry kUnLoad_workarounds[];
|
2010-07-21 14:18:26 +00:00
|
|
|
|
2010-07-23 14:32:24 +00:00
|
|
|
extern SciWorkaroundSolution trackOriginAndFindWorkaround(int index, const SciWorkaroundEntry *workaroundList, SciTrackOriginReply *trackOrigin);
|
|
|
|
|
2010-07-21 14:18:26 +00:00
|
|
|
} // End of namespace Sci
|
|
|
|
|
|
|
|
#endif // SCI_ENGINE_WORKAROUNDS_H
|