aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/engine/vm.h
diff options
context:
space:
mode:
Diffstat (limited to 'engines/sci/engine/vm.h')
-rw-r--r--engines/sci/engine/vm.h31
1 files changed, 24 insertions, 7 deletions
diff --git a/engines/sci/engine/vm.h b/engines/sci/engine/vm.h
index 56fbb0bd64..cd37166d50 100644
--- a/engines/sci/engine/vm.h
+++ b/engines/sci/engine/vm.h
@@ -212,13 +212,6 @@ struct ViewObject {
int real_y, z, index_nr; /* Used for sorting */
};
-enum {
- VAR_GLOBAL = 0,
- VAR_LOCAL = 1,
- VAR_TEMP = 2,
- VAR_PARAM = 3
-};
-
enum ExecStackType {
EXEC_STACK_TYPE_CALL = 0,
EXEC_STACK_TYPE_KERNEL = 1,
@@ -248,6 +241,30 @@ struct ExecStack {
reg_t* getVarPointer(SegManager *segMan) const;
};
+enum {
+ VAR_GLOBAL = 0,
+ VAR_LOCAL = 1,
+ VAR_TEMP = 2,
+ VAR_PARAM = 3
+};
+
+/**
+ * Structure for storing the current internal state of the VM.
+ */
+struct ScriptState {
+ ExecStack *xs;
+ int16 restAdjust;
+ reg_t *variables[4]; // global, local, temp, param, as immediate pointers
+ reg_t *variables_base[4]; // Used for referencing VM ops
+ SegmentId variables_seg[4]; // Same as above, contains segment IDs
+ int variables_max[4]; // Max. values for all variables
+};
+
+/**
+ * The current internal state of the VM.
+ */
+extern ScriptState scriptState;
+
// These types are used both as identifiers and as elements of bitfields
enum BreakpointType {