From 021c5d11dba67951113e293a14347869316c47e1 Mon Sep 17 00:00:00 2001 From: Martin Kiewitz Date: Wed, 28 Jul 2010 21:55:40 +0000 Subject: SCI: changed kRandom signature accepts 1-3 parameters now for all SCI versions (shouldnt hurt and argc 3 will error() out anyway) changed comments a bit svn-id: r51438 --- engines/sci/engine/kernel_tables.h | 4 +--- engines/sci/engine/kmath.cpp | 4 ++-- 2 files changed, 3 insertions(+), 5 deletions(-) (limited to 'engines/sci/engine') diff --git a/engines/sci/engine/kernel_tables.h b/engines/sci/engine/kernel_tables.h index 1dfc1d2134..886e918fd8 100644 --- a/engines/sci/engine/kernel_tables.h +++ b/engines/sci/engine/kernel_tables.h @@ -407,9 +407,7 @@ static SciKernelMapEntry s_kernelMap[] = { { MAP_CALL(Portrait), SIG_EVERYWHERE, "i(.*)", NULL, NULL }, // subop { MAP_CALL(PrevNode), SIG_EVERYWHERE, "n", NULL, NULL }, { MAP_CALL(PriCoord), SIG_EVERYWHERE, "i", NULL, NULL }, - { MAP_CALL(Random), SIG_SCI11, SIGFOR_ALL, "i(i)(i)", NULL, NULL }, - // ^^ they actually changed it in SCI1, but it seems its never called that way ffs. kRandom - { MAP_CALL(Random), SIG_EVERYWHERE, "ii", NULL, NULL }, + { MAP_CALL(Random), SIG_EVERYWHERE, "i(i)(i)", NULL, NULL }, { MAP_CALL(ReadNumber), SIG_EVERYWHERE, "r", NULL, NULL }, { MAP_CALL(ResCheck), SIG_EVERYWHERE, "ii(iiii)", NULL, NULL }, { MAP_CALL(RespondsTo), SIG_EVERYWHERE, ".i", NULL, NULL }, diff --git a/engines/sci/engine/kmath.cpp b/engines/sci/engine/kmath.cpp index 124a64d913..bdc705cae3 100644 --- a/engines/sci/engine/kmath.cpp +++ b/engines/sci/engine/kmath.cpp @@ -29,10 +29,9 @@ namespace Sci { reg_t kRandom(EngineState *s, int argc, reg_t *argv) { - // SCI1 actually supported those argcs as well - // SCI0 only supported argc = 1 to reset the seed (no input was used, it was reset to 0) switch (argc) { case 1: // set seed to argv[0] + // SCI0/SCI01 just reset the seed to 0 instead of using argv[0] at all return NULL_REG; case 2: { // get random number @@ -43,6 +42,7 @@ reg_t kRandom(EngineState *s, int argc, reg_t *argv) { } case 3: // get seed + // SCI0/01 did not support this at all // Actually we would have to return the previous seed error("kRandom: scripts asked for previous seed"); break; -- cgit v1.2.3