aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Hoops2013-04-28 14:47:15 -0400
committerMatthew Hoops2013-04-28 14:56:06 -0400
commit9eb5d23a5e0b9ec5137101ab9c33f329d53341b4 (patch)
treea0c736eefe75d74d95f59ae914a39b9d8f483130
parentee86e671f1c29232d7d1d02841851e43b825d6ac (diff)
downloadscummvm-rg350-9eb5d23a5e0b9ec5137101ab9c33f329d53341b4.tar.gz
scummvm-rg350-9eb5d23a5e0b9ec5137101ab9c33f329d53341b4.tar.bz2
scummvm-rg350-9eb5d23a5e0b9ec5137101ab9c33f329d53341b4.zip
SCI: Fix patched save/load dialogs in SCI32 Mac games
-rw-r--r--engines/sci/sci.cpp21
1 files changed, 19 insertions, 2 deletions
diff --git a/engines/sci/sci.cpp b/engines/sci/sci.cpp
index 14baa400a3..c1aadc3622 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;
}