added other code differences for Amiga FOTAQ versions, full game is now completable under ScummVM

svn-id: r25941
This commit is contained in:
Gregory Montoir 2007-03-02 23:47:49 +00:00
parent 6d958e9f30
commit 370c07f925
10 changed files with 110 additions and 19 deletions

View file

@ -62,9 +62,10 @@ void BankManager::load(const char *bankname, uint32 bankslot) {
if (_res->getPlatform() == Common::kPlatformAmiga) { if (_res->getPlatform() == Common::kPlatformAmiga) {
uint16 entries = READ_BE_UINT16(bank->data + 4); uint16 entries = READ_BE_UINT16(bank->data + 4);
assert(entries < MAX_BANK_SIZE);
debug(9, "BankManager::load() entries = %d", entries); debug(9, "BankManager::load() entries = %d", entries);
assert(entries < MAX_BANK_SIZE);
uint32 offset = 6; uint32 offset = 6;
_banks[bankslot].indexes[0] = offset;
for (uint16 i = 1; i <= entries; ++i) { for (uint16 i = 1; i <= entries; ++i) {
_banks[bankslot].indexes[i] = offset; _banks[bankslot].indexes[i] = offset;
uint16 dataSize = READ_BE_UINT16(bank->data + offset + 10); uint16 dataSize = READ_BE_UINT16(bank->data + offset + 10);
@ -72,9 +73,10 @@ void BankManager::load(const char *bankname, uint32 bankslot) {
} }
} else { } else {
uint16 entries = READ_LE_UINT16(bank->data); uint16 entries = READ_LE_UINT16(bank->data);
assert(entries < MAX_BANK_SIZE);
debug(9, "BankManager::load() entries = %d", entries); debug(9, "BankManager::load() entries = %d", entries);
assert(entries < MAX_BANK_SIZE);
uint32 offset = 2; uint32 offset = 2;
_banks[bankslot].indexes[0] = offset;
for (uint16 i = 1; i <= entries; ++i) { for (uint16 i = 1; i <= entries; ++i) {
_banks[bankslot].indexes[i] = offset; _banks[bankslot].indexes[i] = offset;
uint16 w = READ_LE_UINT16(bank->data + offset + 0); 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; bf->height = h;
uint32 size = bf->width * bf->height; uint32 size = bf->width * bf->height;
bf->data = new uint8[ size ]; if (size != 0) {
convertPlanarBitmap(bf->data, bf->width, p + 12, w, h, plane); bf->data = new uint8[ size ];
convertPlanarBitmap(bf->data, bf->width, p + 12, w, h, plane);
}
} else { } else {
bf->width = READ_LE_UINT16(p + 0); bf->width = READ_LE_UINT16(p + 0);
bf->height = READ_LE_UINT16(p + 2); 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); bf->yhotspot = READ_LE_UINT16(p + 6);
uint32 size = bf->width * bf->height; uint32 size = bf->width * bf->height;
bf->data = new uint8[ size ]; if (size != 0) {
memcpy(bf->data, p + 8, size); 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); debug(9, "BankManager::fetchFrame(%d)", index);
assert(index < MAX_FRAMES_NUMBER); assert(index < MAX_FRAMES_NUMBER);
BobFrame *bf = &_frames[index]; BobFrame *bf = &_frames[index];
assert(bf->data != 0); assert((bf->width == 0 && bf->height == 0) || bf->data != 0);
return bf; return bf;
} }

View file

@ -1212,8 +1212,9 @@ void Command::lookAtSelectedObject() {
break; break;
} }
} }
if (desc != 0) {
_vm->logic()->makeJoeSpeak(desc, true); _vm->logic()->makeJoeSpeak(desc, true);
}
_vm->logic()->joeFace(); _vm->logic()->joeFace();
} }

View file

@ -98,6 +98,9 @@ void Credits::update() {
return; return;
case 'i' : case 'i' :
_color = atoi(&line[3]); _color = atoi(&line[3]);
if (_vm->resource()->getPlatform() == Common::kPlatformAmiga) {
_color &= 31;
}
break; break;
case '1' : case '1' :
case '2' : case '2' :

View file

@ -356,9 +356,9 @@ void Display::palCustomScroll(uint16 roomNum) {
switch (roomNum) { switch (roomNum) {
case 4: case 4:
if ((scrollx & 1) == 0) { if ((scrollx & 1) == 0) {
palScroll(24, 64); palScroll(24, 26);
loPal = 24; loPal = 24;
hiPal = 64; hiPal = 26;
} }
break; break;
case 74: case 74:

View file

@ -594,6 +594,15 @@ void Graphics::setBobText(const BobSlot *pbs, const char *text, int textX, int t
else if ((x + maxLineWidth) > 320) else if ((x + maxLineWidth) > 320)
x = 320 - maxLineWidth - 4; 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); _vm->display()->textCurrentColor(color);
for (i = 0; i < lineCount; i++) { for (i = 0; i < lineCount; i++) {
@ -1068,7 +1077,6 @@ void Graphics::setupRoomObjects() {
curBob = 20 + _numFurnitureStatic + numObjectStatic; curBob = 20 + _numFurnitureStatic + numObjectStatic;
++curImage; ++curImage;
bob(curBob)->clear(); bob(curBob)->clear();
_vm->bankMan()->unpack(pgd->firstFrame, curImage, 15); _vm->bankMan()->unpack(pgd->firstFrame, curImage, 15);
++_numFrames; ++_numFrames;
if (pod->name > 0) { if (pod->name > 0) {
@ -1165,6 +1173,9 @@ void Graphics::update(uint16 room) {
BamScene::BamScene(QueenEngine *vm) BamScene::BamScene(QueenEngine *vm)
: _flag(F_STOP), _screenShaked(false), _fightData(_fight1Data), _vm(vm) { : _flag(F_STOP), _screenShaked(false), _fightData(_fight1Data), _vm(vm) {
if (_vm->resource()->getPlatform() == Common::kPlatformAmiga) {
_fightData = _fight4Data;
}
} }
void BamScene::playSfx() { void BamScene::playSfx() {
@ -1278,7 +1289,9 @@ void BamScene::updateFightAnimation() {
break; break;
case 99: // end of BAM data case 99: // end of BAM data
_lastSoundIndex = _index = 0; _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) { if (_flag == F_REQ_STOP) {
_flag = F_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 }, 0 },
{ { 75, 96, 1 }, { 187, 96, -23 }, { 183, 41, 47 }, 99 } { { 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 #endif
} // End of namespace Queen } // End of namespace Queen

View file

@ -285,6 +285,7 @@ private:
static const BamDataBlock _fight1Data[]; static const BamDataBlock _fight1Data[];
static const BamDataBlock _fight2Data[]; static const BamDataBlock _fight2Data[];
static const BamDataBlock _fight3Data[]; static const BamDataBlock _fight3Data[];
static const BamDataBlock _fight4Data[];
#endif #endif
}; };

View file

@ -1476,9 +1476,10 @@ void Logic::asmMakeFrankGrowing() {
BobSlot *bobFrank = _vm->graphics()->bob(5); BobSlot *bobFrank = _vm->graphics()->bob(5);
bobFrank->frameNum = 38; bobFrank->frameNum = 38;
if (_vm->resource()->getPlatform() == Common::kPlatformAmiga) { if (_vm->resource()->getPlatform() == Common::kPlatformAmiga) {
bobFrank->active = true;
bobFrank->x = 160; bobFrank->x = 160;
bobFrank->scale = 100; bobFrank->scale = 100;
for (int i = 300; i >= 200; i -= 5) { for (int i = 350; i >= 200; i -= 5) {
bobFrank->y = i; bobFrank->y = i;
_vm->update(); _vm->update();
} }
@ -1506,6 +1507,7 @@ void Logic::asmMakeRobotGrowing() {
BobSlot *bobRobot = _vm->graphics()->bob(5); BobSlot *bobRobot = _vm->graphics()->bob(5);
bobRobot->frameNum = 38; bobRobot->frameNum = 38;
if (_vm->resource()->getPlatform() == Common::kPlatformAmiga) { if (_vm->resource()->getPlatform() == Common::kPlatformAmiga) {
bobRobot->active = true;
bobRobot->x = 160; bobRobot->x = 160;
bobRobot->scale = 100; bobRobot->scale = 100;
for (int i = 350; i >= 200; i -= 5) { for (int i = 350; i >= 200; i -= 5) {
@ -2168,7 +2170,6 @@ void LogicGame::setupSpecialMoveTable() {
_specialMoves[29] = &LogicGame::asmScaleBlimp; _specialMoves[29] = &LogicGame::asmScaleBlimp;
_specialMoves[30] = &LogicGame::asmScaleEnding; _specialMoves[30] = &LogicGame::asmScaleEnding;
_specialMoves[31] = &LogicGame::asmWaitForCarPosition; _specialMoves[31] = &LogicGame::asmWaitForCarPosition;
_specialMoves[32] = &LogicGame::asmShakeScreen;
_specialMoves[33] = &LogicGame::asmAttemptPuzzle; _specialMoves[33] = &LogicGame::asmAttemptPuzzle;
_specialMoves[34] = &LogicGame::asmScrollTitle; _specialMoves[34] = &LogicGame::asmScrollTitle;
if (_vm->resource()->getPlatform() == Common::kPlatformPC) { if (_vm->resource()->getPlatform() == Common::kPlatformPC) {
@ -2178,6 +2179,7 @@ void LogicGame::setupSpecialMoveTable() {
_specialMoves[17] = &LogicGame::asmAltIntroPanRight; // cintr.cut _specialMoves[17] = &LogicGame::asmAltIntroPanRight; // cintr.cut
_specialMoves[18] = &LogicGame::asmAltIntroPanLeft; // cintr.cut _specialMoves[18] = &LogicGame::asmAltIntroPanLeft; // cintr.cut
_specialMoves[27] = &LogicGame::asmSmooch; _specialMoves[27] = &LogicGame::asmSmooch;
_specialMoves[32] = &LogicGame::asmShakeScreen;
_specialMoves[34] = &LogicGame::asmScaleTitle; _specialMoves[34] = &LogicGame::asmScaleTitle;
_specialMoves[36] = &LogicGame::asmPanRightToHugh; _specialMoves[36] = &LogicGame::asmPanRightToHugh;
_specialMoves[37] = &LogicGame::asmMakeWhiteFlash; _specialMoves[37] = &LogicGame::asmMakeWhiteFlash;

View file

@ -362,8 +362,9 @@ int QueenEngine::init() {
_system->initSize(GAME_SCREEN_WIDTH, GAME_SCREEN_HEIGHT); _system->initSize(GAME_SCREEN_WIDTH, GAME_SCREEN_HEIGHT);
_system->endGFXTransaction(); _system->endGFXTransaction();
_bam = new BamScene(this);
_resource = new Resource(); _resource = new Resource();
_bam = new BamScene(this);
_bankMan = new BankManager(_resource); _bankMan = new BankManager(_resource);
_command = new Command(this); _command = new Command(this);
_debugger = new Debugger(this); _debugger = new Debugger(this);

View file

@ -160,11 +160,13 @@ bool Resource::detectVersion(DetectedGameVersion *ver, Common::File *f) {
// Handle game versions for which versionStr information is irrevelant // Handle game versions for which versionStr information is irrevelant
if (gameVersion == &_gameVersions[VER_AMI_DEMO]) { // CE101 if (gameVersion == &_gameVersions[VER_AMI_DEMO]) { // CE101
ver->language = Common::EN_ANY;
ver->features |= GF_FLOPPY | GF_DEMO; ver->features |= GF_FLOPPY | GF_DEMO;
ver->platform = Common::kPlatformAmiga; ver->platform = Common::kPlatformAmiga;
return true; return true;
} }
if (gameVersion == &_gameVersions[VER_AMI_INTERVIEW]) { // PE100 if (gameVersion == &_gameVersions[VER_AMI_INTERVIEW]) { // PE100
ver->language = Common::EN_ANY;
ver->features |= GF_FLOPPY | GF_INTERVIEW; ver->features |= GF_FLOPPY | GF_INTERVIEW;
ver->platform = Common::kPlatformAmiga; ver->platform = Common::kPlatformAmiga;
return true; return true;
@ -227,7 +229,8 @@ bool Resource::detectVersion(DetectedGameVersion *ver, Common::File *f) {
void Resource::checkJASVersion() { void Resource::checkJASVersion() {
if (_version.platform == Common::kPlatformAmiga) { 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; return;
} }
ResourceEntry *re = resourceEntry("QUEEN.JAS"); ResourceEntry *re = resourceEntry("QUEEN.JAS");

View file

@ -852,11 +852,22 @@ void Talk::speakSegment(
// talk.c lines 1491-1533 // talk.c lines 1491-1533
switch (_vm->logic()->currentRoom()) { switch (_vm->logic()->currentRoom()) {
case FAYE_HEAD: case FAYE_HEAD:
textX = 15;
if (_vm->resource()->getPlatform() == Common::kPlatformAmiga) {
color = isJoe ? 15 : 29;
}
break;
case AZURA_HEAD: case AZURA_HEAD:
textX = 15; textX = 15;
if (_vm->resource()->getPlatform() == Common::kPlatformAmiga) {
color = isJoe ? 6 : 30;
}
break; break;
default: // FRANK_HEAD default: // FRANK_HEAD
textX = 150; textX = 150;
if (_vm->resource()->getPlatform() == Common::kPlatformAmiga) {
color = 17;
}
break; break;
} }
textY = isJoe ? 30 : 60; textY = isJoe ? 30 : 60;
@ -1029,7 +1040,6 @@ const Talk::SpeechParameters *Talk::findSpeechParameters(
const SpeechParameters *iterator = _speechParameters; const SpeechParameters *iterator = _speechParameters;
if (faceDirection == DIR_RIGHT) if (faceDirection == DIR_RIGHT)
faceDirection = DIR_LEFT; faceDirection = DIR_LEFT;
while (iterator->name[0] != '*') { while (iterator->name[0] != '*') {
if (0 == scumm_stricmp(iterator->name, name) && if (0 == scumm_stricmp(iterator->name, name) &&
iterator->state == state && iterator->state == state &&
@ -1037,7 +1047,6 @@ const Talk::SpeechParameters *Talk::findSpeechParameters(
break; break;
iterator++; iterator++;
} }
return iterator; return iterator;
} }