CVSROOT: /home/cvs
Module name: freesci
Changes by: cvsuser 00/04/16 18:52:47
Modified files:
. : ChangeLog
src/core : Makefile.am game.c kernel.c kgraphics.c
kscripts.c kstring.c savegame.c savegame.cfsml
scriptdebug.c vocab.c
src/include : engine.h vm.h vocabulary.h
Log message:
* Parse() now stores the element it gets. It is used in Said() later on.
* Fixed the "out of hunk" problem (I hope). SCI code overwrites the underBits
selector with 0, so we now keep a copy of the last known value of that
selector. Works fine so far.
* IsObject() now catches cases when it's called with 0xffff, preventing the
unaligned reads from 0xfff7.
* The console command meminfo now dumps hunk information, too.
* Implemented a very basic Parse() that doesn't have nearly the power of the
SCI one. It matches easy sentences, though, and should increase our range
for testing (actually, it's possible that some of the SCI games could be
finishable now- in theory).
This simple parse implementation works (roughly) like this:
-remove all anywords
-find one forward and one backward reference (at maximum) for each word.
These are determined by the word classes; here's the table:
Word class | back | fw
------------------------+-------+----------
preposition | verb | noun
article | | noun
adjective | | noun
pronoun | verb |
noun | verb | noun
auxiliary verb | | verb
adverb | verb | verb
verb | | noun
number | | noun
-Try to match the resulting list against the said spec, using these rules
(approximation):
a b matches a and b, in sequence
a,b matches a or b
/b matches the first b that follows the current position in input
a<b matches b, if it references the last a we found
a<b,c matches b or c, if any of them references the last a
[..] matches "..", but the result is ignored (used to move the input
pointer)
(..) matches ".."
> stores the current position in the input and returns the current
status ("matches" or "doesn't match"). The current position is used
for progressive matching, like this (pseudo-SCI code):
(if (said "examine >")
(if (said "/ door")
(print "Actually, it's a cleverly disguised teapot.")
; else
(print "You don't see that here.")
)
; else
(print "You can't do anything but look in this room.")
)
-return the result, possibly storing the current input position.
Other problems I stumbled over:
- underBits are sometimes overwritten with 0xffff (probably from SCI code).
I don't know how to handle this.
- Trying to enter the grabber in SQ3 enters an infinite loop (inside the
SCI code). Might have something to do with our implementations of some
geometrical functions slightly differing from the SCI ones, or with
something completely differen.
- 'ask about spells' doesn't work with Zara, but 'ask about spell' does
("spells" isn't recognized). Bug in some part of the extended word lookup
code.
-- Christoph