aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/sci/engine/kernel.cpp1
-rw-r--r--engines/sci/engine/kernel.h1
-rw-r--r--engines/sci/engine/kgraphics.cpp17
-rw-r--r--engines/sci/gfx/gfx_resource.h2
4 files changed, 20 insertions, 1 deletions
diff --git a/engines/sci/engine/kernel.cpp b/engines/sci/engine/kernel.cpp
index 7985d3301b..98392803a4 100644
--- a/engines/sci/engine/kernel.cpp
+++ b/engines/sci/engine/kernel.cpp
@@ -211,6 +211,7 @@ SciKernelFunction kfunct_mappers[] = {
DEFUN("ResCheck", kResCheck, "iii*"),
DEFUN("SetQuitStr", kSetQuitStr, "r"),
DEFUN("ShowMovie", kShowMovie, "ri"),
+ DEFUN("SetVideoMode", kSetVideoMode, ".*"),
// Special and NOP stuff
{KF_NEW, NULL, k_Unknown, NULL},
diff --git a/engines/sci/engine/kernel.h b/engines/sci/engine/kernel.h
index c7110d5165..8269157ff9 100644
--- a/engines/sci/engine/kernel.h
+++ b/engines/sci/engine/kernel.h
@@ -434,6 +434,7 @@ reg_t kDoSync(EngineState *s, int funct_nr, int argc, reg_t *argv);
reg_t kResCheck(EngineState *s, int funct_nr, int argc, reg_t *argv);
reg_t kSetQuitStr(EngineState *s, int funct_nr, int argc, reg_t *argv);
reg_t kShowMovie(EngineState *s, int funct_nr, int argc, reg_t *argv);
+reg_t kSetVideoMode(EngineState *s, int funct_nr, int argc, reg_t *argv);
reg_t k_Unknown(EngineState *s, int funct_nr, int argc, reg_t *argv);
// The Unknown/Unnamed kernel function
diff --git a/engines/sci/engine/kgraphics.cpp b/engines/sci/engine/kgraphics.cpp
index 580ec4fc54..5c2fe7b642 100644
--- a/engines/sci/engine/kgraphics.cpp
+++ b/engines/sci/engine/kgraphics.cpp
@@ -3374,4 +3374,21 @@ reg_t kShowMovie(EngineState *s, int funct_nr, int argc, reg_t *argv) {
return s->r_acc;
}
+reg_t kSetVideoMode(EngineState *s, int funct_nr, int argc, reg_t *argv) {
+ // This call is used for KQ6's intro. It has one parameter, which is
+ // 1 when the intro begins, and 0 when it ends. It is suspected that
+ // this is actually a flag to enable video planar memory access, as
+ // the video decoder in KQ6 is specifically written for the planar
+ // memory model. Planar memory mode access was used for VGA "Mode X"
+ // (320x240 resolution, although the intro in KQ6 is 320x200).
+ // Refer to http://en.wikipedia.org/wiki/Mode_X
+
+ //warning("STUB: SetVideoMode %d", UKPV(0));
+
+ // We (ab)use this kernel function to free tagged resources when the
+ // intro of KQ6 starts. This fixes some palette issues in the intro.
+ s->gfx_state->gfxResMan->freeTaggedResources();
+ return s->r_acc;
+}
+
} // End of namespace Sci
diff --git a/engines/sci/gfx/gfx_resource.h b/engines/sci/gfx/gfx_resource.h
index 711681c14d..292fdfa327 100644
--- a/engines/sci/gfx/gfx_resource.h
+++ b/engines/sci/gfx/gfx_resource.h
@@ -95,7 +95,7 @@ struct gfxr_pic_t {
** Bit 3-5: 'filled' (all three bits are set to 1)
*/
- rect_t bounds;
+ // rect_t bounds; // unused
void *undithered_buffer; /* copies visual_map->index_data before dithering */
int undithered_buffer_size;