SCI: Remove PRINT_STK macro; cleanup
svn-id: r44533
This commit is contained in:
parent
0fe40b5053
commit
908e13fa73
2 changed files with 24 additions and 16 deletions
|
@ -503,7 +503,7 @@ bool Console::cmdRegisters(int argc, const char **argv) {
|
||||||
EngineState *s = _vm->_gamestate; // for PRINT_STK
|
EngineState *s = _vm->_gamestate; // for PRINT_STK
|
||||||
DebugPrintf("pc=%04x:%04x obj=%04x:%04x fp=ST:%04x sp=ST:%04x\n",
|
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_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
|
} else
|
||||||
DebugPrintf("<no execution stack: pc,obj,fp omitted>\n");
|
DebugPrintf("<no execution stack: pc,obj,fp omitted>\n");
|
||||||
|
|
||||||
|
|
|
@ -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) {
|
static inline reg_t make_reg(SegmentId segment, uint16 offset) {
|
||||||
reg_t r;
|
reg_t r;
|
||||||
r.offset = offset;
|
r.offset = offset;
|
||||||
|
@ -80,9 +65,32 @@ static inline reg_t make_reg(SegmentId segment, uint16 offset) {
|
||||||
return r;
|
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 NULL_REG;
|
||||||
extern const reg_t SIGNAL_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
|
} // End of namespace Sci
|
||||||
|
|
||||||
#endif // SCI_ENGINE_VM_TYPES_H
|
#endif // SCI_ENGINE_VM_TYPES_H
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue