SCI: improved patcher, inventory patch for kq6/mac

Also added new debug flag for script patcher
This commit is contained in:
Martin Kiewitz 2013-11-01 13:25:31 +01:00
parent c93249cfd0
commit f1abc0c302
4 changed files with 871 additions and 851 deletions

View File

@ -99,8 +99,8 @@ public:
void load(int script_nr, ResourceManager *resMan); void load(int script_nr, ResourceManager *resMan);
void matchSignatureAndPatch(uint16 scriptNr, byte *scriptData, const uint32 scriptSize); void matchSignatureAndPatch(uint16 scriptNr, byte *scriptData, const uint32 scriptSize);
int32 findSignature(const SciScriptSignature *signature, const byte *scriptData, const uint32 scriptSize); int32 findSignature(const SciScriptSignature *signature, const byte *scriptData, const uint32 scriptSize, bool isMacSci11);
void applyPatch(const uint16 *patch, byte *scriptData, const uint32 scriptSize, int32 signatureOffset); void applyPatch(const uint16 *patch, byte *scriptData, const uint32 scriptSize, int32 signatureOffset, bool isMacSci11);
virtual bool isValidOffset(uint16 offset) const; virtual bool isValidOffset(uint16 offset) const;
virtual SegmentRef dereference(reg_t pointer); virtual SegmentRef dereference(reg_t pointer);

File diff suppressed because it is too large Load Diff

View File

@ -112,6 +112,7 @@ SciEngine::SciEngine(OSystem *syst, const ADGameDescription *desc, SciGameId gam
DebugMan.addDebugChannel(kDebugLevelDclInflate, "DCL", "DCL inflate debugging"); DebugMan.addDebugChannel(kDebugLevelDclInflate, "DCL", "DCL inflate debugging");
DebugMan.addDebugChannel(kDebugLevelVM, "VM", "VM debugging"); DebugMan.addDebugChannel(kDebugLevelVM, "VM", "VM debugging");
DebugMan.addDebugChannel(kDebugLevelScripts, "Scripts", "Notifies when scripts are unloaded"); DebugMan.addDebugChannel(kDebugLevelScripts, "Scripts", "Notifies when scripts are unloaded");
DebugMan.addDebugChannel(kDebugLevelScriptPatcher, "ScriptPatcher", "Notifies when scripts are patched");
DebugMan.addDebugChannel(kDebugLevelGC, "GC", "Garbage Collector debugging"); DebugMan.addDebugChannel(kDebugLevelGC, "GC", "Garbage Collector debugging");
DebugMan.addDebugChannel(kDebugLevelResMan, "ResMan", "Resource manager debugging"); DebugMan.addDebugChannel(kDebugLevelResMan, "ResMan", "Resource manager debugging");
DebugMan.addDebugChannel(kDebugLevelOnStartup, "OnStartup", "Enter debugger at start of game"); DebugMan.addDebugChannel(kDebugLevelOnStartup, "OnStartup", "Enter debugger at start of game");

View File

@ -82,28 +82,29 @@ class GfxFrameout;
// our engine debug levels // our engine debug levels
enum kDebugLevels { enum kDebugLevels {
kDebugLevelError = 1 << 0, kDebugLevelError = 1 << 0,
kDebugLevelNodes = 1 << 1, kDebugLevelNodes = 1 << 1,
kDebugLevelGraphics = 1 << 2, kDebugLevelGraphics = 1 << 2,
kDebugLevelStrings = 1 << 3, kDebugLevelStrings = 1 << 3,
kDebugLevelMemory = 1 << 4, kDebugLevelMemory = 1 << 4,
kDebugLevelFuncCheck = 1 << 5, kDebugLevelFuncCheck = 1 << 5,
kDebugLevelBresen = 1 << 6, kDebugLevelBresen = 1 << 6,
kDebugLevelSound = 1 << 7, kDebugLevelSound = 1 << 7,
kDebugLevelBaseSetter = 1 << 8, kDebugLevelBaseSetter = 1 << 8,
kDebugLevelParser = 1 << 9, kDebugLevelParser = 1 << 9,
kDebugLevelSaid = 1 << 10, kDebugLevelSaid = 1 << 10,
kDebugLevelFile = 1 << 11, kDebugLevelFile = 1 << 11,
kDebugLevelTime = 1 << 12, kDebugLevelTime = 1 << 12,
kDebugLevelRoom = 1 << 13, kDebugLevelRoom = 1 << 13,
kDebugLevelAvoidPath = 1 << 14, kDebugLevelAvoidPath = 1 << 14,
kDebugLevelDclInflate = 1 << 15, kDebugLevelDclInflate = 1 << 15,
kDebugLevelVM = 1 << 16, kDebugLevelVM = 1 << 16,
kDebugLevelScripts = 1 << 17, kDebugLevelScripts = 1 << 17,
kDebugLevelGC = 1 << 18, kDebugLevelGC = 1 << 18,
kDebugLevelResMan = 1 << 19, kDebugLevelResMan = 1 << 19,
kDebugLevelOnStartup = 1 << 20, kDebugLevelOnStartup = 1 << 20,
kDebugLevelDebugMode = 1 << 21 kDebugLevelDebugMode = 1 << 21,
kDebugLevelScriptPatcher = 1 << 22
}; };
enum SciGameId { enum SciGameId {