ScummVM API documentation
Sci::Kernel Class Reference

Public Types

typedef Common::Array< KernelFunction > KernelFunctionArray
 

Public Member Functions

 Kernel (ResourceManager *resMan, SegManager *segMan)
 
uint getSelectorNamesSize () const
 
const Common::String & getSelectorName (uint selector)
 
int findKernelFuncPos (Common::String kernelFuncName)
 
uint getKernelNamesSize () const
 
const Common::String & getKernelName (uint number) const
 
Common::String getKernelName (uint number, uint subFunction) const
 
int findSelector (const char *selectorName) const
 
void dissectScript (int scriptNumber, Vocabulary *vocab)
 
void dumpScriptObject (const SciSpan< const byte > &script, SciSpan< const byte > object)
 
void dumpScriptClass (const SciSpan< const byte > &script, SciSpan< const byte > clazz)
 
bool signatureMatch (const uint16 *sig, int argc, const reg_t *argv)
 
void signatureDebug (Common::String &signatureDetails, const uint16 *sig, int argc, const reg_t *argv)
 
uint16 findRegType (reg_t reg)
 
Common::String lookupText (reg_t address, int index)
 
void loadKernelNames (GameFeatures *features)
 

Public Attributes

SelectorCache _selectorCache
 
KernelFunctionArray _kernelFuncs
 

Constructor & Destructor Documentation

◆ Kernel()

Sci::Kernel::Kernel ( ResourceManager *  resMan,
SegManager *  segMan 
)

Initializes the SCI kernel.

Member Function Documentation

◆ findSelector()

int Sci::Kernel::findSelector ( const char *  selectorName) const

Determines the selector ID of a selector by its name.

Parameters
selectorNameName of the selector to look up
Returns
The appropriate selector ID, or -1 on error

◆ signatureMatch()

bool Sci::Kernel::signatureMatch ( const uint16 *  sig,
int  argc,
const reg_t *  argv 
)

Determines whether a list of registers matches a given signature. If no signature is given (i.e., if sig is NULL), this is always treated as a match.

Parameters
sigsignature to test against
argcnumber of arguments to test
argvargument list
Returns
true if the signature was matched, false otherwise

◆ findRegType()

uint16 Sci::Kernel::findRegType ( reg_t  reg)

Determines the type of the object indicated by reg.

Parameters
regregister to check
Returns
one of KSIG_* below KSIG_NULL. KSIG_INVALID set if the type of reg can be determined, but is invalid. 0 on error.

◆ lookupText()

Common::String Sci::Kernel::lookupText ( reg_t  address,
int  index 
)

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. If the text is read from a resource file, then the index refers to the index of the string in the text resource. If the index does not exist in the resource, an empty string is returned.

Parameters
addressThe address to look up
indexThe relative index
Returns
The referenced text, or empty string on error.

◆ loadKernelNames()

void Sci::Kernel::loadKernelNames ( GameFeatures *  features)

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).

Member Data Documentation

◆ _selectorCache

SelectorCache Sci::Kernel::_selectorCache

Shortcut list for important selectors.

◆ _kernelFuncs

KernelFunctionArray Sci::Kernel::_kernelFuncs

Table of kernel functions.


The documentation for this class was generated from the following file: