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/kernel.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/kernel.cpp')
-rw-r--r-- | engines/sci/engine/kernel.cpp | 68 |
1 files changed, 29 insertions, 39 deletions
diff --git a/engines/sci/engine/kernel.cpp b/engines/sci/engine/kernel.cpp index 74be751716..6ded8eb410 100644 --- a/engines/sci/engine/kernel.cpp +++ b/engines/sci/engine/kernel.cpp @@ -120,13 +120,13 @@ static const char *sci_default_knames[SCI_KNAMES_DEFAULT_ENTRIES_NR] = { /*0x51*/ "Platform", /*0x52*/ "SetJump", /*0x53*/ "SetDebug", - /*0x54*/ "InspectObj", - /*0x55*/ "ShowSends", - /*0x56*/ "ShowObjs", - /*0x57*/ "ShowFree", + /*0x54*/ "Dummy", // InspectObj + /*0x55*/ "Dummy", // ShowSends + /*0x56*/ "Dummy", // ShowObjs + /*0x57*/ "Dummy", // ShowFree /*0x58*/ "MemoryInfo", - /*0x59*/ "StackUsage", - /*0x5a*/ "Profiler", + /*0x59*/ "Dummy", // StackUsage + /*0x5a*/ "Dummy", // Profiler /*0x5b*/ "GetMenu", /*0x5c*/ "SetMenu", /*0x5d*/ "GetSaveFiles", @@ -182,7 +182,6 @@ struct SciKernelFunction { }; #define DEFUN(name, fun, sig) {name, fun, sig} -#define NOFUN(name) {name, NULL, NULL} SciKernelFunction kfunct_mappers[] = { /*00*/ DEFUN("Load", kLoad, "iii*"), @@ -282,13 +281,7 @@ SciKernelFunction kfunct_mappers[] = { /*55*/ DEFUN("DoAvoider", kDoAvoider, "o"), /*56*/ DEFUN("SetJump", kSetJump, "oiii"), /*57*/ DEFUN("SetDebug", kSetDebug, "i*"), - /*58*/ NOFUN("InspectObj"), - /*59*/ NOFUN("ShowSends"), - /*5a*/ NOFUN("ShowObjs"), - /*5b*/ NOFUN("ShowFree"), /*5c*/ DEFUN("MemoryInfo", kMemoryInfo, "i"), - /*5d*/ NOFUN("StackUsage"), - /*5e*/ NOFUN("Profiler"), /*5f*/ DEFUN("GetMenu", kGetMenu, "i."), /*60*/ DEFUN("SetMenu", kSetMenu, "i.*"), /*61*/ DEFUN("GetSaveFiles", kGetSaveFiles, "rrr"), @@ -310,8 +303,6 @@ SciKernelFunction kfunct_mappers[] = { /*6f*/ DEFUN("6f", kTimesCos, "ii"), /*70*/ DEFUN("Graph", kGraph, ".*"), /*71*/ DEFUN("Joystick", kJoystick, ".*"), - /*72*/ NOFUN("unknown72"), // ShiftScreen, perhaps? - /*73*/ NOFUN("unknown73"), // Experimental functions /*74*/ DEFUN("FileIO", kFileIO, "i.*"), @@ -343,28 +334,20 @@ SciKernelFunction kfunct_mappers[] = { DEFUN("Platform", kPlatform, "i*"), DEFUN("PalVary", kPalVary, "ii*"), - // Special and NOP stuff - DEFUN("Dummy", kStub, ".*"), - {NULL, kUnknown, NULL}, - - // FIXME: The stub functions below are ignored since the entry - // above ( {NULL, kUnknown, NULL} ) terminates this array effectively. - // Seems like a bug to me; maybe the line above should just be removed? - // If this is on purpose, then whoever knows the reason should replace - // this FIXME by a comment explaining it. - +#if 0 // Stub functions - DEFUN("ShiftScreen", kStub, ".*"), - DEFUN("MemorySegment", kStub, ".*"), - DEFUN("ListOps", kStub, ".*"), - DEFUN("ATan", kStub, ".*"), - DEFUN("MergePoly", kStub, ".*"), - DEFUN("AssertPalette", kStub, ".*"), - DEFUN("TextColors", kStub, ".*"), - DEFUN("TextFonts", kStub, ".*"), - DEFUN("Record", kStub, ".*"), - DEFUN("PlayBack", kStub, ".*"), - DEFUN("DbugStr", kStub, ".*"), + DEFUN("ShiftScreen", kShiftScreen, ".*"), + DEFUN("MemorySegment", kMemorySegment, ".*"), + DEFUN("ListOps", kListOps, ".*"), + DEFUN("ATan", kATan, ".*"), + DEFUN("MergePoly", kMergePoly, ".*"), + DEFUN("AssertPalette", kAssertPalette, ".*"), + DEFUN("TextColors", kTextColors, ".*"), + DEFUN("TextFonts", kTextFonts, ".*"), + DEFUN("Record", kRecord, ".*"), + DEFUN("PlayBack", kPlayBack, ".*"), + DEFUN("DbugStr", kDbugStr, ".*"), +#endif {NULL, NULL, NULL} // Terminator }; @@ -611,8 +594,14 @@ void Kernel::mapFunctions() { if (sought_name.empty()) { // No name was given -> must be an unknown opcode - warning("Flagging kernel function %x as unknown", functnr); - _kernelFuncs[functnr].fun = kUnknown; + warning("Kernel function %s[%x] unknown", sought_name.c_str(), functnr); + _kernelFuncs[functnr].isDummy = true; + continue; + } + + // Don't map dummy functions - they will never be called + if (sought_name == "Dummy") { + _kernelFuncs[functnr].isDummy = true; continue; } @@ -625,12 +614,13 @@ void Kernel::mapFunctions() { if (found == -1) { // No match but a name was given -> stub warning("Kernel function %s[%x] unmapped", sought_name.c_str(), functnr); - _kernelFuncs[functnr].fun = kStub; + _kernelFuncs[functnr].isDummy = true; } else { // A match in kfunct_mappers was found if (kfunct_mappers[found].fun) { _kernelFuncs[functnr].fun = kfunct_mappers[found].fun; _kernelFuncs[functnr].signature = kfunct_mappers[found].signature; + _kernelFuncs[functnr].isDummy = false; kernel_compile_signature(&(_kernelFuncs[functnr].signature)); ++mapped; } else { |