[Scummvm-git-logs] scummvm master -> 0614e80c822469293acef12f406afa0fb4818288

sluicebox noreply at scummvm.org
Tue Feb 25 06:52:37 UTC 2025


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

Summary:
ee6a3a08ed AGI: Add detection for early version of XMASCARD
0614e80c82 AGI: Add support for v2.230 view mirror data


Commit: ee6a3a08ede8774eb57e90e96ff1234d4a390a12
    https://github.com/scummvm/scummvm/commit/ee6a3a08ede8774eb57e90e96ff1234d4a390a12
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2025-02-24T22:51:54-08:00

Commit Message:
AGI: Add detection for early version of XMASCARD

Thanks to @vvdleun for reporting this

Trac #15764

Changed paths:
    engines/agi/detection_tables.h


diff --git a/engines/agi/detection_tables.h b/engines/agi/detection_tables.h
index 71e49c63733..f84a1e2cb2f 100644
--- a/engines/agi/detection_tables.h
+++ b/engines/agi/detection_tables.h
@@ -874,8 +874,14 @@ static const AGIGameDescription gameDescriptions[] = {
 		"wintitle.pic", "cc8d2ae52e18700843f466a23d62c773", 6144,
 		"room62",		"813de04fd57063a402272c603be1188a", 1338, 0x0000, GID_WINNIE, Common::kPlatformCoCo),
 
+	// Xmas Card 1986 (PC) [AGI 2.230]
+	// Includes a scene of Tandy presents being unwrapped.
+	// Does not include demo scenes for AGI games.
+	// Only known game with this interpreter, uses a unique view format.
+	GAME("xmascard", "1986-10-13 [version 1]", "b77b968a84e8cb70a6c9972879f485f4", 0x2230, GID_XMASCARD),
+
 	// Xmas Card 1986 (PC) [AGI 2.272]
-	GAME("xmascard", "1986-11-13 [version 1]", "3067b8d5957e2861e069c3c0011bd43d", 0x2272, GID_XMASCARD),
+	GAME("xmascard", "1986-11-13 [version 2]", "3067b8d5957e2861e069c3c0011bd43d", 0x2272, GID_XMASCARD),
 
 	// Xmas Card 1986 (CoCo3 360k) [AGI 2.072]
 	// Appears to be an unofficial port


Commit: 0614e80c822469293acef12f406afa0fb4818288
    https://github.com/scummvm/scummvm/commit/0614e80c822469293acef12f406afa0fb4818288
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2025-02-24T22:51:54-08:00

Commit Message:
AGI: Add support for v2.230 view mirror data

Used by early version of XMASCARD

Fixes error in Santa scene (room 2)

Trac #15764

Changed paths:
    engines/agi/view.cpp


diff --git a/engines/agi/view.cpp b/engines/agi/view.cpp
index 5467b1e9c7d..77e76c8bdc6 100644
--- a/engines/agi/view.cpp
+++ b/engines/agi/view.cpp
@@ -184,25 +184,29 @@ int AgiEngine::decodeView(byte *resourceData, uint16 resourceSize, int16 viewNr)
 			error("unexpected end of view data for view %d", viewNr);
 
 		// loop-header:
-		//  celCount:BYTE
+		//  celCount:BYTE [ upper nibble used as mirror data in 2.230 ]
 		//  relativeCelOffset[0]:WORD
 		//  relativeCelOffset[1]:WORD
 		//  etc.
-		byte loopHeaderCelCount = resourceData[loopOffset];
-
-		loopData->celCount = loopHeaderCelCount;
+		byte loopHeaderCelCountByte = resourceData[loopOffset];
+		const bool isMirrorDataInLoopHeader = (getVersion() == 0x2230);
+		if (isMirrorDataInLoopHeader) {
+			loopData->celCount = loopHeaderCelCountByte & 0x0f;
+		} else {
+			loopData->celCount = loopHeaderCelCountByte;
+		}
 		loopData->cel = nullptr;
 
 		// Check, if at least the cel-offsets for current loop are available
-		if (resourceSize < (loopOffset + 1 + (loopHeaderCelCount * 2)))
+		if (resourceSize < (loopOffset + 1 + (loopData->celCount * 2)))
 			error("unexpected end of view data for view %d", viewNr);
 
-		if (loopHeaderCelCount) {
+		if (loopData->celCount) {
 			// Allocate space for cel-information of current loop
-			AgiViewCel *celData = new AgiViewCel[loopHeaderCelCount];
+			AgiViewCel *celData = new AgiViewCel[loopData->celCount];
 			loopData->cel = celData;
 
-			for (int16 celNr = 0; celNr < loopHeaderCelCount; celNr++) {
+			for (int16 celNr = 0; celNr < loopData->celCount; celNr++) {
 				uint16 celOffset = READ_LE_UINT16(resourceData + loopOffset + 1 + (celNr * 2));
 				celOffset += loopOffset; // cel offset is relative to loop offset, so adjust accordingly
 
@@ -237,12 +241,27 @@ int AgiEngine::decodeView(byte *resourceData, uint16 resourceSize, int16 viewNr)
 						celHeaderClearKey = apple2ViewColorMap[celHeaderClearKey];
 					}
 
-					if (celHeaderTransparencyMirror & 0x80) {
-						// mirror bit is set
-						byte celHeaderMirrorLoop = (celHeaderTransparencyMirror >> 4) & 0x07;
-						if (celHeaderMirrorLoop != loopNr) {
-							// only set to mirrored in case we are not the original loop
-							celHeaderMirrored = true;
+					if (isMirrorDataInLoopHeader) {
+						// 2.230 (early version of xmascard): mirror data is in loop header.
+						if (loopHeaderCelCountByte & 0x80) {
+							// mirror bit is set
+							// there is a second mirror bit whose purpose is currently unknown;
+							// both bits are set in every xmascard loop with mirror data.
+							byte celHeaderMirrorLoop = (loopHeaderCelCountByte >> 4) & 0x03;
+							if (celHeaderMirrorLoop != loopNr) {
+								// only set to mirrored in case we are not the original loop
+								celHeaderMirrored = true;
+							}
+						}
+					} else {
+						// 2.272+: mirror data is in cel header
+						if (celHeaderTransparencyMirror & 0x80) {
+							// mirror bit is set
+							byte celHeaderMirrorLoop = (celHeaderTransparencyMirror >> 4) & 0x07;
+							if (celHeaderMirrorLoop != loopNr) {
+								// only set to mirrored in case we are not the original loop
+								celHeaderMirrored = true;
+							}
 						}
 					}
 				} else {




More information about the Scummvm-git-logs mailing list