From 62499054a0639fd9bca6b0573bca3b664e8561fe Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Wed, 8 Jul 2009 10:25:37 +0000 Subject: 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 --- engines/sci/debug.h | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) (limited to 'engines/sci/debug.h') 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 -- cgit v1.2.3