diff options
author | Colin Snover | 2016-02-16 01:36:10 -0600 |
---|---|---|
committer | Colin Snover | 2016-02-18 13:18:02 -0600 |
commit | 3bddd869abbd6ba6dd88b0911f80aa305c8d464e (patch) | |
tree | 4811614d83c2416825ef3a55de79f00ffb1bd55e /engines/sci/engine | |
parent | b829e482289ab9cdee50e0809128bb60354bc581 (diff) | |
download | scummvm-rg350-3bddd869abbd6ba6dd88b0911f80aa305c8d464e.tar.gz scummvm-rg350-3bddd869abbd6ba6dd88b0911f80aa305c8d464e.tar.bz2 scummvm-rg350-3bddd869abbd6ba6dd88b0911f80aa305c8d464e.zip |
SCI: Build kernel table for ScrollWindow and stub seen functions
Signatures in subops table are correct for length but unknown
types are marked as . instead of the correct type.
Diffstat (limited to 'engines/sci/engine')
-rw-r--r-- | engines/sci/engine/kernel.h | 6 | ||||
-rw-r--r-- | engines/sci/engine/kernel_tables.h | 29 | ||||
-rw-r--r-- | engines/sci/engine/kgraphics32.cpp | 35 |
3 files changed, 66 insertions, 4 deletions
diff --git a/engines/sci/engine/kernel.h b/engines/sci/engine/kernel.h index 1d7a8507ec..53f5878bba 100644 --- a/engines/sci/engine/kernel.h +++ b/engines/sci/engine/kernel.h @@ -441,6 +441,12 @@ reg_t kStringLower(EngineState *s, int argc, reg_t *argv); reg_t kStringTrn(EngineState *s, int argc, reg_t *argv); reg_t kStringTrnExclude(EngineState *s, int argc, reg_t *argv); +reg_t kScrollWindowCreate(EngineState *s, int argc, reg_t *argv); +reg_t kScrollWindowAdd(EngineState *s, int argc, reg_t *argv); +reg_t kScrollWindowWhere(EngineState *s, int argc, reg_t *argv); +reg_t kScrollWindowShow(EngineState *s, int argc, reg_t *argv); +reg_t kScrollWindowDestroy(EngineState *s, int argc, reg_t *argv); + reg_t kMulDiv(EngineState *s, int argc, reg_t *argv); reg_t kCantBeHere32(EngineState *s, int argc, reg_t *argv); reg_t kRemapColors32(EngineState *s, int argc, reg_t *argv); diff --git a/engines/sci/engine/kernel_tables.h b/engines/sci/engine/kernel_tables.h index fce3230a18..ad0b86b8b1 100644 --- a/engines/sci/engine/kernel_tables.h +++ b/engines/sci/engine/kernel_tables.h @@ -352,6 +352,31 @@ static const SciKernelMapSubEntry kString_subops[] = { SCI_SUBOPENTRY_TERMINATOR }; +// version, subId, function-mapping, signature, workarounds +static const SciKernelMapSubEntry kScrollWindow_subops[] = { + { SIG_SCI32, 0, MAP_CALL(ScrollWindowCreate), "oi", NULL }, + { SIG_SCI32, 1, MAP_CALL(ScrollWindowAdd), "o.ii.(.)", NULL }, + { SIG_SCI32, 2, MAP_DUMMY(ScrollWindowClear), "o", NULL }, + { SIG_SCI32, 3, MAP_DUMMY(ScrollWindowPageUp), "o", NULL }, + { SIG_SCI32, 4, MAP_DUMMY(ScrollWindowPageDown), "o", NULL }, + { SIG_SCI32, 5, MAP_DUMMY(ScrollWindowUpArrow), "o", NULL }, + { SIG_SCI32, 6, MAP_DUMMY(ScrollWindowDownArrow), "o", NULL }, + { SIG_SCI32, 7, MAP_DUMMY(ScrollWindowHome), "o", NULL }, + { SIG_SCI32, 8, MAP_DUMMY(ScrollWindowEnd), "o", NULL }, + { SIG_SCI32, 9, MAP_DUMMY(ScrollWindowResize), "o.", NULL }, + { SIG_SCI32, 10, MAP_CALL(ScrollWindowWhere), "oi", NULL }, + { SIG_SCI32, 11, MAP_DUMMY(ScrollWindowGo), "o..", NULL }, + { SIG_SCI32, 12, MAP_DUMMY(ScrollWindowInsert), "o.....", NULL }, + { SIG_SCI32, 13, MAP_DUMMY(ScrollWindowDelete), "o.", NULL }, + { SIG_SCI32, 14, MAP_DUMMY(ScrollWindowModify), "o.....(.)", NULL }, + { SIG_SCI32, 15, MAP_DUMMY(ScrollWindowHide), "o", NULL }, + { SIG_SCI32, 16, MAP_CALL(ScrollWindowShow), "o", NULL }, + { SIG_SCI32, 17, MAP_CALL(ScrollWindowDestroy), "o", NULL }, + { SIG_SCI32, 18, MAP_DUMMY(ScrollWindowText), "o", NULL }, + { SIG_SCI32, 19, MAP_DUMMY(ScrollWindowReconstruct), "o.", NULL }, + SCI_SUBOPENTRY_TERMINATOR +}; + #endif struct SciKernelMapEntry { @@ -562,7 +587,7 @@ static SciKernelMapEntry s_kernelMap[] = { { MAP_CALL(DeletePlane), SIG_EVERYWHERE, "o", NULL, NULL }, { MAP_CALL(DeleteScreenItem), SIG_EVERYWHERE, "o", NULL, NULL }, { MAP_CALL(DisposeTextBitmap), SIG_EVERYWHERE, "r", NULL, NULL }, - { MAP_CALL(FrameOut), SIG_EVERYWHERE, "", NULL, NULL }, + { MAP_CALL(FrameOut), SIG_EVERYWHERE, "(i)", NULL, NULL }, { MAP_CALL(GetHighPlanePri), SIG_EVERYWHERE, "", NULL, NULL }, { MAP_CALL(InPolygon), SIG_EVERYWHERE, "iio", NULL, NULL }, { MAP_CALL(IsHiRes), SIG_EVERYWHERE, "", NULL, NULL }, @@ -644,7 +669,7 @@ static SciKernelMapEntry s_kernelMap[] = { { MAP_CALL(GetSierraProfileInt), SIG_EVERYWHERE, "rri", NULL, NULL }, { MAP_CALL(CelInfo), SIG_EVERYWHERE, "iiiiii", NULL, NULL }, { MAP_CALL(SetLanguage), SIG_EVERYWHERE, "r", NULL, NULL }, - { MAP_CALL(ScrollWindow), SIG_EVERYWHERE, "io(.*)", NULL, NULL }, + { MAP_CALL(ScrollWindow), SIG_EVERYWHERE, "i(.*)", kScrollWindow_subops, NULL }, { MAP_CALL(SetFontRes), SIG_EVERYWHERE, "ii", NULL, NULL }, { MAP_CALL(Font), SIG_EVERYWHERE, "i(.*)", NULL, NULL }, { MAP_CALL(Bitmap), SIG_EVERYWHERE, "(.*)", NULL, NULL }, diff --git a/engines/sci/engine/kgraphics32.cpp b/engines/sci/engine/kgraphics32.cpp index 93e8b90ecc..64ef7ca610 100644 --- a/engines/sci/engine/kgraphics32.cpp +++ b/engines/sci/engine/kgraphics32.cpp @@ -314,8 +314,39 @@ reg_t kCelInfo(EngineState *s, int argc, reg_t *argv) { } reg_t kScrollWindow(EngineState *s, int argc, reg_t *argv) { - return kStub(s, argc, argv); + if (!s) + return make_reg(0, getSciVersion()); + error("not supposed to call this"); +} + +reg_t kScrollWindowCreate(EngineState *s, int argc, reg_t *argv) { + debug("kScrollWindowCreate"); + kStub(s, argc, argv); + return argv[0]; +} + +reg_t kScrollWindowAdd(EngineState *s, int argc, reg_t *argv) { + debug("kScrollWindowAdd"); + return kStubNull(s, argc, argv); +} + +reg_t kScrollWindowWhere(EngineState *s, int argc, reg_t *argv) { + debug("kScrollWindowWhere"); + return kStubNull(s, argc, argv); +} + +reg_t kScrollWindowShow(EngineState *s, int argc, reg_t *argv) { + debug("kScrollWindowShow"); + return kStubNull(s, argc, argv); +} + +reg_t kScrollWindowDestroy(EngineState *s, int argc, reg_t *argv) { + debug("kScrollWindowDestroy"); + return kStubNull(s, argc, argv); +} + #if 0 +reg_t kScrollWindow(EngineState *s, int argc, reg_t *argv) { // Used by SQ6 and LSL6 hires for the text area in the bottom of the // screen. The relevant scripts also exist in Phantasmagoria 1, but they're // unused. This is always called by scripts 64906 (ScrollerWindow) and @@ -421,8 +452,8 @@ reg_t kScrollWindow(EngineState *s, int argc, reg_t *argv) { } return s->r_acc; -#endif } +#endif reg_t kSetFontRes(EngineState *s, int argc, reg_t *argv) { // TODO: This defines the resolution that the fonts are supposed to be displayed |