diff options
-rw-r--r-- | engines/adl/adl.h | 3 | ||||
-rw-r--r-- | engines/adl/hires1.cpp | 6 | ||||
-rw-r--r-- | engines/adl/hires1.h | 4 | ||||
-rw-r--r-- | engines/adl/hires2.cpp | 29 | ||||
-rw-r--r-- | engines/adl/hires2.h | 16 |
5 files changed, 48 insertions, 10 deletions
diff --git a/engines/adl/adl.h b/engines/adl/adl.h index abdbaff28a..d0da3bfec1 100644 --- a/engines/adl/adl.h +++ b/engines/adl/adl.h @@ -194,11 +194,10 @@ protected: struct { Common::String enterCommand; - Common::String dontHaveIt; - Common::String gettingDark; Common::String verbError; Common::String nounError; Common::String playAgain; + Common::String pressReturn; } _strings; struct { diff --git a/engines/adl/hires1.cpp b/engines/adl/hires1.cpp index 4bdf47a1a6..98e33abbb9 100644 --- a/engines/adl/hires1.cpp +++ b/engines/adl/hires1.cpp @@ -158,12 +158,10 @@ void HiRes1Engine::loadData() { // Load other strings from executable _strings.enterCommand = readStringAt(f, IDI_HR1_OFS_STR_ENTER_COMMAND); - _strings.dontHaveIt = readStringAt(f, IDI_HR1_OFS_STR_DONT_HAVE_IT); - _strings.gettingDark = readStringAt(f, IDI_HR1_OFS_STR_GETTING_DARK); _strings.verbError = readStringAt(f, IDI_HR1_OFS_STR_VERB_ERROR); _strings.nounError = readStringAt(f, IDI_HR1_OFS_STR_NOUN_ERROR); _strings.playAgain = readStringAt(f, IDI_HR1_OFS_STR_PLAY_AGAIN); - _gameStrings.pressReturn = readStringAt(f, IDI_HR1_OFS_STR_PRESS_RETURN); + _strings.pressReturn = readStringAt(f, IDI_HR1_OFS_STR_PRESS_RETURN); // Set message IDs _messageIds.cantGoThere = IDI_HR1_MSG_CANT_GO_THERE; @@ -279,7 +277,7 @@ void HiRes1Engine::initState() { void HiRes1Engine::restartGame() { initState(); - _display->printString(_gameStrings.pressReturn); + _display->printString(_strings.pressReturn); inputString(); // Missing in the original _display->printAsciiString("\r\r\r\r\r"); } diff --git a/engines/adl/hires1.h b/engines/adl/hires1.h index 422118d876..02cec0137a 100644 --- a/engines/adl/hires1.h +++ b/engines/adl/hires1.h @@ -104,10 +104,6 @@ private: void drawLine(const Common::Point &p1, const Common::Point &p2, byte color) const; void drawPic(Common::ReadStream &stream, const Common::Point &pos) const; - struct { - Common::String pressReturn; - } _gameStrings; - Common::Array<byte> _roomDesc; }; diff --git a/engines/adl/hires2.cpp b/engines/adl/hires2.cpp index 4f8ba48837..1c4377180d 100644 --- a/engines/adl/hires2.cpp +++ b/engines/adl/hires2.cpp @@ -56,6 +56,35 @@ void HiRes2Engine::loadData() { if (!f.open(IDS_HR2_DISK_IMAGE)) error("Failed to open file '" IDS_HR2_DISK_IMAGE "'"); + for (uint i = 0; i < IDI_HR2_NUM_MESSAGES; ++i) { + f.seek(IDI_HR2_OFS_MESSAGES + i * 4); + byte track = f.readByte(); + byte sector = f.readByte(); + byte offset = f.readByte(); + // One more byte follows, disk? + + uint diskOffset = TSO(track, sector, offset); + + Common::String str; + + if (diskOffset != 0) + str = readStringAt(f, TSO(track, sector, offset), 0xff); + + _messages.push_back(str); + } + + _strings.enterCommand = readStringAt(f, IDI_HR2_OFS_STR_ENTER_COMMAND); + _strings.verbError = readStringAt(f, IDI_HR2_OFS_STR_VERB_ERROR); + _strings.nounError = readStringAt(f, IDI_HR2_OFS_STR_NOUN_ERROR); + _strings.playAgain = readStringAt(f, IDI_HR2_OFS_STR_PLAY_AGAIN); + _strings.pressReturn = readStringAt(f, IDI_HR2_OFS_STR_PRESS_RETURN); + + _messageIds.cantGoThere = IDI_HR2_MSG_CANT_GO_THERE; + _messageIds.dontUnderstand = IDI_HR2_MSG_DONT_UNDERSTAND; + _messageIds.itemDoesntMove = IDI_HR2_MSG_ITEM_DOESNT_MOVE; + _messageIds.itemNotHere = IDI_HR2_MSG_ITEM_NOT_HERE; + _messageIds.thanksForPlaying = IDI_HR2_MSG_THANKS_FOR_PLAYING; + f.seek(IDI_HR2_OFS_VERBS); loadWords(f, _verbs); diff --git a/engines/adl/hires2.h b/engines/adl/hires2.h index 01bb29f2e5..05926ee7b8 100644 --- a/engines/adl/hires2.h +++ b/engines/adl/hires2.h @@ -45,7 +45,23 @@ namespace Adl { #define IDI_HR2_OFS_VERBS T(0x19) #define IDI_HR2_OFS_NOUNS TS(0x22, 0x2) #define IDI_HR2_OFS_ROOMS TSO(0x21, 0x5, 0x0e) // Skip bogus room 0 +#define IDI_HR2_OFS_MESSAGES TSO(0x1f, 0x2, 0x04) // Skip bogus message 0 + #define IDI_HR2_NUM_ROOMS 135 +#define IDI_HR2_NUM_MESSAGES 254 + +// Messages used outside of scripts +#define IDI_HR2_MSG_CANT_GO_THERE 123 +#define IDI_HR2_MSG_DONT_UNDERSTAND 19 +#define IDI_HR2_MSG_ITEM_DOESNT_MOVE 242 +#define IDI_HR2_MSG_ITEM_NOT_HERE 4 +#define IDI_HR2_MSG_THANKS_FOR_PLAYING 239 + +#define IDI_HR2_OFS_STR_ENTER_COMMAND TSO(0x1a, 0x1, 0xbc) +#define IDI_HR2_OFS_STR_VERB_ERROR TSO(0x1a, 0x1, 0x4f) +#define IDI_HR2_OFS_STR_NOUN_ERROR TSO(0x1a, 0x1, 0x8e) +#define IDI_HR2_OFS_STR_PLAY_AGAIN TSO(0x1a, 0x8, 0x25) +#define IDI_HR2_OFS_STR_PRESS_RETURN TSO(0x1a, 0x8, 0x5f) class HiRes2Engine : public AdlEngine { public: |