- 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
This commit is contained in:
Johannes Schickel 2009-08-10 16:42:39 +00:00
parent fe7453be1c
commit 091ecc8fd0
4 changed files with 20 additions and 6 deletions

Binary file not shown.

View File

@ -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;

View File

@ -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 },

View File

@ -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;
}