Partially unstubbed the PP "oops" opcodes.

svn-id: r24028
This commit is contained in:
Torbjörn Andersson 2006-09-30 07:00:42 +00:00
parent c8689b29d8
commit 0baff35753
3 changed files with 29 additions and 1 deletions

View File

@ -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();

View File

@ -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;

View File

@ -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() {