aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorFilippos Karapetis2010-08-22 16:30:33 +0000
committerFilippos Karapetis2010-08-22 16:30:33 +0000
commit68f3cc944cbdcf6f5997700f996971087937a72e (patch)
treee36792c00172c2fe77397e87104c00f503a31c55 /engines
parentb5cb6b7c98a89d0ae23067c01e6a5325a9349b2d (diff)
downloadscummvm-rg350-68f3cc944cbdcf6f5997700f996971087937a72e.tar.gz
scummvm-rg350-68f3cc944cbdcf6f5997700f996971087937a72e.tar.bz2
scummvm-rg350-68f3cc944cbdcf6f5997700f996971087937a72e.zip
SCI: Reimplemented the kShow kernel command, used by the inbuilt SCI debugger. There is no real need to implement kernel debug commands, but since this one maps almost directly to our own "show" debug command, it has been reimplemented (was removed in rev #45310). Normally, there is no real need to implement kernel functions for debug functionality, since there are advanced tools for this purpose nowadays (plus, ScummVM's debugger). Fixes bug #3050616 - "QFG1 EGA: priority/control/view functions crash, debug mode"
svn-id: r52281
Diffstat (limited to 'engines')
-rw-r--r--engines/sci/engine/kernel.h1
-rw-r--r--engines/sci/engine/kernel_tables.h3
-rw-r--r--engines/sci/engine/kgraphics.cpp24
3 files changed, 27 insertions, 1 deletions
diff --git a/engines/sci/engine/kernel.h b/engines/sci/engine/kernel.h
index b6247b46f1..dedc836b32 100644
--- a/engines/sci/engine/kernel.h
+++ b/engines/sci/engine/kernel.h
@@ -419,6 +419,7 @@ reg_t kStrSplit(EngineState *s, int argc, reg_t *argv);
reg_t kPlatform(EngineState *s, int argc, reg_t *argv);
reg_t kTextColors(EngineState *s, int argc, reg_t *argv);
reg_t kTextFonts(EngineState *s, int argc, reg_t *argv);
+reg_t kShow(EngineState *s, int argc, reg_t *argv);
reg_t kDummy(EngineState *s, int argc, reg_t *argv);
reg_t kEmpty(EngineState *s, int argc, reg_t *argv);
reg_t kStub(EngineState *s, int argc, reg_t *argv);
diff --git a/engines/sci/engine/kernel_tables.h b/engines/sci/engine/kernel_tables.h
index f29ffd878a..20a71896ae 100644
--- a/engines/sci/engine/kernel_tables.h
+++ b/engines/sci/engine/kernel_tables.h
@@ -430,6 +430,7 @@ static SciKernelMapEntry s_kernelMap[] = {
{ MAP_CALL(SetVideoMode), SIG_EVERYWHERE, "i", NULL, NULL },
{ MAP_CALL(ShakeScreen), SIG_EVERYWHERE, "(i)(i)", NULL, NULL },
{ MAP_CALL(ShowMovie), SIG_EVERYWHERE, "(.*)", NULL, NULL },
+ { MAP_CALL(Show), SIG_EVERYWHERE, "i", NULL, NULL },
{ MAP_CALL(SinDiv), SIG_EVERYWHERE, "ii", NULL, NULL },
{ MAP_CALL(Sort), SIG_EVERYWHERE, "ooo", NULL, NULL },
{ MAP_CALL(Sqrt), SIG_EVERYWHERE, "i", NULL, NULL },
@@ -502,7 +503,7 @@ static const char *s_defaultKernelNames[] = {
/*0x06*/ "IsObject",
/*0x07*/ "RespondsTo",
/*0x08*/ "DrawPic",
- /*0x09*/ "Dummy", // Show
+ /*0x09*/ "Show",
/*0x0a*/ "PicNotValid",
/*0x0b*/ "Animate",
/*0x0c*/ "SetNowSeen",
diff --git a/engines/sci/engine/kgraphics.cpp b/engines/sci/engine/kgraphics.cpp
index a566ce0554..25d8b6ef27 100644
--- a/engines/sci/engine/kgraphics.cpp
+++ b/engines/sci/engine/kgraphics.cpp
@@ -1155,6 +1155,30 @@ reg_t kTextColors(EngineState *s, int argc, reg_t *argv) {
return s->r_acc;
}
+/**
+ * Debug command, used by the SCI builtin debugger
+ */
+reg_t kShow(EngineState *s, int argc, reg_t *argv) {
+ uint16 map = argv[0].toUint16();
+
+ switch (map) {
+ case 1: // Visual, substituted by display for us
+ g_sci->_gfxScreen->debugShowMap(3);
+ break;
+ case 2: // Priority
+ g_sci->_gfxScreen->debugShowMap(1);
+ break;
+ case 3: // Control
+ case 4: // Control
+ g_sci->_gfxScreen->debugShowMap(2);
+ break;
+ default:
+ warning("Map %d is not available", map);
+ }
+
+ return s->r_acc;
+}
+
#ifdef ENABLE_SCI32
reg_t kIsHiRes(EngineState *s, int argc, reg_t *argv) {