From c38f58598bfc35aa6c1a413e6f1369d5f09ca819 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Mon, 17 Aug 2009 05:55:21 +0000 Subject: - Simplified some functions to accept only the parts of the EngineState they need as parameters, instead of the whole EngineState - Moved the class table in the Segment manager - it's the only class using it directly - Removed the sci11 flag from save games (we already know this, we don't need to store it) - Moved script_get_segment() and get_class_address() inside the segment manager class - Removed the script_locate_by_segment wrapper - Simplified script_lookup_export() a lot by removing some paranoia checks - Added some WIP code for automatically determining the game id in the fallback detector (still not working) - General cleanup svn-id: r43458 --- engines/sci/engine/scriptdebug.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'engines/sci/engine/scriptdebug.cpp') diff --git a/engines/sci/engine/scriptdebug.cpp b/engines/sci/engine/scriptdebug.cpp index 0341ecb73d..fd7219bc85 100644 --- a/engines/sci/engine/scriptdebug.cpp +++ b/engines/sci/engine/scriptdebug.cpp @@ -37,9 +37,10 @@ extern const char *selector_name(EngineState *s, int selector); ScriptState scriptState; int propertyOffsetToId(EngineState *s, int prop_ofs, reg_t objp) { - Object *obj = obj_get(s, objp); + Object *obj = obj_get(s->seg_manager, s->_version, objp); byte *selectoroffset; int selectors; + SciVersion version = s->_version; // for the selector defines if (!obj) { warning("Applied propertyOffsetToId on non-object at %04x:%04x", PRINT_REG(objp)); @@ -52,7 +53,7 @@ int propertyOffsetToId(EngineState *s, int prop_ofs, reg_t objp) { selectoroffset = ((byte *)(obj->base_obj)) + SCRIPT_SELECTOR_OFFSET + selectors * 2; else { if (!(obj->_variables[SCRIPT_INFO_SELECTOR].offset & SCRIPT_INFO_CLASS)) { - obj = obj_get(s, obj->_variables[SCRIPT_SUPERCLASS_SELECTOR]); + obj = obj_get(s->seg_manager, s->_version, obj->_variables[SCRIPT_SUPERCLASS_SELECTOR]); selectoroffset = (byte *)obj->base_vars; } else selectoroffset = (byte *)obj->base_vars; @@ -268,7 +269,7 @@ reg_t disassemble(EngineState *s, reg_t pos, int print_bw_tag, int print_bytecod selector = sb[- stackframe].offset; - name = obj_get_name(s, called_obj_addr); + name = obj_get_name(s->seg_manager, s->_version, called_obj_addr); if (!name) name = ""; -- cgit v1.2.3