aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/engine/kernel.cpp
diff options
context:
space:
mode:
authorMax Horn2010-06-10 15:25:36 +0000
committerMax Horn2010-06-10 15:25:36 +0000
commit874151f5d12d86557dbea3bde180dbba0dfd4a2c (patch)
tree264fd939d56d028a3fcd1fee4489ba8c9e75eecf /engines/sci/engine/kernel.cpp
parent8295eb09cd7f0a62359631ab4b1975b2b6364bf3 (diff)
downloadscummvm-rg350-874151f5d12d86557dbea3bde180dbba0dfd4a2c.tar.gz
scummvm-rg350-874151f5d12d86557dbea3bde180dbba0dfd4a2c.tar.bz2
scummvm-rg350-874151f5d12d86557dbea3bde180dbba0dfd4a2c.zip
SCI: Cleanup kernel signature code a bit.
* Moved KSIG_SPEC_* from kernel.h to kernel.cpp * Clarified the comment on KSIG_SPEC_* a bit * Changed the other KSIG_ #defines into an enum * Removed KSIG_TERMINATOR and KSIG_SPEC_ARITMETIC (sic) svn-id: r49578
Diffstat (limited to 'engines/sci/engine/kernel.cpp')
-rw-r--r--engines/sci/engine/kernel.cpp23
1 files changed, 21 insertions, 2 deletions
diff --git a/engines/sci/engine/kernel.cpp b/engines/sci/engine/kernel.cpp
index 2315dc384f..33a4d68c88 100644
--- a/engines/sci/engine/kernel.cpp
+++ b/engines/sci/engine/kernel.cpp
@@ -33,6 +33,26 @@
namespace Sci {
+// Uncompiled kernel signatures are formed from a string of letters.
+// each corresponding to a type of a parameter (see below).
+// Use small letters to indicate end of sum type.
+// Use capital letters for sum types, e.g.
+// "LNoLr" for a function which takes two arguments:
+// (1) list, node or object
+// (2) list or ref
+#define KSIG_SPEC_LIST 'l'
+#define KSIG_SPEC_NODE 'n'
+#define KSIG_SPEC_OBJECT 'o'
+#define KSIG_SPEC_REF 'r' // Said Specs and strings
+#define KSIG_SPEC_ARITHMETIC 'i'
+#define KSIG_SPEC_NULL 'z'
+#define KSIG_SPEC_ANY '.'
+#define KSIG_SPEC_ELLIPSIS '*' // Arbitrarily more TYPED arguments
+
+#define KSIG_SPEC_SUM_DONE ('a' - 'A')
+
+
+
// Default kernel name table
#define SCI_KNAMES_DEFAULT_ENTRIES_NR 0x89
@@ -538,8 +558,7 @@ static void kernel_compile_signature(const char **s) {
break;
default:
- error("INTERNAL ERROR when compiling kernel function signature '%s': (%02x) not understood (aka"
- " '%c')\n", *s, c, c);
+ error("ERROR compiling kernel function signature '%s': (%02x / '%c') not understood", *s, c, c);
}
} while (*src && (*src == KSIG_SPEC_ELLIPSIS || (c < 'a' && c != KSIG_SPEC_ANY)));