diff options
author | athrxx | 2019-01-26 22:55:25 +0100 |
---|---|---|
committer | athrxx | 2019-03-06 20:48:20 +0100 |
commit | 890c4c5f41e74938640f4bc8ddb843ac3ca9928d (patch) | |
tree | 1574c7a04f65cc2ce468380b8b9d05a70c0cfaec /engines/kyra/engine | |
parent | 4cc9c81a75f73216ba98b3744a32c900aad36061 (diff) | |
download | scummvm-rg350-890c4c5f41e74938640f4bc8ddb843ac3ca9928d.tar.gz scummvm-rg350-890c4c5f41e74938640f4bc8ddb843ac3ca9928d.tar.bz2 scummvm-rg350-890c4c5f41e74938640f4bc8ddb843ac3ca9928d.zip |
KYRA: (EOB1/Amiga) - fix start up
First efforts to get this running. The intro is shown with severe palette glitches. The Main Menu does not show, thanks to the lack of font drawing.
- implement endian aware stream wrapper for amiga files
- implement sound file handling
- implement some Amiga palette handling
- etc
Diffstat (limited to 'engines/kyra/engine')
-rw-r--r-- | engines/kyra/engine/chargen.cpp | 1 | ||||
-rw-r--r-- | engines/kyra/engine/darkmoon.cpp | 6 | ||||
-rw-r--r-- | engines/kyra/engine/darkmoon.h | 2 | ||||
-rw-r--r-- | engines/kyra/engine/eob.cpp | 5 | ||||
-rw-r--r-- | engines/kyra/engine/eobcommon.cpp | 9 | ||||
-rw-r--r-- | engines/kyra/engine/eobcommon.h | 3 | ||||
-rw-r--r-- | engines/kyra/engine/items_eob.cpp | 22 |
7 files changed, 31 insertions, 17 deletions
diff --git a/engines/kyra/engine/chargen.cpp b/engines/kyra/engine/chargen.cpp index 7bea21e749..5032e86376 100644 --- a/engines/kyra/engine/chargen.cpp +++ b/engines/kyra/engine/chargen.cpp @@ -1972,6 +1972,7 @@ void TransferPartyWiz::giveKhelbensCoin() { // Start functions bool EoBCoreEngine::startCharacterGeneration() { + _sound->selectAudioResourceSet(_flags.platform == Common::kPlatformAmiga ? kMusicIntro : kMusicIngame); return CharacterGenerator(this, _screen).start(_characters, &_faceShapes); } diff --git a/engines/kyra/engine/darkmoon.cpp b/engines/kyra/engine/darkmoon.cpp index 9731f00533..4978164922 100644 --- a/engines/kyra/engine/darkmoon.cpp +++ b/engines/kyra/engine/darkmoon.cpp @@ -70,15 +70,21 @@ Common::Error DarkMoonEngine::init() { } void DarkMoonEngine::startupNew() { + _sound->selectAudioResourceSet(kMusicIngame); _currentLevel = 4; _currentSub = 0; loadLevel(4, 0); _currentBlock = 171; _currentDirection = 2; setHandItem(0); + EoBCoreEngine::startupNew(); } +void DarkMoonEngine::startupLoad() { + _sound->selectAudioResourceSet(kMusicIngame); +} + void DarkMoonEngine::drawNpcScene(int npcIndex) { const uint8 *shpDef = &_npcShpData[npcIndex << 3]; for (int i = npcIndex; i != 255; i = shpDef[7]) { diff --git a/engines/kyra/engine/darkmoon.h b/engines/kyra/engine/darkmoon.h index 3577bdbcec..d1012dbfa6 100644 --- a/engines/kyra/engine/darkmoon.h +++ b/engines/kyra/engine/darkmoon.h @@ -66,7 +66,7 @@ private: // Main loop void startupNew(); - void startupLoad() {} + void startupLoad(); // Intro/Outro void seq_playIntro(); diff --git a/engines/kyra/engine/eob.cpp b/engines/kyra/engine/eob.cpp index 18ed9c623a..b1cf50052c 100644 --- a/engines/kyra/engine/eob.cpp +++ b/engines/kyra/engine/eob.cpp @@ -76,6 +76,8 @@ Common::Error EoBEngine::init() { } void EoBEngine::startupNew() { + _sound->selectAudioResourceSet(kMusicIngame); + _sound->loadSoundFile(0); _currentLevel = 1; _currentSub = 0; loadLevel(1, 0); @@ -87,7 +89,8 @@ void EoBEngine::startupNew() { } void EoBEngine::startupLoad() { - _sound->loadSoundFile("ADLIB"); + _sound->selectAudioResourceSet(kMusicIngame); + _sound->loadSoundFile(0); } void EoBEngine::drawNpcScene(int npcIndex) { diff --git a/engines/kyra/engine/eobcommon.cpp b/engines/kyra/engine/eobcommon.cpp index 0e3e130c94..e6e01ff781 100644 --- a/engines/kyra/engine/eobcommon.cpp +++ b/engines/kyra/engine/eobcommon.cpp @@ -214,6 +214,7 @@ EoBCoreEngine::EoBCoreEngine(OSystem *system, const GameFlags &flags) _menuStringsRest4 = _menuStringsDefeat = _menuStringsTransfer = _menuStringsSpec = 0; _menuStringsSpellNo = _menuYesNoStrings = _2431Strings = _katakanaLines = _katakanaSelectStrings = 0; _errorSlotEmptyString = _errorSlotNoNameString = _menuOkString = 0; + _levelSoundFiles1 = _levelSoundFiles2 = 0; _spellLevelsMage = _spellLevelsCleric = _numSpellsCleric = _numSpellsWisAdj = _numSpellsPal = _numSpellsMage = 0; _mnNumWord = _numSpells = _mageSpellListSize = _spellLevelsMageSize = _spellLevelsClericSize = 0; _inventorySlotsX = _slotValidationFlags = _encodeMonsterShpTable = 0; @@ -435,7 +436,10 @@ Common::Error EoBCoreEngine::init() { assert(_debugger); if (_flags.platform == Common::kPlatformAmiga) { - + if (_res->exists("EOBF6.FONT")) + _screen->loadFont(Screen::FID_6_FNT, "EOBF6.FONT"); + if (_res->exists("EOBF8.FONT")) + _screen->loadFont(Screen::FID_8_FNT, "EOBF8.FONT"); } else { _screen->loadFont(Screen::FID_6_FNT, "FONT6.FNT"); _screen->loadFont(Screen::FID_8_FNT, "FONT8.FNT"); @@ -555,7 +559,6 @@ Common::Error EoBCoreEngine::go() { action = 0; if (_gameToLoad != -1) { - _sound->selectAudioResourceSet(kMusicIngame); if (loadGameState(_gameToLoad).getCode() != Common::kNoError) error("Couldn't load game slot %d on startup", _gameToLoad); startupLoad(); @@ -565,8 +568,6 @@ Common::Error EoBCoreEngine::go() { action = mainMenu(); } - _sound->selectAudioResourceSet(kMusicIngame); - if (action == -1) { // load game repeatLoop = _gui->runLoadMenu(72, 14); diff --git a/engines/kyra/engine/eobcommon.h b/engines/kyra/engine/eobcommon.h index c56a41b6a1..38bdae0a7c 100644 --- a/engines/kyra/engine/eobcommon.h +++ b/engines/kyra/engine/eobcommon.h @@ -1175,6 +1175,9 @@ protected: void snd_stopSound(); void snd_fadeOut(); + const char *const *_levelSoundFiles1; + const char *const *_levelSoundFiles2; + // keymap static const char *const kKeymapName; }; diff --git a/engines/kyra/engine/items_eob.cpp b/engines/kyra/engine/items_eob.cpp index 54d3d5090b..4d11d0dea3 100644 --- a/engines/kyra/engine/items_eob.cpp +++ b/engines/kyra/engine/items_eob.cpp @@ -29,9 +29,9 @@ namespace Kyra { void EoBCoreEngine::loadItemDefs() { - Common::SeekableReadStream *s = _res->createReadStream("item.dat"); + Common::SeekableReadStreamEndian *s = _res->createEndianAwareReadStream("item.dat"); memset(_items, 0, sizeof(EoBItem) * 600); - _numItems = s->readUint16LE(); + _numItems = s->readUint16(); for (int i = 0; i < 600; i++) _items[i].block = -1; @@ -43,29 +43,29 @@ void EoBCoreEngine::loadItemDefs() { _items[i].icon = s->readSByte(); _items[i].type = s->readSByte(); _items[i].pos = s->readSByte(); - _items[i].block = s->readSint16LE(); - _items[i].next = s->readSint16LE(); - _items[i].prev = s->readSint16LE(); + _items[i].block = s->readSint16(); + _items[i].next = s->readSint16(); + _items[i].prev = s->readSint16(); _items[i].level = s->readSByte(); _items[i].value = s->readSByte(); } - _numItemNames = s->readUint16LE(); + _numItemNames = s->readUint16(); for (int i = 0; i < _numItemNames; i++) s->read(_itemNames[i], 35); delete s; - s = _res->createReadStream("itemtype.dat"); - uint16 numTypes = s->readUint16LE(); + s = _res->createEndianAwareReadStream("itemtype.dat"); + uint16 numTypes = s->readUint16(); delete[] _itemTypes; _itemTypes = new EoBItemType[65]; memset(_itemTypes, 0, sizeof(EoBItemType) * 65); for (int i = 0; i < numTypes; i++) { - _itemTypes[i].invFlags = s->readUint16LE(); - _itemTypes[i].handFlags = s->readUint16LE(); + _itemTypes[i].invFlags = s->readUint16(); + _itemTypes[i].handFlags = s->readUint16(); _itemTypes[i].armorClass = s->readSByte(); _itemTypes[i].allowedClasses = s->readSByte(); _itemTypes[i].requiredHands = s->readSByte(); @@ -76,7 +76,7 @@ void EoBCoreEngine::loadItemDefs() { _itemTypes[i].dmgNumPipsL = s->readSByte(); _itemTypes[i].dmgIncL = s->readSByte(); _itemTypes[i].unk1 = s->readByte(); - _itemTypes[i].extraProperties = s->readUint16LE(); + _itemTypes[i].extraProperties = s->readUint16(); } delete s; |