diff options
Diffstat (limited to 'engines/access/amazon')
-rw-r--r-- | engines/access/amazon/amazon_game.cpp | 6 | ||||
-rw-r--r-- | engines/access/amazon/amazon_game.h | 15 | ||||
-rw-r--r-- | engines/access/amazon/amazon_resources.cpp | 208 | ||||
-rw-r--r-- | engines/access/amazon/amazon_resources.h | 15 | ||||
-rw-r--r-- | engines/access/amazon/amazon_room.h | 4 | ||||
-rw-r--r-- | engines/access/amazon/amazon_scripts.cpp | 84 | ||||
-rw-r--r-- | engines/access/amazon/amazon_scripts.h | 1 |
7 files changed, 323 insertions, 10 deletions
diff --git a/engines/access/amazon/amazon_game.cpp b/engines/access/amazon/amazon_game.cpp index f663f03b38..396ba42148 100644 --- a/engines/access/amazon/amazon_game.cpp +++ b/engines/access/amazon/amazon_game.cpp @@ -775,13 +775,15 @@ void AmazonEngine::startChapter(int chapter) { void AmazonEngine::synchronize(Common::Serializer &s) { AccessEngine::synchronize(s); + int dummy = 0; + s.syncAsSint16LE(_canoeLane); s.syncAsSint16LE(_canoeYPos); s.syncAsSint16LE(_hitCount); s.syncAsSint16LE(_saveRiver); s.syncAsSint16LE(_hitSafe); s.syncAsSint16LE(_chapter); - s.syncAsSint16LE(_topList); + s.syncAsSint16LE(dummy); s.syncAsSint16LE(_botList); s.syncAsSint16LE(_riverIndex); s.syncAsSint16LE(_rawInactiveX); @@ -789,6 +791,8 @@ void AmazonEngine::synchronize(Common::Serializer &s) { s.syncAsSint16LE(_inactiveYOff); for (int i = 0; i < 100; ++i) s.syncAsSint16LE(_esTabTable[i]); + + warning("TODO: s.syncAsSint16LE(_topList);"); } /*------------------------------------------------------------------------*/ diff --git a/engines/access/amazon/amazon_game.h b/engines/access/amazon/amazon_game.h index f062a28dcd..911ec55412 100644 --- a/engines/access/amazon/amazon_game.h +++ b/engines/access/amazon/amazon_game.h @@ -55,13 +55,7 @@ public: class AmazonEngine : public AccessEngine { private: // Fields that are included in savegames - int _canoeLane; - int _canoeYPos; - int _hitCount; - int _saveRiver; - int _topList; int _botList; - int _riverIndex; int _esTabTable[100]; // Other fields @@ -108,6 +102,13 @@ public: bool _charSegSwitch; bool _skipStart; + int _canoeLane; + int _canoeYPos; + int _hitCount; + const byte *_topList; + int _riverIndex; + int _saveRiver; + int _canoeDir; int _hitSafe; int _rawInactiveX; int _rawInactiveY; @@ -142,7 +143,7 @@ public: bool _deathFlag; int _deathCount; int _deathType; - int _mapPtr; + byte *_mapPtr; int _canoeVXPos; int _canoeMoveCount; int _canoeFrame; diff --git a/engines/access/amazon/amazon_resources.cpp b/engines/access/amazon/amazon_resources.cpp index 925ea195a5..4df2c0c42e 100644 --- a/engines/access/amazon/amazon_resources.cpp +++ b/engines/access/amazon/amazon_resources.cpp @@ -1537,5 +1537,213 @@ const int openObj[10][4] = { {4, -280, 40, 120}, }; +const byte MAP0[26] = { + 0, 0, 0, 1, 1, 1, 0, 0, 1, 0, 4, 0, + 0, 0, 1, 0, 2, 0, 0, 1, 1, 3, 0, 0, + 0, 0xFF +}; + +const byte MAP1[27] = { + 0, 0, 1, 0, 3, 0, 0, 1, 1, 2, 0, 0, + 0, 0, 1, 1, 1, 0, 0, 0, 1, 0, 4, 0, + 0, 0, 0xFF +}; + +const byte MAP2[32] = { + 0, 0, 0, 1, 0, 2, 0, 0, 0, 0, 1, 0, + 3, 0, 0, 1, 0, 4, 0, 0, 1, 1, 2, 0, + 0, 1, 0, 1, 0, 0, 0, 0xFF +}; + +const byte *MAPTBL[3] = {MAP0, MAP1, MAP2}; + +const byte RIVER0OBJECTS[450] = { + 16, 31, 0, 0, 25, 0, 0, 4, 12, + 0, 16, 31, 0, 56, 24, 0, 0, 2, + 12, 0, 17, 30, 0, 212, 23, 0, 0, + 3, 15, 0, 16, 31, 0, 82, 23, 0, + 0, 7, 12, 0, 17, 30, 0, 22, 23, + 0, 0, 5, 15, 0, 17, 30, 0, 98, + 22, 0, 0, 3, 15, 0, 16, 31, 0, + 68, 22, 0, 0, 7, 12, 0, 255, 58, + 1, 16, 21, 0, 0, 4, 0, 0, 17, + 30, 0, 35, 20, 0, 0, 1, 15, 0, + 16, 31, 0, 30, 20, 0, 0, 5, 12, + 0, 16, 31, 0, 192, 19, 0, 0, 7, + 12, 0, 17, 30, 0, 36, 19, 0, 0, + 2, 15, 0, 17, 30, 0, 177, 18, 0, + 0, 7, 15, 0, 16, 31, 0, 82, 18, + 0, 0, 4, 12, 0, 16, 31, 0, 52, + 18, 0, 0, 1, 12, 0, 17, 30, 0, + 208, 17, 0, 0, 5, 15, 0, 16, 31, + 0, 113, 17, 0, 0, 2, 12, 0, 255, + 58, 1, 16, 16, 0, 0, 4, 0, 0, + 17, 30, 0, 165, 15, 0, 0, 3, 15, + 0, 16, 31, 0, 25, 15, 0, 0, 6, + 12, 0, 17, 30, 0, 21, 14, 0, 0, + 4, 15, 0, 16, 31, 0, 32, 13, 0, + 0, 1, 12, 0, 17, 30, 0, 33, 12, + 0, 0, 0, 15, 0, 16, 31, 0, 8, + 12, 0, 0, 7, 12, 0, 17, 30, 0, + 198, 11, 0, 0, 4, 15, 0, 16, 31, + 0, 176, 11, 0, 0, 3, 12, 0, 16, + 31, 0, 160, 11, 0, 0, 2, 12, 0, + 17, 30, 0, 64, 11, 0, 0, 7, 15, + 0, 17, 30, 0, 44, 11, 0, 0, 0, + 15, 0, 255, 58, 1, 208, 9, 0, 0, + 4, 0, 0, 17, 30, 0, 222, 8, 0, + 0, 4, 15, 0, 16, 31, 0, 147, 8, + 0, 0, 6, 12, 0, 17, 30, 0, 32, + 7, 0, 0, 1, 15, 0, 16, 31, 0, + 240, 6, 0, 0, 4, 12, 0, 17, 30, + 0, 114, 6, 0, 0, 3, 15, 0, 16, + 31, 0, 80, 6, 0, 0, 7, 12, 0, + 17, 30, 0, 49, 6, 0, 0, 2, 15, + 0, 255, 58, 1, 208, 4, 0, 0, 4, + 0, 0, 17, 30, 0, 166, 4, 0, 0, + 2, 15, 0, 16, 31, 0, 96, 4, 0, + 0, 4, 12, 0, 17, 30, 0, 202, 3, + 0, 0, 7, 15, 0, 16, 31, 0, 142, + 3, 0, 0, 5, 12, 0, 17, 30, 0, + 193, 2, 0, 0, 0, 15, 0, 16, 31, + 0, 38, 2, 0, 0, 4, 12, 0, 17, + 30, 0, 49, 1, 0, 0, 2, 15, 0 +}; + +const byte ENDRIVER0[10] = {16, 31, 0, 4, 1, 0, 0, 7, 12, 0}; + +const byte RIVER1OBJECTS[490] = { + 16, 31, 0, 8, 27, 0, 0, 1, 12, + 0, 16, 31, 0, 84, 26, 0, 0, 4, + 12, 0, 17, 30, 0, 43, 26, 0, 0, + 1, 15, 0, 16, 31, 0, 210, 25, 0, + 0, 2, 12, 0, 17, 30, 0, 95, 25, + 0, 0, 6, 15, 0, 17, 30, 0, 241, + 24, 0, 0, 4, 15, 0, 16, 31, 0, + 206, 24, 0, 0, 1, 12, 0, 17, 30, + 0, 36, 24, 0, 0, 0, 15, 0, 255, + 58, 1, 144, 23, 0, 0, 4, 0, 0, + 16, 31, 0, 168, 22, 0, 0, 3, 12, + 0, 17, 30, 0, 158, 22, 0, 0, 6, + 15, 0, 16, 31, 0, 154, 21, 0, 0, + 4, 12, 0, 16, 31, 0, 124, 21, 0, + 0, 7, 12, 0, 17, 30, 0, 119, 21, + 0, 0, 1, 15, 0, 17, 30, 0, 0, + 21, 0, 0, 0, 15, 0, 16, 31, 0, + 208, 20, 0, 0, 7, 12, 0, 17, 30, + 0, 128, 20, 0, 0, 2, 15, 0, 16, + 31, 0, 128, 20, 0, 0, 6, 12, 0, + 255, 58, 1, 144, 18, 0, 0, 4, 0, + 0, 17, 30, 0, 80, 17, 0, 0, 2, + 15, 0, 16, 31, 0, 80, 17, 0, 0, + 7, 12, 0, 16, 31, 0, 32, 17, 0, + 0, 2, 12, 0, 17, 30, 0, 16, 17, + 0, 0, 5, 15, 0, 16, 31, 0, 240, + 16, 0, 0, 4, 12, 0, 17, 30, 0, + 89, 16, 0, 0, 1, 15, 0, 16, 31, + 0, 29, 16, 0, 0, 3, 12, 0, 17, + 30, 0, 233, 14, 0, 0, 7, 15, 0, + 16, 31, 0, 28, 14, 0, 0, 4, 12, + 0, 16, 31, 0, 32, 13, 0, 0, 5, + 12, 0, 16, 31, 0, 193, 12, 0, 0, + 7, 12, 0, 17, 30, 0, 128, 12, 0, + 0, 1, 15, 0, 17, 30, 0, 240, 11, + 0, 0, 6, 15, 0, 255, 58, 1, 16, + 11, 0, 0, 4, 0, 0, 16, 31, 0, + 180, 10, 0, 0, 3, 12, 0, 17, 30, + 0, 134, 10, 0, 0, 6, 15, 0, 16, + 31, 0, 151, 9, 0, 0, 0, 12, 0, + 17, 30, 0, 237, 8, 0, 0, 5, 15, + 0, 16, 31, 0, 212, 8, 0, 0, 2, + 12, 0, 16, 31, 0, 112, 7, 0, 0, + 5, 12, 0, 17, 30, 0, 16, 7, 0, + 0, 1, 15, 0, 16, 31, 0, 208, 6, + 0, 0, 7, 12, 0, 17, 30, 0, 160, + 6, 0, 0, 4, 15, 0, 16, 31, 0, + 32, 6, 0, 0, 2, 12, 0, 255, 58, + 1, 208, 4, 0, 0, 4, 0, 0, 17, + 30, 0, 202, 3, 0, 0, 4, 15, 0, + 16, 31, 0, 142, 3, 0, 0, 7, 12, + 0, 17, 30, 0, 193, 2, 0, 0, 0, + 15, 0, 16, 31, 0, 38, 2, 0, 0, + 6, 12, 0, 17, 30, 0, 49, 1, 0, + 0, 3, 15, 0 +}; + +const byte ENDRIVER1[10] = { + 16, 31, 0, 4, 1, 0, 0, 1, 12, 0 +}; + +const byte RIVER2OBJECTS[530] = { + 16, 31, 0, 38, 32, 0, 0, 6, 12, + 0, 16, 31, 0, 179, 31, 0, 0, 7, + 12, 0, 17, 30, 0, 19, 31, 0, 0, + 4, 15, 0, 16, 31, 0, 210, 30, 0, + 0, 0, 12, 0, 16, 31, 0, 192, 29, + 0, 0, 2, 12, 0, 17, 30, 0, 48, + 29, 0, 0, 5, 15, 0, 16, 31, 0, + 1, 29, 0, 0, 4, 12, 0, 17, 30, + 0, 192, 28, 0, 0, 1, 15, 0, 16, + 31, 0, 160, 28, 0, 0, 6, 12, 0, + 255, 58, 1, 80, 27, 0, 0, 4, 0, + 0, 16, 31, 0, 64, 26, 0, 0, 3, + 12, 0, 17, 30, 0, 44, 26, 0, 0, + 6, 15, 0, 16, 31, 0, 118, 25, 0, + 0, 2, 12, 0, 17, 30, 0, 81, 24, + 0, 0, 5, 15, 0, 16, 31, 0, 56, + 24, 0, 0, 2, 12, 0, 17, 30, 0, + 102, 23, 0, 0, 1, 15, 0, 16, 31, + 0, 72, 23, 0, 0, 7, 12, 0, 16, + 31, 0, 68, 22, 0, 0, 2, 12, 0, + 17, 30, 0, 18, 22, 0, 0, 4, 15, + 0, 16, 31, 0, 192, 21, 0, 0, 5, + 12, 0, 17, 30, 0, 112, 21, 0, 0, + 6, 15, 0, 255, 58, 1, 208, 19, 0, + 0, 4, 0, 0, 17, 30, 0, 217, 18, + 0, 0, 4, 15, 0, 16, 31, 0, 174, + 18, 0, 0, 2, 12, 0, 17, 30, 0, + 52, 18, 0, 0, 5, 15, 0, 16, 31, + 0, 158, 17, 0, 0, 7, 12, 0, 16, + 31, 0, 143, 17, 0, 0, 1, 12, 0, + 17, 30, 0, 154, 16, 0, 0, 2, 15, + 0, 16, 31, 0, 99, 16, 0, 0, 4, + 12, 0, 255, 58, 1, 208, 14, 0, 0, + 4, 0, 0, 17, 30, 0, 16, 14, 0, + 0, 3, 15, 0, 16, 31, 0, 142, 13, + 0, 0, 5, 12, 0, 16, 31, 0, 94, + 13, 0, 0, 2, 12, 0, 17, 30, 0, + 98, 12, 0, 0, 6, 15, 0, 16, 31, + 0, 144, 11, 0, 0, 4, 12, 0, 17, + 30, 0, 139, 11, 0, 0, 7, 15, 0, + 255, 58, 1, 208, 9, 0, 0, 4, 0, + 0, 17, 30, 0, 111, 9, 0, 0, 1, + 15, 0, 16, 31, 0, 14, 9, 0, 0, + 0, 12, 0, 17, 30, 0, 227, 8, 0, + 0, 2, 15, 0, 16, 31, 0, 222, 8, + 0, 0, 6, 12, 0, 17, 30, 0, 234, + 7, 0, 0, 3, 15, 0, 16, 31, 0, + 208, 7, 0, 0, 0, 12, 0, 16, 31, + 0, 48, 7, 0, 0, 3, 12, 0, 17, + 30, 0, 3, 7, 0, 0, 7, 15, 0, + 16, 31, 0, 98, 6, 0, 0, 5, 12, + 0, 17, 30, 0, 94, 6, 0, 0, 1, + 15, 0, 255, 58, 1, 208, 4, 0, 0, + 4, 0, 0, 17, 30, 0, 202, 3, 0, + 0, 2, 15, 0, 16, 31, 0, 142, 3, + 0, 0, 5, 12, 0, 17, 30, 0, 193, + 2, 0, 0, 0, 15, 0, 16, 31, 0, + 38, 2, 0, 0, 4, 12, 0, 17, 30, + 0, 49, 1, 0, 0, 3, 15, 0 +}; + +const byte ENDRIVER2[10] = { + 16, 31, 0, 4, 1, 0, 0, 6, 12, 0 +}; + +const byte *RIVEROBJECTTBL[6] = { + RIVER0OBJECTS, ENDRIVER0, RIVER1OBJECTS, + ENDRIVER1, RIVER2OBJECTS, ENDRIVER2 +}; + } // End of namespace Amazon } // End of namespace Access diff --git a/engines/access/amazon/amazon_resources.h b/engines/access/amazon/amazon_resources.h index 434a0f37db..f7e1b0371b 100644 --- a/engines/access/amazon/amazon_resources.h +++ b/engines/access/amazon/amazon_resources.h @@ -83,6 +83,21 @@ extern const int TORCH[12]; extern const int SPEAR[3]; extern const int openObj[10][4]; + +extern const byte MAP0[26]; +extern const byte MAP1[27]; +extern const byte MAP2[32]; + +extern const byte *MAPTBL[3]; + +extern const byte RIVER0OBJECTS[450]; +extern const byte ENDRIVER0[10]; +extern const byte RIVER1OBJECTS[490]; +extern const byte ENDRIVER1[10]; +extern const byte RIVER2OBJECTS[530]; +extern const byte ENDRIVER2[10]; + +extern const byte *RIVEROBJECTTBL[6]; } // End of namespace Amazon } // End of namespace Access diff --git a/engines/access/amazon/amazon_room.h b/engines/access/amazon/amazon_room.h index ccace1ea45..6b89a8f348 100644 --- a/engines/access/amazon/amazon_room.h +++ b/engines/access/amazon/amazon_room.h @@ -50,8 +50,6 @@ protected: virtual void setupRoom(); - virtual void roomMenu(); - virtual void mainAreaClick(); public: @@ -60,6 +58,8 @@ public: virtual ~AmazonRoom(); virtual void init4Quads(); + + virtual void roomMenu(); }; } // End of namespace Amazon diff --git a/engines/access/amazon/amazon_scripts.cpp b/engines/access/amazon/amazon_scripts.cpp index bb8f8a9223..2d462616db 100644 --- a/engines/access/amazon/amazon_scripts.cpp +++ b/engines/access/amazon/amazon_scripts.cpp @@ -1590,8 +1590,92 @@ void AmazonScripts::plotInactive() { } +void AmazonScripts::SETRIVERPAN() { + warning("TODO: SETRIVERPAN"); +} + void AmazonScripts::initRiver() { warning("TODO: initRiver()"); + + static const int RIVERVXTBL[3] = {6719, 7039, 8319}; + + _vm->_events->centerMousePos(); + _vm->_events->restrictMouse(); + _vm->_screen->setDisplayScan(); + _vm->_screen->clearScreen(); + _vm->_screen->savePalette(); + _vm->_screen->forceFadeOut(); + + _vm->_files->_setPaletteFlag = false; + _vm->_files->loadScreen(95, 4); + _vm->_buffer2.copyFrom(*_vm->_screen); + + _vm->_screen->restorePalette(); + _vm->_screen->setBufferScan(); + _vm->_destIn = &_vm->_buffer2; + _vm->_room->roomMenu(); + + if (_game->_saveRiver == 1) { + _vm->_screen->_scrollRow = _vm->_rScrollRow; + _vm->_screen->_scrollCol = _vm->_rScrollCol; + _vm->_screen->_scrollX = _vm->_rScrollX; + _vm->_screen->_scrollY = _vm->_rScrollY; + } else { + _vm->_screen->_scrollRow = 0; + _vm->_screen->_scrollCol = 140; + _vm->_screen->_scrollX = 0; + _vm->_screen->_scrollY = 0; + } + + _vm->_room->buildScreen(); + _vm->copyBF2Vid(); + _vm->_screen->forceFadeIn(); + if (_game->_saveRiver == 1) { + _vm->_oldRects.resize(_vm->_rOldRectCount); + _vm->_newRects.resize(_vm->_rNewRectCount); + // KEYFLG = _vm->_rKeyFlag + } else { + _vm->_oldRects.clear(); + _vm->_newRects.clear(); + // KEYFLG = 0 + } + + _vm->_player->_scrollAmount = 2; + SETRIVERPAN(); + _game->_timers[3]._timer = 1; + _game->_timers[3]._initTm = 1; + ++_game->_timers[3]._flag; + + _game->_canoeFrame = 0; + _game->_mapPtr = (byte *)MAPTBL[_game->_riverFlag] + 1; + if (_game->_saveRiver == 1) { + _game->_mapPtr--; + _game->_mapPtr += _game->_mapOffset; + } else { + _screenVertX = RIVERVXTBL[_game->_riverFlag] - 320; + _game->_canoeLane = 3; + _game->_hitCount = 0; + _game->_hitSafe = 0; + _game->_canoeYPos = 71; + } + + _game->_riverIndex = _game->_riverFlag; + _game->_topList = RIVEROBJECTTBL[_game->_riverIndex]; + UPDATEOBSTACLES(); + SETPHYSX(); + _game->_canoeDir = 0; + _game->_deathFlag = 0; + _game->_deathCount = 0; + + _game->_timers[11]._timer = 1200; + _game->_timers[11]._initTm = 1200; + ++_game->_timers[11]._flag; + _game->_timers[12]._timer = 1500; + _game->_timers[12]._initTm = 1500; + ++_game->_timers[12]._flag; + + _game->_maxHits = 2 - _game->_riverFlag; + _game->_saveRiver = 0; } bool AmazonScripts::JUMPTEST() { diff --git a/engines/access/amazon/amazon_scripts.h b/engines/access/amazon/amazon_scripts.h index 5c3fc0fb8c..703e0b8497 100644 --- a/engines/access/amazon/amazon_scripts.h +++ b/engines/access/amazon/amazon_scripts.h @@ -103,6 +103,7 @@ protected: void SETPHYSX(); void RIVERCOLLIDE(); void SCROLLRIVER1(); + void SETRIVERPAN(); void RIVER(); void plotInactive(); void setInactive(); |