aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTravis Howell2006-10-11 14:59:16 +0000
committerTravis Howell2006-10-11 14:59:16 +0000
commit4311c3a04c50795cdbf9fdc550a5248ac901bd2e (patch)
treebc72a6602636243b698869e478c569be0271dff0
parent39613c7eec25450f018eecfae02a0d0618d0a0b0 (diff)
downloadscummvm-rg350-4311c3a04c50795cdbf9fdc550a5248ac901bd2e.tar.gz
scummvm-rg350-4311c3a04c50795cdbf9fdc550a5248ac901bd2e.tar.bz2
scummvm-rg350-4311c3a04c50795cdbf9fdc550a5248ac901bd2e.zip
Add AtariST version of Elvira 1 and cleanup
svn-id: r24280
-rw-r--r--engines/agos/agos.cpp37
-rw-r--r--engines/agos/agos.h2
-rw-r--r--engines/agos/game.cpp32
-rw-r--r--engines/agos/res.cpp68
-rw-r--r--engines/agos/vga.cpp4
5 files changed, 77 insertions, 66 deletions
diff --git a/engines/agos/agos.cpp b/engines/agos/agos.cpp
index 588a5fda75..6db763ae24 100644
--- a/engines/agos/agos.cpp
+++ b/engines/agos/agos.cpp
@@ -2311,10 +2311,12 @@ int AGOSEngine::go() {
addTimeEvent(0, 1);
openGameFile();
- if (getGameType() == GType_FF)
- loadIconData();
- else if (getGameType() != GType_PP)
- loadIconFile();
+ if (getFileName(GAME_ICONFILE) != NULL) {
+ if (getGameType() == GType_FF)
+ loadIconData();
+ else
+ loadIconFile();
+ }
vc34_setMouseOff();
@@ -2475,7 +2477,15 @@ void AGOSEngine::delay(uint amount) {
void AGOSEngine::loadMusic(uint music) {
char buf[4];
- if (getGameType() == GType_SIMON2) { // Simon 2 music
+ if (getPlatform() == Common::kPlatformAmiga || getPlatform() == Common::kPlatformAtariST) {
+ if (getFeatures() & GF_CRUNCHED) {
+ // TODO Add support for decruncher
+ debug(5,"loadMusic - Decrunch %dtune attempt", music);
+ }
+ // TODO Add Protracker support for simon1amiga/cd32
+ debug(5,"playMusic - Load %dtune attempt", music);
+ return;
+ } else if (getGameType() == GType_SIMON2) {
midi.stop();
_gameFile->seek(_gameOffsetsPtr[_musicIndexBase + music - 1], SEEK_SET);
_gameFile->read(buf, 4);
@@ -2489,17 +2499,7 @@ void AGOSEngine::loadMusic(uint music) {
_lastMusicPlayed = music;
_nextMusicToPlay = -1;
- } else if (getGameType() == GType_SIMON1) { // Simon 1 music
- if (getPlatform() == Common::kPlatformAmiga) {
- if (getFeatures() & GF_CRUNCHED) {
- // TODO Add support for decruncher
- debug(5,"loadMusic - Decrunch %dtune attempt", music);
- }
- // TODO Add Protracker support for simon1amiga/cd32
- debug(5,"playMusic - Load %dtune attempt", music);
- return;
- }
-
+ } else if (getGameType() == GType_SIMON1) {
midi.stop();
midi.setLoop (true); // Must do this BEFORE loading music. (GMF may have its own override.)
@@ -2538,11 +2538,8 @@ void AGOSEngine::loadMusic(uint music) {
midi.startTrack (0);
} else {
- if (getPlatform() == Common::kPlatformAmiga)
- return;
-
midi.stop();
- midi.setLoop (true); // Must do this BEFORE loading music. (GMF may have its own override.)
+ midi.setLoop (true); // Must do this BEFORE loading music.
char filename[15];
File f;
diff --git a/engines/agos/agos.h b/engines/agos/agos.h
index 5e841da0ce..35dddb4430 100644
--- a/engines/agos/agos.h
+++ b/engines/agos/agos.h
@@ -182,7 +182,7 @@ public:
if (_gameDescription->desc.filesDescriptions[i].fileType == type)
return _gameDescription->desc.filesDescriptions[i].fileName;
}
- error("getFileName: Invalid type %d", type);
+ return NULL;
}
protected:
diff --git a/engines/agos/game.cpp b/engines/agos/game.cpp
index 153c4a14aa..b660e4407b 100644
--- a/engines/agos/game.cpp
+++ b/engines/agos/game.cpp
@@ -169,14 +169,20 @@ namespace AGOS {
using Common::ADGameFileDescription;
using Common::ADGameDescription;
+static const ADGameFileDescription ELVIRA1AMIGA_GameFiles[] = {
+ { "gameamiga", GAME_BASEFILE, "7bdaff4a118d8035047cf9b1393b3fa0"},
+ { "icon.dat", GAME_ICONFILE, "2db931e84f1ca01f0816dddfae3f49e1"},
+};
+
static const ADGameFileDescription ELVIRA1AMIGADEMO_GameFiles[] = {
{ "englishdemo", GAME_BASEFILE, "7bbc2dfe8619ef579004ff57674c6e92"},
{ "icon.dat", GAME_ICONFILE, "68b329da9893e34099c7d8ad5cb9c940"},
};
-static const ADGameFileDescription ELVIRA1AMIGA_GameFiles[] = {
- { "gameamiga", GAME_BASEFILE, "7bdaff4a118d8035047cf9b1393b3fa0"},
+static const ADGameFileDescription ELVIRA1ST_GameFiles[] = {
+ { "gamest", GAME_BASEFILE, "8942859018fcfb2dbed13e83d974d1ab"},
{ "icon.dat", GAME_ICONFILE, "2db931e84f1ca01f0816dddfae3f49e1"},
+ { "tbllist", GAME_TBLFILE, "5b6ff494bf7e24213758598ef4ac0a8b"},
};
static const ADGameFileDescription ELVIRA1DOS_GameFiles[] = {
@@ -185,7 +191,7 @@ static const ADGameFileDescription ELVIRA1DOS_GameFiles[] = {
{ "tbllist", GAME_TBLFILE, "319f6b227c7822a551f57d24e70f8149"},
};
-static const ADGameFileDescription ELVIRA1DOS2_GameFiles[] = {
+static const ADGameFileDescription ELVIRA1DOS_FR_GameFiles[] = {
{ "gamepc", GAME_BASEFILE, "9076d507d60cc454df662316438ec843"},
{ "icon.dat", GAME_ICONFILE, "fda48c9da7f3e72d0313e2f5f760fc45"},
{ "tbllist", GAME_TBLFILE, "319f6b227c7822a551f57d24e70f8149"},
@@ -712,6 +718,22 @@ static const AGOSGameDescription gameDescriptions[] = {
GF_OLD_BUNDLE | GF_CRUNCHED,
},
+ // Elvira - English Atari ST Floppy
+ {
+ {
+ "elvira1",
+ "Floppy",
+ ARRAYSIZE(ELVIRA1ST_GameFiles),
+ ELVIRA1ST_GameFiles,
+ Common::EN_ANY,
+ Common::kPlatformAtariST,
+ },
+
+ GType_ELVIRA1,
+ GID_ELVIRA1,
+ GF_OLD_BUNDLE | GF_CRUNCHED,
+ },
+
// Elvira - English DOS Floppy
{
{
@@ -733,8 +755,8 @@ static const AGOSGameDescription gameDescriptions[] = {
{
"elvira1",
"Floppy",
- ARRAYSIZE(ELVIRA1DOS2_GameFiles),
- ELVIRA1DOS2_GameFiles,
+ ARRAYSIZE(ELVIRA1DOS_FR_GameFiles),
+ ELVIRA1DOS_FR_GameFiles,
Common::FR_FRA,
Common::kPlatformPC,
},
diff --git a/engines/agos/res.cpp b/engines/agos/res.cpp
index 65e278b54e..17a938047a 100644
--- a/engines/agos/res.cpp
+++ b/engines/agos/res.cpp
@@ -168,48 +168,44 @@ void AGOSEngine::loadGamePcFile() {
}
readSubroutineBlock(&in);
-
in.close();
- if ((getGameType() == GType_ELVIRA1 && getPlatform() == Common::kPlatformAmiga) ||
- getGameType() == GType_PP)
- return;
-
- /* Read list of TABLE resources */
- in.open(getFileName(GAME_TBLFILE));
- if (in.isOpen() == false) {
- error("loadGamePcFile: Can't load table resources file '%s'", getFileName(GAME_TBLFILE));
- }
-
- file_size = in.size();
+ if (getFileName(GAME_TBLFILE) != NULL) {
+ /* Read list of TABLE resources */
+ in.open(getFileName(GAME_TBLFILE));
+ if (in.isOpen() == false) {
+ error("loadGamePcFile: Can't load table resources file '%s'", getFileName(GAME_TBLFILE));
+ }
- _tblList = (byte *)malloc(file_size);
- if (_tblList == NULL)
- error("loadGamePcFile: Out of memory for strip table list");
- in.read(_tblList, file_size);
- in.close();
+ file_size = in.size();
- /* Remember the current state */
- _subroutineListOrg = _subroutineList;
- _tablesHeapPtrOrg = _tablesHeapPtr;
- _tablesHeapCurPosOrg = _tablesHeapCurPos;
+ _tblList = (byte *)malloc(file_size);
+ if (_tblList == NULL)
+ error("loadGamePcFile: Out of memory for strip table list");
+ in.read(_tblList, file_size);
+ in.close();
- if (getGameType() == GType_ELVIRA1 || getGameType() == GType_FF)
- return;
+ /* Remember the current state */
+ _subroutineListOrg = _subroutineList;
+ _tablesHeapPtrOrg = _tablesHeapPtr;
+ _tablesHeapCurPosOrg = _tablesHeapCurPos;
+ }
- /* Read list of TEXT resources */
- in.open(getFileName(GAME_STRFILE));
- if (in.isOpen() == false)
- error("loadGamePcFile: Can't load text resources file '%s'", getFileName(GAME_STRFILE));
+ if (getFileName(GAME_STRFILE) != NULL) {
+ /* Read list of TEXT resources */
+ in.open(getFileName(GAME_STRFILE));
+ if (in.isOpen() == false)
+ error("loadGamePcFile: Can't load text resources file '%s'", getFileName(GAME_STRFILE));
- file_size = in.size();
- _strippedTxtMem = (byte *)malloc(file_size);
- if (_strippedTxtMem == NULL)
- error("loadGamePcFile: Out of memory for strip text list");
- in.read(_strippedTxtMem, file_size);
- in.close();
+ file_size = in.size();
+ _strippedTxtMem = (byte *)malloc(file_size);
+ if (_strippedTxtMem == NULL)
+ error("loadGamePcFile: Out of memory for strip text list");
+ in.read(_strippedTxtMem, file_size);
+ in.close();
+ }
- if (getGameType() == GType_WW && getPlatform() == Common::kPlatformPC) {
+ if (getFileName(GAME_RMSLFILE) != NULL) {
/* Read list of ROOM ITEMS resources */
in.open(getFileName(GAME_RMSLFILE));
if (in.isOpen() == false) {
@@ -225,7 +221,7 @@ void AGOSEngine::loadGamePcFile() {
in.close();
}
- if (getGameType() == GType_WW) {
+ if (getFileName(GAME_XTBLFILE) != NULL) {
/* Read list of XTABLE resources */
in.open(getFileName(GAME_XTBLFILE));
if (in.isOpen() == false) {
@@ -665,7 +661,7 @@ void AGOSEngine::loadVGAFile(uint id, uint type) {
dst = allocBlock(dstSize + extraBuffer);
decompressData(filename, dst, offs, srcSize, dstSize);
} else if (getFeatures() & GF_OLD_BUNDLE) {
- if (getPlatform() == Common::kPlatformAmiga) {
+ if (getPlatform() == Common::kPlatformAmiga || getPlatform() == Common::kPlatformAtariST) {
if (getFeatures() & GF_TALKIE) {
sprintf(filename, "%.3d%d.out", id, type);
} else if (getGameType() == GType_ELVIRA1 || getGameType() == GType_ELVIRA2) {
diff --git a/engines/agos/vga.cpp b/engines/agos/vga.cpp
index 2b97663a9c..4599de5043 100644
--- a/engines/agos/vga.cpp
+++ b/engines/agos/vga.cpp
@@ -1335,8 +1335,6 @@ void AGOSEngine::drawImages(VC10_state *state) {
} while (--h);
}
} while (++w != state->draw_width);
-
- /* vc10_helper_5 */
} else if ((((_lockWord & 0x20) && state->palette == 0) || state->palette == 0xC0) &&
(getGameType() == GType_SIMON1 || getGameType() == GType_SIMON2) &&
getPlatform() != Common::kPlatformAmiga) {
@@ -1407,7 +1405,6 @@ void AGOSEngine::drawImages(VC10_state *state) {
src += state->width * 16;
} while (--h);
}
- /* vc10_helper_4 */
} else {
if (getGameType() == GType_SIMON2 && state->flags & kDFUseFrontBuf && getBitFlag(171)) {
state->surf_addr = state->surf2_addr;
@@ -1449,7 +1446,6 @@ void AGOSEngine::drawImages(VC10_state *state) {
} while (++h != state->draw_height);
dstPtr += 2;
} while (++w != state->draw_width);
- /* vc10_helper_6 */
} else {
const byte *src;
byte *dst;