diff options
Diffstat (limited to 'engines/parallaction')
-rw-r--r-- | engines/parallaction/archive.cpp | 11 | ||||
-rw-r--r-- | engines/parallaction/callables.cpp | 10 | ||||
-rw-r--r-- | engines/parallaction/detection.cpp | 25 | ||||
-rw-r--r-- | engines/parallaction/disk.cpp | 337 | ||||
-rw-r--r-- | engines/parallaction/disk.h | 32 | ||||
-rw-r--r-- | engines/parallaction/graphics.cpp | 2 | ||||
-rw-r--r-- | engines/parallaction/menu.cpp | 14 | ||||
-rw-r--r-- | engines/parallaction/parallaction.cpp | 23 |
8 files changed, 317 insertions, 137 deletions
diff --git a/engines/parallaction/archive.cpp b/engines/parallaction/archive.cpp index 4fba3ef0db..0486c6d684 100644 --- a/engines/parallaction/archive.cpp +++ b/engines/parallaction/archive.cpp @@ -56,8 +56,7 @@ Archive::Archive() { } void Archive::open(const char *file) { - bool isSmallArchive; - debugC(3, kDebugDisk, "Archive::open(%s)", file); + debugC(1, kDebugDisk, "Archive::open(%s)", file); if (_archive.isOpen()) close(); @@ -68,11 +67,9 @@ void Archive::open(const char *file) { if (!_archive.open(path)) error("archive '%s' not found", path); - if (_vm->getFeatures() & GF_DEMO) { + bool isSmallArchive = false; + if (_vm->getFeatures() & GF_DEMO) isSmallArchive = _archive.size() == SIZEOF_SMALL_ARCHIVE; - } else { - isSmallArchive = (_archive.readUint32BE() != MKID_BE('NDOS')); - } _numFiles = (isSmallArchive) ? SMALL_ARCHIVE_FILES_NUM : NORMAL_ARCHIVE_FILES_NUM; @@ -102,6 +99,8 @@ void Archive::close() { bool Archive::openArchivedFile(const char *filename) { + debugC(3, kDebugDisk, "Archive::openArchivedFile(%s)", filename); + resetArchivedFile(); debugC(3, kDebugDisk, "Archive::openArchivedFile(%s)", filename); diff --git a/engines/parallaction/callables.cpp b/engines/parallaction/callables.cpp index 403234a095..170fd609ed 100644 --- a/engines/parallaction/callables.cpp +++ b/engines/parallaction/callables.cpp @@ -68,12 +68,12 @@ void _c_score(void *parm) { } void _c_fade(void *parm) { - + _vm->_gfx->setBlackPalette(); Gfx::Palette pal; memset(pal, 0, sizeof(Gfx::Palette)); - + for (uint16 _di = 0; _di < 64; _di++) { _vm->_gfx->fadePalette(pal); _vm->_gfx->setPalette(pal); @@ -300,7 +300,7 @@ void _c_endComment(void *param) { } void _c_frankenstein(void *parm) { - + Gfx::Palette pal0; Gfx::Palette pal1; @@ -308,7 +308,7 @@ void _c_frankenstein(void *parm) { pal0[(i+FIRST_BASE_COLOR)] = _vm->_gfx->_palette[i]; pal0[(i+FIRST_BASE_COLOR)*3+1] = 0; pal0[(i+FIRST_BASE_COLOR)*3+2] = 0; - + pal1[(i+FIRST_BASE_COLOR)*3+1] = 0; pal1[(i+FIRST_BASE_COLOR)*3+2] = 0; } @@ -427,6 +427,8 @@ void _c_ridux(void *parm) { void _c_testResult(void *parm) { _vm->_gfx->swapBuffers(); + + _vm->_disk->selectArchive("disk1"); _vm->parseLocation("common"); _vm->_gfx->setFont(kFontMenu); diff --git a/engines/parallaction/detection.cpp b/engines/parallaction/detection.cpp index cca2d4a17e..89a0372fac 100644 --- a/engines/parallaction/detection.cpp +++ b/engines/parallaction/detection.cpp @@ -77,7 +77,7 @@ static const PARALLACTIONGameDescription gameDescriptions[] = { GType_Nippon, GF_LANG_EN | GF_LANG_FR | GF_LANG_DE | GF_LANG_IT, }, - + { { "nippon", @@ -100,7 +100,7 @@ static const PARALLACTIONGameDescription gameDescriptions[] = { GType_Nippon, GF_LANG_EN | GF_LANG_FR | GF_LANG_DE, }, - + { { "nippon", @@ -119,6 +119,27 @@ static const PARALLACTIONGameDescription gameDescriptions[] = { }, + { + { + "nippon", + "", + { + {"disk0", 0, "bfee75d8015f1fb97e75dbe08df4bef7", 354304}, + {"disk1", 0, "f339dd108c1a1f5cd4853d9966e5d01f", 901120}, + {"disk2", 0, "2db40bf8198a57d18e4471a6deaab970", 901120}, + {"disk3", 0, "0486972962b2bfc230e789b9f88f9ec8", 901120}, + {"disk4", 0, "6f625e7f05da4a2f57d6b62d57013614", 901120}, + {"it", 0, "746088eb8de2b2713685d243a4e4678f", 185344}, + { NULL, 0, NULL, 0} + }, + Common::IT_ITA, + Common::kPlatformAmiga, + Common::ADGF_NO_FLAGS + }, + GType_Nippon, + GF_LANG_IT, + }, + { AD_TABLE_END_MARKER, 0, 0 } }; diff --git a/engines/parallaction/disk.cpp b/engines/parallaction/disk.cpp index a8f652db7d..b44485455f 100644 --- a/engines/parallaction/disk.cpp +++ b/engines/parallaction/disk.cpp @@ -95,6 +95,7 @@ void Disk::selectArchive(const char *name) { } void Disk::setLanguage(uint16 language) { + debugC(1, kDebugDisk, "setLanguage(%i)", language); switch (language) { case 0: @@ -775,31 +776,23 @@ Cnv* AmigaDisk::makeCnv(Common::SeekableReadStream &stream) { #undef NUM_PLANES Script* AmigaDisk::loadLocation(const char *name) { - char archivefile[PATH_LEN]; + debugC(1, kDebugDisk, "AmigaDisk()::loadLocation '%s'", name); + char path[PATH_LEN]; if (IS_MINI_CHARACTER(_vm->_characterName)) { - sprintf(archivefile, "%s%s", _vm->_characterName+4, _languageDir); - } else { - if (IS_DUMMY_CHARACTER(_vm->_characterName)) { - strcpy(archivefile, _languageDir); - } else { - sprintf(archivefile, "%s%s", _vm->_characterName, _languageDir); - } - } - - strcat(archivefile, name); - strcat(archivefile, ".loc.pp"); + sprintf(path, "%s%s%s.loc.pp", _vm->_characterName+4, _languageDir, name); + } else + sprintf(path, "%s%s%s.loc.pp", _vm->_characterName, _languageDir, name); - debugC(1, kDebugDisk, "AmigaDisk::loadLocation(%s): trying '%s'", name, archivefile); - - if (!_locArchive.openArchivedFile(archivefile)) { - sprintf(archivefile, "%s%s.loc.pp", _languageDir, name); - debugC(3, kDebugDisk, "AmigaDisk::loadLocation(%s): trying '%s'", name, archivefile); - - if (!_locArchive.openArchivedFile(archivefile)) + if (!_locArchive.openArchivedFile(path)) { + sprintf(path, "%s%s.loc.pp", _languageDir, name); + if (!_locArchive.openArchivedFile(path)) { errorFileNotFound(name); + } } + debugC(3, kDebugDisk, "location file found: %s", path); + return new Script(new PowerPackerStream(_locArchive), true); } @@ -816,46 +809,6 @@ Script* AmigaDisk::loadScript(const char* name) { return new Script(new DummyArchiveStream(_resArchive), true); } -Cnv* AmigaDisk::loadTalk(const char *name) { - debugC(1, kDebugDisk, "AmigaDisk::loadTalk '%s'", name); - - Common::SeekableReadStream *s; - - char path[PATH_LEN]; - if (_vm->getFeatures() & GF_DEMO) - sprintf(path, "%s.talk", name); - else - sprintf(path, "talk/%s.talk", name); - - s = openArchivedFile(path, false); - if (s == NULL) { - s = openArchivedFile(name, true); - } - - Cnv *cnv = makeCnv(*s); - delete s; - - return cnv; -} - -Cnv* AmigaDisk::loadObjects(const char *name) { - debugC(1, kDebugDisk, "AmigaDisk::loadObjects"); - - char path[PATH_LEN]; - if (_vm->getFeatures() & GF_DEMO) - sprintf(path, "%s.objs", name); - else - sprintf(path, "objs/%s.objs", name); - - Common::SeekableReadStream *s = openArchivedFile(path, true); - - Cnv *cnv = makeCnv(*s); - delete s; - - return cnv; -} - - StaticCnv* AmigaDisk::loadPointer() { debugC(1, kDebugDisk, "AmigaDisk::loadPointer"); @@ -866,32 +819,6 @@ StaticCnv* AmigaDisk::loadPointer() { return makeStaticCnv(stream); } -StaticCnv* AmigaDisk::loadHead(const char* name) { - debugC(1, kDebugDisk, "AmigaDisk::loadHead '%s'", name); - - char path[PATH_LEN]; - sprintf(path, "%s.head", name); - - Common::SeekableReadStream *s = openArchivedFile(path, true); - StaticCnv *cnv = makeStaticCnv(*s); - - delete s; - - return cnv; -} - -Font* AmigaDisk::loadFont(const char* name) { - debugC(1, kDebugDisk, "AmigaDisk::loadFont '%s'", name); - - char path[PATH_LEN]; - sprintf(path, "%sfont", name); - - if (!_resArchive.openArchivedFile(path)) - errorFileNotFound(path); - - return createFont(name, _resArchive); -} - StaticCnv* AmigaDisk::loadStatic(const char* name) { debugC(1, kDebugDisk, "AmigaDisk::loadStatic '%s'", name); @@ -904,6 +831,7 @@ StaticCnv* AmigaDisk::loadStatic(const char* name) { } Common::SeekableReadStream *AmigaDisk::openArchivedFile(const char* name, bool errorOnFileNotFound) { + debugC(3, kDebugDisk, "AmigaDisk::openArchivedFile(%s)", name); if (_resArchive.openArchivedFile(name)) { return new DummyArchiveStream(_resArchive); @@ -927,22 +855,6 @@ Common::SeekableReadStream *AmigaDisk::openArchivedFile(const char* name, bool e return NULL; } -Cnv* AmigaDisk::loadFrames(const char* name) { - debugC(1, kDebugDisk, "AmigaDisk::loadFrames '%s'", name); - - Common::SeekableReadStream *s = openArchivedFile(name, true); - Cnv *cnv = makeCnv(*s); - delete s; - - return cnv; -} - -void AmigaDisk::loadSlide(const char *name) { - debugC(1, kDebugDisk, "AmigaDisk::loadSlide '%s'", name); - loadBackground(name); - return; -} - // FIXME: mask values are not computed correctly for level 1 and 2 void buildMask(byte* buf) { @@ -1107,7 +1019,93 @@ void AmigaDisk::loadScenery(const char* background, const char* mask) { return; } -Table* AmigaDisk::loadTable(const char* name) { + +AmigaFullDisk::AmigaFullDisk(Parallaction *vm) : AmigaDisk(vm) { +} + + +void AmigaFullDisk::loadSlide(const char *name) { + debugC(1, kDebugDisk, "AmigaDisk::loadSlide '%s'", name); + + char path[PATH_LEN]; + sprintf(path, "slides/%s", name); + Common::SeekableReadStream *s = openArchivedFile(path, false); + if (s) + loadBackground(path); + else + loadBackground(name); + + return; +} + +Cnv* AmigaFullDisk::loadFrames(const char* name) { + debugC(1, kDebugDisk, "AmigaDisk::loadFrames '%s'", name); + + Common::SeekableReadStream *s; + + char path[PATH_LEN]; + sprintf(path, "anims/%s", name); + + s = openArchivedFile(path, false); + if (!s) + s = openArchivedFile(name, true); + + Cnv *cnv = makeCnv(*s); + delete s; + + return cnv; +} + + + +StaticCnv* AmigaFullDisk::loadHead(const char* name) { + debugC(1, kDebugDisk, "AmigaDisk::loadHead '%s'", name); + + char path[PATH_LEN]; + sprintf(path, "%s.head", name); + + Common::SeekableReadStream *s = openArchivedFile(path, true); + StaticCnv *cnv = makeStaticCnv(*s); + + delete s; + + return cnv; +} + + +Cnv* AmigaFullDisk::loadObjects(const char *name) { + debugC(1, kDebugDisk, "AmigaDisk::loadObjects"); + + char path[PATH_LEN]; + sprintf(path, "objs/%s.objs", name); + Common::SeekableReadStream *s = openArchivedFile(path, true); + + Cnv *cnv = makeCnv(*s); + delete s; + + return cnv; +} + + +Cnv* AmigaFullDisk::loadTalk(const char *name) { + debugC(1, kDebugDisk, "AmigaDisk::loadTalk '%s'", name); + + Common::SeekableReadStream *s; + + char path[PATH_LEN]; + sprintf(path, "talk/%s.talk", name); + s = openArchivedFile(path, false); + if (s == NULL) { + s = openArchivedFile(name, true); + } + + Cnv *cnv = makeCnv(*s); + delete s; + + return cnv; +} + +Table* AmigaFullDisk::loadTable(const char* name) { debugC(1, kDebugDisk, "AmigaDisk::loadTable '%s'", name); char path[PATH_LEN]; @@ -1125,9 +1123,7 @@ Table* AmigaDisk::loadTable(const char* name) { dispose = true; stream = s; } else { - if (!(_vm->getFeatures() & GF_DEMO)) - sprintf(path, "objs/%s.table", name); - + sprintf(path, "objs/%s.table", name); if (!_resArchive.openArchivedFile(path)) errorFileNotFound(path); @@ -1148,6 +1144,20 @@ Table* AmigaDisk::loadTable(const char* name) { return t; } +Font* AmigaFullDisk::loadFont(const char* name) { + debugC(1, kDebugDisk, "AmigaFullDisk::loadFont '%s'", name); + + char path[PATH_LEN]; + sprintf(path, "%sfont", name); + + Common::File stream; + if (!stream.open(path)) + errorFileNotFound(path); + + return createFont(name, stream); +} + + Common::ReadStream* AmigaDisk::loadMusic(const char* name) { return openArchivedFile(name); } @@ -1161,5 +1171,122 @@ Common::ReadStream* AmigaDisk::loadSound(const char* name) { return new DummyArchiveStream(_resArchive); } +AmigaDemoDisk::AmigaDemoDisk(Parallaction *vm) : AmigaDisk(vm) { +} + +Cnv* AmigaDemoDisk::loadTalk(const char *name) { + debugC(1, kDebugDisk, "AmigaDisk::loadTalk '%s'", name); + + Common::SeekableReadStream *s; + + char path[PATH_LEN]; + sprintf(path, "%s.talk", name); + s = openArchivedFile(path, false); + if (s == NULL) { + s = openArchivedFile(name, true); + } + + Cnv *cnv = makeCnv(*s); + delete s; + + return cnv; +} + +Cnv* AmigaDemoDisk::loadObjects(const char *name) { + debugC(1, kDebugDisk, "AmigaDisk::loadObjects"); + + char path[PATH_LEN]; + sprintf(path, "%s.objs", name); + Common::SeekableReadStream *s = openArchivedFile(path, true); + + Cnv *cnv = makeCnv(*s); + delete s; + + return cnv; +} + + +Cnv* AmigaDemoDisk::loadFrames(const char* name) { + debugC(1, kDebugDisk, "AmigaDisk::loadFrames '%s'", name); + + if (IS_MINI_CHARACTER(name)) + return NULL; + + Common::SeekableReadStream *s = openArchivedFile(name, true); + Cnv *cnv = makeCnv(*s); + delete s; + + return cnv; +} + +void AmigaDemoDisk::loadSlide(const char *name) { + debugC(1, kDebugDisk, "AmigaDisk::loadSlide '%s'", name); + loadBackground(name); + return; +} + +StaticCnv* AmigaDemoDisk::loadHead(const char* name) { + debugC(1, kDebugDisk, "AmigaDisk::loadHead '%s'", name); + + char path[PATH_LEN]; + sprintf(path, "%s.head", name); + + Common::SeekableReadStream *s = openArchivedFile(path, true); + StaticCnv *cnv = makeStaticCnv(*s); + + delete s; + + return cnv; +} + +Table* AmigaDemoDisk::loadTable(const char* name) { + debugC(1, kDebugDisk, "AmigaDisk::loadTable '%s'", name); + + char path[PATH_LEN]; + sprintf(path, "%s.table", name); + + bool dispose = false; + + Common::SeekableReadStream *stream; + + if (!scumm_stricmp(name, "global")) { + Common::File *s = new Common::File; + if (!s->open(path)) + errorFileNotFound(path); + + dispose = true; + stream = s; + } else { + if (!_resArchive.openArchivedFile(path)) + errorFileNotFound(path); + + stream = &_resArchive; + } + + Table *t = new Table(100); + + fillBuffers(*stream); + while (scumm_stricmp(_tokens[0], "ENDTABLE")) { + t->addData(_tokens[0]); + fillBuffers(*stream); + } + + if (dispose) + delete stream; + + return t; +} + +Font* AmigaDemoDisk::loadFont(const char* name) { + debugC(1, kDebugDisk, "AmigaDisk::loadFont '%s'", name); + + char path[PATH_LEN]; + sprintf(path, "%sfont", name); + + if (!_resArchive.openArchivedFile(path)) + errorFileNotFound(path); + + return createFont(name, _resArchive); +} } // namespace Parallaction diff --git a/engines/parallaction/disk.h b/engines/parallaction/disk.h index bfef6d81df..2fab860158 100644 --- a/engines/parallaction/disk.h +++ b/engines/parallaction/disk.h @@ -176,20 +176,42 @@ public: Script* loadLocation(const char *name); Script* loadScript(const char* name); + StaticCnv* loadPointer(); + StaticCnv* loadStatic(const char* name); + void loadScenery(const char* background, const char* mask); + Common::ReadStream* loadMusic(const char* name); + Common::ReadStream* loadSound(const char* name); +}; + +class AmigaDemoDisk : public AmigaDisk { + +public: + AmigaDemoDisk(Parallaction *vm); + Cnv* loadTalk(const char *name); Cnv* loadObjects(const char *name); - StaticCnv* loadPointer(); StaticCnv* loadHead(const char* name); + Cnv* loadFrames(const char* name); + void loadSlide(const char *filename); + Table* loadTable(const char* name); Font* loadFont(const char* name); - StaticCnv* loadStatic(const char* name); +}; + +class AmigaFullDisk : public AmigaDisk { + +public: + AmigaFullDisk(Parallaction *vm); + + Cnv* loadTalk(const char *name); + Cnv* loadObjects(const char *name); + StaticCnv* loadHead(const char* name); Cnv* loadFrames(const char* name); void loadSlide(const char *filename); - void loadScenery(const char* background, const char* mask); Table* loadTable(const char* name); - Common::ReadStream* loadMusic(const char* name); - Common::ReadStream* loadSound(const char* name); + Font* loadFont(const char* name); }; + } // namespace Parallaction diff --git a/engines/parallaction/graphics.cpp b/engines/parallaction/graphics.cpp index 420ca6b681..aab35f8562 100644 --- a/engines/parallaction/graphics.cpp +++ b/engines/parallaction/graphics.cpp @@ -857,7 +857,7 @@ Gfx::~Gfx() { freeStaticCnv(_mouseComposedArrow); delete _mouseComposedArrow; - + return; } diff --git a/engines/parallaction/menu.cpp b/engines/parallaction/menu.cpp index 26285c46b4..457b81e6b6 100644 --- a/engines/parallaction/menu.cpp +++ b/engines/parallaction/menu.cpp @@ -105,10 +105,12 @@ Menu::~Menu() { void Menu::start() { - _vm->_disk->selectArchive((_vm->getFeatures() & GF_DEMO) ? "disk0" : "disk1"); + _vm->_disk->selectArchive((_vm->getPlatform() == Common::kPlatformAmiga) ? "disk0" : "disk1"); splash(); + _vm->_gfx->setFont(kFontMenu); + _language = chooseLanguage(); _vm->_disk->setLanguage(_language); @@ -144,6 +146,8 @@ void Menu::newGame() { const char **v14 = introMsg3; + _vm->_disk->selectArchive("disk1"); + _vm->_disk->loadScenery("test", NULL); _vm->_gfx->setPalette(_vm->_gfx->_palette); _vm->_gfx->swapBuffers(); @@ -182,9 +186,11 @@ uint16 Menu::chooseLanguage() { return 1; } - // user can choose language in dos version + if (_vm->getFeatures() == GF_LANG_IT) { + return 0; + } - _vm->_gfx->setFont(kFontMenu); + // user can choose language in dos version _vm->_disk->loadSlide("lingua"); _vm->_gfx->setPalette(_vm->_gfx->_palette); @@ -329,7 +335,7 @@ void Menu::selectCharacter() { _vm->_gfx->setFont(kFontMenu); - _vm->_disk->selectArchive((_vm->getFeatures() & GF_DEMO) ? "disk0" : "disk1"); + _vm->_disk->selectArchive((_vm->getPlatform() == Common::kPlatformAmiga) ? "disk0" : "disk1"); _vm->_disk->loadSlide("password"); // loads background into kBitBack buffer diff --git a/engines/parallaction/parallaction.cpp b/engines/parallaction/parallaction.cpp index cd87313fd2..f0fb4bc203 100644 --- a/engines/parallaction/parallaction.cpp +++ b/engines/parallaction/parallaction.cpp @@ -135,15 +135,15 @@ Parallaction::~Parallaction() { delete _zoneFlagNames; _animations.remove(&_char._ani); - + freeLocation(); - + freeCharacter(); destroyInventory(); delete _gfx; delete _soundMan; - delete _disk; + delete _disk; } @@ -178,7 +178,12 @@ int Parallaction::init() { if (getPlatform() == Common::kPlatformPC) { _disk = new DosDisk(this); } else { - _disk = new AmigaDisk(this); + if (getFeatures() & GF_DEMO) { + strcpy(_location._name, "fognedemo"); + _disk = new AmigaDemoDisk(this); + } else { + _disk = new AmigaFullDisk(this); + } _disk->selectArchive((_vm->getFeatures() & GF_DEMO) ? "disk0" : "disk1"); } @@ -281,10 +286,11 @@ uint16 Parallaction::updateInput() { switch (e.type) { case Common::EVENT_KEYDOWN: - if (e.kbd.ascii == 'l') KeyDown = kEvLoadGame; - if (e.kbd.ascii == 's') KeyDown = kEvSaveGame; if (e.kbd.flags == Common::KBD_CTRL && e.kbd.keycode == 'd') _debugger->attach(); + if (getFeatures() & GF_DEMO) break; + if (e.kbd.ascii == 'l') KeyDown = kEvLoadGame; + if (e.kbd.ascii == 's') KeyDown = kEvSaveGame; break; case Common::EVENT_LBUTTONDOWN: @@ -753,13 +759,10 @@ void Parallaction::changeCharacter(const char *name) { // character for sanity before memory is freed freeCharacter(); - _disk->selectArchive((_vm->getFeatures() & GF_DEMO) ? "disk0" : "disk1"); + _disk->selectArchive((_vm->getPlatform() == Common::kPlatformAmiga) ? "disk0" : "disk1"); _vm->_char._ani._cnv = _disk->loadFrames(fullName); if (!IS_DUMMY_CHARACTER(name)) { - if (_vm->getPlatform() == Common::kPlatformAmiga) - _disk->selectArchive("disk0"); - _vm->_char._head = _disk->loadHead(baseName); _vm->_char._talk = _disk->loadTalk(baseName); _vm->_char._objs = _disk->loadObjects(baseName); |