diff options
-rw-r--r-- | engines/queen/bankman.cpp | 20 | ||||
-rw-r--r-- | engines/queen/command.cpp | 5 | ||||
-rw-r--r-- | engines/queen/credits.cpp | 3 | ||||
-rw-r--r-- | engines/queen/display.cpp | 4 | ||||
-rw-r--r-- | engines/queen/graphics.cpp | 69 | ||||
-rw-r--r-- | engines/queen/graphics.h | 1 | ||||
-rw-r--r-- | engines/queen/logic.cpp | 6 | ||||
-rw-r--r-- | engines/queen/queen.cpp | 3 | ||||
-rw-r--r-- | engines/queen/resource.cpp | 5 | ||||
-rw-r--r-- | engines/queen/talk.cpp | 13 |
10 files changed, 110 insertions, 19 deletions
diff --git a/engines/queen/bankman.cpp b/engines/queen/bankman.cpp index eb8c2793fa..3769d2c908 100644 --- a/engines/queen/bankman.cpp +++ b/engines/queen/bankman.cpp @@ -62,9 +62,10 @@ void BankManager::load(const char *bankname, uint32 bankslot) { if (_res->getPlatform() == Common::kPlatformAmiga) { uint16 entries = READ_BE_UINT16(bank->data + 4); - assert(entries < MAX_BANK_SIZE); debug(9, "BankManager::load() entries = %d", entries); + assert(entries < MAX_BANK_SIZE); uint32 offset = 6; + _banks[bankslot].indexes[0] = offset; for (uint16 i = 1; i <= entries; ++i) { _banks[bankslot].indexes[i] = offset; uint16 dataSize = READ_BE_UINT16(bank->data + offset + 10); @@ -72,9 +73,10 @@ void BankManager::load(const char *bankname, uint32 bankslot) { } } else { uint16 entries = READ_LE_UINT16(bank->data); - assert(entries < MAX_BANK_SIZE); debug(9, "BankManager::load() entries = %d", entries); + assert(entries < MAX_BANK_SIZE); uint32 offset = 2; + _banks[bankslot].indexes[0] = offset; for (uint16 i = 1; i <= entries; ++i) { _banks[bankslot].indexes[i] = offset; uint16 w = READ_LE_UINT16(bank->data + offset + 0); @@ -152,8 +154,10 @@ void BankManager::unpack(uint32 srcframe, uint32 dstframe, uint32 bankslot) { bf->height = h; uint32 size = bf->width * bf->height; - bf->data = new uint8[ size ]; - convertPlanarBitmap(bf->data, bf->width, p + 12, w, h, plane); + if (size != 0) { + bf->data = new uint8[ size ]; + convertPlanarBitmap(bf->data, bf->width, p + 12, w, h, plane); + } } else { bf->width = READ_LE_UINT16(p + 0); bf->height = READ_LE_UINT16(p + 2); @@ -161,8 +165,10 @@ void BankManager::unpack(uint32 srcframe, uint32 dstframe, uint32 bankslot) { bf->yhotspot = READ_LE_UINT16(p + 6); uint32 size = bf->width * bf->height; - bf->data = new uint8[ size ]; - memcpy(bf->data, p + 8, size); + if (size != 0) { + bf->data = new uint8[ size ]; + memcpy(bf->data, p + 8, size); + } } } @@ -216,7 +222,7 @@ BobFrame *BankManager::fetchFrame(uint32 index) { debug(9, "BankManager::fetchFrame(%d)", index); assert(index < MAX_FRAMES_NUMBER); BobFrame *bf = &_frames[index]; - assert(bf->data != 0); + assert((bf->width == 0 && bf->height == 0) || bf->data != 0); return bf; } diff --git a/engines/queen/command.cpp b/engines/queen/command.cpp index 6ab185bb8a..42e8634270 100644 --- a/engines/queen/command.cpp +++ b/engines/queen/command.cpp @@ -1212,8 +1212,9 @@ void Command::lookAtSelectedObject() { break; } } - - _vm->logic()->makeJoeSpeak(desc, true); + if (desc != 0) { + _vm->logic()->makeJoeSpeak(desc, true); + } _vm->logic()->joeFace(); } diff --git a/engines/queen/credits.cpp b/engines/queen/credits.cpp index c8c0098059..4f663cc66e 100644 --- a/engines/queen/credits.cpp +++ b/engines/queen/credits.cpp @@ -98,6 +98,9 @@ void Credits::update() { return; case 'i' : _color = atoi(&line[3]); + if (_vm->resource()->getPlatform() == Common::kPlatformAmiga) { + _color &= 31; + } break; case '1' : case '2' : diff --git a/engines/queen/display.cpp b/engines/queen/display.cpp index a21df07da2..274924d8d9 100644 --- a/engines/queen/display.cpp +++ b/engines/queen/display.cpp @@ -356,9 +356,9 @@ void Display::palCustomScroll(uint16 roomNum) { switch (roomNum) { case 4: if ((scrollx & 1) == 0) { - palScroll(24, 64); + palScroll(24, 26); loPal = 24; - hiPal = 64; + hiPal = 26; } break; case 74: diff --git a/engines/queen/graphics.cpp b/engines/queen/graphics.cpp index bdd191e935..b3c0542592 100644 --- a/engines/queen/graphics.cpp +++ b/engines/queen/graphics.cpp @@ -594,6 +594,15 @@ void Graphics::setBobText(const BobSlot *pbs, const char *text, int textX, int t else if ((x + maxLineWidth) > 320) x = 320 - maxLineWidth - 4; + // remap some colors for the Amiga + if (_vm->resource()->getPlatform() == Common::kPlatformAmiga) { + if (color == 5) { + color = (_vm->logic()->currentRoom() == 9) ? 15 : 11; + } else if (color == 10 && _vm->logic()->currentRoom() == 100) { + color = 11; + } + } + _vm->display()->textCurrentColor(color); for (i = 0; i < lineCount; i++) { @@ -1068,7 +1077,6 @@ void Graphics::setupRoomObjects() { curBob = 20 + _numFurnitureStatic + numObjectStatic; ++curImage; bob(curBob)->clear(); - _vm->bankMan()->unpack(pgd->firstFrame, curImage, 15); ++_numFrames; if (pod->name > 0) { @@ -1165,6 +1173,9 @@ void Graphics::update(uint16 room) { BamScene::BamScene(QueenEngine *vm) : _flag(F_STOP), _screenShaked(false), _fightData(_fight1Data), _vm(vm) { + if (_vm->resource()->getPlatform() == Common::kPlatformAmiga) { + _fightData = _fight4Data; + } } void BamScene::playSfx() { @@ -1278,7 +1289,9 @@ void BamScene::updateFightAnimation() { break; case 99: // end of BAM data _lastSoundIndex = _index = 0; - _fightData = fightDataBlocks[_vm->randomizer.getRandomNumber(2)]; + if (_vm->resource()->getPlatform() == Common::kPlatformPC) { + _fightData = fightDataBlocks[_vm->randomizer.getRandomNumber(2)]; + } if (_flag == F_REQ_STOP) { _flag = F_STOP; } @@ -1562,6 +1575,58 @@ const BamScene::BamDataBlock BamScene::_fight3Data[] = { { { 75, 96, 1 }, { 187, 96, -23 }, { 183, 41, 47 }, 0 }, { { 75, 96, 1 }, { 187, 96, -23 }, { 183, 41, 47 }, 99 } }; + +const BamScene::BamDataBlock BamScene::_fight4Data[] = { + { { 75, 96, 1 }, { 187, 96, -23 }, { 150, 45, 35 }, 0 }, + { { 75, 96, 1 }, { 187, 96, -23 }, { 150, 45, 35 }, 0 }, + { { 75, 96, 1 }, { 187, 96, -23 }, { 150, 45, 35 }, 0 }, + { { 75, 96, 5 }, { 187, 96, -23 }, { 150, 45, 35 }, 0 }, + { { 75, 96, 5 }, { 187, 96, -23 }, { 150, 45, 35 }, 0 }, + { { 75, 96, 6 }, { 187, 96, -24 }, { 150, 45, 35 }, 0 }, + { { 75, 96, 6 }, { 187, 96, -24 }, { 150, 45, 35 }, 0 }, + { { 75, 96, 7 }, { 187, 96, -24 }, { 150, 45, 35 }, 0 }, + { { 75, 96, 8 }, { 187, 96, -25 }, { 79, 101, 59 }, 0 }, + { { 75, 96, 9 }, { 187, 96, -25 }, { 95, 104, 66 }, 0 }, + { { 75, 96, 10 }, { 187, 96, -25 }, { 129, 104, 65 }, 0 }, + { { 75, 96, 10 }, { 187, 96, -25 }, { 160, 104, 64 }, 0 }, + { { 75, 96, 6 }, { 187, 96, -25 }, { 179, 104, 63 }, 0 }, + { { 75, 96, 6 }, { 187, 96, -23 }, { 188, 104, 62 }, 0 }, + { { 75, 96, 6 }, { 187, 96, -29 }, { 191, 104, 36 }, 0 }, + { { 75, 96, 6 }, { 187, 96, -29 }, { 195, 104, 37 }, 0 }, + { { 75, 96, 6 }, { 187, 96, -31 }, { 202, 104, 38 }, 0 }, + { { 75, 96, 5 }, { 187, 96, -32 }, { 210, 104, 39 }, 0 }, + { { 75, 96, 5 }, { 187, 98, -32 }, { 216, 104, 40 }, 0 }, + { { 75, 96, 5 }, { 187, 96, -32 }, { 223, 104, 42 }, 0 }, + { { 75, 96, 5 }, { 187, 98, -32 }, { 223, 104, 42 }, 0 }, + { { 75, 96, 5 }, { 187, 97, -33 }, { 223, 104, 42 }, 0 }, + { { 75, 96, 5 }, { 187, 96, -34 }, { 223, 104, 42 }, 0 }, + { { 75, 96, 5 }, { 187, 96, -23 }, { 223, 104, 42 }, 0 }, + { { 75, 96, 5 }, { 187, 96, -23 }, { 223, 104, 42 }, 0 }, + { { 75, 96, 6 }, { 187, 96, -23 }, { 223, 104, 42 }, 0 }, + { { 75, 96, 6 }, { 187, 96, -24 }, { 223, 104, 42 }, 0 }, + { { 75, 96, 6 }, { 187, 96, -24 }, { 223, 104, 42 }, 0 }, + { { 75, 96, 5 }, { 187, 96, -25 }, { 223, 104, 42 }, 0 }, + { { 75, 96, 5 }, { 187, 96, -25 }, { 223, 104, 42 }, 0 }, + { { 75, 96, 5 }, { 187, 96, -26 }, { 175, 98, 36 }, 0 }, + { { 75, 96, 5 }, { 187, 96, -26 }, { 152, 98, 36 }, 0 }, + { { 75, 96, 6 }, { 187, 96, -27 }, { 124, 98, 37 }, 0 }, + { { 75, 96, 6 }, { 187, 96, -28 }, { 105, 98, 38 }, 0 }, + { { 75, 96, 11 }, { 187, 96, -23 }, { 77, 98, 39 }, 0 }, + { { 75, 96, 13 }, { 187, 96, -23 }, { 63, 98, 40 }, 0 }, + { { 75, 96, 14 }, { 187, 96, -23 }, { 51, 98, 41 }, 0 }, + { { 75, 98, 14 }, { 187, 96, -23 }, { 51, 98, 42 }, 0 }, + { { 75, 94, 14 }, { 187, 96, -23 }, { 0, 0, 0 }, 0 }, + { { 75, 98, 14 }, { 187, 96, -23 }, { 0, 0, 0 }, 0 }, + { { 75, 96, 15 }, { 187, 96, -23 }, { 0, 0, 0 }, 0 }, + { { 75, 96, 1 }, { 187, 96, -23 }, { 0, 0, 0 }, 0 }, + { { 75, 96, 1 }, { 187, 96, -23 }, { 0, 0, 0 }, 0 }, + { { 75, 96, 1 }, { 187, 96, -23 }, { 0, 0, 0 }, 0 }, + { { 75, 96, 1 }, { 187, 96, -23 }, { 0, 0, 0 }, 0 }, + { { 75, 96, 1 }, { 187, 96, -23 }, { 0, 0, 0 }, 0 }, + { { 75, 96, 1 }, { 187, 96, -23 }, { 0, 0, 0 }, 0 }, + { { 75, 96, 1 }, { 187, 96, -23 }, { 0, 0, 0 }, 0 }, + { { 75, 96, 1 }, { 187, 96, -23 }, { 0, 0, 0 }, 99 } +}; #endif } // End of namespace Queen diff --git a/engines/queen/graphics.h b/engines/queen/graphics.h index 0a0a7d3635..a1714bc59c 100644 --- a/engines/queen/graphics.h +++ b/engines/queen/graphics.h @@ -285,6 +285,7 @@ private: static const BamDataBlock _fight1Data[]; static const BamDataBlock _fight2Data[]; static const BamDataBlock _fight3Data[]; + static const BamDataBlock _fight4Data[]; #endif }; diff --git a/engines/queen/logic.cpp b/engines/queen/logic.cpp index e877ae7891..934b03bb9d 100644 --- a/engines/queen/logic.cpp +++ b/engines/queen/logic.cpp @@ -1476,9 +1476,10 @@ void Logic::asmMakeFrankGrowing() { BobSlot *bobFrank = _vm->graphics()->bob(5); bobFrank->frameNum = 38; if (_vm->resource()->getPlatform() == Common::kPlatformAmiga) { + bobFrank->active = true; bobFrank->x = 160; bobFrank->scale = 100; - for (int i = 300; i >= 200; i -= 5) { + for (int i = 350; i >= 200; i -= 5) { bobFrank->y = i; _vm->update(); } @@ -1506,6 +1507,7 @@ void Logic::asmMakeRobotGrowing() { BobSlot *bobRobot = _vm->graphics()->bob(5); bobRobot->frameNum = 38; if (_vm->resource()->getPlatform() == Common::kPlatformAmiga) { + bobRobot->active = true; bobRobot->x = 160; bobRobot->scale = 100; for (int i = 350; i >= 200; i -= 5) { @@ -2168,7 +2170,6 @@ void LogicGame::setupSpecialMoveTable() { _specialMoves[29] = &LogicGame::asmScaleBlimp; _specialMoves[30] = &LogicGame::asmScaleEnding; _specialMoves[31] = &LogicGame::asmWaitForCarPosition; - _specialMoves[32] = &LogicGame::asmShakeScreen; _specialMoves[33] = &LogicGame::asmAttemptPuzzle; _specialMoves[34] = &LogicGame::asmScrollTitle; if (_vm->resource()->getPlatform() == Common::kPlatformPC) { @@ -2178,6 +2179,7 @@ void LogicGame::setupSpecialMoveTable() { _specialMoves[17] = &LogicGame::asmAltIntroPanRight; // cintr.cut _specialMoves[18] = &LogicGame::asmAltIntroPanLeft; // cintr.cut _specialMoves[27] = &LogicGame::asmSmooch; + _specialMoves[32] = &LogicGame::asmShakeScreen; _specialMoves[34] = &LogicGame::asmScaleTitle; _specialMoves[36] = &LogicGame::asmPanRightToHugh; _specialMoves[37] = &LogicGame::asmMakeWhiteFlash; diff --git a/engines/queen/queen.cpp b/engines/queen/queen.cpp index a5b40ec3f9..750afe4a10 100644 --- a/engines/queen/queen.cpp +++ b/engines/queen/queen.cpp @@ -362,8 +362,9 @@ int QueenEngine::init() { _system->initSize(GAME_SCREEN_WIDTH, GAME_SCREEN_HEIGHT); _system->endGFXTransaction(); - _bam = new BamScene(this); _resource = new Resource(); + + _bam = new BamScene(this); _bankMan = new BankManager(_resource); _command = new Command(this); _debugger = new Debugger(this); diff --git a/engines/queen/resource.cpp b/engines/queen/resource.cpp index 0319d90a3f..b57608be6e 100644 --- a/engines/queen/resource.cpp +++ b/engines/queen/resource.cpp @@ -160,11 +160,13 @@ bool Resource::detectVersion(DetectedGameVersion *ver, Common::File *f) { // Handle game versions for which versionStr information is irrevelant if (gameVersion == &_gameVersions[VER_AMI_DEMO]) { // CE101 + ver->language = Common::EN_ANY; ver->features |= GF_FLOPPY | GF_DEMO; ver->platform = Common::kPlatformAmiga; return true; } if (gameVersion == &_gameVersions[VER_AMI_INTERVIEW]) { // PE100 + ver->language = Common::EN_ANY; ver->features |= GF_FLOPPY | GF_INTERVIEW; ver->platform = Common::kPlatformAmiga; return true; @@ -227,7 +229,8 @@ bool Resource::detectVersion(DetectedGameVersion *ver, Common::File *f) { void Resource::checkJASVersion() { if (_version.platform == Common::kPlatformAmiga) { - warning("Resource::checkJASVersion() disabled for Amiga versions"); + // don't bother verifying the JAS version string with these versions, + // it will be done at the end of Logic::readQueenJas, anyway return; } ResourceEntry *re = resourceEntry("QUEEN.JAS"); diff --git a/engines/queen/talk.cpp b/engines/queen/talk.cpp index d3214cd1ba..f93674e2ff 100644 --- a/engines/queen/talk.cpp +++ b/engines/queen/talk.cpp @@ -852,11 +852,22 @@ void Talk::speakSegment( // talk.c lines 1491-1533 switch (_vm->logic()->currentRoom()) { case FAYE_HEAD: + textX = 15; + if (_vm->resource()->getPlatform() == Common::kPlatformAmiga) { + color = isJoe ? 15 : 29; + } + break; case AZURA_HEAD: textX = 15; + if (_vm->resource()->getPlatform() == Common::kPlatformAmiga) { + color = isJoe ? 6 : 30; + } break; default: // FRANK_HEAD textX = 150; + if (_vm->resource()->getPlatform() == Common::kPlatformAmiga) { + color = 17; + } break; } textY = isJoe ? 30 : 60; @@ -1029,7 +1040,6 @@ const Talk::SpeechParameters *Talk::findSpeechParameters( const SpeechParameters *iterator = _speechParameters; if (faceDirection == DIR_RIGHT) faceDirection = DIR_LEFT; - while (iterator->name[0] != '*') { if (0 == scumm_stricmp(iterator->name, name) && iterator->state == state && @@ -1037,7 +1047,6 @@ const Talk::SpeechParameters *Talk::findSpeechParameters( break; iterator++; } - return iterator; } |