aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWalter van Niftrik2016-03-24 22:50:42 +0100
committerWalter van Niftrik2016-06-06 20:35:49 +0200
commit02563df42218d103a80e9bc5463cc63909b2f495 (patch)
tree2b24692617fe732821963a69e9ed4299cbce95ea
parent71ca8de7e65d535e97d87bb1d30cbc1d9098cc07 (diff)
downloadscummvm-rg350-02563df42218d103a80e9bc5463cc63909b2f495.tar.gz
scummvm-rg350-02563df42218d103a80e9bc5463cc63909b2f495.tar.bz2
scummvm-rg350-02563df42218d103a80e9bc5463cc63909b2f495.zip
ADL: Add support for hires1 disk image
-rw-r--r--engines/adl/detection.cpp16
-rw-r--r--engines/adl/hires1.cpp23
-rw-r--r--engines/adl/hires1.h5
3 files changed, 33 insertions, 11 deletions
diff --git a/engines/adl/detection.cpp b/engines/adl/detection.cpp
index 3d29687df4..457db2ded0 100644
--- a/engines/adl/detection.cpp
+++ b/engines/adl/detection.cpp
@@ -77,7 +77,7 @@ static const PlainGameDescriptor adlGames[] = {
};
static const AdlGameDescription gameDescriptions[] = {
- { // Hi-Res Adventure #1: Mystery House - Apple II - 1987 PD release
+ { // Hi-Res Adventure #1: Mystery House - Apple II - 1987 PD release - Plain files
{
"hires1", 0,
{
@@ -93,6 +93,20 @@ static const AdlGameDescription gameDescriptions[] = {
},
GAME_TYPE_HIRES1
},
+ { // Hi-Res Adventure #1: Mystery House - Apple II - 1987 PD release - .DSK format
+ {
+ "hires1", 0,
+ {
+ { "MYSTHOUS.DSK", 0, "34ba05e62bf51404c4475c349ca48921", 143360 },
+ AD_LISTEND
+ },
+ Common::EN_ANY,
+ Common::kPlatformApple2GS, // FIXME
+ ADGF_UNSTABLE,
+ GUIO2(GAMEOPTION_COLOR, GAMEOPTION_SCANLINES)
+ },
+ GAME_TYPE_HIRES1
+ },
{ // Hi-Res Adventure #2: Wizard and the Princess - Apple II - 1986 SierraVenture release
{
"hires2", 0,
diff --git a/engines/adl/hires1.cpp b/engines/adl/hires1.cpp
index 109879e199..1c46ba6354 100644
--- a/engines/adl/hires1.cpp
+++ b/engines/adl/hires1.cpp
@@ -33,7 +33,7 @@
namespace Adl {
void HiRes1Engine::runIntro() const {
- StreamPtr stream(_files.createReadStream(IDS_HR1_EXE_0));
+ StreamPtr stream(_files->createReadStream(IDS_HR1_EXE_0));
stream->seek(IDI_HR1_OFS_LOGO_0);
_display->setMode(DISPLAY_MODE_HIRES);
@@ -46,7 +46,7 @@ void HiRes1Engine::runIntro() const {
_display->setMode(DISPLAY_MODE_TEXT);
- StreamPtr basic(_files.createReadStream(IDS_HR1_LOADER));
+ StreamPtr basic(_files->createReadStream(IDS_HR1_LOADER));
Common::String str;
str = readStringAt(*basic, IDI_HR1_OFS_PD_TEXT_0, '"');
@@ -120,7 +120,7 @@ void HiRes1Engine::runIntro() const {
_display->setMode(DISPLAY_MODE_MIXED);
// Title screen shown during loading
- stream.reset(_files.createReadStream(IDS_HR1_EXE_1));
+ stream.reset(_files->createReadStream(IDS_HR1_EXE_1));
stream->seek(IDI_HR1_OFS_LOGO_1);
_display->loadFrameBuffer(*stream);
_display->updateHiResScreen();
@@ -128,14 +128,21 @@ void HiRes1Engine::runIntro() const {
}
void HiRes1Engine::init() {
+ if (Common::File::exists("MYSTHOUS.DSK")) {
+ _files = new Files_DOS33();
+ if (!static_cast<Files_DOS33 *>(_files)->open("MYSTHOUS.DSK"))
+ error("Failed to open MYSTHOUS.DSK");
+ } else
+ _files = new PlainFiles();
+
_graphics = new Graphics_v1(*_display);
- StreamPtr stream(_files.createReadStream(IDS_HR1_MESSAGES));
+ StreamPtr stream(_files->createReadStream(IDS_HR1_MESSAGES));
for (uint i = 0; i < IDI_HR1_NUM_MESSAGES; ++i)
_messages.push_back(readString(*stream, APPLECHAR('\r')) + APPLECHAR('\r'));
- stream.reset(_files.createReadStream(IDS_HR1_EXE_1));
+ stream.reset(_files->createReadStream(IDS_HR1_EXE_1));
// Some messages have overrides inside the executable
_messages[IDI_HR1_MSG_CANT_GO_THERE - 1] = readStringAt(*stream, IDI_HR1_OFS_STR_CANT_GO_THERE);
@@ -164,7 +171,7 @@ void HiRes1Engine::init() {
byte block = stream->readByte();
Common::String name = Common::String::format("BLOCK%i", block);
uint16 offset = stream->readUint16LE();
- pic.data = _files.getDataBlock(name, offset);
+ pic.data = _files->getDataBlock(name, offset);
_pictures.push_back(pic);
}
@@ -188,7 +195,7 @@ void HiRes1Engine::init() {
stream->seek(IDI_HR1_OFS_CORNERS);
uint16 cornersCount = stream->readUint16LE();
for (uint i = 0; i < cornersCount; ++i)
- _corners.push_back(_files.getDataBlock(IDS_HR1_EXE_1, IDI_HR1_OFS_CORNERS + stream->readUint16LE()));
+ _corners.push_back(_files->getDataBlock(IDS_HR1_EXE_1, IDI_HR1_OFS_CORNERS + stream->readUint16LE()));
if (stream->eos() || stream->err())
error("Failed to read game data from '" IDS_HR1_EXE_1 "'");
@@ -208,7 +215,7 @@ void HiRes1Engine::initState() {
_state.vars.clear();
_state.vars.resize(IDI_HR1_NUM_VARS);
- StreamPtr stream(_files.createReadStream(IDS_HR1_EXE_1));
+ StreamPtr stream(_files->createReadStream(IDS_HR1_EXE_1));
// Load room data from executable
_state.rooms.clear();
diff --git a/engines/adl/hires1.h b/engines/adl/hires1.h
index 985a18c514..cb1730ab6a 100644
--- a/engines/adl/hires1.h
+++ b/engines/adl/hires1.h
@@ -91,7 +91,8 @@ namespace Adl {
class HiRes1Engine : public AdlEngine {
public:
- HiRes1Engine(OSystem *syst, const AdlGameDescription *gd) : AdlEngine(syst, gd) { }
+ HiRes1Engine(OSystem *syst, const AdlGameDescription *gd) : AdlEngine(syst, gd), _files(nullptr) { }
+ ~HiRes1Engine() { delete _files; }
private:
// AdlEngine
@@ -104,7 +105,7 @@ private:
void drawItem(const Item &item, const Common::Point &pos) const;
void showRoom();
- PlainFiles _files;
+ Files *_files;
Common::File _exe;
Common::Array<DataBlockPtr> _corners;
Common::Array<byte> _roomDesc;