From 0baff357531f2c6b74a8a4da3282705776e20826 Mon Sep 17 00:00:00 2001 From: Torbjörn Andersson Date: Sat, 30 Sep 2006 07:00:42 +0000 Subject: Partially unstubbed the PP "oops" opcodes. svn-id: r24028 --- engines/agos/agos.cpp | 4 ++++ engines/agos/agos.h | 3 +++ engines/agos/items.cpp | 23 ++++++++++++++++++++++- 3 files changed, 29 insertions(+), 1 deletion(-) (limited to 'engines') diff --git a/engines/agos/agos.cpp b/engines/agos/agos.cpp index 260d1d0f4a..06a10705e2 100644 --- a/engines/agos/agos.cpp +++ b/engines/agos/agos.cpp @@ -331,6 +331,7 @@ AGOSEngine::AGOSEngine(OSystem *syst) _variableArray = 0; _variableArray2 = 0; _variableArrayPtr = 0; + _variableBackupArray = 0; memset(_windowArray, 0, sizeof(_windowArray)); @@ -379,6 +380,8 @@ AGOSEngine::AGOSEngine(OSystem *syst) _saveOrLoad = false; _saveLoadEdit = false; + _oopsValid = false; + _hyperLink = 0; _interactY = 0; _oracleMaxScrollY = 0; @@ -614,6 +617,7 @@ void AGOSEngine::setupGame() { _variableArray = (int16 *)calloc(_numVars, sizeof(int16)); _variableArray2 = (int16 *)calloc(_numVars, sizeof(int16)); + _variableBackupArray = (int16 *)calloc(_numVars, sizeof(int16)); setupOpcodes(); diff --git a/engines/agos/agos.h b/engines/agos/agos.h index 1ebda88f95..c1543988df 100644 --- a/engines/agos/agos.h +++ b/engines/agos/agos.h @@ -412,6 +412,7 @@ protected: int16 *_variableArray; int16 *_variableArray2; int16 *_variableArrayPtr; + int16 *_variableBackupArray; WindowBlock *_windowArray[16]; @@ -475,6 +476,8 @@ protected: byte _saveLoadType, _saveLoadSlot; char _saveLoadName[108]; + bool _oopsValid; + int _sdlMouseX, _sdlMouseY; byte *_backGroundBuf; diff --git a/engines/agos/items.cpp b/engines/agos/items.cpp index 565f90c260..60e0f3e35c 100644 --- a/engines/agos/items.cpp +++ b/engines/agos/items.cpp @@ -2569,10 +2569,24 @@ void AGOSEngine::o4_opcode30() { void AGOSEngine::o4_restoreOopsPosition() { // 32: restore oops position getNextItemPtr(); + if (_oopsValid) { + for (uint i = 0; i < _numVars; i++) { + _variableArray[i] = _variableBackupArray[i]; + } +// i=FlagData[999]*100+11; +// C_PICTURE(4,i); + if (getBitFlag(110)) { + _gameTime += 10; + } else { + // Swampy adventures + _gameTime += 30; + } + _oopsValid = false; + } } void AGOSEngine::o4_checkTiles() { - // 37: for MahJongg game + // 37: for MahJongg game getVarOrByte(); } @@ -2627,6 +2641,13 @@ void AGOSEngine::o4_loadUserGame() { void AGOSEngine::o4_saveOopsPosition() { // 173: save oops position +// if (IsVQueueEmpty() == 0) { + _oopsValid = true; + for (uint i = 0; i < _numVars; i++) { + _variableBackupArray[i] = _variableArray[i]; + } +// } else +// _oopsValid = false; } void AGOSEngine::o4_resetGameTime() { -- cgit v1.2.3