[Scummvm-git-logs] scummvm master -> 7a68ee57b1ba091111c7f340fbf877bd165872b3
bluegr
bluegr at gmail.com
Sun Mar 15 23:58:44 UTC 2020
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:
7a68ee57b1 SCI: Always include the opcodeNames table, as it's used in VM hooks
Commit: 7a68ee57b1ba091111c7f340fbf877bd165872b3
https://github.com/scummvm/scummvm/commit/7a68ee57b1ba091111c7f340fbf877bd165872b3
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2020-03-16T01:58:34+02:00
Commit Message:
SCI: Always include the opcodeNames table, as it's used in VM hooks
Changed paths:
engines/sci/engine/scriptdebug.cpp
engines/sci/engine/scriptdebug.h
engines/sci/engine/vm_hooks.cpp
diff --git a/engines/sci/engine/scriptdebug.cpp b/engines/sci/engine/scriptdebug.cpp
index fc80d1f22a..d56c3d9291 100644
--- a/engines/sci/engine/scriptdebug.cpp
+++ b/engines/sci/engine/scriptdebug.cpp
@@ -39,7 +39,8 @@ namespace Sci {
// This table is only used for debugging. Don't include it for devices
// with not enough available memory (e.g. phones), where REDUCE_MEMORY_USAGE
// is defined
-#ifndef REDUCE_MEMORY_USAGE
+// Update: This is used in the VM hooks mechanism. TODO: Readd the memory check?
+//#ifndef REDUCE_MEMORY_USAGE
const char *opcodeNames[] = {
"bnot", "add", "sub", "mul", "div",
"mod", "shr", "shl", "xor", "and",
@@ -68,7 +69,7 @@ const char *opcodeNames[] = {
"-agi", "-ali", "-ati", "-api", "-sgi",
"-sli", "-sti", "-spi"
};
-#endif // REDUCE_MEMORY_USAGE
+//#endif // REDUCE_MEMORY_USAGE
void DebugState::updateActiveBreakpointTypes() {
int type = 0;
@@ -149,9 +150,9 @@ reg_t disassemble(EngineState *s, reg_t pos, const Object *obj, bool printBWTag,
return retval;
}
-#ifndef REDUCE_MEMORY_USAGE
+//#ifndef REDUCE_MEMORY_USAGE
debugN("%-5s", opcodeNames[opcode]);
-#endif
+//#endif
static const char *defaultSeparator = "\t\t; ";
diff --git a/engines/sci/engine/scriptdebug.h b/engines/sci/engine/scriptdebug.h
index 3d54b327d3..df6bcef34f 100644
--- a/engines/sci/engine/scriptdebug.h
+++ b/engines/sci/engine/scriptdebug.h
@@ -25,9 +25,9 @@
namespace Sci {
-#ifndef REDUCE_MEMORY_USAGE
+//#ifndef REDUCE_MEMORY_USAGE
extern const char *opcodeNames[];
-#endif
+//#endif
void debugSelectorCall(reg_t send_obj, Selector selector, int argc, StackPtr argp, ObjVarRef &varp, reg_t funcp, SegManager *segMan, SelectorType selectorType);
diff --git a/engines/sci/engine/vm_hooks.cpp b/engines/sci/engine/vm_hooks.cpp
index d598d9a9a1..267a581dab 100644
--- a/engines/sci/engine/vm_hooks.cpp
+++ b/engines/sci/engine/vm_hooks.cpp
@@ -101,6 +101,9 @@ uint64 HookHashKey::hash() {
return ((uint64)scriptNumber << 32) + offset;
}
+//#ifndef REDUCE_MEMORY_USAGE
+extern const char* opcodeNames[];
+//#endif
// returns true if entry is matching to current state
bool hook_exec_match(Sci::EngineState *s, HookEntry entry) {
More information about the Scummvm-git-logs
mailing list