Skip to content

Commit

Permalink
DIRECTOR: Lingo: Fix handler parameter assigning. Added more debug ou…
Browse files Browse the repository at this point in the history
…tput.
  • Loading branch information
sev- committed Aug 3, 2016
1 parent e93960e commit d440a73
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 1 deletion.
26 changes: 25 additions & 1 deletion engines/director/director.cpp
Expand Up @@ -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\
Expand Down Expand Up @@ -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);

Expand Down
7 changes: 7 additions & 0 deletions engines/director/lingo/lingo-code.cpp
Expand Up @@ -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]))();
}
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit d440a73

Please sign in to comment.