aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/engine
diff options
context:
space:
mode:
authorMax Horn2009-05-18 15:07:51 +0000
committerMax Horn2009-05-18 15:07:51 +0000
commite0366f00bce7d35807425bd9478a0e73a63b5bf1 (patch)
treea2e3b0fc240e7ec39855345c6f5225ab37eaf3d6 /engines/sci/engine
parent790e235ae17382b70f4a90f7a6fa931fde476a64 (diff)
downloadscummvm-rg350-e0366f00bce7d35807425bd9478a0e73a63b5bf1.tar.gz
scummvm-rg350-e0366f00bce7d35807425bd9478a0e73a63b5bf1.tar.bz2
scummvm-rg350-e0366f00bce7d35807425bd9478a0e73a63b5bf1.zip
SCI: Removed SCI_SIMPLE_SAID_CODE and the associated heavily bitrotted code
svn-id: r40691
Diffstat (limited to 'engines/sci/engine')
-rw-r--r--engines/sci/engine/kstring.cpp67
-rw-r--r--engines/sci/engine/scriptdebug.cpp8
-rw-r--r--engines/sci/engine/state.h2
3 files changed, 3 insertions, 74 deletions
diff --git a/engines/sci/engine/kstring.cpp b/engines/sci/engine/kstring.cpp
index 87dd201763..b2e9ebf893 100644
--- a/engines/sci/engine/kstring.cpp
+++ b/engines/sci/engine/kstring.cpp
@@ -77,41 +77,6 @@ char *kernel_lookup_text(EngineState *s, reg_t address, int index) {
/* Parser */
/**********/
-#ifdef SCI_SIMPLE_SAID_CODE
-int vocab_match_simple(EngineState *s, HeapPtr addr) {
- int nextitem;
- int listpos = 0;
-
- if (!s->parser_valid)
- return SAID_NO_MATCH;
-
- if (s->parser_valid == 2) { /* debug mode: sim_said */
- do {
- sciprintf("DEBUGMATCH: ");
- nextitem = s->heap[addr++];
-
- if (nextitem < 0xf0) {
- nextitem = nextitem << 8 | s->heap[addr++];
- if (s->parser_nodes[listpos].type
- || nextitem != s->parser_nodes[listpos++].content.value)
- return SAID_NO_MATCH;
- } else {
-
- if (nextitem == 0xff)
- return (s->parser_nodes[listpos++].type == -1) ? SAID_FULL_MATCH : SAID_NO_MATCH; /* Finished? */
-
- if (s->parser_nodes[listpos].type != 1
- || nextitem != s->parser_nodes[listpos++].content.value)
- return SAID_NO_MATCH;
-
- }
- } while (42);
- } else { /* normal simple match mode */
- return vocab_simple_said_test(s, addr);
- }
-}
-#endif /* SCI_SIMPLE_SAID_CODE */
-
reg_t kSaid(EngineState *s, int funct_nr, int argc, reg_t *argv) {
reg_t heap_said_block = argv[0];
@@ -137,29 +102,8 @@ reg_t kSaid(EngineState *s, int funct_nr, int argc, reg_t *argv) {
return NULL_REG;
}
-#ifdef SCI_SIMPLE_SAID_CODE
-
- s->acc = 0;
-
- if (s->parser_lastmatch_word == SAID_FULL_MATCH)
- return; /* Matched before; we're not doing any more matching work today. */
-
- if ((new_lastmatch = vocab_match_simple(s, said_block)) != SAID_NO_MATCH) {
-
- if (s->debug_mode & (1 << SCIkPARSER_NR))
- sciprintf("Match (simple).\n");
- s->acc = 1;
-
- if (new_lastmatch == SAID_FULL_MATCH) /* Finished matching? */
- PUT_SELECTOR(s->parser_event, claimed, 1); /* claim event */
- /* otherwise, we have a partial match: Set new lastmatch word in all cases. */
-
- s->parser_lastmatch_word = new_lastmatch;
- }
-
-#else /* !SCI_SIMPLE_SAID_CODE */
- if ((new_lastmatch = said(s, said_block, (s->debug_mode & (1 << SCIkPARSER_NR))))
- != SAID_NO_MATCH) { /* Build and possibly display a parse tree */
+ new_lastmatch = said(s, said_block, (s->debug_mode & (1 << SCIkPARSER_NR)));
+ if (new_lastmatch != SAID_NO_MATCH) { /* Build and possibly display a parse tree */
if (s->debug_mode & (1 << SCIkPARSER_NR))
sciprintf("Match.\n");
@@ -175,7 +119,6 @@ reg_t kSaid(EngineState *s, int funct_nr, int argc, reg_t *argv) {
s->parser_lastmatch_word = SAID_NO_MATCH;
return NULL_REG;
}
-#endif /* !SCI_SIMPLE_SAID_CODE */
return s->r_acc;
}
@@ -275,10 +218,6 @@ reg_t kParse(EngineState *s, int funct_nr, int argc, reg_t *argv) {
s->parser_rules))
syntax_fail = 1; /* Building a tree failed */
-#ifdef SCI_SIMPLE_SAID_CODE
- vocab_build_simple_parse_tree(&(s->parser_nodes[0]), words);
-#endif /* SCI_SIMPLE_SAID_CODE */
-
if (syntax_fail) {
s->r_acc = make_reg(0, 1);
@@ -292,10 +231,8 @@ reg_t kParse(EngineState *s, int funct_nr, int argc, reg_t *argv) {
} else {
s->parser_valid = 1;
PUT_SEL32V(event, claimed, 0);
-#ifndef SCI_SIMPLE_SAID_CODE
if (s->debug_mode & (1 << SCIkPARSER_NR))
vocab_dump_parse_tree("Parse-tree", s->parser_nodes);
-#endif /* !SCI_SIMPLE_SAID_CODE */
}
} else {
diff --git a/engines/sci/engine/scriptdebug.cpp b/engines/sci/engine/scriptdebug.cpp
index 6da40fc09d..73ccc357b9 100644
--- a/engines/sci/engine/scriptdebug.cpp
+++ b/engines/sci/engine/scriptdebug.cpp
@@ -3062,14 +3062,6 @@ void script_debug(EngineState *s, reg_t *pc, StackPtr *sp, StackPtr *pp, reg_t *
"SEE ALSO\n"
" debuglog.1, sfx_debuglog.1\n");
-#ifdef SCI_SIMPLE_SAID_CODE
- con_hook_command(c_sim_parse, "simparse", "s*", "Simulates a parsed entity.\n\nUSAGE\n Call this"
- " function with a list of\n Said operators, words, and word group"
- "\n numbers to match Said() specs\n that look identical.\n"
- "\n Note that opening braces and\n everything behind them are\n"
- "\n removed from all non-operator\n parameter tokens.\n"
- "\n simparse without parameters\n removes the entity.\n");
-#endif /* SCI_SIMPLE_SAID_CODE */
#ifdef GFXW_DEBUG_WIDGETS
con_hook_command(c_gfx_print_widget, "gfx_print_widget", "i*", "If called with no parameters, it\n shows which widgets are active.\n"
" With parameters, it lists the\n widget corresponding to the\n numerical index specified (for\n each parameter).");
diff --git a/engines/sci/engine/state.h b/engines/sci/engine/state.h
index 75e9668e15..5ab90f442a 100644
--- a/engines/sci/engine/state.h
+++ b/engines/sci/engine/state.h
@@ -228,7 +228,7 @@ public:
reg_t parser_event; /**< The event passed to Parse() and later used by Said() */
Script *script_000; /**< script 000, e.g. for globals */
- uint16 currentRoomNumber() { return KP_UINT(script_000->locals_block->_locals[13]); }
+ uint16 currentRoomNumber() const { return KP_UINT(script_000->locals_block->_locals[13]); }
int parser_lastmatch_word; /**< Position of the input word the parser last matched on, or SAID_NO_MATCH */