diff options
author | Filippos Karapetis | 2010-08-06 22:51:25 +0000 |
---|---|---|
committer | Filippos Karapetis | 2010-08-06 22:51:25 +0000 |
commit | ab0d57d73d434c3523e5b44ed5f4ce95b895c8a0 (patch) | |
tree | 5944a70d463b515e1f0fd0e6c84b5f1962a89189 /engines | |
parent | 57fd5883277b258eba73bfec98a27503223569ff (diff) | |
download | scummvm-rg350-ab0d57d73d434c3523e5b44ed5f4ce95b895c8a0.tar.gz scummvm-rg350-ab0d57d73d434c3523e5b44ed5f4ce95b895c8a0.tar.bz2 scummvm-rg350-ab0d57d73d434c3523e5b44ed5f4ce95b895c8a0.zip |
SCI: Some cleanup of the script patch code. Added a PATCH_MAGICDWORD define to make the patch tables easier to understand
svn-id: r51811
Diffstat (limited to 'engines')
-rw-r--r-- | engines/sci/engine/script_patches.cpp | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/engines/sci/engine/script_patches.cpp b/engines/sci/engine/script_patches.cpp index 228bf39e7d..51bdf14e46 100644 --- a/engines/sci/engine/script_patches.cpp +++ b/engines/sci/engine/script_patches.cpp @@ -30,6 +30,11 @@ namespace Sci { +#define PATCH_END 0xFFFF +#define PATCH_ADDTOOFFSET 0x8000 +#define PATCH_GETORIGINALBYTE 0x4000 +#define PATCH_MAGICDWORD(a, b, c, d) CONSTANT_LE_32(a | (b << 8) | (c << 16) | (d << 24)) + struct SciScriptSignature { uint16 scriptNr; const char *description; @@ -89,10 +94,6 @@ const byte hoyle4SignaturePortFix[] = { 0 }; -#define PATCH_END 0xFFFF -#define PATCH_ADDTOOFFSET 0x8000 -#define PATCH_GETORIGINALBYTE 0x4000 - const uint16 hoyle4PatchPortFix[] = { PATCH_ADDTOOFFSET | +33, 0x38, 0x31, 0x01, // pushi 0131 (selector curEvent) @@ -108,10 +109,10 @@ const uint16 hoyle4PatchPortFix[] = { PATCH_END }; -// script, description, magic DWORD, adjust +// script, description, magic DWORD, adjust const SciScriptSignature hoyle4Signatures[] = { - { 0, "port fix when disposing windows", CONSTANT_LE_32(0x00C83864), -5, hoyle4SignaturePortFix, hoyle4PatchPortFix }, - { 0, NULL, 0, 0, NULL, NULL } + { 0, "port fix when disposing windows", PATCH_MAGICDWORD(0x64, 0x38, 0xC8, 0x00), -5, hoyle4SignaturePortFix, hoyle4PatchPortFix }, + { 0, NULL, 0, 0, NULL, NULL } }; @@ -159,10 +160,10 @@ const uint16 larry6PatchDeathDialog[] = { PATCH_END }; -// script, description, magic DWORD, adjust +// script, description, magic DWORD, adjust const SciScriptSignature larry6Signatures[] = { - { 82, "death dialog memory corruption", CONSTANT_LE_32(0x3501333e), 0, larry6SignatureDeathDialog, larry6PatchDeathDialog }, - { 0, NULL, 0, 0, NULL, NULL } + { 82, "death dialog memory corruption", PATCH_MAGICDWORD(0x3e, 0x33, 0x01, 0x35), 0, larry6SignatureDeathDialog, larry6PatchDeathDialog }, + { 0, NULL, 0, 0, NULL, NULL } }; // will actually patch previously found signature area |