diff options
author | Eugene Sandulenko | 2016-06-27 10:59:38 +0200 |
---|---|---|
committer | Eugene Sandulenko | 2016-08-03 23:40:36 +0200 |
commit | d440a73a41bb0d1dd6df22013a8df9b6b596600e (patch) | |
tree | fe6942bb4fba5b11681cadb64128a2483e24e412 | |
parent | e93960e200319b61bae57bfc4c1d75d710744fb2 (diff) | |
download | scummvm-rg350-d440a73a41bb0d1dd6df22013a8df9b6b596600e.tar.gz scummvm-rg350-d440a73a41bb0d1dd6df22013a8df9b6b596600e.tar.bz2 scummvm-rg350-d440a73a41bb0d1dd6df22013a8df9b6b596600e.zip |
DIRECTOR: Lingo: Fix handler parameter assigning. Added more debug output.
-rw-r--r-- | engines/director/director.cpp | 26 | ||||
-rw-r--r-- | engines/director/lingo/lingo-code.cpp | 7 |
2 files changed, 32 insertions, 1 deletions
diff --git a/engines/director/director.cpp b/engines/director/director.cpp index 6d8e51ccb8..cb31f88aa0 100644 --- a/engines/director/director.cpp +++ b/engines/director/director.cpp @@ -75,6 +75,29 @@ Common::Error DirectorEngine::run() { _soundManager = new DirectorSound(); #if 0 +_lingo->addCode("--\n\ +macro check par1, par2\n\ +if par1 = 3 then\n\ + put -3\n\ +else\n\ + put 0\n\ +end if\n\ +if par2 = 2 then\n\ + put 2\n\ +else\n\ + put 0\n\ +end if\n\ +put par1\n\ +put par2\n\ +", kMovieScript, 5); + +_lingo->addCode("check(3, 2)\n\ +", kMovieScript, 2); + +_lingo->executeScript(kMovieScript, 2); + +return Common::kNoError; + _lingo->addCode("--\n\ macro SHIPX\n\ set x = 5\n\ @@ -107,7 +130,8 @@ else\n\ end if\n\ ", kMovieScript, 1); -_lingo->addCode("shipx\n\ +_lingo->addCode("check(2, 3)\n\ +shipx\n\ put x\n\ ", kMovieScript, 2); diff --git a/engines/director/lingo/lingo-code.cpp b/engines/director/lingo/lingo-code.cpp index 8d047e466a..3ddc276d86 100644 --- a/engines/director/lingo/lingo-code.cpp +++ b/engines/director/lingo/lingo-code.cpp @@ -53,6 +53,12 @@ namespace Director { void Lingo::execute(int pc) { for(_pc = pc; (*_currentScript)[_pc] != STOP && !_returning;) { + + for (int i = 0; i < _stack.size(); i++) { + debugN(5, "%d ", _stack[i].val); + } + debug(5, ""); + _pc++; (*((*_currentScript)[_pc - 1]))(); } @@ -404,6 +410,7 @@ void Lingo::codeArg(Common::String &s) { g_lingo->code1(g_lingo->c_varpush); g_lingo->codeString(s.c_str()); g_lingo->code1(g_lingo->c_assign); + g_lingo->code1(g_lingo->c_xpop); } int Lingo::codeId(Common::String &s) { |