void HiRes4Engine_Atari::loadRoom(byte roomNr) { if (roomNr >= 59 && roomNr < 113) { if (_curDisk != 2) { insertDisk(2); rebindDisk(); } } else if (_curDisk != 1) { insertDisk(1); rebindDisk(); } if (roomNr == 121) { // Room 121 is not present in the Atari version. This causes // problems when we're dumping scripts with the debugger, so // we intercept this room load here. // FIXME: Find out if the Apple II version does have this room // FIXME: Implement more generic handling of invalid rooms? debug("Warning: attempt to load non-existent room 121"); _roomData.description.clear(); _roomData.pictures.clear(); _roomData.commands.clear(); return; } AdlEngine_v3::loadRoom(roomNr); }
void HiRes5Engine::initGameState() { _state.vars.resize(40); insertDisk(2); StreamPtr stream(_disk->createReadStream(0x5, 0x1, 0x00, 3)); loadItems(*stream); // A combined total of 1213 rooms static const byte rooms[kRegions] = { 6, 16, 24, 57, 40, 30, 76, 40, 54, 38, 44, 21, 26, 42, 49, 32, 59, 69, 1, 1, 1, 1, 1, 18, 25, 13, 28, 28, 11, 23, 9, 31, 6, 29, 29, 34, 9, 10, 95, 86, 1 }; initRegions(rooms, kRegions); loadRegion(1); _state.room = 5; _doAnimation = false; }
void HiRes5Engine::runIntro() { insertDisk(2); StreamPtr stream(_disk->createReadStream(0x10, 0x0, 0x00, 31)); _display->setMode(DISPLAY_MODE_HIRES); _display->loadFrameBuffer(*stream); _display->updateHiResScreen(); inputKey(); _display->home(); _display->setMode(DISPLAY_MODE_TEXT); stream.reset(_disk->createReadStream(0x03, 0xc, 0x34, 1)); Common::String menu(readString(*stream)); while (!g_engine->shouldQuit()) { _display->home(); _display->printString(menu); Common::String cmd(inputString()); // We ignore the backup and format menu options if (!cmd.empty() && cmd[0] == APPLECHAR('1')) break; }; }
void HiRes5Engine::init() { _graphics = new Graphics_v3(*_display); insertDisk(2); StreamPtr stream(_disk->createReadStream(0x5, 0x0, 0x02)); loadRegionLocations(*stream, kRegions); stream.reset(_disk->createReadStream(0xd, 0x2, 0x04)); loadRegionInitDataOffsets(*stream, kRegions); stream.reset(_disk->createReadStream(0x7, 0xe)); _strings.verbError = readStringAt(*stream, 0x4f); _strings.nounError = readStringAt(*stream, 0x8e); _strings.enterCommand = readStringAt(*stream, 0xbc); stream.reset(_disk->createReadStream(0x7, 0xc)); _strings.lineFeeds = readString(*stream); stream.reset(_disk->createReadStream(0x8, 0x3, 0x00, 2)); _strings_v2.saveInsert = readStringAt(*stream, 0x66); _strings_v2.saveReplace = readStringAt(*stream, 0x112); _strings_v2.restoreInsert = readStringAt(*stream, 0x180); _strings.playAgain = readStringAt(*stream, 0x247, 0xff); _messageIds.cantGoThere = 110; _messageIds.dontUnderstand = 112; _messageIds.itemDoesntMove = 114; _messageIds.itemNotHere = 115; _messageIds.thanksForPlaying = 113; stream.reset(_disk->createReadStream(0xe, 0x1, 0x13, 4)); loadItemDescriptions(*stream, kItems); stream.reset(_disk->createReadStream(0x8, 0xd, 0xfd, 1)); loadDroppedItemOffsets(*stream, 16); stream.reset(_disk->createReadStream(0xb, 0xa, 0x05, 1)); loadItemPicIndex(*stream, kItems); stream.reset(_disk->createReadStream(0x7, 0x8, 0x01)); for (uint i = 0; i < kItems; ++i) _itemTimeLimits.push_back(stream->readByte()); if (stream->eos() || stream->err()) error("Failed to read item time limits"); stream.reset(_disk->createReadStream(0x8, 0x2, 0x2d)); _gameStrings.itemTimeLimit = readString(*stream); stream.reset(_disk->createReadStream(0x8, 0x7, 0x02)); _gameStrings.carryingTooMuch = readString(*stream); stream.reset(_disk->createReadStream(0xc, 0xb, 0x20)); loadSong(*stream); }
void HiRes4Engine_Atari::init() { _graphics = new Graphics_v2(*_display); _boot = new DiskImage(); if (!_boot->open(atariDisks[0])) error("Failed to open disk image '%s'", atariDisks[0]); insertDisk(1); loadCommonData(); StreamPtr stream(createReadStream(_boot, 0x06, 0x2)); _strings.verbError = readStringAt(*stream, 0x4f); _strings.nounError = readStringAt(*stream, 0x83); _strings.enterCommand = readStringAt(*stream, 0xa6); stream.reset(createReadStream(_boot, 0x05, 0xb, 0xd7)); _strings_v2.time = readString(*stream, 0xff); stream.reset(createReadStream(_boot, 0x06, 0x7, 0x00, 2)); _strings_v2.saveInsert = readStringAt(*stream, 0x62); _strings_v2.saveReplace = readStringAt(*stream, 0xdd); _strings_v2.restoreInsert = readStringAt(*stream, 0x12a); _strings_v2.restoreReplace = readStringAt(*stream, 0x1b8); _strings.playAgain = readStringAt(*stream, 0x21b); // TODO: restart sequence has "insert side a/b" strings _messageIds.cantGoThere = IDI_HR4_MSG_CANT_GO_THERE; _messageIds.dontUnderstand = IDI_HR4_MSG_DONT_UNDERSTAND; _messageIds.itemDoesntMove = IDI_HR4_MSG_ITEM_DOESNT_MOVE; _messageIds.itemNotHere = IDI_HR4_MSG_ITEM_NOT_HERE; _messageIds.thanksForPlaying = IDI_HR4_MSG_THANKS_FOR_PLAYING; stream.reset(createReadStream(_boot, 0x06, 0xd, 0x12, 2)); loadItemDescriptions(*stream, IDI_HR4_NUM_ITEM_DESCS); stream.reset(createReadStream(_boot, 0x07, 0x1, 0xf4)); loadDroppedItemOffsets(*stream, IDI_HR4_NUM_ITEM_OFFSETS); stream.reset(createReadStream(_boot, 0x08, 0xe, 0xa5, 5)); readCommands(*stream, _roomCommands); stream.reset(createReadStream(_boot, 0x0a, 0x9, 0x00, 3)); readCommands(*stream, _globalCommands); stream.reset(createReadStream(_boot, 0x05, 0x4, 0x00, 3)); loadWords(*stream, _verbs, _priVerbs); stream.reset(createReadStream(_boot, 0x03, 0xb, 0x00, 6)); loadWords(*stream, _nouns, _priNouns); }