diff options
| author | Filippos Karapetis | 2009-06-21 13:06:08 +0000 | 
|---|---|---|
| committer | Filippos Karapetis | 2009-06-21 13:06:08 +0000 | 
| commit | 245a2764fca6bf4ed4798b4e68fd82e4c61bb33c (patch) | |
| tree | d9868f7bf6c0db45b5322d4ea9c2b1fde0080471 /engines | |
| parent | b14fa66f9f7b105d18b00488c9bd620f77082fab (diff) | |
| download | scummvm-rg350-245a2764fca6bf4ed4798b4e68fd82e4c61bb33c.tar.gz scummvm-rg350-245a2764fca6bf4ed4798b4e68fd82e4c61bb33c.tar.bz2 scummvm-rg350-245a2764fca6bf4ed4798b4e68fd82e4c61bb33c.zip | |
Cleanup
svn-id: r41727
Diffstat (limited to 'engines')
| -rw-r--r-- | engines/sci/console.cpp | 9 | ||||
| -rw-r--r-- | engines/sci/console.h | 9 | ||||
| -rw-r--r-- | engines/sci/engine/scriptdebug.cpp | 28 | 
3 files changed, 14 insertions, 32 deletions
| diff --git a/engines/sci/console.cpp b/engines/sci/console.cpp index 22425e7ab4..2f2fbc5243 100644 --- a/engines/sci/console.cpp +++ b/engines/sci/console.cpp @@ -55,15 +55,6 @@ int g_debug_seeking = 0; // Stepping forward until some special condition is met  int g_debug_seek_special = 0;  // Used for special seeks  int g_debug_seek_level = 0; // Used for seekers that want to check their exec stack depth -enum DebugSeeking { -	kDebugSeekNothing = 0, -	kDebugSeekCallk = 1,        // Step forward until callk is found -	kDebugSeekLevelRet = 2,     // Step forward until returned from this level -	kDebugSeekSpecialCallk = 3, // Step forward until a /special/ callk is found -	kDebugSeekSO = 4,           // Step forward until specified PC (after the send command) and stack depth -	kDebugSeekGlobal = 5        // Step forward until one specified global variable is modified -}; -  Console::Console(SciEngine *vm) : GUI::Debugger() {  	_vm = vm; diff --git a/engines/sci/console.h b/engines/sci/console.h index c45202de16..22b5505bf2 100644 --- a/engines/sci/console.h +++ b/engines/sci/console.h @@ -35,6 +35,15 @@ namespace Sci {  class SciEngine;  struct List; +enum DebugSeeking { +	kDebugSeekNothing = 0, +	kDebugSeekCallk = 1,        // Step forward until callk is found +	kDebugSeekLevelRet = 2,     // Step forward until returned from this level +	kDebugSeekSpecialCallk = 3, // Step forward until a /special/ callk is found +	kDebugSeekSO = 4,           // Step forward until specified PC (after the send command) and stack depth +	kDebugSeekGlobal = 5        // Step forward until one specified global variable is modified +}; +  // Refer to the "addresses" command on how to pass address parameters  int parse_reg_t(EngineState *s, const char *str, reg_t *dest);  int printObject(EngineState *s, reg_t pos); diff --git a/engines/sci/engine/scriptdebug.cpp b/engines/sci/engine/scriptdebug.cpp index 63e99ad122..11c38052db 100644 --- a/engines/sci/engine/scriptdebug.cpp +++ b/engines/sci/engine/scriptdebug.cpp @@ -26,24 +26,9 @@  // Script debugger functionality. Absolutely not threadsafe.  #include "sci/sci.h" +#include "sci/console.h"  #include "sci/debug.h"  #include "sci/engine/state.h" -#include "sci/engine/gc.h" -#include "sci/engine/kernel_types.h" -#include "sci/engine/kernel.h" -#include "sci/engine/savegame.h" -#include "sci/gfx/gfx_widgets.h" -#include "sci/gfx/gfx_gui.h" -#include "sci/gfx/gfx_state_internal.h"	// required for GfxContainer, GfxPort, GfxVisual -#include "sci/resource.h" -#include "sci/vocabulary.h" -#include "sci/sfx/iterator.h" -#include "sci/sfx/sci_midi.h" - -#include "common/util.h" -#include "common/savefile.h" - -#include "sound/audiostream.h"  namespace Sci { @@ -63,13 +48,13 @@ static int *p_var_max; // May be NULL even in valid state!  extern const char *selector_name(EngineState *s, int selector); -int prop_ofs_to_id(EngineState *s, int prop_ofs, reg_t objp) { +int propertyOffsetToId(EngineState *s, int prop_ofs, reg_t objp) {  	Object *obj = obj_get(s, objp);  	byte *selectoroffset;  	int selectors;  	if (!obj) { -		sciprintf("Applied prop_ofs_to_id on non-object at %04x:%04x\n", PRINT_REG(objp)); +		sciprintf("Applied propertyOffsetToId on non-object at %04x:%04x\n", PRINT_REG(objp));  		return -1;  	} @@ -86,7 +71,7 @@ int prop_ofs_to_id(EngineState *s, int prop_ofs, reg_t objp) {  	}  	if (prop_ofs < 0 || (prop_ofs >> 1) >= selectors) { -		sciprintf("Applied prop_ofs_to_id to invalid property offset %x (property #%d not in [0..%d]) on object at %04x:%04x\n", +		sciprintf("Applied propertyOffsetToId to invalid property offset %x (property #%d not in [0..%d]) on object at %04x:%04x\n",  		          prop_ofs, prop_ofs >> 1, selectors - 1, PRINT_REG(objp));  		return -1;  	} @@ -257,7 +242,7 @@ reg_t disassemble(EngineState *s, reg_t pos, int print_bw_tag, int print_bytecod  		if ((opcode == op_pTos) || (opcode == op_sTop) || (opcode == op_pToa) || (opcode == op_aTop) ||  		        (opcode == op_dpToa) || (opcode == op_ipToa) || (opcode == op_dpTos) || (opcode == op_ipTos)) {  			int prop_ofs = scr[pos.offset + 1]; -			int prop_id = prop_ofs_to_id(s, prop_ofs, *p_objp); +			int prop_id = propertyOffsetToId(s, prop_ofs, *p_objp);  			sciprintf("	(%s)", selector_name(s, prop_id));  		} @@ -342,8 +327,6 @@ reg_t disassemble(EngineState *s, reg_t pos, int print_bw_tag, int print_bytecod  void script_debug(EngineState *s, reg_t *pc, StackPtr *sp, StackPtr *pp, reg_t *objp, int *restadjust,  	SegmentId *segids, reg_t **variables, reg_t **variables_base, int *variables_nr, int bp) { -// TODO: disabled till this is moved in console.cpp -#if 0  	// Do we support a separate console?  	int old_debugstate = g_debugstate_valid; @@ -412,7 +395,6 @@ void script_debug(EngineState *s, reg_t *pc, StackPtr *sp, StackPtr *pp, reg_t *  			// OK, found whatever we were looking for  		}  	} -#endif  	g_debugstate_valid = (g_debug_step_running == 0); | 
