2009-02-17 15:05:16 +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.
|
|
|
|
|
|
|
|
* 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$
|
|
|
|
*
|
|
|
|
*/
|
2009-02-15 06:10:59 +00:00
|
|
|
|
2009-02-24 15:33:40 +00:00
|
|
|
#ifndef SCI_ENGINE_KERNEL_H
|
|
|
|
#define SCI_ENGINE_KERNEL_H
|
2009-02-15 06:10:59 +00:00
|
|
|
|
2009-02-15 23:39:31 +00:00
|
|
|
#include "common/scummsys.h"
|
2009-02-20 20:11:12 +00:00
|
|
|
#include "common/debug.h"
|
2009-04-22 17:54:11 +00:00
|
|
|
#include "common/rect.h"
|
2009-02-15 23:39:31 +00:00
|
|
|
|
2009-12-20 12:43:36 +00:00
|
|
|
#include "sci/sci.h" // for USE_OLD_MUSIC_FUNCTIONS
|
2009-08-17 07:36:08 +00:00
|
|
|
#include "sci/engine/vm_types.h" // for reg_t
|
|
|
|
#include "sci/engine/vm.h"
|
2009-02-15 06:10:59 +00:00
|
|
|
|
2009-02-21 10:23:36 +00:00
|
|
|
namespace Sci {
|
|
|
|
|
2009-10-06 17:16:27 +00:00
|
|
|
struct Node; // from segment.h
|
|
|
|
struct List; // from segment.h
|
2009-02-24 05:51:55 +00:00
|
|
|
|
2010-01-26 20:40:25 +00:00
|
|
|
/**
|
2010-01-27 14:08:06 +00:00
|
|
|
* @defgroup VocabularyResources Vocabulary resources in SCI
|
2010-01-26 20:40:25 +00:00
|
|
|
*
|
|
|
|
* vocab.999 / 999.voc (unneeded) contains names of the kernel functions which
|
|
|
|
* are implemented by the interpreter. In Sierra SCI, they are used exclusively
|
|
|
|
* by the debugger, which is why keeping the file up to date was less important.
|
|
|
|
* This resource is notoriously unreliable, and should not be used. Fortunately,
|
|
|
|
* kernel names are the same in major SCI revisions, which is why we have them
|
|
|
|
* hardcoded.
|
|
|
|
*
|
|
|
|
* vocab.998 / 998.voc (unneeded) contains opcode names. Opcodes have remained
|
|
|
|
* the same from SCI0 to SCI2.1, and have changed in SCI3, so this is only used
|
|
|
|
* on demand for debugging purposes, for showing the opcode names
|
|
|
|
*
|
|
|
|
* vocab.997 / 997.voc (usually needed) contains the names of every selector in
|
|
|
|
* the class hierarchy. Each method and property '''name''' consumes one id, but
|
|
|
|
* if a name is shared between classes, one id will do. Some demos do not contain
|
|
|
|
* a selector vocabulary, but the selectors used by the engine have stayed more or
|
|
|
|
* less static, so we add the selectors we need inside static_selectors.cpp
|
|
|
|
* The SCI engine loads vocab.997 on startup, and fills in an internal structure
|
|
|
|
* that allows interpreter code to access these selectors via #defined macros. It
|
|
|
|
* does not use the file after this initial stage.
|
|
|
|
*
|
|
|
|
* vocab.996 / 996.voc (required) contains the classes which are used in each
|
|
|
|
* script, and is required by the segment manager
|
|
|
|
*
|
|
|
|
* vocab.995 / 995.voc (unneeded) contains strings for the embedded SCI debugger
|
|
|
|
*
|
|
|
|
* vocab.994 / 994.voc (unneeded) contains offsets into certain classes of certain
|
|
|
|
* properties. This enables the interpreter to update these properties in O(1) time,
|
|
|
|
* which was important in the era when SCI was initially conceived. In SCI, we
|
|
|
|
* figured out what '''property''' a certain offset refers to (which requires one to
|
|
|
|
* guess what class a pointer points to) and then simply use the property name and
|
|
|
|
* vocab.997. This results in much more readable code. Thus, this vocabulary isn't
|
|
|
|
* used at all.
|
|
|
|
*
|
|
|
|
* SCI0 parser vocabularies:
|
|
|
|
* - vocab.901 / 901.voc - suffix vocabulary
|
|
|
|
* - vocab.900 / 900.vo1 - parse tree branches
|
|
|
|
* - vocab.0 / 0.voc - main vocabulary, containing words and their attributes
|
|
|
|
* (e.g. "onto" - "position")
|
|
|
|
*
|
|
|
|
* SCI01 parser vocabularies:
|
|
|
|
* - vocab.902 / 902.voc - suffix vocabulary
|
|
|
|
* - vocab.901 / 901.vo1 - parse tree branches
|
|
|
|
* - vocab.900 / 900.voc - main vocabulary, containing words and their attributes
|
|
|
|
* (e.g. "onto" - "position")
|
|
|
|
*
|
|
|
|
*/
|
2010-01-27 14:08:06 +00:00
|
|
|
//@{
|
2010-01-26 20:40:25 +00:00
|
|
|
|
2009-05-30 15:40:49 +00:00
|
|
|
//#define DEBUG_PARSER // enable for parser debugging
|
2010-01-03 21:12:44 +00:00
|
|
|
//#define DISABLE_VALIDATIONS // enable to stop validation checks
|
2009-02-15 06:10:59 +00:00
|
|
|
|
2009-06-02 14:16:59 +00:00
|
|
|
/* Generic description: */
|
- Changed the unimplemented debug SCI kernel functions (InspectObj, ShowSends, ShowObjs, ShowFree, StackUsage and Profiler) to be dummy functions - we have our own debugger, and don't use these functions for debugging
- Removed the function number parameter from all kernel functions, as it's no longer needed, and removed the FAKE_FUNCT_NR hack
- Removed kUnknown() and kStub()
- Dummy/unknown kernel functions are no longer invoked, and a warning is shown instead, with the paremeters passed to them
Note: there is an evil hack used for debugging scripts in invoke_selector(), which probably no longer works now
svn-id: r44461
2009-09-29 14:24:07 +00:00
|
|
|
typedef reg_t KernelFunc(EngineState *s, int argc, reg_t *argv);
|
2009-06-02 14:16:59 +00:00
|
|
|
|
2009-06-04 20:51:09 +00:00
|
|
|
struct KernelFuncWithSignature {
|
|
|
|
KernelFunc *fun; /**< The actual function */
|
|
|
|
const char *signature; /**< KernelFunc signature */
|
|
|
|
Common::String orig_name; /**< Original name, in case we couldn't map it */
|
- Changed the unimplemented debug SCI kernel functions (InspectObj, ShowSends, ShowObjs, ShowFree, StackUsage and Profiler) to be dummy functions - we have our own debugger, and don't use these functions for debugging
- Removed the function number parameter from all kernel functions, as it's no longer needed, and removed the FAKE_FUNCT_NR hack
- Removed kUnknown() and kStub()
- Dummy/unknown kernel functions are no longer invoked, and a warning is shown instead, with the paremeters passed to them
Note: there is an evil hack used for debugging scripts in invoke_selector(), which probably no longer works now
svn-id: r44461
2009-09-29 14:24:07 +00:00
|
|
|
bool isDummy;
|
2009-06-02 14:16:59 +00:00
|
|
|
};
|
|
|
|
|
2009-07-07 11:14:18 +00:00
|
|
|
enum AutoDetectedFeatures {
|
2009-10-08 14:37:55 +00:00
|
|
|
kFeatureOldScriptHeader = 1 << 0
|
2009-07-07 11:14:18 +00:00
|
|
|
};
|
|
|
|
|
2009-06-01 14:12:43 +00:00
|
|
|
class Kernel {
|
|
|
|
public:
|
2009-08-18 14:10:31 +00:00
|
|
|
/**
|
|
|
|
* Initializes the SCI kernel
|
|
|
|
*/
|
2009-12-27 12:54:03 +00:00
|
|
|
Kernel(ResourceManager *resMan, Common::String gameId);
|
2009-06-01 14:12:43 +00:00
|
|
|
~Kernel();
|
|
|
|
|
2009-09-21 21:38:07 +00:00
|
|
|
uint getSelectorNamesSize() const;
|
|
|
|
const Common::String &getSelectorName(uint selector) const;
|
2009-06-01 14:12:43 +00:00
|
|
|
|
2009-09-21 21:38:07 +00:00
|
|
|
uint getKernelNamesSize() const;
|
|
|
|
const Common::String &getKernelName(uint number) const;
|
2009-06-01 14:12:43 +00:00
|
|
|
|
2009-06-18 22:09:57 +00:00
|
|
|
/**
|
|
|
|
* Determines the selector ID of a selector by its name
|
|
|
|
* @param selectorName Name of the selector to look up
|
|
|
|
* @return The appropriate selector ID, or -1 on error
|
|
|
|
*/
|
2009-06-01 14:12:43 +00:00
|
|
|
int findSelector(const char *selectorName) const;
|
|
|
|
|
|
|
|
// Script dissection/dumping functions
|
|
|
|
void dissectScript(int scriptNumber, Vocabulary *vocab);
|
|
|
|
void dumpScriptObject(char *data, int seeker, int objsize);
|
|
|
|
void dumpScriptClass(char *data, int seeker, int objsize);
|
|
|
|
|
2009-09-17 13:21:42 +00:00
|
|
|
SelectorCache _selectorCache; /**< Shortcut list for important selectors */
|
2010-01-12 20:19:45 +00:00
|
|
|
typedef Common::Array<KernelFuncWithSignature> KernelFuncsContainer;
|
|
|
|
KernelFuncsContainer _kernelFuncs; /**< Table of kernel functions */
|
2009-06-02 14:16:59 +00:00
|
|
|
|
2009-06-01 14:12:43 +00:00
|
|
|
private:
|
|
|
|
/**
|
|
|
|
* Loads the kernel function names.
|
|
|
|
*
|
|
|
|
* This function reads the kernel function name table from resource_map,
|
|
|
|
* and fills the _kernelNames array with them.
|
|
|
|
* The resulting list has the same format regardless of the format of the
|
|
|
|
* name table of the resource (the format changed between version 0 and 1).
|
|
|
|
* @return true on success, false on failure
|
|
|
|
*/
|
2009-12-27 12:54:03 +00:00
|
|
|
bool loadKernelNames(Common::String gameId);
|
2009-06-01 14:12:43 +00:00
|
|
|
|
2009-07-04 15:45:04 +00:00
|
|
|
/**
|
|
|
|
* Sets the default kernel function names, based on the SCI version used
|
|
|
|
*/
|
2009-12-27 12:54:03 +00:00
|
|
|
void setDefaultKernelNames(Common::String gameId);
|
2010-01-25 01:39:44 +00:00
|
|
|
|
2009-08-25 23:02:57 +00:00
|
|
|
#ifdef ENABLE_SCI32
|
|
|
|
/**
|
|
|
|
* Sets the default kernel function names to the SCI2 kernel functions
|
|
|
|
*/
|
|
|
|
void setKernelNamesSci2();
|
2010-01-25 01:39:44 +00:00
|
|
|
|
2009-08-25 23:02:57 +00:00
|
|
|
/**
|
|
|
|
* Sets the default kernel function names to the SCI2.1 kernel functions
|
|
|
|
*/
|
2009-12-30 16:00:56 +00:00
|
|
|
void setKernelNamesSci21(Common::String gameId);
|
2009-08-25 23:02:57 +00:00
|
|
|
#endif
|
2009-07-04 15:45:04 +00:00
|
|
|
|
2009-06-01 14:12:43 +00:00
|
|
|
/**
|
2009-07-05 11:49:05 +00:00
|
|
|
* Loads the kernel selector names.
|
|
|
|
*/
|
2009-07-07 10:28:05 +00:00
|
|
|
void loadSelectorNames();
|
2010-01-25 01:39:44 +00:00
|
|
|
|
2009-07-11 06:33:19 +00:00
|
|
|
/**
|
|
|
|
* Check for any hardcoded selector table we might have that can be used
|
|
|
|
* if a game is missing the selector names.
|
|
|
|
*/
|
2009-09-23 10:55:35 +00:00
|
|
|
Common::StringList checkStaticSelectorNames();
|
2009-07-07 10:28:05 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Maps special selectors
|
|
|
|
*/
|
|
|
|
void mapSelectors();
|
2009-06-01 14:12:43 +00:00
|
|
|
|
2009-06-18 22:09:57 +00:00
|
|
|
/**
|
|
|
|
* Maps kernel functions
|
|
|
|
*/
|
2009-06-02 14:16:59 +00:00
|
|
|
void mapFunctions();
|
|
|
|
|
2009-09-02 12:02:37 +00:00
|
|
|
ResourceManager *_resMan;
|
2009-07-07 11:14:18 +00:00
|
|
|
uint32 features;
|
2009-06-01 14:12:43 +00:00
|
|
|
|
|
|
|
// Kernel-related lists
|
|
|
|
Common::StringList _selectorNames;
|
|
|
|
Common::StringList _kernelNames;
|
|
|
|
};
|
2009-02-15 06:10:59 +00:00
|
|
|
|
|
|
|
/******************** Selector functionality ********************/
|
|
|
|
|
2009-06-01 08:00:58 +00:00
|
|
|
enum SelectorInvocation {
|
|
|
|
kStopOnInvalidSelector = 0,
|
|
|
|
kContinueOnInvalidSelector = 1
|
|
|
|
};
|
|
|
|
|
2009-10-18 19:42:56 +00:00
|
|
|
/**
|
|
|
|
* Retrieves a selector from an object.
|
|
|
|
* @param segMan the segment mananger
|
|
|
|
* @param _obj_ the address of the object which the selector should be read from
|
|
|
|
* @param _slc_ the selector to read
|
|
|
|
* @return the selector value as a reg_t
|
|
|
|
* This macro halts on error. 'selector' must be a selector name registered in vm.h's
|
|
|
|
* SelectorCache and mapped in script.cpp.
|
|
|
|
*/
|
2009-12-26 14:58:23 +00:00
|
|
|
#define GET_SEL32(segMan, _obj_, _slc_) read_selector(segMan, _obj_, ((SciEngine*)g_engine)->getKernel()->_selectorCache._slc_)
|
2009-10-18 19:42:56 +00:00
|
|
|
#define GET_SEL32V(segMan, _obj_, _slc_) (GET_SEL32(segMan, _obj_, _slc_).offset)
|
2009-02-15 06:10:59 +00:00
|
|
|
|
2009-10-18 19:42:56 +00:00
|
|
|
/**
|
|
|
|
* Writes a selector value to an object.
|
|
|
|
* @param segMan the segment mananger
|
|
|
|
* @param _obj_ the address of the object which the selector should be written to
|
|
|
|
* @param _slc_ the selector to read
|
|
|
|
* @param _val_ the value to write
|
|
|
|
* This macro halts on error. 'selector' must be a selector name registered in vm.h's
|
|
|
|
* SelectorCache and mapped in script.cpp.
|
|
|
|
*/
|
2009-12-26 14:58:23 +00:00
|
|
|
#define PUT_SEL32(segMan, _obj_, _slc_, _val_) write_selector(segMan, _obj_, ((SciEngine*)g_engine)->getKernel()->_selectorCache._slc_, _val_)
|
2009-10-18 19:42:56 +00:00
|
|
|
#define PUT_SEL32V(segMan, _obj_, _slc_, _val_) PUT_SEL32(segMan, _obj_, _slc_, make_reg(0, _val_))
|
2009-02-15 06:10:59 +00:00
|
|
|
|
2009-10-18 19:42:56 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Kludge for use with invoke_selector(). Used for compatibility with compilers
|
|
|
|
* that cannot handle vararg macros.
|
|
|
|
*/
|
2009-02-15 06:10:59 +00:00
|
|
|
#define INV_SEL(_object_, _selector_, _noinvalid_) \
|
2009-12-26 14:58:23 +00:00
|
|
|
s, _object_, s->_kernel->_selectorCache._selector_, _noinvalid_, argv, argc
|
2009-02-15 06:10:59 +00:00
|
|
|
|
|
|
|
|
2009-12-26 14:58:23 +00:00
|
|
|
reg_t read_selector(SegManager *segMan, reg_t object, Selector selector_id);
|
|
|
|
void write_selector(SegManager *segMan, reg_t object, Selector selector_id, reg_t value);
|
- Changed the unimplemented debug SCI kernel functions (InspectObj, ShowSends, ShowObjs, ShowFree, StackUsage and Profiler) to be dummy functions - we have our own debugger, and don't use these functions for debugging
- Removed the function number parameter from all kernel functions, as it's no longer needed, and removed the FAKE_FUNCT_NR hack
- Removed kUnknown() and kStub()
- Dummy/unknown kernel functions are no longer invoked, and a warning is shown instead, with the paremeters passed to them
Note: there is an evil hack used for debugging scripts in invoke_selector(), which probably no longer works now
svn-id: r44461
2009-09-29 14:24:07 +00:00
|
|
|
int invoke_selector(EngineState *s, reg_t object, int selector_id, SelectorInvocation noinvalid,
|
2009-12-26 14:58:23 +00:00
|
|
|
StackPtr k_argp, int k_argc, int argc, ...);
|
2009-02-15 06:10:59 +00:00
|
|
|
|
|
|
|
|
|
|
|
/******************** Text functionality ********************/
|
2009-06-18 22:09:57 +00:00
|
|
|
/**
|
|
|
|
* Looks up text referenced by scripts
|
|
|
|
* SCI uses two values to reference to text: An address, and an index. The address
|
|
|
|
* determines whether the text should be read from a resource file, or from the heap,
|
|
|
|
* while the index either refers to the number of the string in the specified source,
|
|
|
|
* or to a relative position inside the text.
|
|
|
|
*
|
|
|
|
* @param s The current state
|
|
|
|
* @param address The address to look up
|
|
|
|
* @param index The relative index
|
2009-09-27 01:50:26 +00:00
|
|
|
* @return The referenced text, or empty string on error.
|
2009-06-18 22:09:57 +00:00
|
|
|
*/
|
2009-09-27 01:50:26 +00:00
|
|
|
Common::String kernel_lookup_text(EngineState *s, reg_t address, int index);
|
2009-02-15 06:10:59 +00:00
|
|
|
|
|
|
|
/******************** Priority macros/functions ********************/
|
2009-06-18 22:09:57 +00:00
|
|
|
/**
|
|
|
|
* Finds the position of the priority band specified
|
|
|
|
* Parameters: (EngineState *) s: State to search in
|
|
|
|
* (int) band: Band to look for
|
|
|
|
* Returns : (int) Offset at which the band starts
|
|
|
|
*/
|
2009-02-21 10:47:56 +00:00
|
|
|
int _find_priority_band(EngineState *s, int band);
|
2009-02-15 06:10:59 +00:00
|
|
|
|
2009-06-18 22:09:57 +00:00
|
|
|
/**
|
|
|
|
* Does the opposite of _find_priority_band
|
|
|
|
* @param s Engine state
|
|
|
|
* @param y Coordinate to check
|
|
|
|
* @return The priority band y belongs to
|
|
|
|
*/
|
2009-02-21 10:47:56 +00:00
|
|
|
int _find_view_priority(EngineState *s, int y);
|
2009-02-15 06:10:59 +00:00
|
|
|
|
|
|
|
|
|
|
|
/******************** Dynamic view list functions ********************/
|
|
|
|
|
2009-06-18 22:09:57 +00:00
|
|
|
/**
|
|
|
|
* Determines the now-seen rectangle of a view object
|
|
|
|
* @param s The state to use
|
|
|
|
* @param object The object to check
|
2010-01-25 01:39:44 +00:00
|
|
|
* @param clip Flag to determine wheter priority band clipping
|
2009-06-18 22:09:57 +00:00
|
|
|
* should be performed
|
|
|
|
* @return The absolute rectangle describing the now-seen area.
|
|
|
|
*/
|
2009-03-18 16:43:12 +00:00
|
|
|
extern Common::Rect get_nsrect(EngineState *s, reg_t object, byte clip);
|
2009-02-15 06:10:59 +00:00
|
|
|
|
|
|
|
|
2009-12-20 12:43:36 +00:00
|
|
|
#ifdef USE_OLD_MUSIC_FUNCTIONS
|
2009-02-15 06:10:59 +00:00
|
|
|
/******************** Misc functions ********************/
|
|
|
|
|
2009-06-18 22:09:57 +00:00
|
|
|
/**
|
2010-01-25 01:39:44 +00:00
|
|
|
* Get all sound events, apply their changes to the heap
|
2009-06-18 22:09:57 +00:00
|
|
|
*/
|
|
|
|
void process_sound_events(EngineState *s);
|
2009-02-15 06:10:59 +00:00
|
|
|
|
|
|
|
/******************** Constants ********************/
|
2009-12-20 12:43:36 +00:00
|
|
|
#endif
|
2009-02-15 06:10:59 +00:00
|
|
|
|
|
|
|
/* Maximum length of a savegame name (including terminator character) */
|
|
|
|
#define SCI_MAX_SAVENAME_LENGTH 0x24
|
|
|
|
|
|
|
|
/******************** Kernel functions ********************/
|
|
|
|
|
2009-04-20 19:28:08 +00:00
|
|
|
// New kernel functions
|
- Changed the unimplemented debug SCI kernel functions (InspectObj, ShowSends, ShowObjs, ShowFree, StackUsage and Profiler) to be dummy functions - we have our own debugger, and don't use these functions for debugging
- Removed the function number parameter from all kernel functions, as it's no longer needed, and removed the FAKE_FUNCT_NR hack
- Removed kUnknown() and kStub()
- Dummy/unknown kernel functions are no longer invoked, and a warning is shown instead, with the paremeters passed to them
Note: there is an evil hack used for debugging scripts in invoke_selector(), which probably no longer works now
svn-id: r44461
2009-09-29 14:24:07 +00:00
|
|
|
reg_t kStrLen(EngineState *s, int argc, reg_t *argv);
|
|
|
|
reg_t kGetFarText(EngineState *s, int argc, reg_t *argv);
|
|
|
|
reg_t kReadNumber(EngineState *s, int argc, reg_t *argv);
|
|
|
|
reg_t kStrCat(EngineState *s, int argc, reg_t *argv);
|
|
|
|
reg_t kStrCmp(EngineState *s, int argc, reg_t *argv);
|
|
|
|
reg_t kSetSynonyms(EngineState *s, int argc, reg_t *argv);
|
|
|
|
reg_t kLock(EngineState *s, int argc, reg_t *argv);
|
|
|
|
reg_t kPalette(EngineState *s, int argc, reg_t *argv);
|
2009-10-15 06:37:05 +00:00
|
|
|
reg_t kPalVary(EngineState *s, int argc, reg_t *argv);
|
2009-10-20 16:11:31 +00:00
|
|
|
reg_t kAssertPalette(EngineState *s, int argc, reg_t *argv);
|
2009-10-30 22:55:35 +00:00
|
|
|
reg_t kPortrait(EngineState *s, int argc, reg_t *argv);
|
- Changed the unimplemented debug SCI kernel functions (InspectObj, ShowSends, ShowObjs, ShowFree, StackUsage and Profiler) to be dummy functions - we have our own debugger, and don't use these functions for debugging
- Removed the function number parameter from all kernel functions, as it's no longer needed, and removed the FAKE_FUNCT_NR hack
- Removed kUnknown() and kStub()
- Dummy/unknown kernel functions are no longer invoked, and a warning is shown instead, with the paremeters passed to them
Note: there is an evil hack used for debugging scripts in invoke_selector(), which probably no longer works now
svn-id: r44461
2009-09-29 14:24:07 +00:00
|
|
|
reg_t kNumCels(EngineState *s, int argc, reg_t *argv);
|
|
|
|
reg_t kNumLoops(EngineState *s, int argc, reg_t *argv);
|
|
|
|
reg_t kDrawCel(EngineState *s, int argc, reg_t *argv);
|
|
|
|
reg_t kCoordPri(EngineState *s, int argc, reg_t *argv);
|
|
|
|
reg_t kPriCoord(EngineState *s, int argc, reg_t *argv);
|
|
|
|
reg_t kShakeScreen(EngineState *s, int argc, reg_t *argv);
|
|
|
|
reg_t kSetCursor(EngineState *s, int argc, reg_t *argv);
|
|
|
|
reg_t kMoveCursor(EngineState *s, int argc, reg_t *argv);
|
|
|
|
reg_t kPicNotValid(EngineState *s, int argc, reg_t *argv);
|
|
|
|
reg_t kOnControl(EngineState *s, int argc, reg_t *argv);
|
|
|
|
reg_t kDrawPic(EngineState *s, int argc, reg_t *argv);
|
|
|
|
reg_t kGetPort(EngineState *s, int argc, reg_t *argv);
|
|
|
|
reg_t kSetPort(EngineState *s, int argc, reg_t *argv);
|
|
|
|
reg_t kNewWindow(EngineState *s, int argc, reg_t *argv);
|
|
|
|
reg_t kDisposeWindow(EngineState *s, int argc, reg_t *argv);
|
|
|
|
reg_t kCelWide(EngineState *s, int argc, reg_t *argv);
|
|
|
|
reg_t kCelHigh(EngineState *s, int argc, reg_t *argv);
|
|
|
|
reg_t kSetJump(EngineState *s, int argc, reg_t *argv);
|
|
|
|
reg_t kDirLoop(EngineState *s, int argc, reg_t *argv);
|
|
|
|
reg_t kDoAvoider(EngineState *s, int argc, reg_t *argv);
|
|
|
|
reg_t kGetAngle(EngineState *s, int argc, reg_t *argv);
|
|
|
|
reg_t kGetDistance(EngineState *s, int argc, reg_t *argv);
|
|
|
|
reg_t kRandom(EngineState *s, int argc, reg_t *argv);
|
|
|
|
reg_t kAbs(EngineState *s, int argc, reg_t *argv);
|
|
|
|
reg_t kSqrt(EngineState *s, int argc, reg_t *argv);
|
|
|
|
reg_t kTimesSin(EngineState *s, int argc, reg_t *argv);
|
|
|
|
reg_t kTimesCos(EngineState *s, int argc, reg_t *argv);
|
|
|
|
reg_t kCosMult(EngineState *s, int argc, reg_t *argv);
|
|
|
|
reg_t kSinMult(EngineState *s, int argc, reg_t *argv);
|
|
|
|
reg_t kTimesTan(EngineState *s, int argc, reg_t *argv);
|
|
|
|
reg_t kTimesCot(EngineState *s, int argc, reg_t *argv);
|
|
|
|
reg_t kCosDiv(EngineState *s, int argc, reg_t *argv);
|
|
|
|
reg_t kSinDiv(EngineState *s, int argc, reg_t *argv);
|
|
|
|
reg_t kValidPath(EngineState *s, int argc, reg_t *argv);
|
|
|
|
reg_t kFOpen(EngineState *s, int argc, reg_t *argv);
|
|
|
|
reg_t kFPuts(EngineState *s, int argc, reg_t *argv);
|
|
|
|
reg_t kFGets(EngineState *s, int argc, reg_t *argv);
|
|
|
|
reg_t kFClose(EngineState *s, int argc, reg_t *argv);
|
|
|
|
reg_t kMapKeyToDir(EngineState *s, int argc, reg_t *argv);
|
|
|
|
reg_t kGlobalToLocal(EngineState *s, int argc, reg_t *argv);
|
|
|
|
reg_t kLocalToGlobal(EngineState *s, int argc, reg_t *argv);
|
|
|
|
reg_t kWait(EngineState *s, int argc, reg_t *argv);
|
|
|
|
reg_t kRestartGame(EngineState *s, int argc, reg_t *argv);
|
|
|
|
reg_t kDeviceInfo(EngineState *s, int argc, reg_t *argv);
|
|
|
|
reg_t kGetEvent(EngineState *s, int argc, reg_t *argv);
|
|
|
|
reg_t kCheckFreeSpace(EngineState *s, int argc, reg_t *argv);
|
|
|
|
reg_t kFlushResources(EngineState *s, int argc, reg_t *argv);
|
|
|
|
reg_t kGetSaveFiles(EngineState *s, int argc, reg_t *argv);
|
|
|
|
reg_t kSetDebug(EngineState *s, int argc, reg_t *argv);
|
|
|
|
reg_t kCheckSaveGame(EngineState *s, int argc, reg_t *argv);
|
|
|
|
reg_t kSaveGame(EngineState *s, int argc, reg_t *argv);
|
|
|
|
reg_t kRestoreGame(EngineState *s, int argc, reg_t *argv);
|
|
|
|
reg_t kFileIO(EngineState *s, int argc, reg_t *argv);
|
|
|
|
reg_t kGetTime(EngineState *s, int argc, reg_t *argv);
|
|
|
|
reg_t kHaveMouse(EngineState *s, int argc, reg_t *argv);
|
|
|
|
reg_t kJoystick(EngineState *s, int argc, reg_t *argv);
|
|
|
|
reg_t kGameIsRestarting(EngineState *s, int argc, reg_t *argv);
|
|
|
|
reg_t kGetCWD(EngineState *s, int argc, reg_t *argv);
|
|
|
|
reg_t kSort(EngineState *s, int argc, reg_t *argv);
|
|
|
|
reg_t kStrEnd(EngineState *s, int argc, reg_t *argv);
|
|
|
|
reg_t kMemory(EngineState *s, int argc, reg_t *argv);
|
|
|
|
reg_t kAvoidPath(EngineState *s, int argc, reg_t *argv);
|
|
|
|
reg_t kParse(EngineState *s, int argc, reg_t *argv);
|
|
|
|
reg_t kSaid(EngineState *s, int argc, reg_t *argv);
|
|
|
|
reg_t kStrCpy(EngineState *s, int argc, reg_t *argv);
|
|
|
|
reg_t kStrAt(EngineState *s, int argc, reg_t *argv);
|
|
|
|
reg_t kEditControl(EngineState *s, int argc, reg_t *argv);
|
|
|
|
reg_t kDrawControl(EngineState *s, int argc, reg_t *argv);
|
|
|
|
reg_t kHiliteControl(EngineState *s, int argc, reg_t *argv);
|
|
|
|
reg_t kClone(EngineState *s, int argc, reg_t *argv);
|
|
|
|
reg_t kDisposeClone(EngineState *s, int argc, reg_t *argv);
|
|
|
|
reg_t kCanBeHere(EngineState *s, int argc, reg_t *argv);
|
|
|
|
reg_t kCantBeHere(EngineState *s, int argc, reg_t *argv);
|
|
|
|
reg_t kSetNowSeen(EngineState *s, int argc, reg_t *argv);
|
|
|
|
reg_t kInitBresen(EngineState *s, int argc, reg_t *argv);
|
|
|
|
reg_t kDoBresen(EngineState *s, int argc, reg_t *argv);
|
|
|
|
reg_t kBaseSetter(EngineState *s, int argc, reg_t *argv);
|
|
|
|
reg_t kAddToPic(EngineState *s, int argc, reg_t *argv);
|
|
|
|
reg_t kAnimate(EngineState *s, int argc, reg_t *argv);
|
|
|
|
reg_t kDisplay(EngineState *s, int argc, reg_t *argv);
|
|
|
|
reg_t kGraph(EngineState *s, int argc, reg_t *argv);
|
|
|
|
reg_t kFormat(EngineState *s, int argc, reg_t *argv);
|
|
|
|
reg_t kDoSound(EngineState *s, int argc, reg_t *argv);
|
|
|
|
reg_t kAddMenu(EngineState *s, int argc, reg_t *argv);
|
|
|
|
reg_t kSetMenu(EngineState *s, int argc, reg_t *argv);
|
|
|
|
reg_t kGetMenu(EngineState *s, int argc, reg_t *argv);
|
|
|
|
reg_t kDrawStatus(EngineState *s, int argc, reg_t *argv);
|
|
|
|
reg_t kDrawMenuBar(EngineState *s, int argc, reg_t *argv);
|
|
|
|
reg_t kMenuSelect(EngineState *s, int argc, reg_t *argv);
|
|
|
|
|
|
|
|
reg_t kLoad(EngineState *s, int argc, reg_t *argv);
|
|
|
|
reg_t kUnLoad(EngineState *s, int argc, reg_t *argv);
|
|
|
|
reg_t kScriptID(EngineState *s, int argc, reg_t *argv);
|
|
|
|
reg_t kDisposeScript(EngineState *s, int argc, reg_t *argv);
|
|
|
|
reg_t kIsObject(EngineState *s, int argc, reg_t *argv);
|
|
|
|
reg_t kRespondsTo(EngineState *s, int argc, reg_t *argv);
|
|
|
|
reg_t kNewList(EngineState *s, int argc, reg_t *argv);
|
|
|
|
reg_t kDisposeList(EngineState *s, int argc, reg_t *argv);
|
|
|
|
reg_t kNewNode(EngineState *s, int argc, reg_t *argv);
|
|
|
|
reg_t kFirstNode(EngineState *s, int argc, reg_t *argv);
|
|
|
|
reg_t kLastNode(EngineState *s, int argc, reg_t *argv);
|
|
|
|
reg_t kEmptyList(EngineState *s, int argc, reg_t *argv);
|
|
|
|
reg_t kNextNode(EngineState *s, int argc, reg_t *argv);
|
|
|
|
reg_t kPrevNode(EngineState *s, int argc, reg_t *argv);
|
|
|
|
reg_t kNodeValue(EngineState *s, int argc, reg_t *argv);
|
|
|
|
reg_t kAddAfter(EngineState *s, int argc, reg_t *argv);
|
|
|
|
reg_t kAddToFront(EngineState *s, int argc, reg_t *argv);
|
|
|
|
reg_t kAddToEnd(EngineState *s, int argc, reg_t *argv);
|
|
|
|
reg_t kFindKey(EngineState *s, int argc, reg_t *argv);
|
|
|
|
reg_t kDeleteKey(EngineState *s, int argc, reg_t *argv);
|
|
|
|
reg_t kMemoryInfo(EngineState *s, int argc, reg_t *argv);
|
|
|
|
reg_t kGetSaveDir(EngineState *s, int argc, reg_t *argv);
|
|
|
|
reg_t kTextSize(EngineState *s, int argc, reg_t *argv);
|
|
|
|
reg_t kIsItSkip(EngineState *s, int argc, reg_t *argv);
|
2009-10-10 02:16:23 +00:00
|
|
|
reg_t kGetMessage(EngineState *s, int argc, reg_t *argv);
|
- Changed the unimplemented debug SCI kernel functions (InspectObj, ShowSends, ShowObjs, ShowFree, StackUsage and Profiler) to be dummy functions - we have our own debugger, and don't use these functions for debugging
- Removed the function number parameter from all kernel functions, as it's no longer needed, and removed the FAKE_FUNCT_NR hack
- Removed kUnknown() and kStub()
- Dummy/unknown kernel functions are no longer invoked, and a warning is shown instead, with the paremeters passed to them
Note: there is an evil hack used for debugging scripts in invoke_selector(), which probably no longer works now
svn-id: r44461
2009-09-29 14:24:07 +00:00
|
|
|
reg_t kMessage(EngineState *s, int argc, reg_t *argv);
|
|
|
|
reg_t kDoAudio(EngineState *s, int argc, reg_t *argv);
|
|
|
|
reg_t kDoSync(EngineState *s, int argc, reg_t *argv);
|
|
|
|
reg_t kResCheck(EngineState *s, int argc, reg_t *argv);
|
|
|
|
reg_t kSetQuitStr(EngineState *s, int argc, reg_t *argv);
|
|
|
|
reg_t kShowMovie(EngineState *s, int argc, reg_t *argv);
|
|
|
|
reg_t kSetVideoMode(EngineState *s, int argc, reg_t *argv);
|
|
|
|
reg_t kStrSplit(EngineState *s, int argc, reg_t *argv);
|
|
|
|
reg_t kPlatform(EngineState *s, int argc, reg_t *argv);
|
2009-10-03 20:49:18 +00:00
|
|
|
reg_t kTextColors(EngineState *s, int argc, reg_t *argv);
|
|
|
|
reg_t kTextFonts(EngineState *s, int argc, reg_t *argv);
|
2009-04-20 19:28:08 +00:00
|
|
|
|
2009-12-21 14:32:54 +00:00
|
|
|
#ifdef ENABLE_SCI32
|
|
|
|
// SCI2 Kernel Functions
|
|
|
|
reg_t kIsHiRes(EngineState *s, int argc, reg_t *argv);
|
|
|
|
reg_t kArray(EngineState *s, int argc, reg_t *argv);
|
2009-12-26 15:47:57 +00:00
|
|
|
reg_t kListAt(EngineState *s, int argc, reg_t *argv);
|
2009-12-21 14:32:54 +00:00
|
|
|
reg_t kString(EngineState *s, int argc, reg_t *argv);
|
2009-12-24 15:02:06 +00:00
|
|
|
// "Screen items" in SCI32 are views
|
2009-12-24 13:50:50 +00:00
|
|
|
reg_t kAddScreenItem(EngineState *s, int argc, reg_t *argv);
|
|
|
|
reg_t kUpdateScreenItem(EngineState *s, int argc, reg_t *argv);
|
|
|
|
reg_t kDeleteScreenItem(EngineState *s, int argc, reg_t *argv);
|
2009-12-24 15:02:06 +00:00
|
|
|
// "Planes" in SCI32 are pictures
|
|
|
|
reg_t kAddPlane(EngineState *s, int argc, reg_t *argv);
|
|
|
|
reg_t kDeletePlane(EngineState *s, int argc, reg_t *argv);
|
|
|
|
reg_t kUpdatePlane(EngineState *s, int argc, reg_t *argv);
|
|
|
|
reg_t kRepaintPlane(EngineState *s, int argc, reg_t *argv);
|
|
|
|
reg_t kFrameOut(EngineState *s, int argc, reg_t *argv);
|
2009-12-30 12:55:24 +00:00
|
|
|
reg_t kListIndexOf(EngineState *s, int argc, reg_t *argv);
|
2009-12-24 15:02:06 +00:00
|
|
|
reg_t kListEachElementDo(EngineState *s, int argc, reg_t *argv);
|
2009-12-30 13:43:17 +00:00
|
|
|
reg_t kListFirstTrue(EngineState *s, int argc, reg_t *argv);
|
2009-12-30 14:00:30 +00:00
|
|
|
reg_t kListAllTrue(EngineState *s, int argc, reg_t *argv);
|
2009-12-24 18:37:35 +00:00
|
|
|
reg_t kOnMe(EngineState *s, int argc, reg_t *argv);
|
2010-01-03 05:29:30 +00:00
|
|
|
reg_t kInPolygon(EngineState *s, int argc, reg_t *argv);
|
2009-12-24 02:43:07 +00:00
|
|
|
|
|
|
|
// SCI2.1 Kernel Functions
|
|
|
|
reg_t kSave(EngineState *s, int argc, reg_t *argv);
|
2009-12-30 14:31:00 +00:00
|
|
|
reg_t kList(EngineState *s, int argc, reg_t *argv);
|
|
|
|
|
2009-12-21 14:32:54 +00:00
|
|
|
#endif
|
|
|
|
|
2009-02-21 10:23:36 +00:00
|
|
|
} // End of namespace Sci
|
|
|
|
|
2009-12-21 14:32:54 +00:00
|
|
|
#endif // SCI_ENGINE_KERNEL_H
|