aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/engine
diff options
context:
space:
mode:
authorKawa2019-06-23 00:46:53 +0200
committerFilippos Karapetis2019-06-23 01:46:53 +0300
commit9aadb2726732e1fcd517088bdcaff60a8a49710d (patch)
tree75a2b0d25058ad47cf8bd523ffa471dc1b3900f7 /engines/sci/engine
parent536db4d7e72a0c775be4fbab5d560f8012b019c1 (diff)
downloadscummvm-rg350-9aadb2726732e1fcd517088bdcaff60a8a49710d.tar.gz
scummvm-rg350-9aadb2726732e1fcd517088bdcaff60a8a49710d.tar.bz2
scummvm-rg350-9aadb2726732e1fcd517088bdcaff60a8a49710d.zip
SCI: Add some more SCI11+ features
Also gate them behind the presence of a 184.VOC resource instead of GID_CATDATE. This should not matter with regards to the remap effects -- the 2015 and 2016 demos had none, and the first that did has an unknown release status. Only the 2017 demo would fall, which would be easily fixed by dropping in a valid 184.VOC patch file.
Diffstat (limited to 'engines/sci/engine')
-rw-r--r--engines/sci/engine/kernel.cpp3
-rw-r--r--engines/sci/engine/kernel.h1
-rw-r--r--engines/sci/engine/kernel_tables.h1
-rw-r--r--engines/sci/engine/kmisc.cpp29
4 files changed, 27 insertions, 7 deletions
diff --git a/engines/sci/engine/kernel.cpp b/engines/sci/engine/kernel.cpp
index d75c910d30..ab332511d7 100644
--- a/engines/sci/engine/kernel.cpp
+++ b/engines/sci/engine/kernel.cpp
@@ -775,8 +775,9 @@ void Kernel::loadKernelNames(GameFeatures *features) {
_kernelNames[0x84] = "ShowMovie";
} else if (g_sci->getGameId() == GID_QFG4DEMO) {
_kernelNames[0x7b] = "RemapColors"; // QFG4 Demo has this SCI2 function instead of StrSplit
- } else if (g_sci->getGameId() == GID_CATDATE) {
+ } else if (_resMan->testResource(ResourceId(kResourceTypeVocab, 184))) {
_kernelNames[0x7b] = "RemapColorsKawa";
+ _kernelNames[0x88] = "KawaDbugStr";
_kernelNames[0x89] = "KawaHacks";
}
diff --git a/engines/sci/engine/kernel.h b/engines/sci/engine/kernel.h
index a27df1ad08..c1cce33e5d 100644
--- a/engines/sci/engine/kernel.h
+++ b/engines/sci/engine/kernel.h
@@ -408,6 +408,7 @@ reg_t kEmpty(EngineState *s, int argc, reg_t *argv);
reg_t kStub(EngineState *s, int argc, reg_t *argv);
reg_t kStubNull(EngineState *s, int argc, reg_t *argv);
reg_t kKawaHacks(EngineState *s, int argc, reg_t *argv);
+reg_t kKawaDbugStr(EngineState *s, int argc, reg_t *argv);
#ifdef ENABLE_SCI32
// SCI2 Kernel Functions
diff --git a/engines/sci/engine/kernel_tables.h b/engines/sci/engine/kernel_tables.h
index 4d2b3b4108..f0ad559ba5 100644
--- a/engines/sci/engine/kernel_tables.h
+++ b/engines/sci/engine/kernel_tables.h
@@ -866,6 +866,7 @@ static SciKernelMapEntry s_kernelMap[] = {
{ MAP_DUMMY(PlayBack), SIG_EVERYWHERE, "(.*)", NULL, NULL },
{ MAP_DUMMY(DbugStr), SIG_EVERYWHERE, "(.*)", NULL, NULL },
// Used in Kawa's SCI11+
+ { MAP_CALL(KawaDbugStr), SIG_SCI11, SIGFOR_ALL, "(.*)", NULL, NULL },
{ MAP_CALL(KawaHacks), SIG_SCI11, SIGFOR_ALL, "(.*)", NULL, NULL },
// =======================================================================================================
diff --git a/engines/sci/engine/kmisc.cpp b/engines/sci/engine/kmisc.cpp
index 848cf189e6..72e2028559 100644
--- a/engines/sci/engine/kmisc.cpp
+++ b/engines/sci/engine/kmisc.cpp
@@ -30,6 +30,7 @@
#include "sci/engine/kernel.h"
#include "sci/engine/gc.h"
#include "sci/graphics/cursor.h"
+#include "sci/graphics/palette.h"
#ifdef ENABLE_SCI32
#include "sci/graphics/cursor32.h"
#endif
@@ -731,18 +732,34 @@ reg_t kKawaHacks(EngineState *s, int argc, reg_t *argv) {
showScummVMDialog(s->_segMan->getString(argv[1]));
return NULL_REG;
}
- case 1: // ZaWarudo
- // Unused, would invert the color palette for the specified range.
- return NULL_REG;
- case 2: // SetTitleColors
+ case 1: { // ZaWarudo
+ // Invert the color palette for the specified range.
+ uint16 from = argv[1].toUint16();
+ uint16 to = argv[2].toUint16();
+ Palette pal = g_sci->_gfxPalette16->_sysPalette;
+ for (uint16 i = from; i <= to; i++)
+ {
+ pal.colors[i].r = 255 - pal.colors[i].r;
+ pal.colors[i].g = 255 - pal.colors[i].g;
+ pal.colors[i].b = 255 - pal.colors[i].b;
+ }
+ g_sci->_gfxPalette16->set(&pal, true);
+ return NULL_REG;
+ }
+ case 2: // SetTitleColors
// Unused, would change the colors for plain windows' title bars.
return NULL_REG;
case 3: // IsDebug
- // Should return 1 if running with an internal debugger, 2 if we have AddMenu support, 3 if both.
- return TRUE_REG;
+ // Return 1 if running with an internal debugger, 2 if we have AddMenu support, 3 if both.
+ return make_reg(0, 3);
}
return NULL_REG;
}
+reg_t kKawaDbugStr(EngineState *s, int argc, reg_t *argv)
+{
+ debug(Common::String::format(s->_segMan->getString(argv[0]).c_str(), argc - 1, argv + 1).c_str());
+ return NULL_REG;
+}
reg_t kEmpty(EngineState *s, int argc, reg_t *argv) {
// Placeholder for empty kernel functions which are still called from the