[Scummvm-git-logs] scummvm master -> 468cb5406e824b70a4c9395cd305a04c3eaf98dc

bluegr noreply at scummvm.org
Mon Dec 5 06:15:42 UTC 2022


This automated email contains information about 15 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
0a82b83344 SAGA: Support amiga floppy uncompressed resources
b08c6ab7b4 SAGA: Support creating ByteArray from plain array
82fbf0f6e4 SAGA: Support embed Amiga font
ef7a3059e1 COMMON: Uplift powerpacker as it's used by Amiga ITE as well
2db745b62b COMMON: Add in-memory decompressor for powerpack
279f4ac5b8 COMMON: Add ITE Amiga powerpack support
4030541bc9 SAGA: Add powerpacker compressed background
a173ca1b31 SAGA: Support crunched resources
c81b7559c2 SAGA: Support missing intro anim
30910cce15 SAGA: Add entry for ite german floppy
f441633978 SAGA: Add AGA German CD demo
6ace00cba7 SAGA: Add German ECS CD demo
2ae17bf6f6 SAGA: Don't attempt to load invalid animations
c47ef4d956 SAGA: Show intro in Wyrmkeep ITE Amiga version
468cb5406e SAGA: Remove now unused INTROLIST_ITE_AMIGA_ENGLISH_AGA_CD


Commit: 0a82b83344dcd5ec33070f46214b6649bf4cf81d
    https://github.com/scummvm/scummvm/commit/0a82b83344dcd5ec33070f46214b6649bf4cf81d
Author: Vladimir Serbinenko (phcoder at gmail.com)
Date: 2022-12-05T08:15:33+02:00

Commit Message:
SAGA: Support amiga floppy uncompressed resources

Changed paths:
    engines/saga/resource.cpp
    engines/saga/resource.h


diff --git a/engines/saga/resource.cpp b/engines/saga/resource.cpp
index 2c6bce59d77..7ccd3b159b6 100644
--- a/engines/saga/resource.cpp
+++ b/engines/saga/resource.cpp
@@ -96,11 +96,12 @@ static const GamePatchDescription *PatchLists[PATCHLIST_MAX] = {
 	/* PATCHLIST_ITE_MAC */ ITEMacPatch_Files
 };
 
-bool ResourceContext::loadResIteAmiga(uint32 contextOffset, uint32 contextSize, int type) {
+bool ResourceContext::loadResIteAmiga(uint32 contextOffset, uint32 contextSize, int type, bool isFloppy) {
 	_file.seek(contextOffset);
 	uint16 resourceCount = _file.readUint16BE();
 	uint16 scriptCount = _file.readUint16BE();
 	uint32 count = (type &  GAME_SCRIPTFILE) ? scriptCount : resourceCount;
+	uint32 extraOffset = isFloppy ? 1024 : 0;
 
 	if (type &  GAME_SCRIPTFILE)
 		_file.seek(resourceCount * 10, SEEK_CUR);
@@ -109,7 +110,7 @@ bool ResourceContext::loadResIteAmiga(uint32 contextOffset, uint32 contextSize,
 
 	for (uint32 i = 0; i < count; i++) {
 		ResourceData *resourceData = &_table[i];
-		resourceData->offset = _file.readUint32BE();
+		resourceData->offset = _file.readUint32BE() + extraOffset;
 		resourceData->size = _file.readUint32BE();
 		resourceData->diskNum = _file.readUint16BE();
 	}
@@ -412,7 +413,10 @@ void Resource::loadResource(ResourceContext *context, uint32 resourceId, ByteArr
 			sz--;
 		if (sz > 0)
 			sz--;
-		fileName = Common::String::format("%s.%03d", fileName.substr(0, sz).c_str(), resourceData->diskNum);
+		if (_vm->getFeatures() & GF_ITE_FLOPPY)
+			fileName = Common::String::format("%s%02d.adf", fileName.substr(0, sz).c_str(), resourceData->diskNum + 1);
+		else
+			fileName = Common::String::format("%s.%03d", fileName.substr(0, sz).c_str(), resourceData->diskNum);
 		if (!file->open(fileName))
 			error("Resource::loadResource() failed to open %s", fileName.c_str());
 	}
diff --git a/engines/saga/resource.h b/engines/saga/resource.h
index b583a78d481..86efdb70a07 100644
--- a/engines/saga/resource.h
+++ b/engines/saga/resource.h
@@ -135,7 +135,7 @@ protected:
 
 	bool load(SagaEngine *_vm, Resource *resource);
 	bool loadResV1(uint32 contextOffset, uint32 contextSize);
-	bool loadResIteAmiga(uint32 contextOffset, uint32 contextSize, int type);
+	bool loadResIteAmiga(uint32 contextOffset, uint32 contextSize, int type, bool isFloppy);
 
 	virtual bool loadMacMIDI() { return false; }
 	virtual bool loadRes(uint32 contextOffset, uint32 contextSize, int type) = 0;
@@ -202,10 +202,15 @@ protected:
 };
 
 class ResourceContext_RSC_ITE_Amiga: public ResourceContext {
+public:
+	ResourceContext_RSC_ITE_Amiga(bool isFloppy) : _isFloppy(isFloppy) {}
+
 protected:
 	bool loadRes(uint32 contextOffset, uint32 contextSize, int type) override {
-		return loadResIteAmiga(contextOffset, contextSize, type);
+		return loadResIteAmiga(contextOffset, contextSize, type, _isFloppy);
 	}
+
+	bool _isFloppy;
 };
 
 class Resource_RSC : public Resource {
@@ -222,7 +227,7 @@ public:
 protected:
 	ResourceContext *createContext() override {
 		if (_vm->getPlatform() == Common::kPlatformAmiga && _vm->getGameId() == GID_ITE)
-			return new ResourceContext_RSC_ITE_Amiga();
+			return new ResourceContext_RSC_ITE_Amiga(_vm->getFeatures() & GF_ITE_FLOPPY);
 		return new ResourceContext_RSC();
 	}
 };


Commit: b08c6ab7b445e87c804649d2977dae51ac30ea5e
    https://github.com/scummvm/scummvm/commit/b08c6ab7b445e87c804649d2977dae51ac30ea5e
Author: Vladimir Serbinenko (phcoder at gmail.com)
Date: 2022-12-05T08:15:33+02:00

Commit Message:
SAGA: Support creating ByteArray from plain array

Changed paths:
    engines/saga/saga.h


diff --git a/engines/saga/saga.h b/engines/saga/saga.h
index 7abb0774d2d..0e33e8354b5 100644
--- a/engines/saga/saga.h
+++ b/engines/saga/saga.h
@@ -403,6 +403,9 @@ public:
 			memcpy(&front(), &src.front(), size());
 		}
 	}
+
+	ByteArray() : Common::Array<byte>() {}
+	ByteArray(const byte *array, size_type n) : Common::Array<byte>(array, n) {}
 };
 
 class ByteArrayReadStreamEndian : public Common::MemoryReadStreamEndian {


Commit: 82fbf0f6e4b92f1eaf05c942304033ef2496c33f
    https://github.com/scummvm/scummvm/commit/82fbf0f6e4b92f1eaf05c942304033ef2496c33f
Author: Vladimir Serbinenko (phcoder at gmail.com)
Date: 2022-12-05T08:15:33+02:00

Commit Message:
SAGA: Support embed Amiga font

Changed paths:
  A engines/saga/ite8.h
  A engines/saga/small8.h
    engines/saga/detection.h
    engines/saga/font.cpp
    engines/saga/font.h


diff --git a/engines/saga/detection.h b/engines/saga/detection.h
index f96d4bf8f92..df4fc265430 100644
--- a/engines/saga/detection.h
+++ b/engines/saga/detection.h
@@ -40,7 +40,8 @@ enum GameFeatures {
 	GF_SOME_MAC_RESOURCES= 1 << 5,
 	GF_AGA_GRAPHICS      = 1 << 6,
 	GF_ECS_GRAPHICS      = 1 << 7,
-	GF_INSTALLER         = 1 << 8
+	GF_INSTALLER         = 1 << 8,
+	GF_EMBED_FONT        = 1 << 9,
 };
 
 enum GameFileTypes {
diff --git a/engines/saga/font.cpp b/engines/saga/font.cpp
index 2b2503fc66d..a9bd26a8ed8 100644
--- a/engines/saga/font.cpp
+++ b/engines/saga/font.cpp
@@ -31,6 +31,9 @@
 #include "graphics/sjis.h"
 #include "common/unicode-bidi.h"
 
+#include "saga/ite8.h"
+#include "saga/small8.h"
+
 namespace Saga {
 
 static const GameFontDescription ITEDEMO_GameFonts[]    = { {0}, {1} };
@@ -165,18 +168,18 @@ void Font::textDraw(FontId fontId, const char *text, const Common::Point &point,
 }
 
 DefaultFont::DefaultFont(SagaEngine *vm) : Font(vm), _fontMapping(0), _chineseFont(nullptr), _cjkFontWidth(0), _cjkFontHeight(0), _koreanFont(nullptr) {
-	uint i;
+	int i;
 
 	// Load font module resource context
 
 	GameFontList index = _vm->getFontList();
-	assert(index < FONTLIST_MAX && index > FONTLIST_NONE);
-	assert(FontLists[index].list);
-	assert(FontLists[index].count > 0);
+	assert(index < FONTLIST_MAX && index >= FONTLIST_NONE);
+	assert(FontLists[index].list || FontLists[index].count == 0);
+	assert(FontLists[index].count > 0 || (_vm->getFeatures() & GF_EMBED_FONT));
 
-	_fonts.resize(FontLists[index].count);
+	_fonts.resize(MAX<int>(FontLists[index].count, (_vm->getFeatures() & GF_EMBED_FONT) ? 2 : 0));
 
-	for (i = 0; i < _fonts.size(); i++) {
+	for (i = 0; i < FontLists[index].count; i++) {
 #ifdef __DS__
 		_fonts[i].outline.font = NULL;
 		_fonts[i].normal.font = NULL;
@@ -187,6 +190,11 @@ DefaultFont::DefaultFont(SagaEngine *vm) : Font(vm), _fontMapping(0), _chineseFo
 			loadFont(&_fonts[i], FontLists[index].list[i].fontResourceId);
 	}
 
+	if (_vm->getFeatures() & GF_EMBED_FONT) {
+		loadFont(&_fonts[kSmallFont], ByteArray(font_small8, sizeof(font_small8)), true);
+		loadFont(&_fonts[kMediumFont], ByteArray(font_ite8, sizeof(font_ite8)), true);
+	}
+
 	if (_vm->getGameId() == GID_ITE && _vm->getLanguage() == Common::ZH_TWN)
 		loadChineseFontITE("ite.fnt");
 
@@ -854,8 +862,6 @@ void DefaultFont::outFont(const FontStyle &drawFont, const char *text, size_t co
 
 void DefaultFont::loadFont(FontData *font, uint32 fontResourceId) {
 	ByteArray fontResourceData;
-	int numBits;
-	int c;
 	ResourceContext *fontContext;
 
 	debug(1, "Font::loadFont(): Reading fontResourceId %d...", fontResourceId);
@@ -868,11 +874,18 @@ void DefaultFont::loadFont(FontData *font, uint32 fontResourceId) {
 	// Load font resource
 	_vm->_resource->loadResource(fontContext, fontResourceId, fontResourceData);
 
+	loadFont(font, fontResourceData, fontContext->isBigEndian());
+}
+
+void DefaultFont::loadFont(FontData *font, const ByteArray& fontResourceData, bool isBigEndian) {
+	int numBits;
+	int c;
+
 	if (fontResourceData.size() < FONT_DESCSIZE) {
 		error("DefaultFont::loadFont() Invalid font length (%i < %i)", (int)fontResourceData.size(), FONT_DESCSIZE);
 	}
 
-	ByteArrayReadStreamEndian readS(fontResourceData, fontContext->isBigEndian());
+	ByteArrayReadStreamEndian readS(fontResourceData, isBigEndian);
 
 	// Read font header
 	font->normal.header.charHeight = readS.readUint16();
diff --git a/engines/saga/font.h b/engines/saga/font.h
index 04334a13834..4ca407aac60 100644
--- a/engines/saga/font.h
+++ b/engines/saga/font.h
@@ -237,6 +237,7 @@ class DefaultFont : public Font {
 	 void draw(FontId fontId, const char *text, size_t count, const Common::Point &point, int color, int effectColor, FontEffectFlags flags) override;
 	 void outFont(const FontStyle &drawFont, const char *text, size_t count, const Common::Point &point, int color, FontEffectFlags flags);
 	 void loadFont(FontData *font, uint32 fontResourceId);
+	 void loadFont(FontData *font, const ByteArray& fontResourceData, bool isBigEndian);
 	 void loadChineseFontIHNM(FontData *font, uint32 fontResourceId);
 	 void loadChineseFontITE(const Common::String& fileName);
 	 void loadKoreanFontIHNM(const Common::String& fileName);
diff --git a/engines/saga/ite8.h b/engines/saga/ite8.h
new file mode 100644
index 00000000000..ecaa499f6ba
--- /dev/null
+++ b/engines/saga/ite8.h
@@ -0,0 +1,351 @@
+static byte font_ite8[] = {
+0x00, 0x08, 0x00, 0x07, 0x00, 0xbc, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x03, 
+0x00, 0x04, 0x00, 0x05, 0x00, 0x06, 0x00, 0x07, 
+0x00, 0x08, 0x00, 0x09, 0x00, 0x0a, 0x00, 0x0b, 
+0x00, 0x0c, 0x00, 0x0d, 0x00, 0x0e, 0x00, 0x0f, 
+0x00, 0x10, 0x00, 0x11, 0x00, 0x12, 0x00, 0x13, 
+0x00, 0x14, 0x00, 0x15, 0x00, 0x16, 0x00, 0x17, 
+0x00, 0x18, 0x00, 0x19, 0x00, 0x1a, 0x00, 0x1b, 
+0x00, 0x1c, 0x00, 0x1d, 0x00, 0x1e, 0x00, 0x1f, 
+0x00, 0x20, 0x00, 0x22, 0x00, 0x23, 0x00, 0x24, 
+0x00, 0x26, 0x00, 0x27, 0x00, 0x28, 0x00, 0x29, 
+0x00, 0x2a, 0x00, 0x2b, 0x00, 0x2c, 0x00, 0x2d, 
+0x00, 0x2f, 0x00, 0x31, 0x00, 0x33, 0x00, 0x34, 
+0x00, 0x35, 0x00, 0x36, 0x00, 0x38, 0x00, 0x39, 
+0x00, 0x3a, 0x00, 0x3b, 0x00, 0x3d, 0x00, 0x3f, 
+0x00, 0x41, 0x00, 0x43, 0x00, 0x44, 0x00, 0x45, 
+0x00, 0x46, 0x00, 0x47, 0x00, 0x48, 0x00, 0x49, 
+0x00, 0x4a, 0x00, 0x4b, 0x00, 0x4c, 0x00, 0x4d, 
+0x00, 0x4e, 0x00, 0x4f, 0x00, 0x50, 0x00, 0x51, 
+0x00, 0x52, 0x00, 0x53, 0x00, 0x54, 0x00, 0x55, 
+0x00, 0x56, 0x00, 0x58, 0x00, 0x59, 0x00, 0x5a, 
+0x00, 0x5b, 0x00, 0x5c, 0x00, 0x5d, 0x00, 0x5e, 
+0x00, 0x5f, 0x00, 0x60, 0x00, 0x61, 0x00, 0x63, 
+0x00, 0x64, 0x00, 0x65, 0x00, 0x66, 0x00, 0x67, 
+0x00, 0x68, 0x00, 0x69, 0x00, 0x6a, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x6b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x6c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x6e, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x71, 0x00, 0x72, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x73, 0x00, 0x74, 
+0x00, 0x76, 0x00, 0x78, 0x00, 0x7a, 0x00, 0x7c, 
+0x00, 0x7e, 0x00, 0x80, 0x00, 0x82, 0x00, 0x83, 
+0x00, 0x84, 0x00, 0x85, 0x00, 0x86, 0x00, 0x87, 
+0x00, 0x88, 0x00, 0x89, 0x00, 0x8a, 0x00, 0x8b, 
+0x00, 0x8d, 0x00, 0x8f, 0x00, 0x90, 0x00, 0x91, 
+0x00, 0x92, 0x00, 0x93, 0x00, 0x94, 0x00, 0x96, 
+0x00, 0x97, 0x00, 0x98, 0x00, 0x99, 0x00, 0x9a, 
+0x00, 0x9b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9c, 
+0x00, 0x9d, 0x00, 0x9e, 0x00, 0x9f, 0x00, 0xa0, 
+0x00, 0xa1, 0x00, 0xa2, 0x00, 0xa4, 0x00, 0xa5, 
+0x00, 0xa6, 0x00, 0xa7, 0x00, 0xa8, 0x00, 0xa9, 
+0x00, 0xaa, 0x00, 0xab, 0x00, 0xac, 0x00, 0xad, 
+0x00, 0xae, 0x00, 0xaf, 0x00, 0xb0, 0x00, 0xb1, 
+0x00, 0xb2, 0x00, 0xb3, 0x00, 0x00, 0x00, 0xb4, 
+0x00, 0xb5, 0x00, 0xb6, 0x00, 0xb7, 0x00, 0xb8, 
+0x00, 0xb9, 0x00, 0x00, 0x00, 0xba, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 
+0x07, 0x07, 0x07, 0x06, 0x07, 0x03, 0x05, 0x04, 
+0x07, 0x06, 0x03, 0x06, 0x03, 0x06, 0x07, 0x05, 
+0x07, 0x07, 0x08, 0x07, 0x07, 0x07, 0x07, 0x07, 
+0x02, 0x03, 0x04, 0x04, 0x04, 0x07, 0x07, 0x09, 
+0x08, 0x07, 0x09, 0x08, 0x08, 0x07, 0x08, 0x06, 
+0x07, 0x08, 0x0a, 0x0a, 0x09, 0x08, 0x08, 0x08, 
+0x09, 0x07, 0x08, 0x08, 0x09, 0x0b, 0x0a, 0x09, 
+0x08, 0x04, 0x06, 0x04, 0x06, 0x06, 0x04, 0x08, 
+0x08, 0x06, 0x08, 0x07, 0x06, 0x07, 0x08, 0x03, 
+0x05, 0x08, 0x03, 0x0a, 0x07, 0x07, 0x07, 0x08, 
+0x07, 0x06, 0x06, 0x08, 0x07, 0x0a, 0x08, 0x08, 
+0x07, 0x04, 0x02, 0x04, 0x06, 0x04, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 
+0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x04, 0x00, 0x00, 0x04, 0x04, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x09, 0x09, 
+0x09, 0x09, 0x09, 0x0a, 0x0c, 0x07, 0x08, 0x08, 
+0x08, 0x08, 0x06, 0x06, 0x06, 0x06, 0x09, 0x09, 
+0x08, 0x08, 0x08, 0x08, 0x08, 0x09, 0x08, 0x08, 
+0x08, 0x08, 0x08, 0x08, 0x00, 0x00, 0x08, 0x08, 
+0x08, 0x08, 0x08, 0x08, 0x0b, 0x06, 0x07, 0x07, 
+0x07, 0x07, 0x03, 0x03, 0x03, 0x03, 0x08, 0x07, 
+0x07, 0x07, 0x07, 0x07, 0x07, 0x00, 0x07, 0x08, 
+0x08, 0x08, 0x08, 0x08, 0x00, 0x08, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x04, 
+0x04, 0x07, 0x08, 0x07, 0x08, 0x04, 0x05, 0x05, 
+0x08, 0x07, 0x04, 0x07, 0x05, 0x07, 0x08, 0x05, 
+0x08, 0x08, 0x09, 0x08, 0x08, 0x08, 0x08, 0x08, 
+0x03, 0x04, 0x05, 0x05, 0x05, 0x08, 0x08, 0x0a, 
+0x09, 0x08, 0x0a, 0x09, 0x09, 0x08, 0x09, 0x07, 
+0x08, 0x09, 0x09, 0x0b, 0x0a, 0x09, 0x09, 0x09, 
+0x09, 0x08, 0x09, 0x09, 0x09, 0x0c, 0x0b, 0x0a, 
+0x09, 0x05, 0x06, 0x05, 0x06, 0x07, 0x05, 0x09, 
+0x09, 0x07, 0x09, 0x08, 0x07, 0x08, 0x09, 0x04, 
+0x06, 0x09, 0x04, 0x0b, 0x08, 0x08, 0x08, 0x09, 
+0x08, 0x07, 0x07, 0x09, 0x08, 0x0b, 0x09, 0x09, 
+0x07, 0x05, 0x03, 0x05, 0x07, 0x04, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 
+0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x05, 0x00, 0x00, 0x05, 0x03, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x0a, 0x0a, 
+0x0a, 0x0a, 0x0a, 0x0a, 0x0d, 0x08, 0x09, 0x09, 
+0x09, 0x09, 0x07, 0x07, 0x07, 0x07, 0x0a, 0x09, 
+0x09, 0x09, 0x09, 0x09, 0x09, 0x00, 0x09, 0x09, 
+0x09, 0x09, 0x09, 0x09, 0x00, 0x00, 0x09, 0x09, 
+0x09, 0x09, 0x09, 0x09, 0x0b, 0x07, 0x08, 0x08, 
+0x08, 0x08, 0x04, 0x04, 0x04, 0x04, 0x09, 0x08, 
+0x08, 0x08, 0x08, 0x08, 0x08, 0x00, 0x08, 0x08, 
+0x08, 0x08, 0x08, 0x09, 0x00, 0x09, 0xc0, 0xa0, 
+0x00, 0x78, 0xc4, 0x38, 0x60, 0x30, 0xc0, 0x6c, 
+0x00, 0x00, 0x00, 0x00, 0x04, 0x7c, 0x20, 0x7c, 
+0x7c, 0x0e, 0xfe, 0x3c, 0xfe, 0x7c, 0x7c, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x7c, 0x7c, 0x0f, 0x80, 
+0xfe, 0x7c, 0xfe, 0x00, 0xff, 0xff, 0x7c, 0xe3, 
+0x78, 0x06, 0xe3, 0xe0, 0x00, 0xe1, 0xc0, 0xe3, 
+0x00, 0x7e, 0xfe, 0x7e, 0xfe, 0x00, 0x7c, 0x7f, 
+0xc6, 0xe7, 0x00, 0xc0, 0xc0, 0xe3, 0x80, 0xe3, 
+0x80, 0x7f, 0xf0, 0xc0, 0xf0, 0x20, 0x00, 0xe0, 
+0x00, 0xe0, 0x00, 0x06, 0x00, 0x3c, 0x00, 0xe0, 
+0xc0, 0x18, 0xe0, 0xc0, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x30, 0xc0, 0xc0, 0x6c, 
+0xa0, 0xc0, 0x3e, 0x00, 0xfd, 0x8c, 0x00, 0x00, 
+0x00, 0x18, 0x0c, 0x00, 0x01, 0x80, 0x02, 0x00, 
+0x06, 0x80, 0x0d, 0x80, 0x06, 0x00, 0x0f, 0xf0, 
+0x7c, 0x30, 0x0c, 0x08, 0x36, 0x60, 0x18, 0x20, 
+0xcc, 0xfe, 0x00, 0x39, 0x00, 0x30, 0x0c, 0x08, 
+0x32, 0x66, 0x00, 0x00, 0x7d, 0x30, 0x0c, 0x08, 
+0x36, 0x0c, 0x60, 0x0c, 0x10, 0x32, 0x6c, 0x38, 
+0x00, 0x00, 0x00, 0x30, 0x18, 0x10, 0x6c, 0x80, 
+0x40, 0x40, 0xa0, 0x06, 0x32, 0x60, 0x0c, 0x10, 
+0x32, 0x6c, 0x00, 0x30, 0x0c, 0x10, 0x66, 0x0c, 
+0x66, 0x00, 0xc0, 0xa0, 0x48, 0xc6, 0xcc, 0x68, 
+0x60, 0x60, 0x60, 0x38, 0x30, 0x00, 0x00, 0x00, 
+0x0c, 0xc6, 0xe0, 0xc6, 0xc6, 0x1e, 0xc0, 0x60, 
+0x06, 0xc6, 0xc6, 0xc0, 0x60, 0x30, 0x00, 0xc0, 
+0xc6, 0xc6, 0x1b, 0x00, 0x63, 0xc6, 0x63, 0x00, 
+0x63, 0x63, 0xc6, 0x63, 0xb0, 0x06, 0x66, 0x60, 
+0x00, 0x73, 0xc0, 0x71, 0x80, 0xc3, 0x63, 0xc3, 
+0x63, 0x00, 0xc6, 0x98, 0x63, 0x63, 0x00, 0x60, 
+0x60, 0x33, 0x00, 0x33, 0x00, 0xc6, 0xc0, 0xc0, 
+0x30, 0x70, 0x00, 0x60, 0x00, 0x60, 0x00, 0x06, 
+0x00, 0x60, 0x00, 0x60, 0x00, 0x00, 0x60, 0xc0, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x60, 0xc0, 0x60, 0xd8, 0x50, 0x00, 0x41, 0x00, 
+0x31, 0xdc, 0x00, 0x60, 0x00, 0x00, 0x02, 0x00, 
+0x02, 0x00, 0x05, 0x00, 0x0b, 0x00, 0x00, 0x00, 
+0x09, 0x00, 0x1b, 0x30, 0xc6, 0x08, 0x10, 0x14, 
+0x00, 0x10, 0x20, 0x50, 0x00, 0x63, 0x00, 0x4e, 
+0x00, 0x08, 0x10, 0x14, 0x4c, 0x00, 0x00, 0x00, 
+0xc6, 0x18, 0x18, 0x14, 0x00, 0x10, 0x10, 0x10, 
+0x28, 0x4c, 0x00, 0x44, 0x00, 0x00, 0x00, 0x08, 
+0x20, 0x28, 0x00, 0x40, 0x80, 0xa0, 0x00, 0x1f, 
+0x4c, 0x10, 0x10, 0x28, 0x4c, 0x00, 0x00, 0x08, 
+0x10, 0x28, 0x00, 0x18, 0x00, 0x00, 0xc0, 0x00, 
+0xfc, 0xc6, 0x18, 0x68, 0xc0, 0xc0, 0x30, 0xfe, 
+0x30, 0x00, 0x00, 0x00, 0x18, 0xc6, 0x60, 0x06, 
+0x06, 0x36, 0xfc, 0xc0, 0x06, 0xc6, 0xc6, 0xc0, 
+0x60, 0x60, 0xf0, 0x60, 0x06, 0xde, 0x33, 0x00, 
+0x7e, 0xc0, 0x61, 0x80, 0x60, 0x60, 0xc0, 0x63, 
+0x30, 0x06, 0x6c, 0x60, 0x00, 0x6e, 0xc0, 0x79, 
+0x80, 0xc3, 0x7e, 0xc3, 0x7e, 0x00, 0x60, 0x18, 
+0x63, 0x62, 0x00, 0x60, 0x60, 0x1e, 0x00, 0x1e, 
+0x00, 0x0c, 0xc0, 0x60, 0x30, 0x98, 0x00, 0x30, 
+0x7c, 0x6e, 0x78, 0x76, 0x7c, 0xf8, 0x7a, 0x7e, 
+0xc0, 0x18, 0x66, 0xc0, 0x77, 0x80, 0xbc, 0x7c, 
+0xbc, 0x7a, 0xbc, 0x7c, 0x7c, 0x66, 0xe6, 0xc1, 
+0x80, 0xe3, 0xc7, 0xfc, 0x60, 0xc0, 0x60, 0x00, 
+0xa0, 0xc0, 0x9c, 0x80, 0x31, 0xac, 0x00, 0xf0, 
+0x00, 0x18, 0x0f, 0x80, 0x0f, 0x80, 0x0f, 0x80, 
+0x0f, 0x80, 0x0f, 0x80, 0x0e, 0x00, 0x33, 0x00, 
+0xc0, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78, 
+0x78, 0x61, 0x80, 0xf3, 0x00, 0x7e, 0x7e, 0x7e, 
+0x7e, 0x7e, 0x00, 0x00, 0xc7, 0xc3, 0xc3, 0xc3, 
+0xc3, 0xe7, 0x7c, 0x7c, 0x7c, 0x7c, 0x7c, 0x7c, 
+0x7f, 0x80, 0x78, 0x7c, 0x7c, 0x7c, 0x7c, 0xc0, 
+0xc0, 0x00, 0xc0, 0x06, 0x00, 0x7c, 0x7c, 0x7c, 
+0x7c, 0x7c, 0x7a, 0x46, 0x66, 0x66, 0x66, 0xc3, 
+0xc7, 0x00, 0xc0, 0x00, 0x48, 0xf8, 0x30, 0x36, 
+0x00, 0xc0, 0x30, 0x38, 0xfc, 0x00, 0xfc, 0x00, 
+0x30, 0xc6, 0x60, 0x1c, 0x1c, 0x66, 0x06, 0xfc, 
+0x0c, 0x7c, 0x7e, 0x00, 0x00, 0xc0, 0x00, 0x30, 
+0x1c, 0xd6, 0x3f, 0x00, 0x63, 0xc0, 0x61, 0x80, 
+0x7c, 0x78, 0xce, 0x7f, 0x30, 0x06, 0x78, 0x60, 
+0x00, 0x64, 0xc0, 0x6d, 0x80, 0xc3, 0x60, 0xc3, 
+0x6c, 0x00, 0x18, 0x18, 0x63, 0x36, 0x00, 0x64, 
+0x60, 0x0c, 0x00, 0x0c, 0x00, 0x18, 0xc0, 0x60, 
+0x30, 0x00, 0x00, 0x00, 0xc6, 0x73, 0xc4, 0xce, 
+0xcc, 0x60, 0xc6, 0x63, 0xc0, 0x18, 0x68, 0xc0, 
+0xcc, 0xc0, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc0, 
+0xb0, 0xc6, 0xc6, 0xc0, 0xc0, 0x36, 0x63, 0x18, 
+0xc0, 0xc0, 0x30, 0x00, 0x50, 0xc0, 0xb0, 0x80, 
+0x31, 0x8c, 0x10, 0xf0, 0x00, 0x70, 0x13, 0x00, 
+0x13, 0x00, 0x13, 0x00, 0x13, 0x00, 0x13, 0x00, 
+0x13, 0x00, 0x3f, 0xe0, 0xc0, 0x63, 0x63, 0x63, 
+0x63, 0xb0, 0xb0, 0xb0, 0xb0, 0xf9, 0x80, 0x7b, 
+0x00, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0x00, 0x00, 
+0xcb, 0x63, 0x63, 0x63, 0x63, 0x3c, 0xc6, 0xc6, 
+0xc6, 0xc6, 0xc6, 0xc6, 0xcc, 0xc0, 0xc4, 0xcc, 
+0xcc, 0xcc, 0xcc, 0xc0, 0xc0, 0xc0, 0xc0, 0x76, 
+0xbc, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xce, 0xc6, 
+0xc6, 0xc6, 0xc6, 0x63, 0x63, 0x00, 0xc0, 0x00, 
+0xfc, 0xc6, 0x60, 0xdc, 0x00, 0xc0, 0x30, 0x6c, 
+0x30, 0x00, 0x00, 0x00, 0x60, 0xc6, 0x60, 0x60, 
+0x06, 0xff, 0x06, 0xc6, 0x18, 0xc6, 0x06, 0xc0, 
+0x60, 0x60, 0xf0, 0x60, 0x30, 0xdc, 0x63, 0x00, 
+0x63, 0xc0, 0x61, 0x80, 0x60, 0x60, 0xc6, 0x63, 
+0x30, 0x06, 0x78, 0x60, 0x00, 0x60, 0xc0, 0x67, 
+0x80, 0xc3, 0x60, 0xdb, 0x66, 0x00, 0x06, 0x18, 
+0x63, 0x34, 0x00, 0x64, 0x60, 0x1e, 0x00, 0x0c, 
+0x00, 0x30, 0xc0, 0x30, 0x30, 0x00, 0x00, 0x00, 
+0xc6, 0x63, 0xc0, 0xc6, 0xd8, 0x60, 0xc6, 0x63, 
+0xc0, 0x18, 0x78, 0xc0, 0xcc, 0xc0, 0xc6, 0xc6, 
+0xe6, 0xce, 0xc0, 0x78, 0x30, 0xc6, 0x66, 0xcc, 
+0xc0, 0x18, 0x36, 0x30, 0x60, 0xc0, 0x60, 0x00, 
+0xa0, 0xc0, 0xb0, 0x80, 0x00, 0x00, 0x30, 0x60, 
+0x00, 0xc0, 0x3f, 0x00, 0x3f, 0x00, 0x3f, 0x00, 
+0x3f, 0x00, 0x3f, 0x00, 0x3f, 0x00, 0x63, 0x00, 
+0xc0, 0x78, 0x78, 0x78, 0x78, 0x30, 0x30, 0x30, 
+0x30, 0x61, 0x80, 0x6f, 0x00, 0xc3, 0xc3, 0xc3, 
+0xc3, 0xc3, 0x00, 0x00, 0xd3, 0x63, 0x63, 0x63, 
+0x63, 0x18, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 
+0xcf, 0xc0, 0xc0, 0xd8, 0xd8, 0xd8, 0xd8, 0xc0, 
+0xc0, 0xc0, 0xc0, 0xce, 0xc6, 0xc6, 0xc6, 0xc6, 
+0xc6, 0xc6, 0xd6, 0xc6, 0xc6, 0xc6, 0xc6, 0x36, 
+0x36, 0x00, 0x00, 0x00, 0x48, 0xc6, 0xcc, 0xcc, 
+0x00, 0x60, 0x60, 0x00, 0x30, 0x60, 0x00, 0x60, 
+0xc0, 0xc6, 0x60, 0xc6, 0xc6, 0x06, 0xc6, 0xc6, 
+0x30, 0xc6, 0x0c, 0xc0, 0x60, 0x30, 0x00, 0xc0, 
+0x00, 0xc0, 0x63, 0x00, 0x63, 0xc0, 0x63, 0x00, 
+0x63, 0x60, 0xc6, 0x63, 0x34, 0xc6, 0x6c, 0x63, 
+0x00, 0x60, 0xc0, 0x63, 0x80, 0xc3, 0x60, 0xcf, 
+0x63, 0x00, 0xc6, 0x18, 0x63, 0x1c, 0x00, 0x66, 
+0x60, 0x33, 0x00, 0x0c, 0x00, 0x63, 0xc0, 0x30, 
+0x30, 0x00, 0x00, 0x00, 0xc6, 0x63, 0xc0, 0xc6, 
+0xe2, 0x60, 0x7c, 0x63, 0xc0, 0x18, 0x6c, 0xc0, 
+0xc0, 0xc0, 0xc6, 0xc6, 0xdc, 0x76, 0xc0, 0x0c, 
+0x30, 0xc6, 0x36, 0xcc, 0xc0, 0x6c, 0x1c, 0x60, 
+0x60, 0xc0, 0x60, 0x00, 0x50, 0xc0, 0x9c, 0x80, 
+0x00, 0x00, 0x60, 0x00, 0x00, 0xc6, 0x63, 0x00, 
+0x63, 0x00, 0x63, 0x00, 0x63, 0x00, 0x63, 0x00, 
+0x63, 0x00, 0x63, 0x30, 0xc0, 0x63, 0x63, 0x63, 
+0x63, 0x34, 0x34, 0x34, 0x34, 0x63, 0x00, 0x67, 
+0x00, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0x00, 0x00, 
+0x63, 0x63, 0x63, 0x63, 0x63, 0x18, 0xc6, 0xc6, 
+0xc6, 0xc6, 0xc6, 0xc6, 0xdc, 0x00, 0xc0, 0xe2, 
+0xe2, 0xe2, 0xe2, 0xc0, 0xc0, 0xc0, 0xc0, 0xc6, 
+0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xe6, 0xc6, 
+0xc6, 0xc6, 0xc6, 0x1c, 0x1c, 0x00, 0xc0, 0x00, 
+0x00, 0xcc, 0x8c, 0x76, 0x00, 0x30, 0xc0, 0x00, 
+0x00, 0x60, 0x00, 0x60, 0x80, 0x7c, 0xf0, 0xfe, 
+0x7c, 0x06, 0x7c, 0x7c, 0x60, 0x7c, 0x78, 0x00, 
+0xc0, 0x00, 0x00, 0x00, 0x30, 0x7c, 0xf1, 0x80, 
+0x7e, 0x7e, 0x6e, 0x00, 0x7f, 0x60, 0x7e, 0x63, 
+0x78, 0x7c, 0x67, 0xfe, 0x00, 0x61, 0x80, 0x61, 
+0x80, 0x7e, 0xc0, 0x7e, 0xc1, 0x80, 0x7c, 0x38, 
+0x3f, 0x1c, 0x00, 0x3b, 0xc0, 0x71, 0xc0, 0x1c, 
+0x00, 0xff, 0xf0, 0x18, 0xf0, 0x00, 0xfc, 0x00, 
+0x7b, 0x6e, 0x7c, 0x7b, 0x7c, 0x60, 0x06, 0x66, 
+0x60, 0x18, 0x67, 0x60, 0xc1, 0x80, 0xcc, 0x7c, 
+0xc0, 0x06, 0xc0, 0xf8, 0x18, 0x7b, 0x1c, 0x7b, 
+0x80, 0xc7, 0x18, 0xfc, 0x30, 0xc0, 0xc0, 0x00, 
+0xa0, 0xc0, 0x41, 0x00, 0x00, 0x00, 0xf0, 0x00, 
+0x40, 0x7c, 0xf1, 0x80, 0xf1, 0x80, 0xf1, 0x80, 
+0xf1, 0x80, 0xf1, 0x80, 0xf1, 0x80, 0xf3, 0xf0, 
+0x7e, 0x7f, 0x7f, 0x7f, 0x7f, 0x78, 0x78, 0x78, 
+0x78, 0x6e, 0x00, 0x63, 0x00, 0x7e, 0x7e, 0x7e, 
+0x7e, 0x7e, 0x00, 0x00, 0xbe, 0x3f, 0x3f, 0x3f, 
+0x3f, 0x38, 0x7b, 0x7b, 0x7b, 0x7b, 0x7b, 0x7b, 
+0x67, 0x80, 0x7c, 0x7c, 0x7c, 0x7c, 0x7c, 0x60, 
+0x60, 0x60, 0x60, 0x7b, 0xcc, 0x7c, 0x7c, 0x7c, 
+0x7c, 0x7c, 0xbc, 0x7b, 0x7b, 0x7b, 0x7b, 0x18, 
+0x18, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x02, 0x06, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x7c, 0x00, 0x00, 0xf0, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x60, 0x03, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0xf0, 0xf0, 0x00, 
+};
diff --git a/engines/saga/small8.h b/engines/saga/small8.h
new file mode 100644
index 00000000000..ca385ad5578
--- /dev/null
+++ b/engines/saga/small8.h
@@ -0,0 +1,323 @@
+static byte font_small8[] = {
+0x00, 0x08, 0x00, 0x07, 0x00, 0xa0, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x03, 
+0x00, 0x04, 0x00, 0x05, 0x00, 0x06, 0x00, 0x07, 
+0x00, 0x08, 0x00, 0x09, 0x00, 0x0a, 0x00, 0x0b, 
+0x00, 0x0c, 0x00, 0x0d, 0x00, 0x0e, 0x00, 0x0f, 
+0x00, 0x10, 0x00, 0x11, 0x00, 0x12, 0x00, 0x13, 
+0x00, 0x14, 0x00, 0x15, 0x00, 0x16, 0x00, 0x17, 
+0x00, 0x18, 0x00, 0x19, 0x00, 0x1a, 0x00, 0x1b, 
+0x00, 0x1c, 0x00, 0x1d, 0x00, 0x1e, 0x00, 0x1f, 
+0x00, 0x20, 0x00, 0x21, 0x00, 0x22, 0x00, 0x23, 
+0x00, 0x24, 0x00, 0x25, 0x00, 0x26, 0x00, 0x27, 
+0x00, 0x28, 0x00, 0x29, 0x00, 0x2a, 0x00, 0x2b, 
+0x00, 0x2c, 0x00, 0x2d, 0x00, 0x2e, 0x00, 0x2f, 
+0x00, 0x30, 0x00, 0x31, 0x00, 0x32, 0x00, 0x33, 
+0x00, 0x34, 0x00, 0x35, 0x00, 0x36, 0x00, 0x37, 
+0x00, 0x38, 0x00, 0x39, 0x00, 0x3a, 0x00, 0x3b, 
+0x00, 0x3c, 0x00, 0x3d, 0x00, 0x3e, 0x00, 0x3f, 
+0x00, 0x40, 0x00, 0x41, 0x00, 0x42, 0x00, 0x43, 
+0x00, 0x44, 0x00, 0x45, 0x00, 0x46, 0x00, 0x47, 
+0x00, 0x48, 0x00, 0x49, 0x00, 0x4a, 0x00, 0x4b, 
+0x00, 0x4c, 0x00, 0x4d, 0x00, 0x4e, 0x00, 0x4f, 
+0x00, 0x50, 0x00, 0x51, 0x00, 0x52, 0x00, 0x53, 
+0x00, 0x54, 0x00, 0x55, 0x00, 0x56, 0x00, 0x57, 
+0x00, 0x58, 0x00, 0x59, 0x00, 0x5a, 0x00, 0x5b, 
+0x00, 0x5c, 0x00, 0x5d, 0x00, 0x5e, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x5f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x62, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x65, 0x00, 0x66, 
+0x00, 0x67, 0x00, 0x68, 0x00, 0x69, 0x00, 0x6a, 
+0x00, 0x6b, 0x00, 0x6c, 0x00, 0x6d, 0x00, 0x6e, 
+0x00, 0x6f, 0x00, 0x70, 0x00, 0x71, 0x00, 0x72, 
+0x00, 0x73, 0x00, 0x74, 0x00, 0x75, 0x00, 0x76, 
+0x00, 0x77, 0x00, 0x78, 0x00, 0x79, 0x00, 0x7a, 
+0x00, 0x7b, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x7d, 
+0x00, 0x7e, 0x00, 0x7f, 0x00, 0x80, 0x00, 0x81, 
+0x00, 0x82, 0x00, 0x00, 0x00, 0x00, 0x00, 0x83, 
+0x00, 0x84, 0x00, 0x85, 0x00, 0x86, 0x00, 0x87, 
+0x00, 0x88, 0x00, 0x89, 0x00, 0x00, 0x00, 0x8a, 
+0x00, 0x8b, 0x00, 0x8c, 0x00, 0x8d, 0x00, 0x8e, 
+0x00, 0x8f, 0x00, 0x90, 0x00, 0x91, 0x00, 0x92, 
+0x00, 0x93, 0x00, 0x94, 0x00, 0x95, 0x00, 0x96, 
+0x00, 0x97, 0x00, 0x98, 0x00, 0x00, 0x00, 0x99, 
+0x00, 0x9a, 0x00, 0x9b, 0x00, 0x9c, 0x00, 0x9d, 
+0x00, 0x9e, 0x00, 0x00, 0x00, 0x9f, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 
+0x03, 0x05, 0x05, 0x06, 0x06, 0x03, 0x04, 0x03, 
+0x04, 0x05, 0x02, 0x05, 0x01, 0x05, 0x05, 0x03, 
+0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 
+0x01, 0x02, 0x03, 0x04, 0x03, 0x05, 0x05, 0x06, 
+0x06, 0x05, 0x06, 0x06, 0x06, 0x05, 0x06, 0x05, 
+0x06, 0x07, 0x07, 0x08, 0x07, 0x06, 0x06, 0x06, 
+0x06, 0x05, 0x05, 0x06, 0x07, 0x08, 0x07, 0x07, 
+0x07, 0x03, 0x05, 0x03, 0x05, 0x05, 0x03, 0x05, 
+0x05, 0x04, 0x04, 0x05, 0x05, 0x04, 0x05, 0x01, 
+0x04, 0x05, 0x02, 0x07, 0x05, 0x04, 0x05, 0x04, 
+0x04, 0x04, 0x04, 0x05, 0x05, 0x07, 0x06, 0x05, 
+0x05, 0x05, 0x01, 0x05, 0x04, 0x05, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 
+0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x05, 0x05, 
+0x05, 0x05, 0x05, 0x05, 0x07, 0x05, 0x05, 0x06, 
+0x06, 0x05, 0x06, 0x06, 0x06, 0x06, 0x05, 0x05, 
+0x05, 0x05, 0x05, 0x05, 0x05, 0x00, 0x07, 0x06, 
+0x06, 0x06, 0x06, 0x08, 0x00, 0x00, 0x05, 0x05, 
+0x05, 0x05, 0x05, 0x05, 0x07, 0x00, 0x05, 0x05, 
+0x05, 0x05, 0x02, 0x02, 0x03, 0x03, 0x05, 0x05, 
+0x04, 0x04, 0x04, 0x04, 0x04, 0x00, 0x05, 0x05, 
+0x05, 0x05, 0x05, 0x05, 0x00, 0x05, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x02, 
+0x04, 0x06, 0x06, 0x06, 0x07, 0x04, 0x04, 0x04, 
+0x05, 0x06, 0x03, 0x05, 0x02, 0x06, 0x06, 0x04, 
+0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 
+0x02, 0x03, 0x04, 0x05, 0x04, 0x06, 0x06, 0x06, 
+0x07, 0x06, 0x07, 0x07, 0x07, 0x06, 0x07, 0x04, 
+0x07, 0x08, 0x07, 0x09, 0x08, 0x07, 0x07, 0x07, 
+0x07, 0x06, 0x06, 0x06, 0x06, 0x08, 0x08, 0x08, 
+0x08, 0x04, 0x06, 0x04, 0x06, 0x06, 0x04, 0x05, 
+0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x02, 
+0x05, 0x06, 0x03, 0x08, 0x05, 0x05, 0x05, 0x05, 
+0x05, 0x05, 0x05, 0x05, 0x06, 0x09, 0x05, 0x05, 
+0x06, 0x06, 0x02, 0x06, 0x05, 0x04, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 
+0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x06, 0x06, 
+0x06, 0x06, 0x06, 0x06, 0x08, 0x06, 0x06, 0x06, 
+0x06, 0x06, 0x04, 0x04, 0x04, 0x04, 0x06, 0x06, 
+0x06, 0x06, 0x06, 0x06, 0x06, 0x00, 0x07, 0x06, 
+0x06, 0x06, 0x06, 0x07, 0x00, 0x00, 0x05, 0x05, 
+0x05, 0x05, 0x05, 0x05, 0x08, 0x00, 0x05, 0x05, 
+0x05, 0x05, 0x03, 0x03, 0x04, 0x04, 0x05, 0x05, 
+0x05, 0x05, 0x05, 0x05, 0x05, 0x00, 0x06, 0x05, 
+0x05, 0x05, 0x05, 0x05, 0x00, 0x05, 0x80, 0xa0, 
+0x00, 0x70, 0x88, 0x30, 0x20, 0x20, 0x80, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x08, 0x70, 0x40, 0x70, 
+0x70, 0x10, 0xf8, 0x30, 0xf8, 0x70, 0x70, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x70, 0x70, 0x70, 0xf8, 
+0x70, 0xf8, 0xfc, 0xfc, 0x70, 0xc4, 0xe0, 0x1c, 
+0xc2, 0xc0, 0xc1, 0xc6, 0x78, 0xf8, 0x78, 0xf8, 
+0x70, 0xf8, 0x98, 0x98, 0x84, 0x82, 0x86, 0xfe, 
+0xe0, 0x80, 0xe0, 0x20, 0x00, 0x80, 0x00, 0x80, 
+0x00, 0x10, 0x00, 0x30, 0x00, 0x80, 0x80, 0x10, 
+0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x18, 0x80, 0xc0, 0x50, 0xa0, 0x80, 0x3e, 0x00, 
+0xed, 0x80, 0x00, 0x20, 0x40, 0x10, 0x20, 0x28, 
+0x50, 0x70, 0x7e, 0x70, 0x40, 0x10, 0x20, 0x50, 
+0x80, 0x20, 0x40, 0xa0, 0x70, 0x50, 0x40, 0x10, 
+0x20, 0x50, 0x50, 0x74, 0xc0, 0x18, 0x20, 0x50, 
+0x08, 0xc0, 0x30, 0x20, 0x68, 0x50, 0x60, 0x00, 
+0xc0, 0x30, 0x20, 0x50, 0x80, 0x40, 0x40, 0xa0, 
+0x10, 0x50, 0xc0, 0x30, 0x20, 0x50, 0x50, 0x00, 
+0xc0, 0x30, 0x20, 0x50, 0x30, 0x90, 0x80, 0xa0, 
+0x50, 0x88, 0x08, 0x50, 0x40, 0x40, 0x40, 0x90, 
+0x20, 0x00, 0x00, 0x00, 0x08, 0x88, 0xc0, 0x88, 
+0x88, 0x30, 0x80, 0x40, 0x08, 0x88, 0x88, 0x00, 
+0x00, 0x20, 0x00, 0x80, 0x88, 0x88, 0x88, 0x44, 
+0x88, 0x44, 0x44, 0x44, 0x88, 0x44, 0x40, 0x08, 
+0x44, 0x40, 0x63, 0x62, 0x84, 0x44, 0x84, 0x44, 
+0x88, 0x20, 0x88, 0x88, 0x82, 0x44, 0x82, 0x04, 
+0x80, 0x80, 0x20, 0x50, 0x00, 0x40, 0x00, 0x80, 
+0x00, 0x10, 0x00, 0x40, 0x00, 0x80, 0x00, 0x00, 
+0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x20, 0x80, 0x20, 0xa0, 0x50, 0x00, 0x41, 0x00, 
+0x4a, 0x80, 0x70, 0x00, 0x20, 0x20, 0x50, 0x50, 
+0x00, 0x88, 0x90, 0x88, 0x20, 0x20, 0x50, 0x00, 
+0x40, 0x40, 0xa0, 0x00, 0x48, 0xa0, 0x20, 0x20, 
+0x50, 0xa0, 0x00, 0x88, 0x20, 0x20, 0x50, 0x00, 
+0x10, 0x20, 0x40, 0x50, 0x90, 0x00, 0x90, 0x00, 
+0x20, 0x40, 0x50, 0x00, 0x40, 0x80, 0xa0, 0x00, 
+0x78, 0xa0, 0x20, 0x40, 0x50, 0xa0, 0x00, 0x00, 
+0x20, 0x40, 0x50, 0x00, 0x40, 0x00, 0x80, 0x00, 
+0xf8, 0x88, 0x10, 0x50, 0x80, 0x80, 0x20, 0x60, 
+0x20, 0x00, 0x00, 0x00, 0x10, 0x88, 0x40, 0x88, 
+0x88, 0x50, 0xf0, 0xf0, 0x08, 0x88, 0x88, 0x80, 
+0x40, 0x40, 0xf0, 0x40, 0x08, 0xb8, 0x88, 0x44, 
+0x80, 0x44, 0x70, 0x70, 0x80, 0x44, 0x40, 0x08, 
+0x48, 0x40, 0x55, 0x52, 0x84, 0x78, 0x84, 0x78, 
+0x80, 0x20, 0x88, 0x88, 0x82, 0x28, 0x44, 0x08, 
+0x80, 0x40, 0x20, 0x88, 0x00, 0x20, 0x60, 0xe0, 
+0x60, 0x70, 0x60, 0xe0, 0x70, 0xe0, 0x80, 0x10, 
+0x98, 0x80, 0x6c, 0xe0, 0x60, 0xe0, 0x70, 0xb0, 
+0x70, 0xf0, 0x90, 0x88, 0x42, 0x88, 0x90, 0xf8, 
+0x20, 0x80, 0x20, 0x00, 0xa0, 0x80, 0x9c, 0x80, 
+0x48, 0x80, 0xf8, 0x20, 0x70, 0x70, 0x70, 0x70, 
+0x70, 0x70, 0x90, 0x80, 0xf8, 0xf8, 0xf8, 0xf8, 
+0xe0, 0xe0, 0xe0, 0xe0, 0x48, 0x08, 0x70, 0x70, 
+0x70, 0x70, 0x70, 0x94, 0x88, 0x88, 0x88, 0x88, 
+0x84, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x6c, 
+0x60, 0x60, 0x60, 0x60, 0x00, 0x00, 0x00, 0x40, 
+0x10, 0x00, 0x60, 0x60, 0x60, 0x60, 0x60, 0x78, 
+0x90, 0x90, 0x00, 0x90, 0x90, 0x90, 0x80, 0x00, 
+0x50, 0xf0, 0x20, 0xa0, 0x00, 0x80, 0x20, 0xf0, 
+0xf8, 0x00, 0xf0, 0x00, 0x20, 0x88, 0x40, 0x30, 
+0x30, 0x90, 0x08, 0x88, 0x10, 0x70, 0x78, 0x00, 
+0x00, 0x80, 0x00, 0x20, 0x10, 0xb8, 0xf8, 0x78, 
+0x80, 0x44, 0x40, 0x40, 0x98, 0x7c, 0x40, 0x08, 
+0x70, 0x40, 0x49, 0x4a, 0x84, 0x40, 0x84, 0x50, 
+0x70, 0x20, 0x88, 0x50, 0x82, 0x10, 0x28, 0x10, 
+0x80, 0x20, 0x20, 0x00, 0x00, 0x00, 0x10, 0x90, 
+0x90, 0x90, 0x90, 0x40, 0x90, 0x90, 0x80, 0x10, 
+0xa0, 0x80, 0x92, 0x90, 0x90, 0x90, 0x90, 0xc0, 
+0x80, 0x40, 0x90, 0x88, 0x82, 0x50, 0x90, 0x10, 
+0xc0, 0x80, 0x18, 0x00, 0x50, 0x80, 0x90, 0x80, 
+0x00, 0x00, 0xf8, 0x40, 0x88, 0x88, 0x88, 0x88, 
+0x88, 0x88, 0xfc, 0x80, 0x80, 0x80, 0x80, 0x80, 
+0x40, 0x40, 0x40, 0x40, 0xe8, 0xc8, 0x88, 0x88, 
+0x88, 0x88, 0x88, 0xa4, 0x88, 0x88, 0x88, 0x88, 
+0x44, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x12, 
+0x90, 0x90, 0x90, 0x90, 0x40, 0x80, 0x40, 0x40, 
+0x70, 0xe0, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 
+0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x80, 0x00, 
+0xf8, 0x88, 0x40, 0x94, 0x00, 0x80, 0x20, 0x60, 
+0x20, 0x00, 0x00, 0x00, 0x40, 0x88, 0x40, 0x40, 
+0x08, 0xf8, 0x08, 0x88, 0x20, 0x88, 0x08, 0x80, 
+0x40, 0x40, 0xf0, 0x40, 0x20, 0x80, 0x88, 0x44, 
+0x80, 0x44, 0x40, 0x40, 0x88, 0x44, 0x40, 0x08, 
+0x50, 0x40, 0x41, 0x46, 0x84, 0x40, 0x84, 0x48, 
+0x08, 0x20, 0x88, 0x50, 0x92, 0x28, 0x10, 0x20, 
+0x80, 0x10, 0x20, 0x00, 0x00, 0x00, 0x70, 0x90, 
+0x80, 0x90, 0xf0, 0x40, 0x90, 0x90, 0x80, 0x10, 
+0xc0, 0x80, 0x92, 0x90, 0x90, 0x90, 0x90, 0x80, 
+0x60, 0x40, 0x90, 0x50, 0x92, 0x20, 0x90, 0x20, 
+0x20, 0x80, 0x20, 0x00, 0xa0, 0x80, 0x9c, 0x80, 
+0x00, 0x00, 0xf8, 0x80, 0xf8, 0xf8, 0xf8, 0xf8, 
+0xf8, 0xf8, 0x90, 0x80, 0xe0, 0xf0, 0xf0, 0xf0, 
+0x40, 0x40, 0x40, 0x40, 0x48, 0xa8, 0x88, 0x88, 
+0x88, 0x88, 0x88, 0xa4, 0x88, 0x88, 0x88, 0x88, 
+0x28, 0x70, 0x70, 0x70, 0x70, 0x70, 0x70, 0x7c, 
+0xf0, 0xf0, 0xf0, 0xf0, 0x40, 0x80, 0x40, 0x40, 
+0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0xa8, 
+0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x00, 0x00, 
+0x50, 0x88, 0x80, 0x88, 0x00, 0x40, 0x40, 0x90, 
+0x20, 0x40, 0x00, 0x00, 0x80, 0x88, 0x40, 0x80, 
+0x88, 0x10, 0x88, 0x88, 0x40, 0x88, 0x10, 0x00, 
+0x40, 0x20, 0x00, 0x80, 0x00, 0x80, 0x88, 0x44, 
+0x80, 0x44, 0x40, 0x40, 0x88, 0x44, 0x40, 0x88, 
+0x48, 0x44, 0x41, 0x42, 0x84, 0x40, 0x94, 0x44, 
+0x88, 0x20, 0x98, 0x20, 0x92, 0x44, 0x10, 0x40, 
+0x80, 0x08, 0x20, 0x00, 0x00, 0x00, 0x90, 0x90, 
+0x80, 0x90, 0x80, 0x40, 0x70, 0x90, 0x80, 0x10, 
+0xa0, 0x80, 0x82, 0x90, 0x90, 0xe0, 0x70, 0x80, 
+0x10, 0x40, 0x90, 0x50, 0x92, 0x50, 0x50, 0x40, 
+0x20, 0x80, 0x20, 0x00, 0x50, 0x80, 0x41, 0x00, 
+0x00, 0x00, 0x70, 0x88, 0x88, 0x88, 0x88, 0x88, 
+0x88, 0x88, 0x90, 0x80, 0x80, 0x80, 0x80, 0x80, 
+0x40, 0x40, 0x40, 0x40, 0x48, 0x98, 0x88, 0x88, 
+0x88, 0x88, 0x88, 0x44, 0x98, 0x98, 0x98, 0x98, 
+0x10, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 
+0x80, 0x80, 0x80, 0x80, 0x40, 0x80, 0x40, 0x40, 
+0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x48, 
+0x90, 0x90, 0x90, 0x90, 0x50, 0x50, 0x80, 0x00, 
+0x50, 0x90, 0x88, 0x74, 0x00, 0x20, 0x80, 0x00, 
+0x00, 0x40, 0x00, 0x80, 0x80, 0x70, 0xe0, 0xf8, 
+0x70, 0x10, 0x70, 0x70, 0x40, 0x70, 0x60, 0x00, 
+0x40, 0x00, 0x00, 0x00, 0x20, 0x70, 0x88, 0x78, 
+0x78, 0x78, 0x7c, 0x40, 0x78, 0x44, 0xe0, 0x70, 
+0x46, 0x78, 0x43, 0x42, 0x78, 0x40, 0x78, 0x44, 
+0x70, 0x20, 0x68, 0x20, 0x6c, 0x82, 0x10, 0xfe, 
+0xe0, 0x08, 0xe0, 0x00, 0xf8, 0x00, 0x70, 0xe0, 
+0x70, 0x70, 0x70, 0x40, 0x10, 0x90, 0x80, 0x90, 
+0x98, 0x40, 0x84, 0x90, 0x60, 0x80, 0x10, 0x80, 
+0xe0, 0x30, 0x70, 0x20, 0x6c, 0x88, 0x20, 0xf8, 
+0x18, 0x80, 0xc0, 0x00, 0xa0, 0x80, 0x3e, 0x00, 
+0x00, 0x00, 0x00, 0x70, 0x88, 0x88, 0x88, 0x88, 
+0x88, 0x88, 0x9e, 0x78, 0xf8, 0xf8, 0xf8, 0xf8, 
+0xe0, 0xe0, 0xe0, 0xe0, 0x70, 0x88, 0x70, 0x70, 
+0x70, 0x70, 0x70, 0xb8, 0x68, 0x68, 0x68, 0x68, 
+0x10, 0x70, 0x70, 0x70, 0x70, 0x70, 0x70, 0x7e, 
+0x70, 0x70, 0x70, 0x70, 0x40, 0x80, 0x40, 0x40, 
+0x70, 0x90, 0x60, 0x60, 0x60, 0x60, 0x60, 0xf0, 
+0x70, 0x70, 0x70, 0x70, 0x20, 0x20, 0x00, 0x00, 
+0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x60, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x10, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 
+};


Commit: ef7a3059e18a87f1cf3caa419ecece21633c460c
    https://github.com/scummvm/scummvm/commit/ef7a3059e18a87f1cf3caa419ecece21633c460c
Author: Vladimir Serbinenko (phcoder at gmail.com)
Date: 2022-12-05T08:15:33+02:00

Commit Message:
COMMON: Uplift powerpacker as it's used by Amiga ITE as well

Changed paths:
  A common/compression/powerpacker.cpp
  A common/compression/powerpacker.h
    common/module.mk
    engines/parallaction/disk_ns.cpp


diff --git a/common/compression/powerpacker.cpp b/common/compression/powerpacker.cpp
new file mode 100644
index 00000000000..5e6d4759bc3
--- /dev/null
+++ b/common/compression/powerpacker.cpp
@@ -0,0 +1,156 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#include "common/compression/powerpacker.h"
+#include "common/memstream.h"
+#include "common/debug.h"
+
+namespace Common {
+
+/* the decoder presented here is taken from pplib by Stuart Caie. The
+ * following statement comes from the original source.
+ *
+ * pplib 1.0: a simple PowerPacker decompression and decryption library
+ * placed in the Public Domain on 2003-09-18 by Stuart Caie.
+ */
+
+#define PP_READ_BITS(nbits, var) do {				\
+	bit_cnt = (nbits); (var) = 0;				\
+	while (bits_left < bit_cnt) {				\
+		if (buf < src) return 0;			\
+		bit_buffer |= *--buf << bits_left;		\
+		bits_left += 8;					\
+	}							\
+	bits_left -= bit_cnt;					\
+	while (bit_cnt--) {					\
+		(var) = ((var) << 1) | (bit_buffer & 1);	\
+		bit_buffer >>= 1;				\
+	}							\
+} while (0)
+
+#define PP_BYTE_OUT(byte) do {					\
+	if (out <= dest) return 0;				\
+	*--out = (byte); written++;				\
+} while (0)
+
+
+int PowerPackerStream::ppDecrunchBuffer(byte *src, byte *dest, uint32 src_len, uint32 dest_len) {
+	byte *buf, *out, *dest_end, *off_lens, bits_left = 0, bit_cnt;
+	uint32 bit_buffer = 0, x, todo, offbits, offset, written = 0;
+
+	if (!src || !dest) return 0;
+
+	/* set up input and output pointers */
+	off_lens = src; src = &src[4];
+	buf = &src[src_len];
+
+	out = dest_end = &dest[dest_len];
+
+	/* skip the first few bits */
+	PP_READ_BITS(src[src_len + 3], x);
+
+	/* while there are input bits left */
+	while (written < dest_len) {
+		PP_READ_BITS(1, x);
+		if (x == 0) {
+			/* bit==0: literal, then match. bit==1: just match */
+			todo = 1; do { PP_READ_BITS(2, x); todo += x; } while (x == 3);
+			while (todo--) { PP_READ_BITS(8, x); PP_BYTE_OUT(x); }
+
+			/* should we end decoding on a literal, break out of the main loop */
+			if (written == dest_len) break;
+		}
+
+		/* match: read 2 bits for initial offset bitlength / match length */
+		PP_READ_BITS(2, x);
+		offbits = off_lens[x];
+		todo = x+2;
+		if (x == 3) {
+			PP_READ_BITS(1, x);
+			if (x == 0) offbits = 7;
+			PP_READ_BITS(offbits, offset);
+			do { PP_READ_BITS(3, x); todo += x; } while (x == 7);
+		}
+		else {
+			PP_READ_BITS(offbits, offset);
+		}
+		if (&out[offset] > dest_end) return 0; /* match_overflow */
+		while (todo--) { x = out[offset]; PP_BYTE_OUT(x); }
+	}
+
+	/* all output bytes written without error */
+	return 1;
+}
+
+uint16 PowerPackerStream::getCrunchType(uint32 signature) {
+	byte eff = 0;
+
+	switch (signature) {
+	case 0x50503230: /* PP20 */
+		eff = 4;
+		break;
+	case 0x50504C53: /* PPLS */
+		error("PPLS crunched files are not supported");
+#if 0
+		eff = 8;
+		break;
+#endif
+	case 0x50583230: /* PX20 */
+		error("PX20 crunched files are not supported");
+#if 0
+		eff = 6;
+		break;
+#endif
+	default:
+		eff = 0;
+
+	}
+
+	return eff;
+}
+
+PowerPackerStream::PowerPackerStream(Common::SeekableReadStream &stream) {
+	_dispose = false;
+
+	uint32 signature = stream.readUint32BE();
+	if (getCrunchType(signature) == 0) {
+		stream.seek(0, SEEK_SET);
+		_stream = &stream;
+		return;
+	}
+
+	stream.seek(-4, SEEK_END);
+	uint32 decrlen = stream.readUint32BE() >> 8;
+	byte *dest = (byte *)malloc(decrlen);
+
+	uint32 crlen = stream.size() - 4;
+	byte *src = (byte *)malloc(crlen);
+	stream.seek(4, SEEK_SET);
+	stream.read(src, crlen);
+
+	ppDecrunchBuffer(src, dest, crlen-8, decrlen);
+
+	free(src);
+	_stream = new Common::MemoryReadStream(dest, decrlen, DisposeAfterUse::YES);
+	_dispose = true;
+}
+
+}
diff --git a/common/compression/powerpacker.h b/common/compression/powerpacker.h
new file mode 100644
index 00000000000..58b65eeeee2
--- /dev/null
+++ b/common/compression/powerpacker.h
@@ -0,0 +1,67 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#ifndef COMMON_POWERPACKER_H
+#define COMMON_POWERPACKER_H
+
+#include "common/stream.h"
+
+namespace Common {
+class PowerPackerStream : public Common::SeekableReadStream {
+
+	SeekableReadStream *_stream;
+	bool				_dispose;
+
+private:
+	int ppDecrunchBuffer(byte *src, byte *dest, uint32 src_len, uint32 dest_len);
+	uint16 getCrunchType(uint32 signature);
+
+public:
+	PowerPackerStream(Common::SeekableReadStream &stream);
+
+	~PowerPackerStream() override {
+		if (_dispose) delete _stream;
+	}
+
+	int64 size() const override {
+		return _stream->size();
+	}
+
+	int64 pos() const override {
+		return _stream->pos();
+	}
+
+	bool eos() const override {
+		return _stream->eos();
+	}
+
+	bool seek(int64 offs, int whence = SEEK_SET) override {
+		return _stream->seek(offs, whence);
+	}
+
+	uint32 read(void *dataPtr, uint32 dataSize) override {
+		return _stream->read(dataPtr, dataSize);
+	}
+
+};
+} // End of namespace Common
+
+#endif
diff --git a/common/module.mk b/common/module.mk
index 0f8d97ab571..fe270afd910 100644
--- a/common/module.mk
+++ b/common/module.mk
@@ -53,6 +53,7 @@ MODULE_OBJS := \
 	compression/gzio.o \
 	compression/installshield_cab.o \
 	compression/installshieldv3_archive.o \
+	compression/powerpacker.o \
 	compression/rnc_deco.o \
 	compression/stuffit.o \
 	compression/unarj.o \
diff --git a/engines/parallaction/disk_ns.cpp b/engines/parallaction/disk_ns.cpp
index 15106eff90d..b06ec595c2e 100644
--- a/engines/parallaction/disk_ns.cpp
+++ b/engines/parallaction/disk_ns.cpp
@@ -25,6 +25,7 @@
 #include "common/memstream.h"
 #include "common/substream.h"
 #include "common/textconsole.h"
+#include "common/compression/powerpacker.h"
 #include "image/iff.h"
 #include "parallaction/parser.h"
 #include "parallaction/parallaction.h"
@@ -547,170 +548,6 @@ Common::SeekableReadStream* DosDisk_ns::loadSound(const char* name) {
 #pragma mark -
 
 
-/* the decoder presented here is taken from pplib by Stuart Caie. The
- * following statement comes from the original source.
- *
- * pplib 1.0: a simple PowerPacker decompression and decryption library
- * placed in the Public Domain on 2003-09-18 by Stuart Caie.
- */
-
-#define PP_READ_BITS(nbits, var) do {				\
-	bit_cnt = (nbits); (var) = 0;				\
-	while (bits_left < bit_cnt) {				\
-		if (buf < src) return 0;			\
-		bit_buffer |= *--buf << bits_left;		\
-		bits_left += 8;					\
-	}							\
-	bits_left -= bit_cnt;					\
-	while (bit_cnt--) {					\
-		(var) = ((var) << 1) | (bit_buffer & 1);	\
-		bit_buffer >>= 1;				\
-	}							\
-} while (0)
-
-#define PP_BYTE_OUT(byte) do {					\
-	if (out <= dest) return 0;				\
-	*--out = (byte); written++;				\
-} while (0)
-
-
-class PowerPackerStream : public Common::SeekableReadStream {
-
-	SeekableReadStream *_stream;
-	bool				_dispose;
-
-private:
-	int ppDecrunchBuffer(byte *src, byte *dest, uint32 src_len, uint32 dest_len) {
-
-		byte *buf, *out, *dest_end, *off_lens, bits_left = 0, bit_cnt;
-		uint32 bit_buffer = 0, x, todo, offbits, offset, written = 0;
-
-		if (!src || !dest) return 0;
-
-		/* set up input and output pointers */
-		off_lens = src; src = &src[4];
-		buf = &src[src_len];
-
-		out = dest_end = &dest[dest_len];
-
-		/* skip the first few bits */
-		PP_READ_BITS(src[src_len + 3], x);
-
-		/* while there are input bits left */
-		while (written < dest_len) {
-			PP_READ_BITS(1, x);
-			if (x == 0) {
-				  /* bit==0: literal, then match. bit==1: just match */
-				  todo = 1; do { PP_READ_BITS(2, x); todo += x; } while (x == 3);
-				  while (todo--) { PP_READ_BITS(8, x); PP_BYTE_OUT(x); }
-
-				  /* should we end decoding on a literal, break out of the main loop */
-				  if (written == dest_len) break;
-			}
-
-			/* match: read 2 bits for initial offset bitlength / match length */
-			PP_READ_BITS(2, x);
-			offbits = off_lens[x];
-			todo = x+2;
-			if (x == 3) {
-				PP_READ_BITS(1, x);
-				if (x == 0) offbits = 7;
-				PP_READ_BITS(offbits, offset);
-				do { PP_READ_BITS(3, x); todo += x; } while (x == 7);
-			}
-			else {
-				PP_READ_BITS(offbits, offset);
-			}
-			if (&out[offset] > dest_end) return 0; /* match_overflow */
-			while (todo--) { x = out[offset]; PP_BYTE_OUT(x); }
-		}
-
-		/* all output bytes written without error */
-		return 1;
-	}
-
-	uint16 getCrunchType(uint32 signature) {
-
-		byte eff = 0;
-
-		switch (signature) {
-		case 0x50503230: /* PP20 */
-			eff = 4;
-			break;
-		case 0x50504C53: /* PPLS */
-			error("PPLS crunched files are not supported");
-#if 0
-			eff = 8;
-			break;
-#endif
-		case 0x50583230: /* PX20 */
-			error("PX20 crunched files are not supported");
-#if 0
-			eff = 6;
-			break;
-#endif
-		default:
-			eff = 0;
-
-		}
-
-		return eff;
-	}
-
-public:
-	PowerPackerStream(Common::SeekableReadStream &stream) {
-
-		_dispose = false;
-
-		uint32 signature = stream.readUint32BE();
-		if (getCrunchType(signature) == 0) {
-			stream.seek(0, SEEK_SET);
-			_stream = &stream;
-			return;
-		}
-
-		stream.seek(-4, SEEK_END);
-		uint32 decrlen = stream.readUint32BE() >> 8;
-		byte *dest = (byte *)malloc(decrlen);
-
-		uint32 crlen = stream.size() - 4;
-		byte *src = (byte *)malloc(crlen);
-		stream.seek(4, SEEK_SET);
-		stream.read(src, crlen);
-
-		ppDecrunchBuffer(src, dest, crlen-8, decrlen);
-
-		free(src);
-		_stream = new Common::MemoryReadStream(dest, decrlen, DisposeAfterUse::YES);
-		_dispose = true;
-	}
-
-	~PowerPackerStream() override {
-		if (_dispose) delete _stream;
-	}
-
-	int64 size() const override {
-		return _stream->size();
-	}
-
-	int64 pos() const override {
-		return _stream->pos();
-	}
-
-	bool eos() const override {
-		return _stream->eos();
-	}
-
-	bool seek(int64 offs, int whence = SEEK_SET) override {
-		return _stream->seek(offs, whence);
-	}
-
-	uint32 read(void *dataPtr, uint32 dataSize) override {
-		return _stream->read(dataPtr, dataSize);
-	}
-};
-
-
 
 
 AmigaDisk_ns::AmigaDisk_ns(Parallaction *vm) : Disk_ns(vm) {
@@ -862,7 +699,7 @@ GfxObj* AmigaDisk_ns::loadStatic(const char* name) {
 Common::SeekableReadStream *AmigaDisk_ns::tryOpenFile(const char* name) {
 	debugC(3, kDebugDisk, "AmigaDisk_ns::tryOpenFile(%s)", name);
 
-	PowerPackerStream *ret;
+	Common::PowerPackerStream *ret;
 	Common::SeekableReadStream *stream = _sset.createReadStreamForMember(name);
 	if (stream)
 		return stream;
@@ -871,7 +708,7 @@ Common::SeekableReadStream *AmigaDisk_ns::tryOpenFile(const char* name) {
 	Common::sprintf_s(path, "%s.pp", name);
 	stream = _sset.createReadStreamForMember(path);
 	if (stream) {
-		ret = new PowerPackerStream(*stream);
+		ret = new Common::PowerPackerStream(*stream);
 		delete stream;
 		return ret;
 	}
@@ -879,7 +716,7 @@ Common::SeekableReadStream *AmigaDisk_ns::tryOpenFile(const char* name) {
 	Common::sprintf_s(path, "%s.dd", name);
 	stream = _sset.createReadStreamForMember(path);
 	if (stream) {
-		ret = new PowerPackerStream(*stream);
+		ret = new Common::PowerPackerStream(*stream);
 		delete stream;
 		return ret;
 	}


Commit: 2db745b62bf35af6aa7c59c3fb62c13c0b73a84c
    https://github.com/scummvm/scummvm/commit/2db745b62bf35af6aa7c59c3fb62c13c0b73a84c
Author: Vladimir Serbinenko (phcoder at gmail.com)
Date: 2022-12-05T08:15:33+02:00

Commit Message:
COMMON: Add in-memory decompressor for powerpack

Changed paths:
    common/compression/powerpacker.cpp
    common/compression/powerpacker.h


diff --git a/common/compression/powerpacker.cpp b/common/compression/powerpacker.cpp
index 5e6d4759bc3..06887180495 100644
--- a/common/compression/powerpacker.cpp
+++ b/common/compression/powerpacker.cpp
@@ -52,8 +52,9 @@ namespace Common {
 } while (0)
 
 
-int PowerPackerStream::ppDecrunchBuffer(byte *src, byte *dest, uint32 src_len, uint32 dest_len) {
-	byte *buf, *out, *dest_end, *off_lens, bits_left = 0, bit_cnt;
+int PowerPackerStream::ppDecrunchBuffer(const byte *src, byte *dest, uint32 src_len, uint32 dest_len) {
+	const byte *buf, *off_lens;
+	byte *out, *dest_end, bits_left = 0, bit_cnt;
 	uint32 bit_buffer = 0, x, todo, offbits, offset, written = 0;
 
 	if (!src || !dest) return 0;
@@ -153,4 +154,23 @@ PowerPackerStream::PowerPackerStream(Common::SeekableReadStream &stream) {
 	_dispose = true;
 }
 
+byte *PowerPackerStream::unpackBuffer(const byte *input, uint32 input_len, uint32 &output_len) {
+	if (input_len < 8) {
+		output_len = 0;
+		return nullptr;
+	}
+	uint32 signature = READ_BE_UINT32(input);
+	if (getCrunchType(signature) == 0) {
+		output_len = 0;
+		return nullptr;
+	}
+
+	output_len = READ_BE_UINT32(input + input_len - 4) >> 8;
+	byte *dest = new byte[output_len];
+
+	ppDecrunchBuffer(input + 4, dest, input_len - 12, output_len);
+
+	return dest;
+}
+
 }
diff --git a/common/compression/powerpacker.h b/common/compression/powerpacker.h
index 58b65eeeee2..ce14963cd34 100644
--- a/common/compression/powerpacker.h
+++ b/common/compression/powerpacker.h
@@ -31,12 +31,14 @@ class PowerPackerStream : public Common::SeekableReadStream {
 	bool				_dispose;
 
 private:
-	int ppDecrunchBuffer(byte *src, byte *dest, uint32 src_len, uint32 dest_len);
-	uint16 getCrunchType(uint32 signature);
+	static int ppDecrunchBuffer(const byte *src, byte *dest, uint32 src_len, uint32 dest_len);
+	static uint16 getCrunchType(uint32 signature);
 
 public:
 	PowerPackerStream(Common::SeekableReadStream &stream);
 
+	static byte *unpackBuffer(const byte *input, uint32 input_len, uint32 &output_len);
+
 	~PowerPackerStream() override {
 		if (_dispose) delete _stream;
 	}


Commit: 279f4ac5b86965dc36328aa51eb74a65944576e0
    https://github.com/scummvm/scummvm/commit/279f4ac5b86965dc36328aa51eb74a65944576e0
Author: Vladimir Serbinenko (phcoder at gmail.com)
Date: 2022-12-05T08:15:33+02:00

Commit Message:
COMMON: Add ITE Amiga powerpack support

Changed paths:
    common/compression/powerpacker.cpp


diff --git a/common/compression/powerpacker.cpp b/common/compression/powerpacker.cpp
index 06887180495..e3b427003c7 100644
--- a/common/compression/powerpacker.cpp
+++ b/common/compression/powerpacker.cpp
@@ -106,6 +106,7 @@ uint16 PowerPackerStream::getCrunchType(uint32 signature) {
 
 	switch (signature) {
 	case 0x50503230: /* PP20 */
+	case 0x5041434b: /* PACK, non-standard header used in amiga floppy ITE.  */
 		eff = 4;
 		break;
 	case 0x50504C53: /* PPLS */


Commit: 4030541bc92b2f1dcebb7c33825364ed99bcd754
    https://github.com/scummvm/scummvm/commit/4030541bc92b2f1dcebb7c33825364ed99bcd754
Author: Vladimir Serbinenko (phcoder at gmail.com)
Date: 2022-12-05T08:15:33+02:00

Commit Message:
SAGA: Add powerpacker compressed background

Changed paths:
    engines/saga/detection.h
    engines/saga/image.cpp


diff --git a/engines/saga/detection.h b/engines/saga/detection.h
index df4fc265430..725c9c564be 100644
--- a/engines/saga/detection.h
+++ b/engines/saga/detection.h
@@ -42,6 +42,7 @@ enum GameFeatures {
 	GF_ECS_GRAPHICS      = 1 << 7,
 	GF_INSTALLER         = 1 << 8,
 	GF_EMBED_FONT        = 1 << 9,
+	GF_POWERPACK_GFX     = 1 << 10,
 };
 
 enum GameFileTypes {
diff --git a/engines/saga/image.cpp b/engines/saga/image.cpp
index 5b2758de842..855091e414d 100644
--- a/engines/saga/image.cpp
+++ b/engines/saga/image.cpp
@@ -22,6 +22,7 @@
 // SAGA Image resource management routines
 
 #include "saga/saga.h"
+#include "common/compression/powerpacker.h"
 
 namespace Saga {
 
@@ -43,6 +44,23 @@ static int granulate(int value, int granularity) {
 	}
 }
 
+static bool unbankAmiga(ByteArray& outputBuffer, const byte *banked, uint len, uint16 height, uint16 width, uint bitnum) {
+	uint planePitch = (width + 15) & ~15;
+	uint linePitch = bitnum == 8 ? planePitch : (planePitch * 5 / 8);
+	if (len != linePitch * height)
+		return false;
+	outputBuffer.resize(height * width);
+	memset(outputBuffer.getBuffer(), 0, width * height);
+	for (uint y = 0; y < height; y++)
+		for (uint x = 0; x < width; x++)
+			for (unsigned bit = 0; bit < bitnum; bit++) {
+				int inXbit = x + bit * planePitch;
+				outputBuffer[y * width + x] |= ((banked[y * linePitch + inXbit / 8] >> (7 - inXbit % 8)) & 1) << bit;
+			}
+	return true;
+}
+
+
 bool SagaEngine::decodeBGImageMask(const ByteArray &imageData, ByteArray &outputBuffer, int *w, int *h, bool flip) {
 	if (isAGA() || isECS()) {
 		if (imageData.size() < 160 * 137 + 64)
@@ -96,26 +114,49 @@ bool SagaEngine::decodeBGImage(const ByteArray &imageData, ByteArray &outputBuff
 	readS.readUint16();
 	readS.readUint16();
 
-	outputBuffer.resize(hdr.width * hdr.height);
-
 	if (isAGA() || isECS()) {
-		int planePitch = (hdr.width + 15) & ~15;
-		int linePitch = isAGA() ? planePitch : (planePitch * 5 / 8);
 		unsigned bitnum = isAGA() ? 8 : 5;
 		int headerSize = 8 + (3 << bitnum);
 		const byte *RLE_data_ptr = &imageData.front() + headerSize;
 		size_t RLE_data_len = imageData.size() - headerSize;
 
-		if (RLE_data_len != (size_t) linePitch * hdr.height)
-			return false;
-
-		memset(outputBuffer.getBuffer(), 0, hdr.width * hdr.height);
-		for (int y = 0; y < hdr.height; y++)
-			for (int x = 0; x < hdr.width; x++)
-				for (unsigned bit = 0; bit < bitnum; bit++) {
-					int inXbit = x + bit * planePitch;
-					outputBuffer[y * hdr.width + x] |= ((RLE_data_ptr[y * linePitch + inXbit / 8] >> (7 - inXbit % 8)) & 1) << bit;
-				}
+		if (getFeatures() & GF_POWERPACK_GFX) {
+			int aligned_width = (hdr.width + 15) & ~15;
+			int pitch = isAGA() ? aligned_width : (aligned_width * 5 / 8);
+			if (RLE_data_len < 12) {
+				warning("Compressed size too short");
+				return false;
+			}
+			if (READ_BE_UINT32 (RLE_data_ptr) != RLE_data_len - 4) {
+				warning("Compressed size mismatch: %d vs %d", READ_BE_UINT32 (RLE_data_ptr), (int)RLE_data_len - 4);
+				return false;
+			}
+			if (READ_BE_UINT32 (RLE_data_ptr + 4) != MKTAG('P', 'A', 'C', 'K')) {
+				warning("Compressed magic mismatch: 0x%08x vs %08x", READ_BE_UINT32 (RLE_data_ptr + 4), MKTAG('P', 'A', 'C', 'K'));
+				return false;
+			}
+			uint32 uncompressed_len = 0;
+			byte *uncompressed = Common::PowerPackerStream::unpackBuffer(RLE_data_ptr + 4, RLE_data_len - 4, uncompressed_len);
+			if (uncompressed == nullptr || (int) uncompressed_len != pitch * hdr.height) {
+				warning("Uncompressed size mismatch: %d vs %d", uncompressed_len, pitch * hdr.height);
+				return false;
+			}
+			if (isAGA() && pitch == hdr.width) {
+				// TODO: Use some kind of move semantics
+				outputBuffer = ByteArray(uncompressed, uncompressed_len);
+			} else if (isAGA()) {
+				outputBuffer.resize(hdr.height * hdr.width);
+				for (int y = 0; y < hdr.height; y++)
+					memcpy(outputBuffer.getBuffer() + y * hdr.width, uncompressed + y * pitch, hdr.width);
+			} else {
+				if (!unbankAmiga(outputBuffer, uncompressed, uncompressed_len, hdr.height, hdr.width, bitnum))
+					return false;
+			}
+			delete[] uncompressed;
+		} else {
+			if (!unbankAmiga(outputBuffer, RLE_data_ptr, RLE_data_len, hdr.height, hdr.width, bitnum))
+				return false;
+		}
 	} else {
 		int modex_height = granulate(hdr.height, 4);
 		const byte *RLE_data_ptr;
@@ -126,6 +167,7 @@ bool SagaEngine::decodeBGImage(const ByteArray &imageData, ByteArray &outputBuff
 		if (!decodeBGImageRLE(RLE_data_ptr, RLE_data_len, decodeBuffer)) {
 			return false;
 		}
+		outputBuffer.resize(hdr.width * hdr.height);
 		unbankBGImage(outputBuffer.getBuffer(), decodeBuffer.getBuffer(), hdr.width, hdr.height);
 	}
 


Commit: a173ca1b3156c6d3600ca0701f0497012d2adc5d
    https://github.com/scummvm/scummvm/commit/a173ca1b3156c6d3600ca0701f0497012d2adc5d
Author: Vladimir Serbinenko (phcoder at gmail.com)
Date: 2022-12-05T08:15:33+02:00

Commit Message:
SAGA: Support crunched resources

Changed paths:
    engines/saga/resource.cpp


diff --git a/engines/saga/resource.cpp b/engines/saga/resource.cpp
index 7ccd3b159b6..e748af7205b 100644
--- a/engines/saga/resource.cpp
+++ b/engines/saga/resource.cpp
@@ -32,6 +32,7 @@
 #include "saga/sndres.h"
 
 #include "engines/advancedDetector.h"
+#include "common/compression/powerpacker.h"
 
 namespace Saga {
 
@@ -435,6 +436,25 @@ void Resource::loadResource(ResourceContext *context, uint32 resourceId, ByteArr
 	// 1 patch file, which is reused, so don't close it
 	if (resourceData->patchData != nullptr && _vm->getGameId() == GID_ITE)
 		file->close();
+
+	if (_vm->getPlatform() == Common::Platform::kPlatformAmiga &&
+	    resourceBuffer.size() >= 16 && READ_BE_UINT32(resourceBuffer.getBuffer()) == MKTAG('H', 'E', 'A', 'D')
+	    && READ_BE_UINT32(resourceBuffer.getBuffer() + 12) == MKTAG('P', 'A', 'C', 'K')) {
+		uint32 unpackedLen = READ_BE_UINT32(resourceBuffer.getBuffer() + 4);
+		uint32 packedLen = READ_BE_UINT32(resourceBuffer.getBuffer() + 8);
+		uint32 actualUncompressedLen = 0;
+		if (packedLen != resourceBuffer.size() - 20) {
+			warning("Compressed size mismatch in resource %d: %d vs %d", resourceId, packedLen, resourceBuffer.size() - 20);
+		}
+		byte *uncompressed = Common::PowerPackerStream::unpackBuffer(resourceBuffer.getBuffer() + 12, packedLen + 8, actualUncompressedLen);
+		if (uncompressed == nullptr || unpackedLen != actualUncompressedLen) {
+			warning("Uncompressed size mismatch in resource %d: %d vs %d", resourceId, unpackedLen, actualUncompressedLen);
+		}
+
+		// TODO: Use move semantics
+		resourceBuffer = ByteArray(uncompressed, actualUncompressedLen);
+		delete[] uncompressed;
+	}
 }
 
 ResourceContext *Resource::getContext(uint16 fileType, int serial) {


Commit: c81b7559c21e0b9b7e4d3c6cdc458a77e75af9d6
    https://github.com/scummvm/scummvm/commit/c81b7559c21e0b9b7e4d3c6cdc458a77e75af9d6
Author: Vladimir Serbinenko (phcoder at gmail.com)
Date: 2022-12-05T08:15:33+02:00

Commit Message:
SAGA: Support missing intro anim

Changed paths:
    engines/saga/introproc_ite.cpp


diff --git a/engines/saga/introproc_ite.cpp b/engines/saga/introproc_ite.cpp
index 666e58ebc83..cd4358e3a61 100644
--- a/engines/saga/introproc_ite.cpp
+++ b/engines/saga/introproc_ite.cpp
@@ -409,31 +409,45 @@ int Scene::ITEIntroAnimProc(int param) {
 		debug(3, "Intro animation procedure started.");
 		debug(3, "Linking animation resources...");
 
-		_vm->_anim->setFrameTime(0, INTRO_FRAMETIME);
+		// Some demos lack animations
+		if (_vm->_anim->hasAnimation(0)) {
+			_vm->_anim->setFrameTime(0, INTRO_FRAMETIME);
 
-		// Link this scene's animation resources for continuous
-		// playback
-		int lastAnim;
+			// Link this scene's animation resources for continuous
+			// playback
+			int lastAnim;
 
-		if (hasWyrmkeepCredits || isMultiCD || isDemo)
-			lastAnim = isMac ? 3 : 2;
-		else
-			lastAnim = isMac ? 4 : 5;
+			if (hasWyrmkeepCredits || isMultiCD || isDemo)
+				lastAnim = isMac ? 3 : 2;
+			else
+				lastAnim = isMac ? 4 : 5;
 
-		for (int i = 0; i < lastAnim; i++)
-			_vm->_anim->link(i, i+1);
+			for (int i = 0; i < lastAnim; i++) {
+				if (!_vm->_anim->hasAnimation(i+1)) {
+					lastAnim = i;
+					break;
+				}
+				_vm->_anim->link(i, i+1);
+			}
 
-		_vm->_anim->setFlag(lastAnim, ANIM_FLAG_ENDSCENE);
+			_vm->_anim->setFlag(lastAnim, ANIM_FLAG_ENDSCENE);
 
-		debug(3, "Beginning animation playback.");
+			debug(3, "Beginning animation playback.");
 
-		// Begin the animation
-		event.type = kEvTOneshot;
-		event.code = kAnimEvent;
-		event.op = kEventPlay;
-		event.param = 0;
-		event.time = 0;
-		_vm->_events->chain(eventColumns, event);
+			// Begin the animation
+			event.type = kEvTOneshot;
+			event.code = kAnimEvent;
+			event.op = kEventPlay;
+			event.param = 0;
+			event.time = 0;
+			_vm->_events->chain(eventColumns, event);
+		} else {
+			event.type = kEvTOneshot;
+			event.code = kSceneEvent;
+			event.op = kEventEnd;
+			event.time = 1000;
+			_vm->_events->chain(eventColumns, event);
+		}
 
 		// Queue intro music playback
 		_vm->_events->chainMusic(eventColumns, MUSIC_INTRO, true);


Commit: 30910cce15b2a7270bad129b02b98862b2b89c72
    https://github.com/scummvm/scummvm/commit/30910cce15b2a7270bad129b02b98862b2b89c72
Author: Vladimir Serbinenko (phcoder at gmail.com)
Date: 2022-12-05T08:15:33+02:00

Commit Message:
SAGA: Add entry for ite german floppy

Changed paths:
    engines/saga/detection_tables.h


diff --git a/engines/saga/detection_tables.h b/engines/saga/detection_tables.h
index 2c412cb009f..001fe295e7a 100644
--- a/engines/saga/detection_tables.h
+++ b/engines/saga/detection_tables.h
@@ -1075,8 +1075,33 @@ static const SAGAGameDescription gameDescriptions[] = {
 		{},
 	},
 
-	// TODO: Add Amiga floppy versions
+	// Inherit the earth - German Floppy version
+	{
+		{
+			"ite",
+			"AGA Floppy",
+			{
+				{"ite.rtn",		GAME_RESOURCEFILE,	"38f6a3aca708ef3ab6059d94a268da29", 18564},
+				{"ite01.adf",		0,					"4f7913f82d7f8318d24f31b6226731eb", 901120},
+				{"ite02.adf",	0,					"9c959343c3e2e4a067426bf4cf28eba0", 901120},
+				AD_LISTEND
+			},
+			Common::DE_DEU,
+			Common::kPlatformAmiga,
+			ADGF_NO_FLAGS,
+			GUIO1(GUIO_NOSPEECH)
+		},
+		GID_ITE,
+		GF_ITE_FLOPPY | GF_AGA_GRAPHICS | GF_EMBED_FONT | GF_POWERPACK_GFX,
+		ITE_DEFAULT_SCENE,
+		RESOURCELIST_ITE_GERMAN_AGA_CD,
+		FONTLIST_NONE,
+		PATCHLIST_NONE,
+		INTROLIST_ITE_AMIGA_GERMAN_AGA,
+		{},
+	},
 
+	// TODO: Add other Amiga floppy versions
 	// IHNM Section ///////////////////////////////////////////////////////////////////////////////////////////
 
 	// I Have No Mouth And I Must Scream - Demo version


Commit: f4416339788a8d36da2a8eef90fd76b2d7b40efd
    https://github.com/scummvm/scummvm/commit/f4416339788a8d36da2a8eef90fd76b2d7b40efd
Author: Vladimir Serbinenko (phcoder at gmail.com)
Date: 2022-12-05T08:15:33+02:00

Commit Message:
SAGA: Add AGA German CD demo

Changed paths:
    engines/saga/detection_tables.h


diff --git a/engines/saga/detection_tables.h b/engines/saga/detection_tables.h
index 001fe295e7a..48980b67398 100644
--- a/engines/saga/detection_tables.h
+++ b/engines/saga/detection_tables.h
@@ -173,7 +173,30 @@ static const SAGAGameDescription gameDescriptions[] = {
 	},
 
 
-	// TODO: Add Amiga demos here (not supported yet)
+	// TODO: Add Amiga floppy demos here (not supported yet)
+	{
+		{
+			"ite",
+			"AGA Demo CD",
+			{
+				{"ite.rtn",		GAME_RESOURCEFILE,	"634d36f78ac151b14dbeed274e169def", 18564},
+				{"ite.000",                             0,      "75a2c63fd67d3c87512a37af91537fba", 900096},
+				AD_LISTEND
+			},
+			Common::DE_DEU,
+			Common::kPlatformAmiga,
+			ADGF_CD,
+			GUIO0()
+		},
+		GID_ITE,
+		GF_EXTRA_ITE_CREDITS | GF_AGA_GRAPHICS | GF_EMBED_FONT | GF_POWERPACK_GFX,
+		ITE_DEFAULT_SCENE,
+		RESOURCELIST_ITE_GERMAN_AGA_CD,
+		FONTLIST_NONE,
+		PATCHLIST_ITE,
+		INTROLIST_ITE_AMIGA_GERMAN_AGA,
+		{},
+	},
 
 
 	// ITE Mac versions ///////////////////////////////////////////////////////////////////////////////////////


Commit: 6ace00cba7e418455e08654d7c1286c6127eda1d
    https://github.com/scummvm/scummvm/commit/6ace00cba7e418455e08654d7c1286c6127eda1d
Author: Vladimir Serbinenko (phcoder at gmail.com)
Date: 2022-12-05T08:15:33+02:00

Commit Message:
SAGA: Add German ECS CD demo

Changed paths:
    engines/saga/detection_tables.h


diff --git a/engines/saga/detection_tables.h b/engines/saga/detection_tables.h
index 48980b67398..55ebf120b25 100644
--- a/engines/saga/detection_tables.h
+++ b/engines/saga/detection_tables.h
@@ -197,6 +197,29 @@ static const SAGAGameDescription gameDescriptions[] = {
 		INTROLIST_ITE_AMIGA_GERMAN_AGA,
 		{},
 	},
+	{
+		{
+			"ite",
+			"ECS Demo CD",
+			{
+				{"ite.rtn",		GAME_RESOURCEFILE,	"1e77154f045358ef3f09fbdb00ea92a4", 18624},
+				{"ite.000",                             0,      "7907e74ed9ce17bb9d6c10e21273d53e", 788221},
+				AD_LISTEND
+			},
+			Common::DE_DEU,
+			Common::kPlatformAmiga,
+			ADGF_CD,
+			GUIO0()
+		},
+		GID_ITE,
+		GF_EXTRA_ITE_CREDITS | GF_ECS_GRAPHICS | GF_EMBED_FONT | GF_POWERPACK_GFX,
+		ITE_DEFAULT_SCENE,
+		RESOURCELIST_ITE_GERMAN_ECS_CD,
+		FONTLIST_NONE,
+		PATCHLIST_ITE,
+		INTROLIST_ITE_AMIGA_GERMAN_ECS,
+		{},
+	},
 
 
 	// ITE Mac versions ///////////////////////////////////////////////////////////////////////////////////////


Commit: 2ae17bf6f6ec05d3bc87f7885b7c3aab8014a659
    https://github.com/scummvm/scummvm/commit/2ae17bf6f6ec05d3bc87f7885b7c3aab8014a659
Author: Vladimir Serbinenko (phcoder at gmail.com)
Date: 2022-12-05T08:15:33+02:00

Commit Message:
SAGA: Don't attempt to load invalid animations

Wyrmkeep CDs have invalid animations in intro. Skip them

Changed paths:
    engines/saga/animation.cpp


diff --git a/engines/saga/animation.cpp b/engines/saga/animation.cpp
index 01145a1fc56..150f3431e11 100644
--- a/engines/saga/animation.cpp
+++ b/engines/saga/animation.cpp
@@ -379,20 +379,21 @@ void Anim::returnFromVideo() {
 #endif
 
 void Anim::load(uint16 animId, const ByteArray &resourceData) {
-	AnimationData *anim;
+	AnimationData *anim = new AnimationData();
 	uint16 temp;
 
-	if (animId >= MAX_ANIMATIONS) {
-		if (animId >= MAX_ANIMATIONS + ARRAYSIZE(_cutawayAnimations))
-			error("Anim::load could not find unused animation slot");
-		anim = _cutawayAnimations[animId - MAX_ANIMATIONS] = new AnimationData();
-	} else
-		anim = _animations[animId] = new AnimationData();
-
 	ByteArrayReadStreamEndian headerReadS(resourceData, _vm->isBigEndian() && !_vm->isAGA() && !_vm->isECS());
 	anim->magic = headerReadS.readUint16LE(); // cause ALWAYS LE
+	if (anim->magic != 0x0044) {
+		warning ("Anim::load animId=%d animation magic mismatch (0x%x vs 0x%x), skipping", animId, anim->magic, 0x0044);
+		return;
+	}
 	anim->screenWidth = headerReadS.readUint16();
 	anim->screenHeight = headerReadS.readUint16();
+	if (anim->screenHeight > 2000 || anim->screenWidth > 2000) {
+		warning ("Anim::load animId=%d Excessive dimensions %dx%d, skipping", animId, anim->screenWidth, anim->screenHeight);
+		return;
+	}
 
 	anim->unknown06 = headerReadS.readByte();
 	anim->unknown07 = headerReadS.readByte();
@@ -437,6 +438,13 @@ void Anim::load(uint16 animId, const ByteArray &resourceData) {
 	anim->flags = ANIM_FLAG_NONE;
 	anim->linkId = -1;
 	anim->state = ANIM_PAUSE;
+
+	if (animId >= MAX_ANIMATIONS) {
+		if (animId >= MAX_ANIMATIONS + ARRAYSIZE(_cutawayAnimations))
+			error("Anim::load could not find unused animation slot");
+		_cutawayAnimations[animId - MAX_ANIMATIONS] = anim;
+	} else
+		_animations[animId] = anim;
 }
 
 void Anim::link(int16 animId1, int16 animId2) {


Commit: c47ef4d95606b136b8e4d8fbfeb2b7638dabe5f1
    https://github.com/scummvm/scummvm/commit/c47ef4d95606b136b8e4d8fbfeb2b7638dabe5f1
Author: Vladimir Serbinenko (phcoder at gmail.com)
Date: 2022-12-05T08:15:33+02:00

Commit Message:
SAGA: Show intro in Wyrmkeep ITE Amiga version

Changed paths:
    engines/saga/introproc_ite.cpp


diff --git a/engines/saga/introproc_ite.cpp b/engines/saga/introproc_ite.cpp
index cd4358e3a61..9117263c12c 100644
--- a/engines/saga/introproc_ite.cpp
+++ b/engines/saga/introproc_ite.cpp
@@ -83,7 +83,7 @@ static LoadSceneParams ITE_IntroListDefault[] = {
 };
 
 static const LoadSceneParams ITE_AmigaEnglishECSCD_IntroList[] = {
-//	{1544, kLoadByResourceId, Scene::SC_ITEIntroAnimProc, false, kTransitionNoFade, 0, NO_CHAPTER_CHANGE}, // Crashes, skip for now
+	{1544, kLoadByResourceId, Scene::SC_ITEIntroAnimProc, false, kTransitionNoFade, 0, NO_CHAPTER_CHANGE},
 	{1548, kLoadByResourceId, Scene::SC_ITEIntroCave1Proc, false, kTransitionFade, 0, NO_CHAPTER_CHANGE},
 	{1551, kLoadByResourceId, Scene::SC_ITEIntroCave2Proc, false, kTransitionNoFade, 0, NO_CHAPTER_CHANGE},
 	{1554, kLoadByResourceId, Scene::SC_ITEIntroCave3Proc, false, kTransitionNoFade, 0, NO_CHAPTER_CHANGE},
@@ -131,7 +131,7 @@ static const LoadSceneParams ITE_DOS_Demo_IntroList[] = {
 static const LoadSceneParams *ITE_IntroLists[INTROLIST_MAX] = {
 	/* INTROLIST_ITE_NONE */                 nullptr,
 	/* INTROLIST_ITE_DEFAULT */              ITE_IntroListDefault,
-	/* INTROLIST_ITE_AMIGA_ENGLISH_AGA_CD */ ITE_IntroListDefault + 1, // Skip first (logo) scene until we figure it out
+	/* INTROLIST_ITE_AMIGA_ENGLISH_AGA_CD */ ITE_IntroListDefault,
 	/* INTROLIST_ITE_AMIGA_ENGLISH_ECS_CD */ ITE_AmigaEnglishECSCD_IntroList,
 	/* INTROLIST_ITE_AMIGA_GERMAN_AGA */     ITE_AmigaGermanAGA_IntroList,
 	/* INTROLIST_ITE_AMIGA_GERMAN_ECS */     ITE_AmigaGermanECS_IntroList,


Commit: 468cb5406e824b70a4c9395cd305a04c3eaf98dc
    https://github.com/scummvm/scummvm/commit/468cb5406e824b70a4c9395cd305a04c3eaf98dc
Author: Vladimir Serbinenko (phcoder at gmail.com)
Date: 2022-12-05T08:15:33+02:00

Commit Message:
SAGA: Remove now unused INTROLIST_ITE_AMIGA_ENGLISH_AGA_CD

Changed paths:
    engines/saga/detection.h
    engines/saga/detection_tables.h
    engines/saga/introproc_ite.cpp


diff --git a/engines/saga/detection.h b/engines/saga/detection.h
index 725c9c564be..4b5b50fd8df 100644
--- a/engines/saga/detection.h
+++ b/engines/saga/detection.h
@@ -99,7 +99,6 @@ enum GamePatchList : uint8 {
 enum GameIntroList : uint8 {
 	INTROLIST_NONE = 0,
 	INTROLIST_ITE_DEFAULT,
-	INTROLIST_ITE_AMIGA_ENGLISH_AGA_CD,
 	INTROLIST_ITE_AMIGA_ENGLISH_ECS_CD,
 	INTROLIST_ITE_AMIGA_GERMAN_AGA,
 	INTROLIST_ITE_AMIGA_GERMAN_ECS,
diff --git a/engines/saga/detection_tables.h b/engines/saga/detection_tables.h
index 55ebf120b25..df4f0b9855f 100644
--- a/engines/saga/detection_tables.h
+++ b/engines/saga/detection_tables.h
@@ -1094,7 +1094,7 @@ static const SAGAGameDescription gameDescriptions[] = {
 		RESOURCELIST_ITE,
 		FONTLIST_ITE,
 		PATCHLIST_ITE,
-		INTROLIST_ITE_AMIGA_ENGLISH_AGA_CD,
+		INTROLIST_ITE_DEFAULT,
 		{},
 	},
 	// This is on the same disk as previous but it's for ECS systems
diff --git a/engines/saga/introproc_ite.cpp b/engines/saga/introproc_ite.cpp
index 9117263c12c..d7b332176a2 100644
--- a/engines/saga/introproc_ite.cpp
+++ b/engines/saga/introproc_ite.cpp
@@ -131,7 +131,6 @@ static const LoadSceneParams ITE_DOS_Demo_IntroList[] = {
 static const LoadSceneParams *ITE_IntroLists[INTROLIST_MAX] = {
 	/* INTROLIST_ITE_NONE */                 nullptr,
 	/* INTROLIST_ITE_DEFAULT */              ITE_IntroListDefault,
-	/* INTROLIST_ITE_AMIGA_ENGLISH_AGA_CD */ ITE_IntroListDefault,
 	/* INTROLIST_ITE_AMIGA_ENGLISH_ECS_CD */ ITE_AmigaEnglishECSCD_IntroList,
 	/* INTROLIST_ITE_AMIGA_GERMAN_AGA */     ITE_AmigaGermanAGA_IntroList,
 	/* INTROLIST_ITE_AMIGA_GERMAN_ECS */     ITE_AmigaGermanECS_IntroList,




More information about the Scummvm-git-logs mailing list