diff options
-rw-r--r-- | engines/sci/engine/kgraphics.cpp | 11 | ||||
-rw-r--r-- | engines/sci/engine/script.cpp | 1 | ||||
-rw-r--r-- | engines/sci/engine/vm.h | 1 |
3 files changed, 12 insertions, 1 deletions
diff --git a/engines/sci/engine/kgraphics.cpp b/engines/sci/engine/kgraphics.cpp index 3313c06779..e65f9eea5b 100644 --- a/engines/sci/engine/kgraphics.cpp +++ b/engines/sci/engine/kgraphics.cpp @@ -1625,12 +1625,21 @@ static void _k_draw_control(EngineState *s, reg_t obj, int inverse) { case K_CONTROL_CONTROL: case K_CONTROL_CONTROL_ALIAS: { int entries_nr; - int lsTop = GET_SEL32V(obj, lsTop) - text_pos.offset; + int lsTop; int list_top = 0; int selection = 0; int entry_size = GET_SEL32V(obj, x); int i; + if (s->_kernel->_selectorCache.topString != -1) { + // Games from early SCI1 onwards use topString + lsTop = GET_SEL32V(obj, topString); + } else { + // Earlier games use lsTop + lsTop = GET_SEL32V(obj, lsTop); + } + lsTop -= text_pos.offset; + debugC(2, kDebugLevelGraphics, "drawing list control %04x:%04x to %d,%d, diff %d\n", PRINT_REG(obj), x, y, SCI_MAX_SAVENAME_LENGTH); cursor = GET_SEL32V(obj, cursor) - text_pos.offset; diff --git a/engines/sci/engine/script.cpp b/engines/sci/engine/script.cpp index a19da886b2..7a4883e15c 100644 --- a/engines/sci/engine/script.cpp +++ b/engines/sci/engine/script.cpp @@ -241,6 +241,7 @@ void Kernel::mapSelectors() { FIND_SELECTOR(parseLang); FIND_SELECTOR(motionCue); FIND_SELECTOR(setCursor); + FIND_SELECTOR(topString); } void Kernel::dumpScriptObject(char *data, int seeker, int objsize) { diff --git a/engines/sci/engine/vm.h b/engines/sci/engine/vm.h index c701634bc9..530a293081 100644 --- a/engines/sci/engine/vm.h +++ b/engines/sci/engine/vm.h @@ -157,6 +157,7 @@ struct SelectorCache { Selector elements; /**< Used by SetSynonyms() */ Selector lsTop, lsBottom, lsRight, lsLeft; /**< Used by Animate() subfunctions and scroll list controls */ + Selector topString; /**< SCI1 scroll lists use this instead of lsTop */ Selector looper, mover, isBlocked, heading; /**< Used in DoAvoider */ |