aboutsummaryrefslogtreecommitdiff
path: root/engines/sci
diff options
context:
space:
mode:
authorMartin Kiewitz2010-07-10 10:20:23 +0000
committerMartin Kiewitz2010-07-10 10:20:23 +0000
commitf687a44d2ad911b22408fee0505aab187607b3ef (patch)
tree1311b7a4aa82c85bf670694be488aafacef3359e /engines/sci
parentde7108054fe802b0fb283bfc7484988a1344b9e1 (diff)
downloadscummvm-rg350-f687a44d2ad911b22408fee0505aab187607b3ef.tar.gz
scummvm-rg350-f687a44d2ad911b22408fee0505aab187607b3ef.tar.bz2
scummvm-rg350-f687a44d2ad911b22408fee0505aab187607b3ef.zip
SCI: added kPalVary signatures & mapping, removed debug-warnings
svn-id: r50777
Diffstat (limited to 'engines/sci')
-rw-r--r--engines/sci/engine/kernel.cpp16
-rw-r--r--engines/sci/engine/kernel.h9
-rw-r--r--engines/sci/engine/kgraphics.cpp137
3 files changed, 72 insertions, 90 deletions
diff --git a/engines/sci/engine/kernel.cpp b/engines/sci/engine/kernel.cpp
index 2b8daf03d1..ce5d4c9f2b 100644
--- a/engines/sci/engine/kernel.cpp
+++ b/engines/sci/engine/kernel.cpp
@@ -308,6 +308,18 @@ static const SciKernelMapSubEntry kDoSound_subops[] = {
SCI_SUBOPENTRY_TERMINATOR
};
+static const SciKernelMapSubEntry kPalVary_subops[] = {
+ { SIG_SCIALL, 0, MAP_CALL(PalVaryInit), "ii(i)(i)", NULL },
+ { SIG_SCIALL, 1, MAP_CALL(PalVaryReverse), "(i)(i)(i)", NULL },
+ { SIG_SCIALL, 2, MAP_CALL(PalVaryGetCurrentStep), "", NULL },
+ { SIG_SCIALL, 3, MAP_CALL(PalVaryDeinit), "", NULL },
+ { SIG_SCIALL, 4, MAP_CALL(PalVaryChangeTarget), "i", NULL },
+ { SIG_SCIALL, 5, MAP_CALL(PalVaryChangeTicks), "i", NULL },
+ { SIG_SCIALL, 6, MAP_CALL(PalVaryPauseResume), "i", NULL },
+ { SIG_SCI32, 8, MAP_CALL(PalVaryUnknown), "", NULL },
+ SCI_SUBOPENTRY_TERMINATOR
+};
+
struct SciKernelMapEntry {
const char *name;
KernelFunctionCall *function;
@@ -355,7 +367,7 @@ static SciKernelMapEntry s_kernelMap[] = {
{ MAP_CALL(DoAudio), SIG_EVERYWHERE, "i(.*)", NULL, NULL }, // subop
{ MAP_CALL(DoAvoider), SIG_EVERYWHERE, "o", NULL, NULL },
{ MAP_CALL(DoBresen), SIG_EVERYWHERE, "o", NULL, NULL },
- { MAP_CALL(DoSound), SIG_EVERYWHERE, "i([io])(i)(ii[io])(i)", kDoSound_subops, NULL }, // subop
+ { MAP_CALL(DoSound), SIG_EVERYWHERE, "i([io])(i)(ii[io])(i)", kDoSound_subops, NULL },
{ MAP_CALL(DoSync), SIG_EVERYWHERE, "i(.*)", NULL, NULL }, // subop
{ MAP_CALL(DrawCel), SIG_SCI11, SIGFOR_PC, "iiiii(i)(i)(r0)", NULL, NULL }, // for kq6 hires
{ MAP_CALL(DrawCel), SIG_EVERYWHERE, "iiiii(i)(i)", NULL, NULL },
@@ -426,7 +438,7 @@ static SciKernelMapEntry s_kernelMap[] = {
{ MAP_CALL(NumCels), SIG_EVERYWHERE, "o", NULL, NULL },
{ MAP_CALL(NumLoops), SIG_EVERYWHERE, "o", NULL, NULL },
{ MAP_CALL(OnControl), SIG_EVERYWHERE, "ii(i)(i)(i)", NULL, NULL },
- { MAP_CALL(PalVary), SIG_EVERYWHERE, "i(i*)", NULL, NULL }, // subop
+ { MAP_CALL(PalVary), SIG_EVERYWHERE, "i(i*)", kPalVary_subops, NULL },
{ MAP_CALL(Palette), SIG_EVERYWHERE, "i(.*)", NULL, NULL }, // subop
{ MAP_CALL(Parse), SIG_EVERYWHERE, "ro", NULL, NULL },
{ MAP_CALL(PicNotValid), SIG_EVERYWHERE, "(i)", NULL, NULL },
diff --git a/engines/sci/engine/kernel.h b/engines/sci/engine/kernel.h
index b7806ce551..9c7a9bfbe1 100644
--- a/engines/sci/engine/kernel.h
+++ b/engines/sci/engine/kernel.h
@@ -491,6 +491,15 @@ reg_t kDoSoundSetVolume(EngineState *s, int argc, reg_t *argv);
reg_t kDoSoundSetPriority(EngineState *s, int argc, reg_t *argv);
reg_t kDoSoundSetLoop(EngineState *s, int argc, reg_t *argv);
+reg_t kPalVaryInit(EngineState *s, int argc, reg_t *argv);
+reg_t kPalVaryReverse(EngineState *s, int argc, reg_t *argv);
+reg_t kPalVaryGetCurrentStep(EngineState *s, int argc, reg_t *argv);
+reg_t kPalVaryDeinit(EngineState *s, int argc, reg_t *argv);
+reg_t kPalVaryChangeTarget(EngineState *s, int argc, reg_t *argv);
+reg_t kPalVaryChangeTicks(EngineState *s, int argc, reg_t *argv);
+reg_t kPalVaryPauseResume(EngineState *s, int argc, reg_t *argv);
+reg_t kPalVaryUnknown(EngineState *s, int argc, reg_t *argv);
+
//@}
} // End of namespace Sci
diff --git a/engines/sci/engine/kgraphics.cpp b/engines/sci/engine/kgraphics.cpp
index bacba674d7..f006c1e0ae 100644
--- a/engines/sci/engine/kgraphics.cpp
+++ b/engines/sci/engine/kgraphics.cpp
@@ -641,97 +641,58 @@ reg_t kPalette(EngineState *s, int argc, reg_t *argv) {
}
reg_t kPalVary(EngineState *s, int argc, reg_t *argv) {
- uint16 operation = argv[0].toUint16();
+ if (!s)
+ return make_reg(0, getSciVersion());
+ error("not supposed to call this");
+}
- switch (operation) {
- case 0: { // Init
- GuiResourceId paletteId;
- uint16 ticks, stepStop;
- uint16 direction;
- if ((argc >= 3) && (argc <= 5)) {
- paletteId = argv[1].toUint16();
- ticks = argv[2].toUint16();
- stepStop = argc >= 4 ? argv[3].toUint16() : 64;
- direction = argc >= 5 ? argv[4].toUint16() : 1;
- warning("kPalVary(init) called with paletteId = %d, ticks = %d, stop = %d, direction = %d", paletteId, ticks, stepStop, direction);
- if (g_sci->_gfxPalette->kernelPalVaryInit(paletteId, ticks, stepStop, direction))
- return SIGNAL_REG;
- } else {
- warning("kPalVary(init) called with unsupported argc %d", argc);
- }
- break;
- }
- case 1: { // Reverse
- int16 ticks, stepStop, direction;
+reg_t kPalVaryInit(EngineState *s, int argc, reg_t *argv) {
+ GuiResourceId paletteId = argv[0].toUint16();
+ uint16 ticks = argv[1].toUint16();
+ uint16 stepStop = argc >= 3 ? argv[2].toUint16() : 64;
+ uint16 direction = argc >= 4 ? argv[3].toUint16() : 1;
+ if (g_sci->_gfxPalette->kernelPalVaryInit(paletteId, ticks, stepStop, direction))
+ return SIGNAL_REG;
+ return NULL_REG;
+}
- if ((argc >= 1) && (argc <= 4)) {
- ticks = argc >= 2 ? argv[1].toUint16() : -1;
- stepStop = argc >= 3 ? argv[2].toUint16() : 0;
- direction = argc >= 4 ? argv[3].toSint16() : -1;
+reg_t kPalVaryReverse(EngineState *s, int argc, reg_t *argv) {
+ int16 ticks = argc >= 1 ? argv[0].toUint16() : -1;
+ int16 stepStop = argc >= 2 ? argv[1].toUint16() : 0;
+ int16 direction = argc >= 3 ? argv[2].toSint16() : -1;
- int16 result = g_sci->_gfxPalette->kernelPalVaryReverse(ticks, stepStop, direction);
- warning("kPalVary(reverse) called with ticks = %d, stop = %d, direction = %d", ticks, stepStop, direction);
- return make_reg(0, result);
- } else {
- warning("kPalVary(reverse) called with unsupported argc %d", argc);
- }
- }
- case 2: { // Get Current Step
- if (argc == 1) {
- int16 currentStep = g_sci->_gfxPalette->kernelPalVaryGetCurrentStep();
- return make_reg(0, currentStep);
- } else {
- warning("kPalVary(getCurrentStep) called with unsupported argc %d", argc);
- }
- break;
- }
- case 3: { // DeInit
- if (argc == 1) {
- g_sci->_gfxPalette->kernelPalVaryDeinit();
- warning("kPalVary(deinit)");
- } else {
- warning("kPalVary(deinit) called with unsupported argc %d", argc);
- }
- break;
- }
- case 4: { // Change Target
- if (argc == 2) {
- GuiResourceId paletteId = argv[1].toUint16();
- int16 currentStep = g_sci->_gfxPalette->kernelPalVaryChangeTarget(paletteId);
- return make_reg(0, currentStep);
- } else {
- warning("kPalVary(changeTarget) called with unsupported argc %d", argc);
- }
- break;
- }
- case 5: { // Change ticks
- if (argc == 2) {
- uint16 ticks = argv[1].toUint16();
- g_sci->_gfxPalette->kernelPalVaryChangeTicks(ticks);
- } else {
- warning("kPalVary(changeTicks) called with unsupported argc %d", argc);
- }
- break;
- }
- case 6: { // Pause/Resume
- bool pauseState;
- if (argc == 2) {
- pauseState = argv[1].isNull() ? false : true;
- g_sci->_gfxPalette->kernelPalVaryPause(pauseState);
- warning("kPalVary(pause) called with state = %d", pauseState);
- } else {
- warning("kPalVary(pause) called with unsupported argc %d", argc);
- }
- break;
- }
- case 8: { // Unknown (seems to be SCI32 exclusive)
- // Called in PQ4 (1 parameter)
- warning("kPalVary(8) called with parameter %d (argc %d)", argv[1].toUint16(), argc);
- break;
- }
- default:
- error("kPalVary(%d), not implemented (argc = %d)", operation, argc);
- }
+ return make_reg(0, g_sci->_gfxPalette->kernelPalVaryReverse(ticks, stepStop, direction));
+}
+
+reg_t kPalVaryGetCurrentStep(EngineState *s, int argc, reg_t *argv) {
+ return make_reg(0, g_sci->_gfxPalette->kernelPalVaryGetCurrentStep());
+}
+
+reg_t kPalVaryDeinit(EngineState *s, int argc, reg_t *argv) {
+ g_sci->_gfxPalette->kernelPalVaryDeinit();
+ return NULL_REG;
+}
+
+reg_t kPalVaryChangeTarget(EngineState *s, int argc, reg_t *argv) {
+ GuiResourceId paletteId = argv[1].toUint16();
+ int16 currentStep = g_sci->_gfxPalette->kernelPalVaryChangeTarget(paletteId);
+ return make_reg(0, currentStep);
+}
+
+reg_t kPalVaryChangeTicks(EngineState *s, int argc, reg_t *argv) {
+ uint16 ticks = argv[1].toUint16();
+ g_sci->_gfxPalette->kernelPalVaryChangeTicks(ticks);
+ return NULL_REG;
+}
+
+reg_t kPalVaryPauseResume(EngineState *s, int argc, reg_t *argv) {
+ bool pauseState = pauseState = argv[1].isNull() ? false : true;
+ g_sci->_gfxPalette->kernelPalVaryPause(pauseState);
+ return NULL_REG;
+}
+
+reg_t kPalVaryUnknown(EngineState *s, int argc, reg_t *argv) {
+ // Unknown (seems to be SCI32 exclusive)
return NULL_REG;
}