ScummVM API documentation
Sci::EngineState Struct Reference
Inheritance diagram for Sci::EngineState:
Common::Serializable

Public Types

enum  { kMemorySegmentMax = 256 }
 

Public Member Functions

 EngineState (SegManager *segMan)
 
void saveLoadWithSerializer (Common::Serializer &ser) override
 
void speedThrottler (uint32 neededSleep)
 
uint16 wait (uint16 ticks)
 
void sleep (uint16 ticks)
 
uint16 currentRoomNumber () const
 
void setRoomNumber (uint16 roomNumber)
 
void initGlobals ()
 
void shrinkStackToBase ()
 
void reset (bool isRestoring)
 
SciCallOrigin getCurrentCallOrigin () const
 
bool callInStack (const reg_t object, const Selector selector) const
 
Common::String getGameVersionFromGlobal () const
 

Public Attributes

SegManager_segMan
 
uint32 lastWaitTime
 
uint32 _screenUpdateTime
 
uint32 _eventCounter
 
uint32 _paletteSetIntensityCounter
 
uint32 _throttleLastTime
 
bool _throttleTrigger
 
Common::Array< FileHandle_fileHandles
 
DirSeeker _dirseeker
 
int16 _lastSaveVirtualId
 
int16 _lastSaveNewId
 
int _delayedRestoreGameId
 
int _kq7MacSaveGameId
 
Common::String _kq7MacSaveGameDescription
 
uint _chosenQfGImportItem
 
bool _cursorWorkaroundActive
 
int16 _cursorWorkaroundPosCount
 
Common::Point _cursorWorkaroundPoint
 
Common::Rect _cursorWorkaroundRect
 
Common::List< ExecStack_executionStack
 
int executionStackBase
 
bool _executionStackPosChanged
 
reg_t r_acc
 
reg_t r_prev
 
int16 r_rest
 
StackPtr stack_base
 
StackPtr stack_top
 
ExecStackxs
 
reg_tvariables [4]
 global, local, temp, param, as immediate pointers
 
reg_tvariablesBase [4]
 Used for referencing VM ops.
 
SegmentId variablesSegment [4]
 Same as above, contains segment IDs.
 
int variablesMax [4]
 Max. values for all variables.
 
AbortGameState abortScriptProcessing
 
int16 gameIsRestarting
 
int scriptStepCounter
 
int scriptGCInterval
 
int gcCountDown
 
MessageState_msgState
 
uint16 _memorySegmentSize
 
byte _memorySegment [kMemorySegmentMax]
 

Member Function Documentation

◆ initGlobals()

void Sci::EngineState::initGlobals ( )

Sets global variables from script 0

◆ shrinkStackToBase()

void Sci::EngineState::shrinkStackToBase ( )

Shrink execution stack to size. Contains an assert if it is not already smaller.

◆ reset()

void Sci::EngineState::reset ( bool  isRestoring)

Resets the engine state.

◆ getCurrentCallOrigin()

SciCallOrigin Sci::EngineState::getCurrentCallOrigin ( ) const

Finds and returns the origin of the current call.

◆ callInStack()

bool Sci::EngineState::callInStack ( const reg_t  object,
const Selector  selector 
) const

Determines whether the given object method is in the current stack.

◆ getGameVersionFromGlobal()

Common::String Sci::EngineState::getGameVersionFromGlobal ( ) const

Returns the game's version string from its global variable. Most games initialize this to a string embedded in a script resource, or the contents of the VERSION file in the game directory.

Member Data Documentation

◆ _segMan

SegManager* Sci::EngineState::_segMan

The segment manager

◆ lastWaitTime

uint32 Sci::EngineState::lastWaitTime

The last time the game invoked Wait()

◆ _screenUpdateTime

uint32 Sci::EngineState::_screenUpdateTime

The last time the game updated the screen

◆ _eventCounter

uint32 Sci::EngineState::_eventCounter

total times kGetEvent was invoked since the last call to kGameIsRestarting(0) or kWait or kFrameOut

◆ _paletteSetIntensityCounter

uint32 Sci::EngineState::_paletteSetIntensityCounter

total times kPaletteSetIntensity was invoked since the last call to kGameIsRestarting(0) or kWait

◆ _throttleLastTime

uint32 Sci::EngineState::_throttleLastTime

last time kAnimate was invoked

◆ _fileHandles

Common::Array<FileHandle> Sci::EngineState::_fileHandles

Array of file handles. Dynamically increased if required.

◆ _executionStack

Common::List<ExecStack> Sci::EngineState::_executionStack

The execution stack

◆ executionStackBase

int Sci::EngineState::executionStackBase

When called from kernel functions, the vm is re-started recursively on the same stack. This variable contains the stack base for the current vm.

◆ _executionStackPosChanged

bool Sci::EngineState::_executionStackPosChanged

Set to true if the execution stack position should be re-evaluated by the vm

◆ r_acc

reg_t Sci::EngineState::r_acc

Accumulator

◆ r_prev

reg_t Sci::EngineState::r_prev

previous comparison result

◆ r_rest

int16 Sci::EngineState::r_rest

current &rest register

◆ stack_base

StackPtr Sci::EngineState::stack_base

Pointer to the least stack element

◆ stack_top

StackPtr Sci::EngineState::stack_top

First invalid stack element

◆ gcCountDown

int Sci::EngineState::gcCountDown

Number of kernel calls until next gc


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