22#ifndef SCI_ENGINE_STATE_H
23#define SCI_ENGINE_STATE_H
25#include "common/scummsys.h"
26#include "common/array.h"
27#include "common/serializer.h"
28#include "common/str-array.h"
31class SeekableReadStream;
36#include "sci/engine/file.h"
37#include "sci/engine/seg_manager.h"
39#include "sci/parser/vocabulary.h"
41#include "sci/sound/soundcmd.h"
49class SoundCommandParser;
50class VirtualIndexFile;
55 kAbortRestartGame = 2,
62 SAVEGAMEID_OFFICIALRANGE_START = 100,
63 SAVEGAMEID_OFFICIALRANGE_END = 199
67 GAMEISRESTARTING_NONE = 0,
68 GAMEISRESTARTING_RESTART = 1,
69 GAMEISRESTARTING_RESTORE = 2
79 kHoldBlackFrame = 1 << 5,
80 kHoldLastFrame = 1 << 6,
96 return Common::String::format(
"method %s::%s (room %d, script %d, localCall %x)", objectName.c_str(), methodName.c_str(), roomNr, scriptNr, localCallOffset);
113 void speedThrottler(uint32 neededSleep);
114 uint16 wait(uint16 ticks);
115 void sleep(uint16 ticks);
120 bool _throttleTrigger;
128 int16 _lastSaveVirtualId;
129 int16 _lastSaveNewId;
132 int _delayedRestoreGameId;
135 int _kq7MacSaveGameId;
138 uint _chosenQfGImportItem;
140 bool _cursorWorkaroundActive;
141 int16 _cursorWorkaroundPosCount;
170 AbortGameState abortScriptProcessing;
171 int16 gameIsRestarting;
173 int scriptStepCounter;
174 int scriptGCInterval;
176 uint16 currentRoomNumber()
const;
177 void setRoomNumber(uint16 roomNumber);
193 void initMessageState();
198 kMemorySegmentMax = 256
200 uint16 _memorySegmentSize;
201 byte _memorySegment[kMemorySegmentMax];
Definition: serializer.h:352
Definition: serializer.h:80
static String format(MSVC_PRINTF const char *fmt,...) GCC_PRINTF(1
Definition: seg_manager.h:48
Definition: algorithm.h:29
int executionStackBase
Definition: state.h:152
void reset(bool isRestoring)
reg_t * variablesBase[4]
Used for referencing VM ops.
Definition: state.h:166
SegmentId variablesSegment[4]
Same as above, contains segment IDs.
Definition: state.h:167
SciCallOrigin getCurrentCallOrigin() const
StackPtr stack_top
Definition: state.h:161
SegManager * _segMan
Definition: state.h:106
uint32 _screenUpdateTime
Definition: state.h:111
Common::List< ExecStack > _executionStack
Definition: state.h:147
int variablesMax[4]
Max. values for all variables.
Definition: state.h:168
uint32 _throttleLastTime
Definition: state.h:119
bool _executionStackPosChanged
Definition: state.h:153
int16 r_rest
Definition: state.h:158
Common::String getGameVersionFromGlobal() const
StackPtr stack_base
Definition: state.h:160
int gcCountDown
Definition: state.h:190
bool callInStack(const reg_t object, const Selector selector) const
reg_t r_prev
Definition: state.h:157
uint32 lastWaitTime
Definition: state.h:110
uint32 _eventCounter
Definition: state.h:117
reg_t * variables[4]
global, local, temp, param, as immediate pointers
Definition: state.h:165
Common::Array< FileHandle > _fileHandles
Definition: state.h:124
uint32 _paletteSetIntensityCounter
Definition: state.h:118
reg_t r_acc
Definition: state.h:156
Definition: vm_types.h:39