diff options
author | Colin Snover | 2017-07-29 15:53:35 -0500 |
---|---|---|
committer | Colin Snover | 2017-07-30 19:10:50 -0500 |
commit | 06686c09f00700ac07b5503aad41e02696cfdb16 (patch) | |
tree | 51b32bab73b3d8222d09a46103d530d2484f20b8 /engines/sci | |
parent | d02e62a76940c3b35c24872033d2c9ee1386f45b (diff) | |
download | scummvm-rg350-06686c09f00700ac07b5503aad41e02696cfdb16.tar.gz scummvm-rg350-06686c09f00700ac07b5503aad41e02696cfdb16.tar.bz2 scummvm-rg350-06686c09f00700ac07b5503aad41e02696cfdb16.zip |
SCI32: Fix breakpoints on reading/writing selectors in SCI3
Diffstat (limited to 'engines/sci')
-rw-r--r-- | engines/sci/engine/scriptdebug.cpp | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/engines/sci/engine/scriptdebug.cpp b/engines/sci/engine/scriptdebug.cpp index 1b3f18694e..f31a43cec4 100644 --- a/engines/sci/engine/scriptdebug.cpp +++ b/engines/sci/engine/scriptdebug.cpp @@ -950,11 +950,21 @@ void debugPropertyAccess(Object *obj, reg_t objp, unsigned int index, reg_t curV const Object *var_container = obj; if (!obj->isClass() && getSciVersion() != SCI_VERSION_3) var_container = segMan->getObject(obj->getSuperClassSelector()); - if ((index >> 1) >= var_container->getVarCount()) { - // TODO: error, warning, debug? - return; + + uint16 varSelector; + if (getSciVersion() == SCI_VERSION_3) { + varSelector = index; + } else { + index >>= 1; + + if (index >= var_container->getVarCount()) { + // TODO: error, warning, debug? + return; + } + + varSelector = var_container->getVarSelector(index); } - uint16 varSelector = var_container->getVarSelector(index >> 1); + if (g_sci->checkSelectorBreakpoint(breakpointType, objp, varSelector)) { // checkSelectorBreakpoint has already triggered the breakpoint. // We just output the relevant data here. |