aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/debug.h
diff options
context:
space:
mode:
authorFilippos Karapetis2009-07-08 10:25:37 +0000
committerFilippos Karapetis2009-07-08 10:25:37 +0000
commit62499054a0639fd9bca6b0573bca3b664e8561fe (patch)
tree12b9cab8657bd4bd9ae9fe6c9b0d3cc54e59dd69 /engines/sci/debug.h
parent90422f6bd3e7f4b6c1df82124ce5000986822651 (diff)
downloadscummvm-rg350-62499054a0639fd9bca6b0573bca3b664e8561fe.tar.gz
scummvm-rg350-62499054a0639fd9bca6b0573bca3b664e8561fe.tar.bz2
scummvm-rg350-62499054a0639fd9bca6b0573bca3b664e8561fe.zip
Some cleanup for the script debugger code:
- Renamed struct DebugState to ScriptState and r_amp_rest to restAdjust inside EngineState. Changed restAdjust to be a uint16 (actually it is a uint16, but it was being casted back and forth from an unsigned integer, so this clears up its type and size) - Moved the script state variables from inside the run_vm() into the ScriptState struct, so that they can be accessed by the console commands and the script debugger all the time, and removed the weird isValid code svn-id: r42260
Diffstat (limited to 'engines/sci/debug.h')
-rw-r--r--engines/sci/debug.h20
1 files changed, 8 insertions, 12 deletions
diff --git a/engines/sci/debug.h b/engines/sci/debug.h
index fbd98e0d6f..ccf0602600 100644
--- a/engines/sci/debug.h
+++ b/engines/sci/debug.h
@@ -37,8 +37,7 @@ enum DebugSeeking {
kDebugSeekGlobal = 5 // Step forward until one specified global variable is modified
};
-struct DebugState {
- bool isValid;
+struct ScriptState {
bool stopOnEvent;
DebugSeeking seeking; // Stepping forward until some special condition is met
int runningStep; // Set to > 0 to allow multiple stepping
@@ -46,15 +45,12 @@ struct DebugState {
int seekSpecial; // Used for special seeks
int old_pc_offset;
StackPtr old_sp;
- reg_t *p_pc;
- StackPtr *p_sp;
- StackPtr *p_pp;
- reg_t *p_objp;
- int *p_restadjust;
- SegmentId *p_var_segs;
- reg_t **p_vars;
- reg_t **p_var_base;
- int *p_var_max; // May be NULL even in valid state!
+ ExecStack *xs;
+ uint16 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
};
// Various global variables used for debugging are declared here
@@ -62,7 +58,7 @@ extern int g_debug_sleeptime_factor;
extern int g_debug_simulated_key;
extern bool g_debug_track_mouse_clicks;
extern bool g_debug_weak_validations;
-extern DebugState debugState;
+extern ScriptState scriptState;
} // End of namespace Sci