diff options
author | Johannes Schickel | 2009-08-10 16:42:39 +0000 |
---|---|---|
committer | Johannes Schickel | 2009-08-10 16:42:39 +0000 |
commit | 091ecc8fd09b302e9a0c86375f9b848a576700f3 (patch) | |
tree | ddaeecd13202f3c928f0c3c32515ead49ce39969 | |
parent | fe7453be1c32b6187706a6be70a0dbbe4edb3e02 (diff) | |
download | scummvm-rg350-091ecc8fd09b302e9a0c86375f9b848a576700f3.tar.gz scummvm-rg350-091ecc8fd09b302e9a0c86375f9b848a576700f3.tar.bz2 scummvm-rg350-091ecc8fd09b302e9a0c86375f9b848a576700f3.zip |
- Fix extraction of Kyra 1 amiga string tables in kyra.dat
- Fix "taken" string offsets in kyra.dat
- Add temporary workaround for only one "taken" string being present in Kyra 1 amiga.
- Update kyra.dat
svn-id: r43208
-rw-r--r-- | dists/engine-data/kyra.dat | bin | 257551 -> 257322 bytes | |||
-rw-r--r-- | engines/kyra/gui_lok.cpp | 6 | ||||
-rw-r--r-- | tools/create_kyradat/amiga.h | 2 | ||||
-rw-r--r-- | tools/create_kyradat/create_kyradat.cpp | 18 |
4 files changed, 20 insertions, 6 deletions
diff --git a/dists/engine-data/kyra.dat b/dists/engine-data/kyra.dat Binary files differindex 7911a2e549..c945b7863b 100644 --- a/dists/engine-data/kyra.dat +++ b/dists/engine-data/kyra.dat diff --git a/engines/kyra/gui_lok.cpp b/engines/kyra/gui_lok.cpp index 6878f00d7b..98596807fd 100644 --- a/engines/kyra/gui_lok.cpp +++ b/engines/kyra/gui_lok.cpp @@ -71,7 +71,11 @@ int KyraEngine_LoK::buttonInventoryCallback(Button *caller) { _screen->fillRect(_itemPosX[itemOffset], _itemPosY[itemOffset], _itemPosX[itemOffset] + 15, _itemPosY[itemOffset] + 15, _flags.platform == Common::kPlatformAmiga ? 19 : 12); _screen->drawShape(0, _shapes[216+_itemInHand], _itemPosX[itemOffset], _itemPosY[itemOffset], 0, 0); setMouseItem(inventoryItem); - updateSentenceCommand(_itemList[inventoryItem], _takenList[1], 179); + // TODO: Proper support for both taken strings in Amiga version + if (_flags.platform == Common::kPlatformAmiga) + updateSentenceCommand(_itemList[inventoryItem], _takenList[0], 179); + else + updateSentenceCommand(_itemList[inventoryItem], _takenList[1], 179); _screen->showMouse(); _currentCharacter->inventoryItems[itemOffset] = _itemInHand; _itemInHand = inventoryItem; diff --git a/tools/create_kyradat/amiga.h b/tools/create_kyradat/amiga.h index 26fcddf614..4dbc404d28 100644 --- a/tools/create_kyradat/amiga.h +++ b/tools/create_kyradat/amiga.h @@ -14,7 +14,7 @@ const ExtractEntry kyra1AmigaEng[] = { { kCharacterImageFilenames, 0x0000C814, 0x0000C904 }, { kDefaultShapes, 0x00039230, 0x000396BA }, { kItemNames, 0x0001A3B8, 0x0001A738 }, - { kTakenStrings, 0x0000F9F4, 0x0000FAF0 }, + { kTakenStrings, 0x0000FAE8, 0x0000FAF0 }, { kPlacedStrings, 0x0000FAF0, 0x0000FAFA }, { kDroppedStrings, 0x000101F2, 0x000101FC }, { kNoDropStrings, 0x0000C98E, 0x0000C9D6 }, diff --git a/tools/create_kyradat/create_kyradat.cpp b/tools/create_kyradat/create_kyradat.cpp index ead0c232b1..2e53efbaff 100644 --- a/tools/create_kyradat/create_kyradat.cpp +++ b/tools/create_kyradat/create_kyradat.cpp @@ -498,7 +498,11 @@ bool extractStrings(PAKFile &out, const Game *g, const byte *data, const uint32 for (uint32 i = 0; i < size; ++i) { if (!data[i]) { if (g->special == kAmigaVersion) { - if (!((i + 1) & 0x1)) + if (i + 1 >= size) + ++entries; + else if (!data[i+1]) + continue; + else ++entries; } else { ++entries; @@ -554,6 +558,7 @@ bool extractStrings(PAKFile &out, const Game *g, const byte *data, const uint32 uint8 *buffer = new uint8[targetsize]; assert(buffer); + memset(buffer, 0, targetsize); uint8 *output = buffer; const uint8 *input = (const uint8*) data; @@ -561,7 +566,7 @@ bool extractStrings(PAKFile &out, const Game *g, const byte *data, const uint32 if (g->special == kFMTownsVersionE || g->special == kFMTownsVersionJ || g->special == k2TownsFile1E || g->special == k2TownsFile1J || g->special == k2TownsFile2E || g->special == k2TownsFile2J || fmtPatch == 5) { - const byte * c = data + size; + const byte *c = data + size; do { if (fmtPatch == 2 && input - data == 0x3C0 && input[0x10] == 0x32) { memcpy(output, input, 0x0F); @@ -611,8 +616,13 @@ bool extractStrings(PAKFile &out, const Game *g, const byte *data, const uint32 // we need to strip some aligment zeros out here int dstPos = 0; for (uint32 i = 0; i < size; ++i) { - if (!data[i] && ((i+1) & 0x1)) - continue; + if (!data[i]) { + if (i + 1 > size) + continue; + else if (i + 1 < size && !data[i+1]) + continue; + } + *output++ = data[i]; ++dstPos; } |