From d2f9087f20864bc2268dc7795b2e4ff023cd7758 Mon Sep 17 00:00:00 2001 From: Jussi Pitkanen Date: Fri, 17 Jun 2011 18:14:42 +0300 Subject: AGI: Fix warning messages about undefined opcodes --- engines/agi/op_cmd.cpp | 7 +++---- engines/agi/op_test.cpp | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) (limited to 'engines/agi') diff --git a/engines/agi/op_cmd.cpp b/engines/agi/op_cmd.cpp index 42c3e57a34..bd189eeac5 100644 --- a/engines/agi/op_cmd.cpp +++ b/engines/agi/op_cmd.cpp @@ -41,6 +41,7 @@ namespace Agi { #define p5 (p[5]) #define p6 (p[6]) +#define code state->_curLogic->data #define ip state->_curLogic->cIP #define vt state->viewTable[p0] #define vt_v state->viewTable[state->vars[p0]] @@ -1581,7 +1582,7 @@ void cmdSetSpeed(AgiGame *state, uint8 *p) { } void cmdUnknown(AgiGame *state, uint8 *p) { - warning("Skipping unknown opcode %2X", *(p - 1)); + warning("Skipping unknown opcode %2X", *(code + ip - 1)); } /** @@ -1589,12 +1590,11 @@ void cmdUnknown(AgiGame *state, uint8 *p) { * @param n Number of the logic resource to execute */ int AgiEngine::runLogic(int n) { + AgiGame *state = &_game; uint8 op = 0; uint8 p[CMD_BSIZE] = { 0 }; - uint8 *code = NULL; int num = 0; ScriptPos sp; - AgiGame *state = &_game; debugC(2, kDebugLevelScripts, "================="); debugC(2, kDebugLevelScripts, "runLogic(%d)", n); @@ -1612,7 +1612,6 @@ int AgiEngine::runLogic(int n) { _game.lognum = n; _game._curLogic = &_game.logics[_game.lognum]; - code = _game._curLogic->data; _game._curLogic->cIP = _game._curLogic->sIP; _timerHack = 0; diff --git a/engines/agi/op_test.cpp b/engines/agi/op_test.cpp index a99a4eafc4..f8fd7674f1 100644 --- a/engines/agi/op_test.cpp +++ b/engines/agi/op_test.cpp @@ -189,7 +189,7 @@ void condUnknown13(AgiGame *state, uint8 *p) { } void condUnknown(AgiGame *state, uint8 *p) { - warning("Skipping unknown test command %2X", *(p - 1)); + warning("Skipping unknown test command %2X", *(code + ip - 1)); state->testResult = false; } -- cgit v1.2.3