diff options
author | Filippos Karapetis | 2009-09-29 14:24:07 +0000 |
---|---|---|
committer | Filippos Karapetis | 2009-09-29 14:24:07 +0000 |
commit | f9296a64459a09961bdf61fa4dbb3d3f524a4c25 (patch) | |
tree | 47e58f397493e87f18560b7891cbb23afa668eb2 /engines/sci/engine/vm.cpp | |
parent | af4c6c5f5b642e6a53596b7a00d57e2060ba0693 (diff) | |
download | scummvm-rg350-f9296a64459a09961bdf61fa4dbb3d3f524a4c25.tar.gz scummvm-rg350-f9296a64459a09961bdf61fa4dbb3d3f524a4c25.tar.bz2 scummvm-rg350-f9296a64459a09961bdf61fa4dbb3d3f524a4c25.zip |
- Changed the unimplemented debug SCI kernel functions (InspectObj, ShowSends, ShowObjs, ShowFree, StackUsage and Profiler) to be dummy functions - we have our own debugger, and don't use these functions for debugging
- Removed the function number parameter from all kernel functions, as it's no longer needed, and removed the FAKE_FUNCT_NR hack
- Removed kUnknown() and kStub()
- Dummy/unknown kernel functions are no longer invoked, and a warning is shown instead, with the paremeters passed to them
Note: there is an evil hack used for debugging scripts in invoke_selector(), which probably no longer works now
svn-id: r44461
Diffstat (limited to 'engines/sci/engine/vm.cpp')
-rw-r--r-- | engines/sci/engine/vm.cpp | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/engines/sci/engine/vm.cpp b/engines/sci/engine/vm.cpp index d5188665f6..de910e012b 100644 --- a/engines/sci/engine/vm.cpp +++ b/engines/sci/engine/vm.cpp @@ -943,7 +943,24 @@ void run_vm(EngineState *s, int restoring) { && !kernel_matches_signature(s->segMan, kfun.signature, argc, scriptState.xs->sp + 1)) { error("[VM] Invalid arguments to kernel call %x", opparams[0]); } else { - s->r_acc = kfun.fun(s, opparams[0], argc, scriptState.xs->sp + 1); + reg_t *argv = scriptState.xs->sp + 1; + + if (!kfun.isDummy) { + s->r_acc = kfun.fun(s, argc, argv); + } else { + Common::String warningMsg = "Dummy function " + kfun.orig_name + "["; + warningMsg += warningMsg.printf("0x%x", opparams[0]); + warningMsg += "] invoked - ignoring. Params: "; + warningMsg += warningMsg.printf("%d", argc); + warningMsg += " ("; + + for (int i = 0; i < argc; i++) { + warningMsg += warningMsg.printf("%04x:%04x", PRINT_REG(argv[i])); + warningMsg += (i == argc - 1 ? ")" : ", "); + } + + warning(warningMsg.c_str()); + } } // Call kernel function |