aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorMax Horn2009-10-02 12:53:04 +0000
committerMax Horn2009-10-02 12:53:04 +0000
commit908e13fa73e946340c6ae9867a370af0562d9c8e (patch)
treedae79848477e01b3509c87926b1be444c278da70 /engines
parent0fe40b505395ee7f54344be67741d6efb44e02f4 (diff)
downloadscummvm-rg350-908e13fa73e946340c6ae9867a370af0562d9c8e.tar.gz
scummvm-rg350-908e13fa73e946340c6ae9867a370af0562d9c8e.tar.bz2
scummvm-rg350-908e13fa73e946340c6ae9867a370af0562d9c8e.zip
SCI: Remove PRINT_STK macro; cleanup
svn-id: r44533
Diffstat (limited to 'engines')
-rw-r--r--engines/sci/console.cpp2
-rw-r--r--engines/sci/engine/vm_types.h38
2 files changed, 24 insertions, 16 deletions
diff --git a/engines/sci/console.cpp b/engines/sci/console.cpp
index 2e00127351..7f03629221 100644
--- a/engines/sci/console.cpp
+++ b/engines/sci/console.cpp
@@ -503,7 +503,7 @@ bool Console::cmdRegisters(int argc, const char **argv) {
EngineState *s = _vm->_gamestate; // for PRINT_STK
DebugPrintf("pc=%04x:%04x obj=%04x:%04x fp=ST:%04x sp=ST:%04x\n",
PRINT_REG(scriptState.xs->addr.pc), PRINT_REG(scriptState.xs->objp),
- PRINT_STK(scriptState.xs->fp), PRINT_STK(scriptState.xs->sp));
+ (unsigned)(scriptState.xs->fp - s->stack_base), (unsigned)(scriptState.xs->sp - s->stack_base));
} else
DebugPrintf("<no execution stack: pc,obj,fp omitted>\n");
diff --git a/engines/sci/engine/vm_types.h b/engines/sci/engine/vm_types.h
index c62d0bddcb..29dc798c35 100644
--- a/engines/sci/engine/vm_types.h
+++ b/engines/sci/engine/vm_types.h
@@ -58,21 +58,6 @@ struct reg_t {
}
};
-#define PRINT_REG(r) (0xffff) & (unsigned) (r).segment, (unsigned) (r).offset
-
-// Stack pointer type
-typedef reg_t *StackPtr;
-
-// Selector ID
-typedef int Selector;
-#define NULL_SELECTOR -1
-
-// Offset sent to indicate an error, or that an operation has finished
-// (depending on the case)
-#define SIGNAL_OFFSET 0xffff
-
-#define PRINT_STK(v) (unsigned) (v - s->stack_base)
-
static inline reg_t make_reg(SegmentId segment, uint16 offset) {
reg_t r;
r.offset = offset;
@@ -80,9 +65,32 @@ static inline reg_t make_reg(SegmentId segment, uint16 offset) {
return r;
}
+#define PRINT_REG(r) (0xffff) & (unsigned) (r).segment, (unsigned) (r).offset
+
+// Stack pointer type
+typedef reg_t *StackPtr;
+
+enum {
+ /**
+ * Special reg_t 'offset' used to indicate an error, or that an operation has
+ * finished (depending on the case).
+ * @see SIGNAL_REG
+ */
+ SIGNAL_OFFSET = 0xffff
+};
+
extern const reg_t NULL_REG;
extern const reg_t SIGNAL_REG;
+// Selector ID
+typedef int Selector;
+
+enum {
+ /** Special 'selector' value, used when calling add_exec_stack_entry. */
+ NULL_SELECTOR = -1
+};
+
+
} // End of namespace Sci
#endif // SCI_ENGINE_VM_TYPES_H