diff options
author | Filippos Karapetis | 2009-07-11 06:43:01 +0000 |
---|---|---|
committer | Filippos Karapetis | 2009-07-11 06:43:01 +0000 |
commit | 28dd343e08afb9eeb8318d06c8c18eb6b48fd210 (patch) | |
tree | e530db6ac3f75e93aa3cecce5236dbb9960531c2 | |
parent | 4f2b8579829d0f32345e6932814af54c181d2cd8 (diff) | |
download | scummvm-rg350-28dd343e08afb9eeb8318d06c8c18eb6b48fd210.tar.gz scummvm-rg350-28dd343e08afb9eeb8318d06c8c18eb6b48fd210.tar.bz2 scummvm-rg350-28dd343e08afb9eeb8318d06c8c18eb6b48fd210.zip |
Applied slightly modified patch 2819002 - "SCI: resource-view-patch on SQ5/German fix"
svn-id: r42374
-rw-r--r-- | engines/sci/resource.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/engines/sci/resource.cpp b/engines/sci/resource.cpp index 5fdc286894..a0aa40bcd5 100644 --- a/engines/sci/resource.cpp +++ b/engines/sci/resource.cpp @@ -883,6 +883,21 @@ void ResourceManager::processPatch(ResourceSource *source, ResourceType restype, debug("Patching %s failed - resource type mismatch", source->location_name.c_str()); return; } + + // Fixes SQ5/German, patch file special case logic taken from SCI View disassembly + if (patch_data_offset & 0x80) { + switch (patch_data_offset & 0x7F) { + case 0: + patch_data_offset = 24; + break; + case 1: + patch_data_offset = 2; + break; + default: + warning("Resource patch unsupported special case %X\n", patch_data_offset); + } + } + if (patch_data_offset + 2 >= fsize) { debug("Patching %s failed - patch starting at offset %d can't be in file of size %d", source->location_name.c_str(), patch_data_offset + 2, fsize); |