aboutsummaryrefslogtreecommitdiff
path: root/engines/sci
diff options
context:
space:
mode:
authorMartin Kiewitz2010-07-28 21:55:40 +0000
committerMartin Kiewitz2010-07-28 21:55:40 +0000
commit021c5d11dba67951113e293a14347869316c47e1 (patch)
tree2eb5b2f59a709fb4607799633521c9b89ee6137f /engines/sci
parentabf53f839a090fe6535390a27142964cd44f2566 (diff)
downloadscummvm-rg350-021c5d11dba67951113e293a14347869316c47e1.tar.gz
scummvm-rg350-021c5d11dba67951113e293a14347869316c47e1.tar.bz2
scummvm-rg350-021c5d11dba67951113e293a14347869316c47e1.zip
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
Diffstat (limited to 'engines/sci')
-rw-r--r--engines/sci/engine/kernel_tables.h4
-rw-r--r--engines/sci/engine/kmath.cpp4
2 files changed, 3 insertions, 5 deletions
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;