aboutsummaryrefslogtreecommitdiff
path: root/engines/tony/mpal/mpal.cpp
diff options
context:
space:
mode:
authorPaul Gilbert2012-05-06 21:24:55 +1000
committerPaul Gilbert2012-05-06 21:24:55 +1000
commit156d8cdb733fe03688da9e2e9844b722681bed7f (patch)
tree6f255fd9f1e53c84e434907c30dc1769af0b930e /engines/tony/mpal/mpal.cpp
parent8bfc60f5c9bdba4b1f37fcf42df4b0aa360c325f (diff)
downloadscummvm-rg350-156d8cdb733fe03688da9e2e9844b722681bed7f.tar.gz
scummvm-rg350-156d8cdb733fe03688da9e2e9844b722681bed7f.tar.bz2
scummvm-rg350-156d8cdb733fe03688da9e2e9844b722681bed7f.zip
TONY: Bugfix for waitForSingleObject, and added action process debug information
Diffstat (limited to 'engines/tony/mpal/mpal.cpp')
-rw-r--r--engines/tony/mpal/mpal.cpp18
1 files changed, 16 insertions, 2 deletions
diff --git a/engines/tony/mpal/mpal.cpp b/engines/tony/mpal/mpal.cpp
index 9000693292..26cbf3652d 100644
--- a/engines/tony/mpal/mpal.cpp
+++ b/engines/tony/mpal/mpal.cpp
@@ -102,7 +102,8 @@ static byte * lpMpcImage;
LPITEMIRQFUNCTION lpiifCustom=NULL;
-LPLPCUSTOMFUNCTION lplpFunctions=NULL;
+LPLPCUSTOMFUNCTION lplpFunctions = NULL;
+Common::String * lplpFunctionStrings = NULL;
uint16 nObjs;
uint16 nVars;
@@ -959,6 +960,12 @@ void ActionThread(CORO_PARAM, const void *param) {
if (item->Command[_ctx->k].type == 1) {
// Custom function
+ debugC(DEBUG_DETAILED, kTonyDebugActions, "Action Process %d Call=%s params=%d,%d,%d,%d",
+ _vm->_scheduler.getCurrentPID(), lplpFunctionStrings[item->Command[_ctx->k].nCf].c_str(),
+ item->Command[_ctx->k].arg1, item->Command[_ctx->k].arg2,
+ item->Command[_ctx->k].arg3, item->Command[_ctx->k].arg4
+ );
+
CORO_INVOKE_4(lplpFunctions[item->Command[_ctx->k].nCf],
item->Command[_ctx->k].arg1,
item->Command[_ctx->k].arg2,
@@ -968,6 +975,9 @@ void ActionThread(CORO_PARAM, const void *param) {
);
} else if (item->Command[_ctx->k].type == 2) {
// Variable assign
+ debugC(DEBUG_DETAILED, kTonyDebugActions, "Action Process %d Variable=%s",
+ _vm->_scheduler.getCurrentPID(), item->Command[_ctx->k].lpszVarName);
+
LockVar();
varSetValue(item->Command[_ctx->k].lpszVarName, EvaluateExpression(item->Command[_ctx->k].expr));
UnlockVar();
@@ -981,6 +991,8 @@ void ActionThread(CORO_PARAM, const void *param) {
GlobalFree(item);
+ debugC(DEBUG_DETAILED, kTonyDebugActions, "Action Process %d ended", _vm->_scheduler.getCurrentPID());
+
CORO_KILL_SELF();
CORO_END_CODE;
@@ -1705,7 +1717,8 @@ bool DoSelection(uint32 i, uint32 dwData) {
*
\****************************************************************************/
-bool mpalInit(const char *lpszMpcFileName, const char *lpszMprFileName, LPLPCUSTOMFUNCTION lplpcfArray) {
+bool mpalInit(const char *lpszMpcFileName, const char *lpszMprFileName,
+ LPLPCUSTOMFUNCTION lplpcfArray, Common::String *lpcfStrings) {
Common::File hMpc;
byte buf[5];
uint32 nBytesRead;
@@ -1719,6 +1732,7 @@ bool mpalInit(const char *lpszMpcFileName, const char *lpszMprFileName, LPLPCUST
/* Si salva l'array delle funzioni custom */
lplpFunctions = lplpcfArray;
+ lplpFunctionStrings = lpcfStrings;
/* Apre il file MPC in lettura */
if (!hMpc.open(lpszMpcFileName))