[Scummvm-cvs-logs] scummvm master -> 9eb5d23a5e0b9ec5137101ab9c33f329d53341b4

clone2727 clone2727 at gmail.com
Sun Apr 28 20:59:15 CEST 2013


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

Summary:
9eb5d23a5e SCI: Fix patched save/load dialogs in SCI32 Mac games


Commit: 9eb5d23a5e0b9ec5137101ab9c33f329d53341b4
    https://github.com/scummvm/scummvm/commit/9eb5d23a5e0b9ec5137101ab9c33f329d53341b4
Author: Matthew Hoops (clone2727 at gmail.com)
Date: 2013-04-28T11:56:06-07:00

Commit Message:
SCI: Fix patched save/load dialogs in SCI32 Mac games

Changed paths:
    engines/sci/sci.cpp



diff --git a/engines/sci/sci.cpp b/engines/sci/sci.cpp
index 14baa40..c1aadc3 100644
--- a/engines/sci/sci.cpp
+++ b/engines/sci/sci.cpp
@@ -455,10 +455,19 @@ static byte patchGameRestoreSaveSci21[] = {
 static void patchGameSaveRestoreCode(SegManager *segMan, reg_t methodAddress, byte id) {
 	Script *script = segMan->getScript(methodAddress.getSegment());
 	byte *patchPtr = const_cast<byte *>(script->getBuf(methodAddress.getOffset()));
-	if (getSciVersion() <= SCI_VERSION_1_1)
+
+	if (getSciVersion() <= SCI_VERSION_1_1) {
 		memcpy(patchPtr, patchGameRestoreSave, sizeof(patchGameRestoreSave));
-	else	// SCI2+
+	} else {	// SCI2+
 		memcpy(patchPtr, patchGameRestoreSaveSci2, sizeof(patchGameRestoreSaveSci2));
+
+		if (g_sci->isBE()) {
+			// LE -> BE
+			patchPtr[9] = 0x00;
+			patchPtr[10] = 0x06;
+		}
+	}
+
 	patchPtr[8] = id;
 }
 
@@ -466,8 +475,16 @@ static void patchGameSaveRestoreCodeSci21(SegManager *segMan, reg_t methodAddres
 	Script *script = segMan->getScript(methodAddress.getSegment());
 	byte *patchPtr = const_cast<byte *>(script->getBuf(methodAddress.getOffset()));
 	memcpy(patchPtr, patchGameRestoreSaveSci21, sizeof(patchGameRestoreSaveSci21));
+
 	if (doRestore)
 		patchPtr[2] = 0x78;	// push1
+
+	if (g_sci->isBE()) {
+		// LE -> BE
+		patchPtr[10] = 0x00;
+		patchPtr[11] = 0x08;
+	}
+
 	patchPtr[9] = id;
 }
 






More information about the Scummvm-git-logs mailing list