diff options
author | Sven Hesse | 2007-04-05 13:37:20 +0000 |
---|---|---|
committer | Sven Hesse | 2007-04-05 13:37:20 +0000 |
commit | ec5a9eee3132c5e7ccc5338f426f0839bb9e0913 (patch) | |
tree | 0d12e8599143530241731872be276c45e8a8c7fd /engines/gob/parse_v2.cpp | |
parent | c5e7eaf7dbcc18f4d26532f64e6cbf3e8614fc18 (diff) | |
download | scummvm-rg350-ec5a9eee3132c5e7ccc5338f426f0839bb9e0913.tar.gz scummvm-rg350-ec5a9eee3132c5e7ccc5338f426f0839bb9e0913.tar.bz2 scummvm-rg350-ec5a9eee3132c5e7ccc5338f426f0839bb9e0913.zip |
- Minor cleanup
- Added Inter_v3 (for new opcode o3_getTotTextItemPart)
- Some fixes to let Gob3 start with the first screen
svn-id: r26383
Diffstat (limited to 'engines/gob/parse_v2.cpp')
-rw-r--r-- | engines/gob/parse_v2.cpp | 48 |
1 files changed, 21 insertions, 27 deletions
diff --git a/engines/gob/parse_v2.cpp b/engines/gob/parse_v2.cpp index d32ae0382f..cb72d1866e 100644 --- a/engines/gob/parse_v2.cpp +++ b/engines/gob/parse_v2.cpp @@ -116,6 +116,8 @@ int16 Parse_v2::parseValExpr(byte stopToken) { static int16 flag = 0; int16 oldflag; + memset(values, 0, 20 * sizeof(int16)); + oldflag = flag; if (flag == 0) { flag = 1; @@ -388,10 +390,7 @@ int16 Parse_v2::parseExpr(byte stopToken, byte *arg_2) { case 26: case 27: case 28: - if ((operation == 27) || (operation == 16)) - *operPtr = 20; - else - *operPtr = operation - 6; + *operPtr = (operation == 28) ? 22 : 20; temp = _vm->_inter->load16(); dimCount = *_vm->_global->_inter_execPtr++; arrDescPtr = _vm->_global->_inter_execPtr; @@ -481,11 +480,6 @@ int16 Parse_v2::parseExpr(byte stopToken, byte *arg_2) { parseExpr(10, 0); switch (operation) { - case 5: - _vm->_global->_inter_resVal = - _vm->_global->_inter_resVal * _vm->_global->_inter_resVal; - break; - case 0: case 1: case 6: @@ -500,20 +494,27 @@ int16 Parse_v2::parseExpr(byte stopToken, byte *arg_2) { _vm->_global->_inter_resVal = curVal; break; - case 10: + case 5: _vm->_global->_inter_resVal = - _vm->_util->getRandom(_vm->_global->_inter_resVal); + _vm->_global->_inter_resVal * _vm->_global->_inter_resVal; break; case 7: if (_vm->_global->_inter_resVal < 0) _vm->_global->_inter_resVal = -_vm->_global->_inter_resVal; break; + + case 10: + _vm->_global->_inter_resVal = + _vm->_util->getRandom(_vm->_global->_inter_resVal); + break; } + *operPtr = 20; *valPtr = _vm->_global->_inter_resVal; break; } + if ((stkPos > 0) && ((operPtr[-1] == 1) || (operPtr[-1] == 11))) { stkPos--; operPtr--; @@ -522,12 +523,8 @@ int16 Parse_v2::parseExpr(byte stopToken, byte *arg_2) { if (*operPtr == 1) { *operPtr = 20; valPtr[0] = -valPtr[1]; - } else if (*operPtr == 11) { - if (operPtr[1] == 23) - *operPtr = 24; - else - *operPtr = 23; - } + } else + *operPtr = (operPtr[1] == 23) ? 24 : 23; } if (stkPos <= 0) @@ -600,11 +597,7 @@ int16 Parse_v2::parseExpr(byte stopToken, byte *arg_2) { operPtr--; valPtr--; } else if (operPtr[-2] == 11) { - if (operPtr[-1] == 23) - operPtr[-2] = 24; - else - operPtr[-2] = 23; - + operPtr[-2] = (operPtr[-1] == 23) ? 24 : 23; stkPos--; operPtr--; valPtr--; @@ -619,6 +612,7 @@ int16 Parse_v2::parseExpr(byte stopToken, byte *arg_2) { operPtr -= 2; valPtr -= 2; break; + case 6: valPtr[-3] /= valPtr[-1]; stkPos -= 2; @@ -897,6 +891,11 @@ int16 Parse_v2::parseExpr(byte stopToken, byte *arg_2) { *arg_2 = operStack[0]; switch (operStack[0]) { + case 11: + if (arg_2 != 0) + *arg_2 ^= 1; + break; + case 20: _vm->_global->_inter_resVal = values[0]; break; @@ -906,11 +905,6 @@ int16 Parse_v2::parseExpr(byte stopToken, byte *arg_2) { strcpy(_vm->_global->_inter_resStr, (char *) decodePtr(values[0])); break; - case 11: - if (arg_2 != 0) - *arg_2 ^= 1; - break; - case 23: case 24: break; |