A few, mostly untested, fixes to the SAGA script engine:

* The frame pointer is updated. This won't make any difference since we
  don't actually *use* the frame pointer yet.
* Return values from script functions are handled like in the original now,
  i.e. the function sets thread->retVal and lets the call instruction push
  it onto the stack. (There are two call instructions, one that handles
  return values and one that doesn't, so the script function doesn't know
  if it should push or not.)
* Script return values are handled.

None of this makes any noticeable difference to the ITE intro.

svn-id: r15393
This commit is contained in:
Torbjörn Andersson 2004-10-03 17:11:23 +00:00
parent 80fd0d75f3
commit ff1cf82089
3 changed files with 34 additions and 28 deletions

View file

@ -149,8 +149,11 @@ int Script::SF_objectIsCarried(R_SCRIPTFUNC_PARAMS) {
// INCOMPLETE
SDataWord_T param1;
param1 = thread->pop();
thread->push(0); // push for now to allow intro faire
// setup to run completely
// FIXME: Incomplete, but returning 0 assures that the fair start
// script will run completely.
thread->retVal = 0;
return R_SUCCESS;
}
@ -637,7 +640,7 @@ int Script::SF_placeActor(R_SCRIPTFUNC_PARAMS) {
// game cinematic. Pushes a zero or positive value if the game
// has not been interrupted.
int Script::SF_checkUserInterrupt(R_SCRIPTFUNC_PARAMS) {
thread->push(0);
thread->retVal = 0;
// INCOMPLETE